aclocal.m4 revision 0eb1301b
10eb1301bSmrg# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
2f1ee322dSmrg
30eb1301bSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
4c43cc173Smrg
5c43cc173Smrg# This file is free software; the Free Software Foundation
6c43cc173Smrg# gives unlimited permission to copy and/or distribute it,
7c43cc173Smrg# with or without modifications, as long as this notice is preserved.
8c43cc173Smrg
9c43cc173Smrg# This program is distributed in the hope that it will be useful,
10c43cc173Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11c43cc173Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12c43cc173Smrg# PARTICULAR PURPOSE.
13c43cc173Smrg
1406c34b88Smrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
1521e67964Smrgm4_ifndef([AC_AUTOCONF_VERSION],
1621e67964Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17f1ee322dSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
18f1ee322dSmrg[m4_warning([this file was generated for autoconf 2.69.
1921e67964SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
2021e67964SmrgIf you have problems, you may need to regenerate the build system entirely.
21f1ee322dSmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22c43cc173Smrg
23dc9477beSmrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
24c27c18e8Smrg#
250eb1301bSmrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
260eb1301bSmrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
270eb1301bSmrg#                 Foundation, Inc.
28dc9477beSmrg#   Written by Gordon Matzigkeit, 1996
29c27c18e8Smrg#
30dc9477beSmrg# This file is free software; the Free Software Foundation gives
31dc9477beSmrg# unlimited permission to copy and/or distribute it, with or without
32dc9477beSmrg# modifications, as long as this notice is preserved.
33c27c18e8Smrg
34dc9477beSmrgm4_define([_LT_COPYING], [dnl
350eb1301bSmrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
360eb1301bSmrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
370eb1301bSmrg#                 Foundation, Inc.
380eb1301bSmrg#   Written by Gordon Matzigkeit, 1996
39c27c18e8Smrg#
400eb1301bSmrg#   This file is part of GNU Libtool.
41c27c18e8Smrg#
420eb1301bSmrg# GNU Libtool is free software; you can redistribute it and/or
430eb1301bSmrg# modify it under the terms of the GNU General Public License as
440eb1301bSmrg# published by the Free Software Foundation; either version 2 of
450eb1301bSmrg# the License, or (at your option) any later version.
460eb1301bSmrg#
470eb1301bSmrg# As a special exception to the GNU General Public License,
480eb1301bSmrg# if you distribute this file as part of a program or library that
490eb1301bSmrg# is built using GNU Libtool, you may include this file under the
500eb1301bSmrg# same distribution terms that you use for the rest of that program.
510eb1301bSmrg#
520eb1301bSmrg# GNU Libtool is distributed in the hope that it will be useful,
530eb1301bSmrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
54dc9477beSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
55dc9477beSmrg# GNU General Public License for more details.
56c27c18e8Smrg#
57dc9477beSmrg# You should have received a copy of the GNU General Public License
580eb1301bSmrg# along with GNU Libtool; see the file COPYING.  If not, a copy
590eb1301bSmrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
600eb1301bSmrg# obtained by writing to the Free Software Foundation, Inc.,
610eb1301bSmrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
62c27c18e8Smrg])
63c27c18e8Smrg
640eb1301bSmrg# serial 57 LT_INIT
65c27c18e8Smrg
66c43cc173Smrg
67dc9477beSmrg# LT_PREREQ(VERSION)
68dc9477beSmrg# ------------------
69dc9477beSmrg# Complain and exit if this libtool version is less that VERSION.
70dc9477beSmrgm4_defun([LT_PREREQ],
71dc9477beSmrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
72dc9477beSmrg       [m4_default([$3],
73dc9477beSmrg		   [m4_fatal([Libtool version $1 or higher is required],
74dc9477beSmrg		             63)])],
75dc9477beSmrg       [$2])])
76c43cc173Smrg
77c27c18e8Smrg
78dc9477beSmrg# _LT_CHECK_BUILDDIR
79dc9477beSmrg# ------------------
80dc9477beSmrg# Complain if the absolute build directory name contains unusual characters
81dc9477beSmrgm4_defun([_LT_CHECK_BUILDDIR],
82dc9477beSmrg[case `pwd` in
83dc9477beSmrg  *\ * | *\	*)
84dc9477beSmrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
85dc9477beSmrgesac
86dc9477beSmrg])
87c27c18e8Smrg
88c27c18e8Smrg
89dc9477beSmrg# LT_INIT([OPTIONS])
90dc9477beSmrg# ------------------
91dc9477beSmrgAC_DEFUN([LT_INIT],
920eb1301bSmrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
93dc9477beSmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
94dc9477beSmrgAC_BEFORE([$0], [LT_LANG])dnl
95dc9477beSmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
96dc9477beSmrgAC_BEFORE([$0], [LTDL_INIT])dnl
97dc9477beSmrgm4_require([_LT_CHECK_BUILDDIR])dnl
98c27c18e8Smrg
99dc9477beSmrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
100dc9477beSmrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
101dc9477beSmrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
102dc9477beSmrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
103dc9477beSmrgdnl unless we require an AC_DEFUNed macro:
104dc9477beSmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
105dc9477beSmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
106dc9477beSmrgAC_REQUIRE([LTVERSION_VERSION])dnl
107dc9477beSmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
108dc9477beSmrgm4_require([_LT_PROG_LTMAIN])dnl
109c27c18e8Smrg
110dc9477beSmrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
111c27c18e8Smrg
112dc9477beSmrgdnl Parse OPTIONS
113dc9477beSmrg_LT_SET_OPTIONS([$0], [$1])
114c43cc173Smrg
115dc9477beSmrg# This can be used to rebuild libtool when needed
1160eb1301bSmrgLIBTOOL_DEPS="$ltmain"
117c43cc173Smrg
118dc9477beSmrg# Always use our own libtool.
119dc9477beSmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
120dc9477beSmrgAC_SUBST(LIBTOOL)dnl
121c43cc173Smrg
122dc9477beSmrg_LT_SETUP
123c43cc173Smrg
124dc9477beSmrg# Only expand once:
125dc9477beSmrgm4_define([LT_INIT])
126dc9477beSmrg])# LT_INIT
127c43cc173Smrg
128dc9477beSmrg# Old names:
129dc9477beSmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
130dc9477beSmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
131dc9477beSmrgdnl aclocal-1.4 backwards compatibility:
132dc9477beSmrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
133dc9477beSmrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
134c43cc173Smrg
135c43cc173Smrg
136dc9477beSmrg# _LT_CC_BASENAME(CC)
137dc9477beSmrg# -------------------
1380eb1301bSmrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
139dc9477beSmrgm4_defun([_LT_CC_BASENAME],
1400eb1301bSmrg[for cc_temp in $1""; do
1410eb1301bSmrg  case $cc_temp in
1420eb1301bSmrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
1430eb1301bSmrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
1440eb1301bSmrg    \-*) ;;
1450eb1301bSmrg    *) break;;
1460eb1301bSmrg  esac
1470eb1301bSmrgdone
1480eb1301bSmrgcc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
14906c34b88Smrg])
15037eb1ca1Smrg
15137eb1ca1Smrg
152dc9477beSmrg# _LT_FILEUTILS_DEFAULTS
153dc9477beSmrg# ----------------------
154dc9477beSmrg# It is okay to use these file commands and assume they have been set
1550eb1301bSmrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
156dc9477beSmrgm4_defun([_LT_FILEUTILS_DEFAULTS],
157dc9477beSmrg[: ${CP="cp -f"}
158dc9477beSmrg: ${MV="mv -f"}
159dc9477beSmrg: ${RM="rm -f"}
160dc9477beSmrg])# _LT_FILEUTILS_DEFAULTS
16137eb1ca1Smrg
162c43cc173Smrg
163dc9477beSmrg# _LT_SETUP
164dc9477beSmrg# ---------
165dc9477beSmrgm4_defun([_LT_SETUP],
166dc9477beSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
167dc9477beSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
168dc9477beSmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
169dc9477beSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
170c43cc173Smrg
171dc9477beSmrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
172dc9477beSmrgdnl
173dc9477beSmrg_LT_DECL([], [host_alias], [0], [The host system])dnl
174dc9477beSmrg_LT_DECL([], [host], [0])dnl
175dc9477beSmrg_LT_DECL([], [host_os], [0])dnl
176dc9477beSmrgdnl
177dc9477beSmrg_LT_DECL([], [build_alias], [0], [The build system])dnl
178dc9477beSmrg_LT_DECL([], [build], [0])dnl
179dc9477beSmrg_LT_DECL([], [build_os], [0])dnl
180dc9477beSmrgdnl
181dc9477beSmrgAC_REQUIRE([AC_PROG_CC])dnl
182dc9477beSmrgAC_REQUIRE([LT_PATH_LD])dnl
183dc9477beSmrgAC_REQUIRE([LT_PATH_NM])dnl
184dc9477beSmrgdnl
185dc9477beSmrgAC_REQUIRE([AC_PROG_LN_S])dnl
186dc9477beSmrgtest -z "$LN_S" && LN_S="ln -s"
187dc9477beSmrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
188dc9477beSmrgdnl
189dc9477beSmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
190dc9477beSmrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
191dc9477beSmrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
192dc9477beSmrgdnl
193dc9477beSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
194dc9477beSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
195dc9477beSmrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
196dc9477beSmrgm4_require([_LT_CMD_RELOAD])dnl
197dc9477beSmrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
198dc9477beSmrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
199dc9477beSmrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
200dc9477beSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
201dc9477beSmrgm4_require([_LT_WITH_SYSROOT])dnl
202c27c18e8Smrg
203dc9477beSmrg_LT_CONFIG_LIBTOOL_INIT([
2040eb1301bSmrg# See if we are running on zsh, and set the options which allow our
205dc9477beSmrg# commands through without removal of \ escapes INIT.
2060eb1301bSmrgif test -n "\${ZSH_VERSION+set}" ; then
207dc9477beSmrg   setopt NO_GLOB_SUBST
208dc9477beSmrgfi
20906c34b88Smrg])
2100eb1301bSmrgif test -n "${ZSH_VERSION+set}" ; then
211dc9477beSmrg   setopt NO_GLOB_SUBST
212dc9477beSmrgfi
213c27c18e8Smrg
214dc9477beSmrg_LT_CHECK_OBJDIR
215c27c18e8Smrg
216dc9477beSmrgm4_require([_LT_TAG_COMPILER])dnl
217c27c18e8Smrg
218dc9477beSmrgcase $host_os in
219dc9477beSmrgaix3*)
220dc9477beSmrg  # AIX sometimes has problems with the GCC collect2 program.  For some
221dc9477beSmrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
222dc9477beSmrg  # vanish in a puff of smoke.
2230eb1301bSmrg  if test "X${COLLECT_NAMES+set}" != Xset; then
224dc9477beSmrg    COLLECT_NAMES=
225dc9477beSmrg    export COLLECT_NAMES
22606c34b88Smrg  fi
227dc9477beSmrg  ;;
228dc9477beSmrgesac
229c27c18e8Smrg
230dc9477beSmrg# Global variables:
231dc9477beSmrgofile=libtool
232dc9477beSmrgcan_build_shared=yes
233c27c18e8Smrg
2340eb1301bSmrg# All known linkers require a `.a' archive for static linking (except MSVC,
235dc9477beSmrg# which needs '.lib').
236dc9477beSmrglibext=a
237c27c18e8Smrg
2380eb1301bSmrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
239c27c18e8Smrg
2400eb1301bSmrgold_CC="$CC"
2410eb1301bSmrgold_CFLAGS="$CFLAGS"
242c27c18e8Smrg
243dc9477beSmrg# Set sane defaults for various variables
244dc9477beSmrgtest -z "$CC" && CC=cc
245dc9477beSmrgtest -z "$LTCC" && LTCC=$CC
246dc9477beSmrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
247dc9477beSmrgtest -z "$LD" && LD=ld
248dc9477beSmrgtest -z "$ac_objext" && ac_objext=o
249c27c18e8Smrg
250dc9477beSmrg_LT_CC_BASENAME([$compiler])
251c27c18e8Smrg
252dc9477beSmrg# Only perform the check for file, if the check method requires it
253dc9477beSmrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
254dc9477beSmrgcase $deplibs_check_method in
255dc9477beSmrgfile_magic*)
256dc9477beSmrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
257dc9477beSmrg    _LT_PATH_MAGIC
258dc9477beSmrg  fi
259dc9477beSmrg  ;;
260dc9477beSmrgesac
261c27c18e8Smrg
262dc9477beSmrg# Use C for the default configuration in the libtool script
263dc9477beSmrgLT_SUPPORTED_TAG([CC])
264dc9477beSmrg_LT_LANG_C_CONFIG
265dc9477beSmrg_LT_LANG_DEFAULT_CONFIG
266dc9477beSmrg_LT_CONFIG_COMMANDS
267dc9477beSmrg])# _LT_SETUP
268c27c18e8Smrg
269c27c18e8Smrg
270dc9477beSmrg# _LT_PREPARE_SED_QUOTE_VARS
271dc9477beSmrg# --------------------------
272dc9477beSmrg# Define a few sed substitution that help us do robust quoting.
273dc9477beSmrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
274dc9477beSmrg[# Backslashify metacharacters that are still active within
275dc9477beSmrg# double-quoted strings.
276dc9477beSmrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
277c27c18e8Smrg
278dc9477beSmrg# Same as above, but do not quote variable references.
279dc9477beSmrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
280c27c18e8Smrg
281dc9477beSmrg# Sed substitution to delay expansion of an escaped shell variable in a
282dc9477beSmrg# double_quote_subst'ed string.
283dc9477beSmrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
284c27c18e8Smrg
285dc9477beSmrg# Sed substitution to delay expansion of an escaped single quote.
286dc9477beSmrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
287c27c18e8Smrg
288dc9477beSmrg# Sed substitution to avoid accidental globbing in evaled expressions
289dc9477beSmrgno_glob_subst='s/\*/\\\*/g'
290dc9477beSmrg])
291c27c18e8Smrg
292dc9477beSmrg# _LT_PROG_LTMAIN
293dc9477beSmrg# ---------------
2940eb1301bSmrg# Note that this code is called both from `configure', and `config.status'
295dc9477beSmrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
2960eb1301bSmrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
297dc9477beSmrg# so we pass a copy along to make sure it has a sensible value anyway.
298dc9477beSmrgm4_defun([_LT_PROG_LTMAIN],
299dc9477beSmrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
300dc9477beSmrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
3010eb1301bSmrgltmain="$ac_aux_dir/ltmain.sh"
302dc9477beSmrg])# _LT_PROG_LTMAIN
303c27c18e8Smrg
304c27c18e8Smrg
305c43cc173Smrg
306dc9477beSmrg# So that we can recreate a full libtool script including additional
307dc9477beSmrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
3080eb1301bSmrg# in macros and then make a single call at the end using the `libtool'
309dc9477beSmrg# label.
310dc9477beSmrg
311dc9477beSmrg
312dc9477beSmrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
313dc9477beSmrg# ----------------------------------------
314dc9477beSmrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
315dc9477beSmrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
316dc9477beSmrg[m4_ifval([$1],
317dc9477beSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
318dc9477beSmrg                     [$1
319dc9477beSmrg])])])
320dc9477beSmrg
321dc9477beSmrg# Initialize.
322dc9477beSmrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
323dc9477beSmrg
324dc9477beSmrg
325dc9477beSmrg# _LT_CONFIG_LIBTOOL([COMMANDS])
32606c34b88Smrg# ------------------------------
327dc9477beSmrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
328dc9477beSmrgm4_define([_LT_CONFIG_LIBTOOL],
329dc9477beSmrg[m4_ifval([$1],
330dc9477beSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
331dc9477beSmrg                     [$1
332dc9477beSmrg])])])
333c43cc173Smrg
334dc9477beSmrg# Initialize.
335dc9477beSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
336dc9477beSmrg
337dc9477beSmrg
338dc9477beSmrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
339dc9477beSmrg# -----------------------------------------------------
340dc9477beSmrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
341dc9477beSmrg[_LT_CONFIG_LIBTOOL([$1])
342dc9477beSmrg_LT_CONFIG_LIBTOOL_INIT([$2])
343c27c18e8Smrg])
344c27c18e8Smrg
345c27c18e8Smrg
346dc9477beSmrg# _LT_FORMAT_COMMENT([COMMENT])
347dc9477beSmrg# -----------------------------
348dc9477beSmrg# Add leading comment marks to the start of each line, and a trailing
349dc9477beSmrg# full-stop to the whole comment if one is not present already.
350dc9477beSmrgm4_define([_LT_FORMAT_COMMENT],
351dc9477beSmrg[m4_ifval([$1], [
352dc9477beSmrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
353dc9477beSmrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
354dc9477beSmrg)])
355c27c18e8Smrg
356c27c18e8Smrg
357c27c18e8Smrg
358c27c18e8Smrg
359c27c18e8Smrg
360dc9477beSmrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
361dc9477beSmrg# -------------------------------------------------------------------
362dc9477beSmrg# CONFIGNAME is the name given to the value in the libtool script.
363dc9477beSmrg# VARNAME is the (base) name used in the configure script.
364dc9477beSmrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
365dc9477beSmrg# VARNAME.  Any other value will be used directly.
366dc9477beSmrgm4_define([_LT_DECL],
367dc9477beSmrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
368dc9477beSmrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
369dc9477beSmrg	[m4_ifval([$1], [$1], [$2])])
370dc9477beSmrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
371dc9477beSmrg    m4_ifval([$4],
372dc9477beSmrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
373dc9477beSmrg    lt_dict_add_subkey([lt_decl_dict], [$2],
374dc9477beSmrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
375dc9477beSmrg])
376c27c18e8Smrg
377c27c18e8Smrg
378dc9477beSmrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
379dc9477beSmrg# --------------------------------------------------------
380dc9477beSmrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
381c27c18e8Smrg
382c27c18e8Smrg
383dc9477beSmrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
384dc9477beSmrg# ------------------------------------------------
385dc9477beSmrgm4_define([lt_decl_tag_varnames],
386dc9477beSmrg[_lt_decl_filter([tagged?], [yes], $@)])
387dc9477beSmrg
388dc9477beSmrg
389dc9477beSmrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
390dc9477beSmrg# ---------------------------------------------------------
391dc9477beSmrgm4_define([_lt_decl_filter],
392dc9477beSmrg[m4_case([$#],
393dc9477beSmrg  [0], [m4_fatal([$0: too few arguments: $#])],
394dc9477beSmrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
395dc9477beSmrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
396dc9477beSmrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
397dc9477beSmrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
39806c34b88Smrg])
399c27c18e8Smrg
400c27c18e8Smrg
401dc9477beSmrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
402dc9477beSmrg# --------------------------------------------------
403dc9477beSmrgm4_define([lt_decl_quote_varnames],
404dc9477beSmrg[_lt_decl_filter([value], [1], $@)])
405dc9477beSmrg
406dc9477beSmrg
407dc9477beSmrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
408dc9477beSmrg# ---------------------------------------------------
409dc9477beSmrgm4_define([lt_decl_dquote_varnames],
410dc9477beSmrg[_lt_decl_filter([value], [2], $@)])
411dc9477beSmrg
412dc9477beSmrg
413dc9477beSmrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
414dc9477beSmrg# ---------------------------------------------------
415dc9477beSmrgm4_define([lt_decl_varnames_tagged],
416dc9477beSmrg[m4_assert([$# <= 2])dnl
417dc9477beSmrg_$0(m4_quote(m4_default([$1], [[, ]])),
418dc9477beSmrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
419dc9477beSmrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
420dc9477beSmrgm4_define([_lt_decl_varnames_tagged],
421dc9477beSmrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
422dc9477beSmrg
423dc9477beSmrg
424dc9477beSmrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
425dc9477beSmrg# ------------------------------------------------
426dc9477beSmrgm4_define([lt_decl_all_varnames],
427dc9477beSmrg[_$0(m4_quote(m4_default([$1], [[, ]])),
428dc9477beSmrg     m4_if([$2], [],
429dc9477beSmrg	   m4_quote(lt_decl_varnames),
430dc9477beSmrg	m4_quote(m4_shift($@))))[]dnl
43106c34b88Smrg])
432dc9477beSmrgm4_define([_lt_decl_all_varnames],
433dc9477beSmrg[lt_join($@, lt_decl_varnames_tagged([$1],
434dc9477beSmrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
43506c34b88Smrg])
436c27c18e8Smrg
43737eb1ca1Smrg
438dc9477beSmrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
439dc9477beSmrg# ------------------------------------
4400eb1301bSmrg# Quote a variable value, and forward it to `config.status' so that its
4410eb1301bSmrg# declaration there will have the same value as in `configure'.  VARNAME
442dc9477beSmrg# must have a single quote delimited value for this to work.
443dc9477beSmrgm4_define([_LT_CONFIG_STATUS_DECLARE],
444dc9477beSmrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
44506c34b88Smrg
44606c34b88Smrg
447dc9477beSmrg# _LT_CONFIG_STATUS_DECLARATIONS
448dc9477beSmrg# ------------------------------
449dc9477beSmrg# We delimit libtool config variables with single quotes, so when
450dc9477beSmrg# we write them to config.status, we have to be sure to quote all
451dc9477beSmrg# embedded single quotes properly.  In configure, this macro expands
452dc9477beSmrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
453dc9477beSmrg#
454dc9477beSmrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
455dc9477beSmrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
456dc9477beSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
457dc9477beSmrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
45806c34b88Smrg
45906c34b88Smrg
460dc9477beSmrg# _LT_LIBTOOL_TAGS
461dc9477beSmrg# ----------------
462dc9477beSmrg# Output comment and list of tags supported by the script
463dc9477beSmrgm4_defun([_LT_LIBTOOL_TAGS],
464dc9477beSmrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
4650eb1301bSmrgavailable_tags="_LT_TAGS"dnl
466dc9477beSmrg])
46706c34b88Smrg
46806c34b88Smrg
469dc9477beSmrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
470dc9477beSmrg# -----------------------------------
471dc9477beSmrg# Extract the dictionary values for VARNAME (optionally with TAG) and
472dc9477beSmrg# expand to a commented shell variable setting:
47306c34b88Smrg#
474dc9477beSmrg#    # Some comment about what VAR is for.
475dc9477beSmrg#    visible_name=$lt_internal_name
476dc9477beSmrgm4_define([_LT_LIBTOOL_DECLARE],
477dc9477beSmrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
478dc9477beSmrg					   [description])))[]dnl
479dc9477beSmrgm4_pushdef([_libtool_name],
480dc9477beSmrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
481dc9477beSmrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
482dc9477beSmrg    [0], [_libtool_name=[$]$1],
483dc9477beSmrg    [1], [_libtool_name=$lt_[]$1],
484dc9477beSmrg    [2], [_libtool_name=$lt_[]$1],
485dc9477beSmrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
486dc9477beSmrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
487dc9477beSmrg])
48806c34b88Smrg
48906c34b88Smrg
490dc9477beSmrg# _LT_LIBTOOL_CONFIG_VARS
491dc9477beSmrg# -----------------------
492dc9477beSmrg# Produce commented declarations of non-tagged libtool config variables
4930eb1301bSmrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
494dc9477beSmrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
495dc9477beSmrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
496dc9477beSmrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
497dc9477beSmrg[m4_foreach([_lt_var],
498dc9477beSmrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
499dc9477beSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
50006c34b88Smrg
50106c34b88Smrg
502dc9477beSmrg# _LT_LIBTOOL_TAG_VARS(TAG)
503dc9477beSmrg# -------------------------
504dc9477beSmrgm4_define([_LT_LIBTOOL_TAG_VARS],
505dc9477beSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
506dc9477beSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
50706c34b88Smrg
50806c34b88Smrg
509dc9477beSmrg# _LT_TAGVAR(VARNAME, [TAGNAME])
510dc9477beSmrg# ------------------------------
511dc9477beSmrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
51206c34b88Smrg
51306c34b88Smrg
514dc9477beSmrg# _LT_CONFIG_COMMANDS
515dc9477beSmrg# -------------------
516dc9477beSmrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
517dc9477beSmrg# variables for single and double quote escaping we saved from calls
518dc9477beSmrg# to _LT_DECL, we can put quote escaped variables declarations
5190eb1301bSmrg# into `config.status', and then the shell code to quote escape them in
5200eb1301bSmrg# for loops in `config.status'.  Finally, any additional code accumulated
521dc9477beSmrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
522dc9477beSmrgm4_defun([_LT_CONFIG_COMMANDS],
523dc9477beSmrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
524dc9477beSmrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
525dc9477beSmrg	dnl instead of duplicating it all over again into config.status,
526dc9477beSmrg	dnl then we will have config.status run $CONFIG_LT later, so it
527dc9477beSmrg	dnl needs to know what name is stored there:
528dc9477beSmrg        [AC_CONFIG_COMMANDS([libtool],
529dc9477beSmrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
530dc9477beSmrg    dnl If the libtool generation code is destined for config.status,
531dc9477beSmrg    dnl expand the accumulated commands and init code now:
532dc9477beSmrg    [AC_CONFIG_COMMANDS([libtool],
533dc9477beSmrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
534dc9477beSmrg])#_LT_CONFIG_COMMANDS
535c27c18e8Smrg
536c27c18e8Smrg
537dc9477beSmrg# Initialize.
538dc9477beSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
539dc9477beSmrg[
540c27c18e8Smrg
541dc9477beSmrg# The HP-UX ksh and POSIX shell print the target directory to stdout
542dc9477beSmrg# if CDPATH is set.
543dc9477beSmrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
544c27c18e8Smrg
545dc9477beSmrgsed_quote_subst='$sed_quote_subst'
546dc9477beSmrgdouble_quote_subst='$double_quote_subst'
547dc9477beSmrgdelay_variable_subst='$delay_variable_subst'
548dc9477beSmrg_LT_CONFIG_STATUS_DECLARATIONS
549dc9477beSmrgLTCC='$LTCC'
550dc9477beSmrgLTCFLAGS='$LTCFLAGS'
551dc9477beSmrgcompiler='$compiler_DEFAULT'
552c27c18e8Smrg
553dc9477beSmrg# A function that is used when there is no print builtin or printf.
554dc9477beSmrgfunc_fallback_echo ()
555dc9477beSmrg{
556dc9477beSmrg  eval 'cat <<_LTECHO_EOF
557dc9477beSmrg\$[]1
558dc9477beSmrg_LTECHO_EOF'
559dc9477beSmrg}
560c27c18e8Smrg
561dc9477beSmrg# Quote evaled strings.
562dc9477beSmrgfor var in lt_decl_all_varnames([[ \
563dc9477beSmrg]], lt_decl_quote_varnames); do
564dc9477beSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
565dc9477beSmrg    *[[\\\\\\\`\\"\\\$]]*)
5660eb1301bSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
567dc9477beSmrg      ;;
568dc9477beSmrg    *)
569dc9477beSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
570dc9477beSmrg      ;;
571dc9477beSmrg    esac
572dc9477beSmrgdone
573c27c18e8Smrg
574dc9477beSmrg# Double-quote double-evaled strings.
575dc9477beSmrgfor var in lt_decl_all_varnames([[ \
576dc9477beSmrg]], lt_decl_dquote_varnames); do
577dc9477beSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
578dc9477beSmrg    *[[\\\\\\\`\\"\\\$]]*)
5790eb1301bSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
580dc9477beSmrg      ;;
581dc9477beSmrg    *)
582dc9477beSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
583dc9477beSmrg      ;;
584dc9477beSmrg    esac
585dc9477beSmrgdone
586c27c18e8Smrg
587dc9477beSmrg_LT_OUTPUT_LIBTOOL_INIT
58806c34b88Smrg])
589c27c18e8Smrg
590dc9477beSmrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
591dc9477beSmrg# ------------------------------------
592dc9477beSmrg# Generate a child script FILE with all initialization necessary to
593dc9477beSmrg# reuse the environment learned by the parent script, and make the
594dc9477beSmrg# file executable.  If COMMENT is supplied, it is inserted after the
5950eb1301bSmrg# `#!' sequence but before initialization text begins.  After this
596dc9477beSmrg# macro, additional text can be appended to FILE to form the body of
597dc9477beSmrg# the child script.  The macro ends with non-zero status if the
598dc9477beSmrg# file could not be fully written (such as if the disk is full).
599dc9477beSmrgm4_ifdef([AS_INIT_GENERATED],
600dc9477beSmrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
601dc9477beSmrg[m4_defun([_LT_GENERATED_FILE_INIT],
602dc9477beSmrg[m4_require([AS_PREPARE])]dnl
603dc9477beSmrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
604dc9477beSmrg[lt_write_fail=0
605dc9477beSmrgcat >$1 <<_ASEOF || lt_write_fail=1
606dc9477beSmrg#! $SHELL
607dc9477beSmrg# Generated by $as_me.
608dc9477beSmrg$2
609dc9477beSmrgSHELL=\${CONFIG_SHELL-$SHELL}
610dc9477beSmrgexport SHELL
611dc9477beSmrg_ASEOF
612dc9477beSmrgcat >>$1 <<\_ASEOF || lt_write_fail=1
613dc9477beSmrgAS_SHELL_SANITIZE
614dc9477beSmrg_AS_PREPARE
615dc9477beSmrgexec AS_MESSAGE_FD>&1
616dc9477beSmrg_ASEOF
6170eb1301bSmrgtest $lt_write_fail = 0 && chmod +x $1[]dnl
618dc9477beSmrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
619c27c18e8Smrg
620dc9477beSmrg# LT_OUTPUT
621dc9477beSmrg# ---------
622dc9477beSmrg# This macro allows early generation of the libtool script (before
623dc9477beSmrg# AC_OUTPUT is called), incase it is used in configure for compilation
624dc9477beSmrg# tests.
625dc9477beSmrgAC_DEFUN([LT_OUTPUT],
626dc9477beSmrg[: ${CONFIG_LT=./config.lt}
627dc9477beSmrgAC_MSG_NOTICE([creating $CONFIG_LT])
628dc9477beSmrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
629dc9477beSmrg[# Run this file to recreate a libtool stub with the current configuration.])
630c27c18e8Smrg
631dc9477beSmrgcat >>"$CONFIG_LT" <<\_LTEOF
632dc9477beSmrglt_cl_silent=false
633dc9477beSmrgexec AS_MESSAGE_LOG_FD>>config.log
634dc9477beSmrg{
635dc9477beSmrg  echo
636dc9477beSmrg  AS_BOX([Running $as_me.])
637dc9477beSmrg} >&AS_MESSAGE_LOG_FD
638c27c18e8Smrg
639dc9477beSmrglt_cl_help="\
6400eb1301bSmrg\`$as_me' creates a local libtool stub from the current configuration,
641dc9477beSmrgfor use in further configure time tests before the real libtool is
642dc9477beSmrggenerated.
643c27c18e8Smrg
644dc9477beSmrgUsage: $[0] [[OPTIONS]]
645c27c18e8Smrg
646dc9477beSmrg  -h, --help      print this help, then exit
647dc9477beSmrg  -V, --version   print version number, then exit
648dc9477beSmrg  -q, --quiet     do not print progress messages
649dc9477beSmrg  -d, --debug     don't remove temporary files
650c27c18e8Smrg
651dc9477beSmrgReport bugs to <bug-libtool@gnu.org>."
652c27c18e8Smrg
653dc9477beSmrglt_cl_version="\
654dc9477beSmrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
655dc9477beSmrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
656dc9477beSmrgconfigured by $[0], generated by m4_PACKAGE_STRING.
657c27c18e8Smrg
658dc9477beSmrgCopyright (C) 2011 Free Software Foundation, Inc.
659dc9477beSmrgThis config.lt script is free software; the Free Software Foundation
660dc9477beSmrggives unlimited permision to copy, distribute and modify it."
661dc9477beSmrg
6620eb1301bSmrgwhile test $[#] != 0
663dc9477beSmrgdo
664dc9477beSmrg  case $[1] in
665dc9477beSmrg    --version | --v* | -V )
666dc9477beSmrg      echo "$lt_cl_version"; exit 0 ;;
667dc9477beSmrg    --help | --h* | -h )
668dc9477beSmrg      echo "$lt_cl_help"; exit 0 ;;
669dc9477beSmrg    --debug | --d* | -d )
670dc9477beSmrg      debug=: ;;
671dc9477beSmrg    --quiet | --q* | --silent | --s* | -q )
672dc9477beSmrg      lt_cl_silent=: ;;
673c27c18e8Smrg
674dc9477beSmrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
6750eb1301bSmrgTry \`$[0] --help' for more information.]) ;;
676c27c18e8Smrg
677dc9477beSmrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
6780eb1301bSmrgTry \`$[0] --help' for more information.]) ;;
67906c34b88Smrg  esac
680dc9477beSmrg  shift
68106c34b88Smrgdone
682c27c18e8Smrg
683dc9477beSmrgif $lt_cl_silent; then
684dc9477beSmrg  exec AS_MESSAGE_FD>/dev/null
685dc9477beSmrgfi
686dc9477beSmrg_LTEOF
687c27c18e8Smrg
688dc9477beSmrgcat >>"$CONFIG_LT" <<_LTEOF
689dc9477beSmrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
690dc9477beSmrg_LTEOF
691c27c18e8Smrg
692dc9477beSmrgcat >>"$CONFIG_LT" <<\_LTEOF
693dc9477beSmrgAC_MSG_NOTICE([creating $ofile])
694dc9477beSmrg_LT_OUTPUT_LIBTOOL_COMMANDS
695dc9477beSmrgAS_EXIT(0)
696dc9477beSmrg_LTEOF
697dc9477beSmrgchmod +x "$CONFIG_LT"
698c27c18e8Smrg
699dc9477beSmrg# configure is writing to config.log, but config.lt does its own redirection,
700dc9477beSmrg# appending to config.log, which fails on DOS, as config.log is still kept
701dc9477beSmrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
702dc9477beSmrg# config.log, so it can be properly (re)opened and appended to by config.lt.
703dc9477beSmrglt_cl_success=:
7040eb1301bSmrgtest "$silent" = yes &&
705dc9477beSmrg  lt_config_lt_args="$lt_config_lt_args --quiet"
706dc9477beSmrgexec AS_MESSAGE_LOG_FD>/dev/null
707dc9477beSmrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
708dc9477beSmrgexec AS_MESSAGE_LOG_FD>>config.log
709dc9477beSmrg$lt_cl_success || AS_EXIT(1)
710dc9477beSmrg])# LT_OUTPUT
71106c34b88Smrg
71206c34b88Smrg
713dc9477beSmrg# _LT_CONFIG(TAG)
714dc9477beSmrg# ---------------
715dc9477beSmrg# If TAG is the built-in tag, create an initial libtool script with a
716dc9477beSmrg# default configuration from the untagged config vars.  Otherwise add code
717dc9477beSmrg# to config.status for appending the configuration named by TAG from the
718dc9477beSmrg# matching tagged config vars.
719dc9477beSmrgm4_defun([_LT_CONFIG],
720dc9477beSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
721dc9477beSmrg_LT_CONFIG_SAVE_COMMANDS([
722dc9477beSmrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
723dc9477beSmrg  m4_if(_LT_TAG, [C], [
7240eb1301bSmrg    # See if we are running on zsh, and set the options which allow our
725dc9477beSmrg    # commands through without removal of \ escapes.
7260eb1301bSmrg    if test -n "${ZSH_VERSION+set}" ; then
727dc9477beSmrg      setopt NO_GLOB_SUBST
728dc9477beSmrg    fi
729c27c18e8Smrg
7300eb1301bSmrg    cfgfile="${ofile}T"
731dc9477beSmrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
732dc9477beSmrg    $RM "$cfgfile"
733c27c18e8Smrg
734dc9477beSmrg    cat <<_LT_EOF >> "$cfgfile"
735dc9477beSmrg#! $SHELL
7360eb1301bSmrg
7370eb1301bSmrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
7380eb1301bSmrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
739dc9477beSmrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
740dc9477beSmrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
7410eb1301bSmrg#
742dc9477beSmrg_LT_COPYING
743dc9477beSmrg_LT_LIBTOOL_TAGS
744c27c18e8Smrg
745dc9477beSmrg# ### BEGIN LIBTOOL CONFIG
746dc9477beSmrg_LT_LIBTOOL_CONFIG_VARS
747dc9477beSmrg_LT_LIBTOOL_TAG_VARS
748dc9477beSmrg# ### END LIBTOOL CONFIG
749c27c18e8Smrg
750dc9477beSmrg_LT_EOF
751c27c18e8Smrg
752dc9477beSmrg  case $host_os in
753dc9477beSmrg  aix3*)
754dc9477beSmrg    cat <<\_LT_EOF >> "$cfgfile"
755dc9477beSmrg# AIX sometimes has problems with the GCC collect2 program.  For some
756dc9477beSmrg# reason, if we set the COLLECT_NAMES environment variable, the problems
757dc9477beSmrg# vanish in a puff of smoke.
7580eb1301bSmrgif test "X${COLLECT_NAMES+set}" != Xset; then
759dc9477beSmrg  COLLECT_NAMES=
760dc9477beSmrg  export COLLECT_NAMES
761dc9477beSmrgfi
762dc9477beSmrg_LT_EOF
763dc9477beSmrg    ;;
764dc9477beSmrg  esac
765c27c18e8Smrg
766dc9477beSmrg  _LT_PROG_LTMAIN
767c27c18e8Smrg
768dc9477beSmrg  # We use sed instead of cat because bash on DJGPP gets confused if
769dc9477beSmrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
770dc9477beSmrg  # text mode, it properly converts lines to CR/LF.  This bash problem
771dc9477beSmrg  # is reportedly fixed, but why not run on old versions too?
772dc9477beSmrg  sed '$q' "$ltmain" >> "$cfgfile" \
773dc9477beSmrg     || (rm -f "$cfgfile"; exit 1)
774c27c18e8Smrg
7750eb1301bSmrg  _LT_PROG_REPLACE_SHELLFNS
7760eb1301bSmrg
777dc9477beSmrg   mv -f "$cfgfile" "$ofile" ||
778dc9477beSmrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
779dc9477beSmrg  chmod +x "$ofile"
780dc9477beSmrg],
781dc9477beSmrg[cat <<_LT_EOF >> "$ofile"
782c27c18e8Smrg
783dc9477beSmrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
784dc9477beSmrgdnl in a comment (ie after a #).
785dc9477beSmrg# ### BEGIN LIBTOOL TAG CONFIG: $1
786dc9477beSmrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
787dc9477beSmrg# ### END LIBTOOL TAG CONFIG: $1
788dc9477beSmrg_LT_EOF
789dc9477beSmrg])dnl /m4_if
790dc9477beSmrg],
791dc9477beSmrg[m4_if([$1], [], [
792dc9477beSmrg    PACKAGE='$PACKAGE'
793dc9477beSmrg    VERSION='$VERSION'
7940eb1301bSmrg    TIMESTAMP='$TIMESTAMP'
795dc9477beSmrg    RM='$RM'
796dc9477beSmrg    ofile='$ofile'], [])
797dc9477beSmrg])dnl /_LT_CONFIG_SAVE_COMMANDS
798dc9477beSmrg])# _LT_CONFIG
799c27c18e8Smrg
800c27c18e8Smrg
801dc9477beSmrg# LT_SUPPORTED_TAG(TAG)
802dc9477beSmrg# ---------------------
803dc9477beSmrg# Trace this macro to discover what tags are supported by the libtool
804dc9477beSmrg# --tag option, using:
805dc9477beSmrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
806dc9477beSmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
807c27c18e8Smrg
808c27c18e8Smrg
809dc9477beSmrg# C support is built-in for now
810dc9477beSmrgm4_define([_LT_LANG_C_enabled], [])
811dc9477beSmrgm4_define([_LT_TAGS], [])
812c27c18e8Smrg
813c27c18e8Smrg
814dc9477beSmrg# LT_LANG(LANG)
815dc9477beSmrg# -------------
816dc9477beSmrg# Enable libtool support for the given language if not already enabled.
817dc9477beSmrgAC_DEFUN([LT_LANG],
818dc9477beSmrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
819dc9477beSmrgm4_case([$1],
820dc9477beSmrg  [C],			[_LT_LANG(C)],
821dc9477beSmrg  [C++],		[_LT_LANG(CXX)],
822dc9477beSmrg  [Go],			[_LT_LANG(GO)],
823dc9477beSmrg  [Java],		[_LT_LANG(GCJ)],
824dc9477beSmrg  [Fortran 77],		[_LT_LANG(F77)],
825dc9477beSmrg  [Fortran],		[_LT_LANG(FC)],
826dc9477beSmrg  [Windows Resource],	[_LT_LANG(RC)],
827dc9477beSmrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
828dc9477beSmrg    [_LT_LANG($1)],
829dc9477beSmrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
830dc9477beSmrg])# LT_LANG
831c27c18e8Smrg
832c43cc173Smrg
833dc9477beSmrg# _LT_LANG(LANGNAME)
834dc9477beSmrg# ------------------
835dc9477beSmrgm4_defun([_LT_LANG],
836dc9477beSmrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
837dc9477beSmrg  [LT_SUPPORTED_TAG([$1])dnl
838dc9477beSmrg  m4_append([_LT_TAGS], [$1 ])dnl
839dc9477beSmrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
840dc9477beSmrg  _LT_LANG_$1_CONFIG($1)])dnl
841dc9477beSmrg])# _LT_LANG
842c27c18e8Smrg
843c43cc173Smrg
844dc9477beSmrgm4_ifndef([AC_PROG_GO], [
845dc9477beSmrg# NOTE: This macro has been submitted for inclusion into   #
846dc9477beSmrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
847dc9477beSmrg#  a released version of Autoconf we should remove this    #
848dc9477beSmrg#  macro and use it instead.                               #
849dc9477beSmrgm4_defun([AC_PROG_GO],
850dc9477beSmrg[AC_LANG_PUSH(Go)dnl
851dc9477beSmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
852dc9477beSmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
853dc9477beSmrg_AC_ARG_VAR_LDFLAGS()dnl
854dc9477beSmrgAC_CHECK_TOOL(GOC, gccgo)
855dc9477beSmrgif test -z "$GOC"; then
856dc9477beSmrg  if test -n "$ac_tool_prefix"; then
857dc9477beSmrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
858dc9477beSmrg  fi
859dc9477beSmrgfi
860dc9477beSmrgif test -z "$GOC"; then
861dc9477beSmrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
862dc9477beSmrgfi
863dc9477beSmrg])#m4_defun
864dc9477beSmrg])#m4_ifndef
865c43cc173Smrg
866c43cc173Smrg
867dc9477beSmrg# _LT_LANG_DEFAULT_CONFIG
868dc9477beSmrg# -----------------------
869dc9477beSmrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
870dc9477beSmrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
871dc9477beSmrg  [LT_LANG(CXX)],
872dc9477beSmrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
873c43cc173Smrg
874dc9477beSmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
875dc9477beSmrg  [LT_LANG(F77)],
876dc9477beSmrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
877c43cc173Smrg
878dc9477beSmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
879dc9477beSmrg  [LT_LANG(FC)],
880dc9477beSmrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
881c43cc173Smrg
882dc9477beSmrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
883dc9477beSmrgdnl pulling things in needlessly.
884dc9477beSmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
885dc9477beSmrg  [LT_LANG(GCJ)],
886dc9477beSmrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
887dc9477beSmrg    [LT_LANG(GCJ)],
888dc9477beSmrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
889dc9477beSmrg      [LT_LANG(GCJ)],
890dc9477beSmrg      [m4_ifdef([AC_PROG_GCJ],
891dc9477beSmrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
892dc9477beSmrg       m4_ifdef([A][M_PROG_GCJ],
893dc9477beSmrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
894dc9477beSmrg       m4_ifdef([LT_PROG_GCJ],
895dc9477beSmrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
896c43cc173Smrg
897dc9477beSmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
898dc9477beSmrg  [LT_LANG(GO)],
899dc9477beSmrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
90021e67964Smrg
901dc9477beSmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
902dc9477beSmrg  [LT_LANG(RC)],
903dc9477beSmrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
904dc9477beSmrg])# _LT_LANG_DEFAULT_CONFIG
905f1ee322dSmrg
906dc9477beSmrg# Obsolete macros:
907dc9477beSmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
908dc9477beSmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
909dc9477beSmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
910dc9477beSmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
911dc9477beSmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
912dc9477beSmrgdnl aclocal-1.4 backwards compatibility:
913dc9477beSmrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
914dc9477beSmrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
915dc9477beSmrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
916dc9477beSmrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
917dc9477beSmrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
918f1ee322dSmrg
919c43cc173Smrg
920dc9477beSmrg# _LT_TAG_COMPILER
921dc9477beSmrg# ----------------
922dc9477beSmrgm4_defun([_LT_TAG_COMPILER],
923dc9477beSmrg[AC_REQUIRE([AC_PROG_CC])dnl
924c27c18e8Smrg
925dc9477beSmrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
926dc9477beSmrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
927dc9477beSmrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
928dc9477beSmrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
92906c34b88Smrg
930dc9477beSmrg# If no C compiler was specified, use CC.
931dc9477beSmrgLTCC=${LTCC-"$CC"}
93206c34b88Smrg
933dc9477beSmrg# If no C compiler flags were specified, use CFLAGS.
934dc9477beSmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
93506c34b88Smrg
936dc9477beSmrg# Allow CC to be a program name with arguments.
937dc9477beSmrgcompiler=$CC
938dc9477beSmrg])# _LT_TAG_COMPILER
93906c34b88Smrg
940c27c18e8Smrg
941dc9477beSmrg# _LT_COMPILER_BOILERPLATE
942dc9477beSmrg# ------------------------
943dc9477beSmrg# Check for compiler boilerplate output or warnings with
944dc9477beSmrg# the simple compiler test code.
945dc9477beSmrgm4_defun([_LT_COMPILER_BOILERPLATE],
946dc9477beSmrg[m4_require([_LT_DECL_SED])dnl
947dc9477beSmrgac_outfile=conftest.$ac_objext
948dc9477beSmrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
949dc9477beSmrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
950dc9477beSmrg_lt_compiler_boilerplate=`cat conftest.err`
951dc9477beSmrg$RM conftest*
952dc9477beSmrg])# _LT_COMPILER_BOILERPLATE
953c43cc173Smrg
954c43cc173Smrg
955dc9477beSmrg# _LT_LINKER_BOILERPLATE
956dc9477beSmrg# ----------------------
957dc9477beSmrg# Check for linker boilerplate output or warnings with
958dc9477beSmrg# the simple link test code.
959dc9477beSmrgm4_defun([_LT_LINKER_BOILERPLATE],
960dc9477beSmrg[m4_require([_LT_DECL_SED])dnl
961dc9477beSmrgac_outfile=conftest.$ac_objext
962dc9477beSmrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
963dc9477beSmrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
964dc9477beSmrg_lt_linker_boilerplate=`cat conftest.err`
965dc9477beSmrg$RM -r conftest*
966dc9477beSmrg])# _LT_LINKER_BOILERPLATE
96737eb1ca1Smrg
968dc9477beSmrg# _LT_REQUIRED_DARWIN_CHECKS
969dc9477beSmrg# -------------------------
970dc9477beSmrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
971dc9477beSmrg  case $host_os in
972dc9477beSmrg    rhapsody* | darwin*)
973dc9477beSmrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
974dc9477beSmrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
975dc9477beSmrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
976dc9477beSmrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
977dc9477beSmrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
978dc9477beSmrg    _LT_DECL([], [DSYMUTIL], [1],
979dc9477beSmrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
980dc9477beSmrg    _LT_DECL([], [NMEDIT], [1],
981dc9477beSmrg      [Tool to change global to local symbols on Mac OS X])
982dc9477beSmrg    _LT_DECL([], [LIPO], [1],
983dc9477beSmrg      [Tool to manipulate fat objects and archives on Mac OS X])
984dc9477beSmrg    _LT_DECL([], [OTOOL], [1],
985dc9477beSmrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
986dc9477beSmrg    _LT_DECL([], [OTOOL64], [1],
987dc9477beSmrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
988c43cc173Smrg
989dc9477beSmrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
990dc9477beSmrg      [lt_cv_apple_cc_single_mod=no
9910eb1301bSmrg      if test -z "${LT_MULTI_MODULE}"; then
992dc9477beSmrg	# By default we will add the -single_module flag. You can override
993dc9477beSmrg	# by either setting the environment variable LT_MULTI_MODULE
994dc9477beSmrg	# non-empty at configure time, or by adding -multi_module to the
995dc9477beSmrg	# link flags.
996dc9477beSmrg	rm -rf libconftest.dylib*
997dc9477beSmrg	echo "int foo(void){return 1;}" > conftest.c
998dc9477beSmrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
999dc9477beSmrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
1000dc9477beSmrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1001dc9477beSmrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
1002dc9477beSmrg        _lt_result=$?
1003dc9477beSmrg	# If there is a non-empty error log, and "single_module"
1004dc9477beSmrg	# appears in it, assume the flag caused a linker warning
1005dc9477beSmrg        if test -s conftest.err && $GREP single_module conftest.err; then
1006dc9477beSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
1007dc9477beSmrg	# Otherwise, if the output was created with a 0 exit code from
1008dc9477beSmrg	# the compiler, it worked.
10090eb1301bSmrg	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
1010dc9477beSmrg	  lt_cv_apple_cc_single_mod=yes
1011dc9477beSmrg	else
1012dc9477beSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
1013dc9477beSmrg	fi
1014dc9477beSmrg	rm -rf libconftest.dylib*
1015dc9477beSmrg	rm -f conftest.*
1016dc9477beSmrg      fi])
1017c43cc173Smrg
1018dc9477beSmrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
1019dc9477beSmrg      [lt_cv_ld_exported_symbols_list],
1020dc9477beSmrg      [lt_cv_ld_exported_symbols_list=no
1021dc9477beSmrg      save_LDFLAGS=$LDFLAGS
1022dc9477beSmrg      echo "_main" > conftest.sym
1023dc9477beSmrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
1024dc9477beSmrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
1025dc9477beSmrg	[lt_cv_ld_exported_symbols_list=yes],
1026dc9477beSmrg	[lt_cv_ld_exported_symbols_list=no])
10270eb1301bSmrg	LDFLAGS="$save_LDFLAGS"
1028dc9477beSmrg    ])
1029c43cc173Smrg
1030dc9477beSmrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
1031dc9477beSmrg      [lt_cv_ld_force_load=no
1032dc9477beSmrg      cat > conftest.c << _LT_EOF
1033dc9477beSmrgint forced_loaded() { return 2;}
1034dc9477beSmrg_LT_EOF
1035dc9477beSmrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
1036dc9477beSmrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
1037dc9477beSmrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
1038dc9477beSmrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
1039dc9477beSmrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
1040dc9477beSmrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
1041dc9477beSmrg      cat > conftest.c << _LT_EOF
1042dc9477beSmrgint main() { return 0;}
1043dc9477beSmrg_LT_EOF
1044dc9477beSmrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
1045dc9477beSmrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
1046dc9477beSmrg      _lt_result=$?
1047dc9477beSmrg      if test -s conftest.err && $GREP force_load conftest.err; then
1048dc9477beSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
10490eb1301bSmrg      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
1050dc9477beSmrg	lt_cv_ld_force_load=yes
1051dc9477beSmrg      else
1052dc9477beSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
1053dc9477beSmrg      fi
1054dc9477beSmrg        rm -f conftest.err libconftest.a conftest conftest.c
1055dc9477beSmrg        rm -rf conftest.dSYM
1056dc9477beSmrg    ])
1057dc9477beSmrg    case $host_os in
1058dc9477beSmrg    rhapsody* | darwin1.[[012]])
10590eb1301bSmrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
1060dc9477beSmrg    darwin1.*)
10610eb1301bSmrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
1062dc9477beSmrg    darwin*) # darwin 5.x on
1063dc9477beSmrg      # if running on 10.5 or later, the deployment target defaults
1064dc9477beSmrg      # to the OS version, if on x86, and 10.4, the deployment
1065dc9477beSmrg      # target defaults to 10.4. Don't you love it?
1066dc9477beSmrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
1067dc9477beSmrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
10680eb1301bSmrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
10690eb1301bSmrg	10.[[012]]*)
10700eb1301bSmrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
1071dc9477beSmrg	10.*)
10720eb1301bSmrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
1073dc9477beSmrg      esac
1074dc9477beSmrg    ;;
1075dc9477beSmrg  esac
10760eb1301bSmrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
1077dc9477beSmrg      _lt_dar_single_mod='$single_module'
1078dc9477beSmrg    fi
10790eb1301bSmrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
10800eb1301bSmrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
1081dc9477beSmrg    else
10820eb1301bSmrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
1083dc9477beSmrg    fi
10840eb1301bSmrg    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
1085dc9477beSmrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
1086dc9477beSmrg    else
1087dc9477beSmrg      _lt_dsymutil=
1088dc9477beSmrg    fi
1089dc9477beSmrg    ;;
1090dc9477beSmrg  esac
109106c34b88Smrg])
1092c43cc173Smrg
1093c43cc173Smrg
1094dc9477beSmrg# _LT_DARWIN_LINKER_FEATURES([TAG])
1095dc9477beSmrg# ---------------------------------
1096dc9477beSmrg# Checks for linker and compiler features on darwin
1097dc9477beSmrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
1098dc9477beSmrg[
1099dc9477beSmrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1100dc9477beSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1101dc9477beSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
1102dc9477beSmrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
1103dc9477beSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
11040eb1301bSmrg  if test "$lt_cv_ld_force_load" = "yes"; then
11050eb1301bSmrg    _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\"`'
1106dc9477beSmrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
1107dc9477beSmrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
1108dc9477beSmrg  else
1109dc9477beSmrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1110dc9477beSmrg  fi
1111dc9477beSmrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
11120eb1301bSmrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
1113dc9477beSmrg  case $cc_basename in
11140eb1301bSmrg     ifort*) _lt_dar_can_shared=yes ;;
1115dc9477beSmrg     *) _lt_dar_can_shared=$GCC ;;
1116dc9477beSmrg  esac
11170eb1301bSmrg  if test "$_lt_dar_can_shared" = "yes"; then
1118dc9477beSmrg    output_verbose_link_cmd=func_echo_all
11190eb1301bSmrg    _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}"
11200eb1301bSmrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
11210eb1301bSmrg    _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}"
11220eb1301bSmrg    _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}"
1123dc9477beSmrg    m4_if([$1], [CXX],
11240eb1301bSmrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
11250eb1301bSmrg      _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}"
11260eb1301bSmrg      _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}"
1127dc9477beSmrg    fi
1128dc9477beSmrg],[])
1129dc9477beSmrg  else
1130dc9477beSmrg  _LT_TAGVAR(ld_shlibs, $1)=no
1131dc9477beSmrg  fi
1132dc9477beSmrg])
1133c43cc173Smrg
1134dc9477beSmrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
1135dc9477beSmrg# ----------------------------------
1136dc9477beSmrg# Links a minimal program and checks the executable
1137dc9477beSmrg# for the system default hardcoded library path. In most cases,
1138dc9477beSmrg# this is /usr/lib:/lib, but when the MPI compilers are used
1139dc9477beSmrg# the location of the communication and MPI libs are included too.
1140dc9477beSmrg# If we don't find anything, use the default library path according
1141dc9477beSmrg# to the aix ld manual.
1142dc9477beSmrg# Store the results from the different compilers for each TAGNAME.
1143dc9477beSmrg# Allow to override them for all tags through lt_cv_aix_libpath.
1144dc9477beSmrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
1145dc9477beSmrg[m4_require([_LT_DECL_SED])dnl
11460eb1301bSmrgif test "${lt_cv_aix_libpath+set}" = set; then
1147dc9477beSmrg  aix_libpath=$lt_cv_aix_libpath
1148dc9477beSmrgelse
1149dc9477beSmrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
1150dc9477beSmrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
1151dc9477beSmrg  lt_aix_libpath_sed='[
1152dc9477beSmrg      /Import File Strings/,/^$/ {
1153dc9477beSmrg	  /^0/ {
1154dc9477beSmrg	      s/^0  *\([^ ]*\) *$/\1/
1155dc9477beSmrg	      p
1156dc9477beSmrg	  }
1157dc9477beSmrg      }]'
1158dc9477beSmrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1159dc9477beSmrg  # Check for a 64-bit object if we didn't find anything.
1160dc9477beSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1161dc9477beSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1162dc9477beSmrg  fi],[])
1163dc9477beSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
11640eb1301bSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
1165dc9477beSmrg  fi
1166dc9477beSmrg  ])
1167dc9477beSmrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
1168dc9477beSmrgfi
1169dc9477beSmrg])# _LT_SYS_MODULE_PATH_AIX
1170c43cc173Smrg
1171b789ec8aSmrg
1172dc9477beSmrg# _LT_SHELL_INIT(ARG)
1173dc9477beSmrg# -------------------
1174dc9477beSmrgm4_define([_LT_SHELL_INIT],
1175dc9477beSmrg[m4_divert_text([M4SH-INIT], [$1
1176dc9477beSmrg])])# _LT_SHELL_INIT
1177b789ec8aSmrg
1178b789ec8aSmrg
1179c43cc173Smrg
1180dc9477beSmrg# _LT_PROG_ECHO_BACKSLASH
118106c34b88Smrg# -----------------------
1182dc9477beSmrg# Find how we can fake an echo command that does not interpret backslash.
1183dc9477beSmrg# In particular, with Autoconf 2.60 or later we add some code to the start
11840eb1301bSmrg# of the generated configure script which will find a shell with a builtin
11850eb1301bSmrg# printf (which we can use as an echo command).
1186dc9477beSmrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
1187dc9477beSmrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1188dc9477beSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1189dc9477beSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1190c43cc173Smrg
1191dc9477beSmrgAC_MSG_CHECKING([how to print strings])
1192dc9477beSmrg# Test print first, because it will be a builtin if present.
1193dc9477beSmrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
1194dc9477beSmrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
1195dc9477beSmrg  ECHO='print -r --'
1196dc9477beSmrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
1197dc9477beSmrg  ECHO='printf %s\n'
1198dc9477beSmrgelse
1199dc9477beSmrg  # Use this function as a fallback that always works.
1200dc9477beSmrg  func_fallback_echo ()
1201dc9477beSmrg  {
1202dc9477beSmrg    eval 'cat <<_LTECHO_EOF
1203dc9477beSmrg$[]1
1204dc9477beSmrg_LTECHO_EOF'
1205dc9477beSmrg  }
1206dc9477beSmrg  ECHO='func_fallback_echo'
1207dc9477beSmrgfi
1208c43cc173Smrg
1209dc9477beSmrg# func_echo_all arg...
1210dc9477beSmrg# Invoke $ECHO with all args, space-separated.
1211dc9477beSmrgfunc_echo_all ()
1212dc9477beSmrg{
12130eb1301bSmrg    $ECHO "$*" 
1214dc9477beSmrg}
1215c27c18e8Smrg
12160eb1301bSmrgcase "$ECHO" in
1217dc9477beSmrg  printf*) AC_MSG_RESULT([printf]) ;;
1218dc9477beSmrg  print*) AC_MSG_RESULT([print -r]) ;;
1219dc9477beSmrg  *) AC_MSG_RESULT([cat]) ;;
1220dc9477beSmrgesac
1221c27c18e8Smrg
1222dc9477beSmrgm4_ifdef([_AS_DETECT_SUGGESTED],
1223dc9477beSmrg[_AS_DETECT_SUGGESTED([
1224dc9477beSmrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
1225dc9477beSmrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1226dc9477beSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1227dc9477beSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1228dc9477beSmrg    PATH=/empty FPATH=/empty; export PATH FPATH
1229dc9477beSmrg    test "X`printf %s $ECHO`" = "X$ECHO" \
1230dc9477beSmrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
1231b789ec8aSmrg
1232dc9477beSmrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1233dc9477beSmrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
1234dc9477beSmrg])# _LT_PROG_ECHO_BACKSLASH
1235b789ec8aSmrg
1236b789ec8aSmrg
1237dc9477beSmrg# _LT_WITH_SYSROOT
1238dc9477beSmrg# ----------------
1239dc9477beSmrgAC_DEFUN([_LT_WITH_SYSROOT],
1240dc9477beSmrg[AC_MSG_CHECKING([for sysroot])
1241dc9477beSmrgAC_ARG_WITH([sysroot],
12420eb1301bSmrg[  --with-sysroot[=DIR] Search for dependent libraries within DIR
12430eb1301bSmrg                        (or the compiler's sysroot if not specified).],
1244dc9477beSmrg[], [with_sysroot=no])
1245b789ec8aSmrg
1246dc9477beSmrgdnl lt_sysroot will always be passed unquoted.  We quote it here
1247dc9477beSmrgdnl in case the user passed a directory name.
1248dc9477beSmrglt_sysroot=
12490eb1301bSmrgcase ${with_sysroot} in #(
1250dc9477beSmrg yes)
12510eb1301bSmrg   if test "$GCC" = yes; then
1252dc9477beSmrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
1253dc9477beSmrg   fi
1254dc9477beSmrg   ;; #(
1255dc9477beSmrg /*)
1256dc9477beSmrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
1257dc9477beSmrg   ;; #(
1258dc9477beSmrg no|'')
1259dc9477beSmrg   ;; #(
1260dc9477beSmrg *)
12610eb1301bSmrg   AC_MSG_RESULT([${with_sysroot}])
1262dc9477beSmrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
1263dc9477beSmrg   ;;
1264dc9477beSmrgesac
1265c27c18e8Smrg
1266dc9477beSmrg AC_MSG_RESULT([${lt_sysroot:-no}])
1267dc9477beSmrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
12680eb1301bSmrg[dependent libraries, and in which our libraries should be installed.])])
1269c27c18e8Smrg
1270dc9477beSmrg# _LT_ENABLE_LOCK
1271dc9477beSmrg# ---------------
1272dc9477beSmrgm4_defun([_LT_ENABLE_LOCK],
1273dc9477beSmrg[AC_ARG_ENABLE([libtool-lock],
1274dc9477beSmrg  [AS_HELP_STRING([--disable-libtool-lock],
1275dc9477beSmrg    [avoid locking (might break parallel builds)])])
12760eb1301bSmrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1277c27c18e8Smrg
1278dc9477beSmrg# Some flags need to be propagated to the compiler or linker for good
1279dc9477beSmrg# libtool support.
1280dc9477beSmrgcase $host in
1281dc9477beSmrgia64-*-hpux*)
12820eb1301bSmrg  # Find out which ABI we are using.
1283dc9477beSmrg  echo 'int i;' > conftest.$ac_ext
1284dc9477beSmrg  if AC_TRY_EVAL(ac_compile); then
1285dc9477beSmrg    case `/usr/bin/file conftest.$ac_objext` in
1286dc9477beSmrg      *ELF-32*)
12870eb1301bSmrg	HPUX_IA64_MODE="32"
1288dc9477beSmrg	;;
1289dc9477beSmrg      *ELF-64*)
12900eb1301bSmrg	HPUX_IA64_MODE="64"
1291dc9477beSmrg	;;
129206c34b88Smrg    esac
1293dc9477beSmrg  fi
1294dc9477beSmrg  rm -rf conftest*
1295dc9477beSmrg  ;;
1296dc9477beSmrg*-*-irix6*)
12970eb1301bSmrg  # Find out which ABI we are using.
1298dc9477beSmrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1299dc9477beSmrg  if AC_TRY_EVAL(ac_compile); then
13000eb1301bSmrg    if test "$lt_cv_prog_gnu_ld" = yes; then
1301dc9477beSmrg      case `/usr/bin/file conftest.$ac_objext` in
1302dc9477beSmrg	*32-bit*)
1303dc9477beSmrg	  LD="${LD-ld} -melf32bsmip"
1304dc9477beSmrg	  ;;
1305dc9477beSmrg	*N32*)
1306dc9477beSmrg	  LD="${LD-ld} -melf32bmipn32"
1307dc9477beSmrg	  ;;
1308dc9477beSmrg	*64-bit*)
1309dc9477beSmrg	  LD="${LD-ld} -melf64bmip"
1310dc9477beSmrg	;;
1311dc9477beSmrg      esac
1312dc9477beSmrg    else
1313dc9477beSmrg      case `/usr/bin/file conftest.$ac_objext` in
1314dc9477beSmrg	*32-bit*)
1315dc9477beSmrg	  LD="${LD-ld} -32"
1316dc9477beSmrg	  ;;
1317dc9477beSmrg	*N32*)
1318dc9477beSmrg	  LD="${LD-ld} -n32"
1319dc9477beSmrg	  ;;
1320dc9477beSmrg	*64-bit*)
1321dc9477beSmrg	  LD="${LD-ld} -64"
1322dc9477beSmrg	  ;;
1323dc9477beSmrg      esac
1324dc9477beSmrg    fi
1325dc9477beSmrg  fi
1326dc9477beSmrg  rm -rf conftest*
1327dc9477beSmrg  ;;
1328c43cc173Smrg
1329dc9477beSmrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
1330dc9477beSmrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
13310eb1301bSmrg  # Find out which ABI we are using.
1332dc9477beSmrg  echo 'int i;' > conftest.$ac_ext
1333dc9477beSmrg  if AC_TRY_EVAL(ac_compile); then
1334dc9477beSmrg    case `/usr/bin/file conftest.o` in
1335dc9477beSmrg      *32-bit*)
1336dc9477beSmrg	case $host in
1337dc9477beSmrg	  x86_64-*kfreebsd*-gnu)
1338dc9477beSmrg	    LD="${LD-ld} -m elf_i386_fbsd"
1339dc9477beSmrg	    ;;
1340dc9477beSmrg	  x86_64-*linux*)
134144584a44Smrg	    case `/usr/bin/file conftest.o` in
134244584a44Smrg	      *x86-64*)
134344584a44Smrg		LD="${LD-ld} -m elf32_x86_64"
134444584a44Smrg		;;
134544584a44Smrg	      *)
134644584a44Smrg		LD="${LD-ld} -m elf_i386"
134744584a44Smrg		;;
134844584a44Smrg	    esac
1349dc9477beSmrg	    ;;
13500eb1301bSmrg	  powerpc64le-*)
1351dc9477beSmrg	    LD="${LD-ld} -m elf32lppclinux"
1352dc9477beSmrg	    ;;
13530eb1301bSmrg	  powerpc64-*)
1354dc9477beSmrg	    LD="${LD-ld} -m elf32ppclinux"
1355dc9477beSmrg	    ;;
1356dc9477beSmrg	  s390x-*linux*)
1357dc9477beSmrg	    LD="${LD-ld} -m elf_s390"
1358dc9477beSmrg	    ;;
1359dc9477beSmrg	  sparc64-*linux*)
1360dc9477beSmrg	    LD="${LD-ld} -m elf32_sparc"
1361dc9477beSmrg	    ;;
1362dc9477beSmrg	esac
1363dc9477beSmrg	;;
1364dc9477beSmrg      *64-bit*)
1365dc9477beSmrg	case $host in
1366dc9477beSmrg	  x86_64-*kfreebsd*-gnu)
1367dc9477beSmrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
1368dc9477beSmrg	    ;;
1369dc9477beSmrg	  x86_64-*linux*)
1370dc9477beSmrg	    LD="${LD-ld} -m elf_x86_64"
1371dc9477beSmrg	    ;;
13720eb1301bSmrg	  powerpcle-*)
1373dc9477beSmrg	    LD="${LD-ld} -m elf64lppc"
1374dc9477beSmrg	    ;;
13750eb1301bSmrg	  powerpc-*)
1376dc9477beSmrg	    LD="${LD-ld} -m elf64ppc"
1377dc9477beSmrg	    ;;
1378dc9477beSmrg	  s390*-*linux*|s390*-*tpf*)
1379dc9477beSmrg	    LD="${LD-ld} -m elf64_s390"
1380dc9477beSmrg	    ;;
1381dc9477beSmrg	  sparc*-*linux*)
1382dc9477beSmrg	    LD="${LD-ld} -m elf64_sparc"
1383dc9477beSmrg	    ;;
1384dc9477beSmrg	esac
1385dc9477beSmrg	;;
138606c34b88Smrg    esac
1387dc9477beSmrg  fi
1388dc9477beSmrg  rm -rf conftest*
1389dc9477beSmrg  ;;
1390c43cc173Smrg
1391dc9477beSmrg*-*-sco3.2v5*)
1392dc9477beSmrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
13930eb1301bSmrg  SAVE_CFLAGS="$CFLAGS"
1394dc9477beSmrg  CFLAGS="$CFLAGS -belf"
1395dc9477beSmrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1396dc9477beSmrg    [AC_LANG_PUSH(C)
1397dc9477beSmrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1398dc9477beSmrg     AC_LANG_POP])
13990eb1301bSmrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1400dc9477beSmrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
14010eb1301bSmrg    CFLAGS="$SAVE_CFLAGS"
1402dc9477beSmrg  fi
1403dc9477beSmrg  ;;
1404dc9477beSmrg*-*solaris*)
14050eb1301bSmrg  # Find out which ABI we are using.
1406dc9477beSmrg  echo 'int i;' > conftest.$ac_ext
1407dc9477beSmrg  if AC_TRY_EVAL(ac_compile); then
1408dc9477beSmrg    case `/usr/bin/file conftest.o` in
1409dc9477beSmrg    *64-bit*)
1410dc9477beSmrg      case $lt_cv_prog_gnu_ld in
1411dc9477beSmrg      yes*)
1412dc9477beSmrg        case $host in
14130eb1301bSmrg        i?86-*-solaris*)
1414dc9477beSmrg          LD="${LD-ld} -m elf_x86_64"
1415dc9477beSmrg          ;;
1416dc9477beSmrg        sparc*-*-solaris*)
1417dc9477beSmrg          LD="${LD-ld} -m elf64_sparc"
1418dc9477beSmrg          ;;
1419dc9477beSmrg        esac
1420dc9477beSmrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
1421dc9477beSmrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
14220eb1301bSmrg          LD="${LD-ld}_sol2"
1423dc9477beSmrg        fi
1424dc9477beSmrg        ;;
1425dc9477beSmrg      *)
1426dc9477beSmrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1427dc9477beSmrg	  LD="${LD-ld} -64"
1428dc9477beSmrg	fi
1429dc9477beSmrg	;;
1430dc9477beSmrg      esac
1431dc9477beSmrg      ;;
1432dc9477beSmrg    esac
1433dc9477beSmrg  fi
1434dc9477beSmrg  rm -rf conftest*
1435dc9477beSmrg  ;;
1436dc9477beSmrgesac
1437c43cc173Smrg
14380eb1301bSmrgneed_locks="$enable_libtool_lock"
1439dc9477beSmrg])# _LT_ENABLE_LOCK
1440c43cc173Smrg
1441c27c18e8Smrg
1442dc9477beSmrg# _LT_PROG_AR
1443dc9477beSmrg# -----------
1444dc9477beSmrgm4_defun([_LT_PROG_AR],
1445dc9477beSmrg[AC_CHECK_TOOLS(AR, [ar], false)
1446dc9477beSmrg: ${AR=ar}
1447dc9477beSmrg: ${AR_FLAGS=cru}
1448dc9477beSmrg_LT_DECL([], [AR], [1], [The archiver])
1449dc9477beSmrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
1450c43cc173Smrg
1451dc9477beSmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
1452dc9477beSmrg  [lt_cv_ar_at_file=no
1453dc9477beSmrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
1454dc9477beSmrg     [echo conftest.$ac_objext > conftest.lst
1455dc9477beSmrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
1456dc9477beSmrg      AC_TRY_EVAL([lt_ar_try])
14570eb1301bSmrg      if test "$ac_status" -eq 0; then
1458dc9477beSmrg	# Ensure the archiver fails upon bogus file names.
1459dc9477beSmrg	rm -f conftest.$ac_objext libconftest.a
1460dc9477beSmrg	AC_TRY_EVAL([lt_ar_try])
14610eb1301bSmrg	if test "$ac_status" -ne 0; then
1462dc9477beSmrg          lt_cv_ar_at_file=@
1463dc9477beSmrg        fi
1464dc9477beSmrg      fi
1465dc9477beSmrg      rm -f conftest.* libconftest.a
1466dc9477beSmrg     ])
1467dc9477beSmrg  ])
1468c43cc173Smrg
14690eb1301bSmrgif test "x$lt_cv_ar_at_file" = xno; then
1470dc9477beSmrg  archiver_list_spec=
1471dc9477beSmrgelse
1472dc9477beSmrg  archiver_list_spec=$lt_cv_ar_at_file
1473dc9477beSmrgfi
1474dc9477beSmrg_LT_DECL([], [archiver_list_spec], [1],
1475dc9477beSmrg  [How to feed a file listing to the archiver])
1476dc9477beSmrg])# _LT_PROG_AR
1477c43cc173Smrg
1478c27c18e8Smrg
1479dc9477beSmrg# _LT_CMD_OLD_ARCHIVE
1480dc9477beSmrg# -------------------
1481dc9477beSmrgm4_defun([_LT_CMD_OLD_ARCHIVE],
1482dc9477beSmrg[_LT_PROG_AR
1483c43cc173Smrg
1484dc9477beSmrgAC_CHECK_TOOL(STRIP, strip, :)
1485dc9477beSmrgtest -z "$STRIP" && STRIP=:
1486dc9477beSmrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1487c43cc173Smrg
1488dc9477beSmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
1489dc9477beSmrgtest -z "$RANLIB" && RANLIB=:
1490dc9477beSmrg_LT_DECL([], [RANLIB], [1],
1491dc9477beSmrg    [Commands used to install an old-style archive])
1492c43cc173Smrg
1493dc9477beSmrg# Determine commands to create old-style static archives.
1494dc9477beSmrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1495dc9477beSmrgold_postinstall_cmds='chmod 644 $oldlib'
1496dc9477beSmrgold_postuninstall_cmds=
1497c43cc173Smrg
1498dc9477beSmrgif test -n "$RANLIB"; then
1499dc9477beSmrg  case $host_os in
15000eb1301bSmrg  openbsd*)
1501dc9477beSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
1502dc9477beSmrg    ;;
1503dc9477beSmrg  *)
1504dc9477beSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
1505dc9477beSmrg    ;;
150606c34b88Smrg  esac
1507dc9477beSmrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
150806c34b88Smrgfi
1509c43cc173Smrg
1510dc9477beSmrgcase $host_os in
1511dc9477beSmrg  darwin*)
1512dc9477beSmrg    lock_old_archive_extraction=yes ;;
1513dc9477beSmrg  *)
1514dc9477beSmrg    lock_old_archive_extraction=no ;;
1515dc9477beSmrgesac
1516dc9477beSmrg_LT_DECL([], [old_postinstall_cmds], [2])
1517dc9477beSmrg_LT_DECL([], [old_postuninstall_cmds], [2])
1518dc9477beSmrg_LT_TAGDECL([], [old_archive_cmds], [2],
1519dc9477beSmrg    [Commands used to build an old-style archive])
1520dc9477beSmrg_LT_DECL([], [lock_old_archive_extraction], [0],
1521dc9477beSmrg    [Whether to use a lock for old archive extraction])
1522dc9477beSmrg])# _LT_CMD_OLD_ARCHIVE
1523f1ee322dSmrg
152406c34b88Smrg
1525dc9477beSmrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1526dc9477beSmrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1527dc9477beSmrg# ----------------------------------------------------------------
1528dc9477beSmrg# Check whether the given compiler option works
1529dc9477beSmrgAC_DEFUN([_LT_COMPILER_OPTION],
153006c34b88Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1531dc9477beSmrgm4_require([_LT_DECL_SED])dnl
1532dc9477beSmrgAC_CACHE_CHECK([$1], [$2],
1533dc9477beSmrg  [$2=no
1534dc9477beSmrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1535dc9477beSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
15360eb1301bSmrg   lt_compiler_flag="$3"
1537dc9477beSmrg   # Insert the option either (1) after the last *FLAGS variable, or
1538dc9477beSmrg   # (2) before a word containing "conftest.", or (3) at the end.
1539dc9477beSmrg   # Note that $ac_compile itself does not contain backslashes and begins
1540dc9477beSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
1541dc9477beSmrg   # The option is referenced via a variable to avoid confusing sed.
1542dc9477beSmrg   lt_compile=`echo "$ac_compile" | $SED \
1543dc9477beSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1544dc9477beSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1545dc9477beSmrg   -e 's:$: $lt_compiler_flag:'`
1546dc9477beSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1547dc9477beSmrg   (eval "$lt_compile" 2>conftest.err)
1548dc9477beSmrg   ac_status=$?
1549dc9477beSmrg   cat conftest.err >&AS_MESSAGE_LOG_FD
1550dc9477beSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1551dc9477beSmrg   if (exit $ac_status) && test -s "$ac_outfile"; then
1552dc9477beSmrg     # The compiler can only warn and ignore the option if not recognized
1553dc9477beSmrg     # So say no if there are warnings other than the usual output.
1554dc9477beSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
1555dc9477beSmrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1556dc9477beSmrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1557dc9477beSmrg       $2=yes
1558dc9477beSmrg     fi
1559dc9477beSmrg   fi
1560dc9477beSmrg   $RM conftest*
1561dc9477beSmrg])
1562c43cc173Smrg
15630eb1301bSmrgif test x"[$]$2" = xyes; then
1564dc9477beSmrg    m4_if([$5], , :, [$5])
1565dc9477beSmrgelse
1566dc9477beSmrg    m4_if([$6], , :, [$6])
156706c34b88Smrgfi
1568dc9477beSmrg])# _LT_COMPILER_OPTION
1569c43cc173Smrg
1570dc9477beSmrg# Old name:
1571dc9477beSmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1572dc9477beSmrgdnl aclocal-1.4 backwards compatibility:
1573dc9477beSmrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1574c43cc173Smrg
157521e67964Smrg
1576dc9477beSmrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1577dc9477beSmrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
1578dc9477beSmrg# ----------------------------------------------------
1579dc9477beSmrg# Check whether the given linker option works
1580dc9477beSmrgAC_DEFUN([_LT_LINKER_OPTION],
1581dc9477beSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1582dc9477beSmrgm4_require([_LT_DECL_SED])dnl
1583dc9477beSmrgAC_CACHE_CHECK([$1], [$2],
1584dc9477beSmrg  [$2=no
15850eb1301bSmrg   save_LDFLAGS="$LDFLAGS"
1586dc9477beSmrg   LDFLAGS="$LDFLAGS $3"
1587dc9477beSmrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
1588dc9477beSmrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1589dc9477beSmrg     # The linker can only warn and ignore the option if not recognized
1590dc9477beSmrg     # So say no if there are warnings
1591dc9477beSmrg     if test -s conftest.err; then
1592dc9477beSmrg       # Append any errors to the config.log.
1593dc9477beSmrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
1594dc9477beSmrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
1595dc9477beSmrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1596dc9477beSmrg       if diff conftest.exp conftest.er2 >/dev/null; then
1597dc9477beSmrg         $2=yes
1598dc9477beSmrg       fi
1599dc9477beSmrg     else
1600dc9477beSmrg       $2=yes
1601dc9477beSmrg     fi
1602dc9477beSmrg   fi
1603dc9477beSmrg   $RM -r conftest*
16040eb1301bSmrg   LDFLAGS="$save_LDFLAGS"
1605dc9477beSmrg])
160637eb1ca1Smrg
16070eb1301bSmrgif test x"[$]$2" = xyes; then
1608dc9477beSmrg    m4_if([$4], , :, [$4])
1609dc9477beSmrgelse
1610dc9477beSmrg    m4_if([$5], , :, [$5])
1611dc9477beSmrgfi
1612dc9477beSmrg])# _LT_LINKER_OPTION
161321e67964Smrg
1614dc9477beSmrg# Old name:
1615dc9477beSmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1616dc9477beSmrgdnl aclocal-1.4 backwards compatibility:
1617dc9477beSmrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
161821e67964Smrg
1619c43cc173Smrg
1620dc9477beSmrg# LT_CMD_MAX_LEN
1621dc9477beSmrg#---------------
1622dc9477beSmrgAC_DEFUN([LT_CMD_MAX_LEN],
1623dc9477beSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1624dc9477beSmrg# find the maximum length of command line arguments
1625dc9477beSmrgAC_MSG_CHECKING([the maximum length of command line arguments])
1626dc9477beSmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1627dc9477beSmrg  i=0
16280eb1301bSmrg  teststring="ABCD"
1629c43cc173Smrg
1630dc9477beSmrg  case $build_os in
1631dc9477beSmrg  msdosdjgpp*)
1632dc9477beSmrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
1633dc9477beSmrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
1634dc9477beSmrg    # during glob expansion).  Even if it were fixed, the result of this
1635dc9477beSmrg    # check would be larger than it should be.
1636dc9477beSmrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
1637dc9477beSmrg    ;;
1638c43cc173Smrg
1639dc9477beSmrg  gnu*)
1640dc9477beSmrg    # Under GNU Hurd, this test is not required because there is
1641dc9477beSmrg    # no limit to the length of command line arguments.
1642dc9477beSmrg    # Libtool will interpret -1 as no limit whatsoever
1643dc9477beSmrg    lt_cv_sys_max_cmd_len=-1;
1644dc9477beSmrg    ;;
1645c43cc173Smrg
1646dc9477beSmrg  cygwin* | mingw* | cegcc*)
1647dc9477beSmrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
1648dc9477beSmrg    # about 5 minutes as the teststring grows exponentially.
1649dc9477beSmrg    # Worse, since 9x/ME are not pre-emptively multitasking,
1650dc9477beSmrg    # you end up with a "frozen" computer, even though with patience
1651dc9477beSmrg    # the test eventually succeeds (with a max line length of 256k).
1652dc9477beSmrg    # Instead, let's just punt: use the minimum linelength reported by
1653dc9477beSmrg    # all of the supported platforms: 8192 (on NT/2K/XP).
1654dc9477beSmrg    lt_cv_sys_max_cmd_len=8192;
1655dc9477beSmrg    ;;
1656c43cc173Smrg
1657dc9477beSmrg  mint*)
1658dc9477beSmrg    # On MiNT this can take a long time and run out of memory.
1659dc9477beSmrg    lt_cv_sys_max_cmd_len=8192;
1660dc9477beSmrg    ;;
1661c43cc173Smrg
1662dc9477beSmrg  amigaos*)
1663dc9477beSmrg    # On AmigaOS with pdksh, this test takes hours, literally.
1664dc9477beSmrg    # So we just punt and use a minimum line length of 8192.
1665dc9477beSmrg    lt_cv_sys_max_cmd_len=8192;
1666dc9477beSmrg    ;;
166721e67964Smrg
16680eb1301bSmrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
1669dc9477beSmrg    # This has been around since 386BSD, at least.  Likely further.
1670dc9477beSmrg    if test -x /sbin/sysctl; then
1671dc9477beSmrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1672dc9477beSmrg    elif test -x /usr/sbin/sysctl; then
1673dc9477beSmrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1674dc9477beSmrg    else
1675dc9477beSmrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
1676dc9477beSmrg    fi
1677dc9477beSmrg    # And add a safety zone
1678dc9477beSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1679dc9477beSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1680dc9477beSmrg    ;;
1681c43cc173Smrg
1682dc9477beSmrg  interix*)
1683dc9477beSmrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
1684dc9477beSmrg    lt_cv_sys_max_cmd_len=196608
1685dc9477beSmrg    ;;
1686c43cc173Smrg
1687dc9477beSmrg  os2*)
1688dc9477beSmrg    # The test takes a long time on OS/2.
1689dc9477beSmrg    lt_cv_sys_max_cmd_len=8192
1690dc9477beSmrg    ;;
1691c43cc173Smrg
1692dc9477beSmrg  osf*)
1693dc9477beSmrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1694dc9477beSmrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1695dc9477beSmrg    # nice to cause kernel panics so lets avoid the loop below.
1696dc9477beSmrg    # First set a reasonable default.
1697dc9477beSmrg    lt_cv_sys_max_cmd_len=16384
1698dc9477beSmrg    #
1699dc9477beSmrg    if test -x /sbin/sysconfig; then
1700dc9477beSmrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1701dc9477beSmrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
1702dc9477beSmrg      esac
1703dc9477beSmrg    fi
1704dc9477beSmrg    ;;
1705dc9477beSmrg  sco3.2v5*)
1706dc9477beSmrg    lt_cv_sys_max_cmd_len=102400
1707dc9477beSmrg    ;;
1708dc9477beSmrg  sysv5* | sco5v6* | sysv4.2uw2*)
1709dc9477beSmrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1710dc9477beSmrg    if test -n "$kargmax"; then
1711dc9477beSmrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
1712dc9477beSmrg    else
1713dc9477beSmrg      lt_cv_sys_max_cmd_len=32768
1714dc9477beSmrg    fi
1715dc9477beSmrg    ;;
1716dc9477beSmrg  *)
1717dc9477beSmrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
171844584a44Smrg    if test -n "$lt_cv_sys_max_cmd_len" && \
17190eb1301bSmrg	test undefined != "$lt_cv_sys_max_cmd_len"; then
1720dc9477beSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1721dc9477beSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1722dc9477beSmrg    else
1723dc9477beSmrg      # Make teststring a little bigger before we do anything with it.
1724dc9477beSmrg      # a 1K string should be a reasonable start.
17250eb1301bSmrg      for i in 1 2 3 4 5 6 7 8 ; do
1726dc9477beSmrg        teststring=$teststring$teststring
1727dc9477beSmrg      done
1728dc9477beSmrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1729dc9477beSmrg      # If test is not a shell built-in, we'll probably end up computing a
1730dc9477beSmrg      # maximum length that is only half of the actual maximum length, but
1731dc9477beSmrg      # we can't tell.
17320eb1301bSmrg      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
1733dc9477beSmrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
17340eb1301bSmrg	      test $i != 17 # 1/2 MB should be enough
1735dc9477beSmrg      do
1736dc9477beSmrg        i=`expr $i + 1`
1737dc9477beSmrg        teststring=$teststring$teststring
1738dc9477beSmrg      done
1739dc9477beSmrg      # Only check the string length outside the loop.
1740dc9477beSmrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1741dc9477beSmrg      teststring=
1742dc9477beSmrg      # Add a significant safety factor because C++ compilers can tack on
1743dc9477beSmrg      # massive amounts of additional arguments before passing them to the
1744dc9477beSmrg      # linker.  It appears as though 1/2 is a usable value.
1745dc9477beSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1746dc9477beSmrg    fi
1747dc9477beSmrg    ;;
1748dc9477beSmrg  esac
1749dc9477beSmrg])
17500eb1301bSmrgif test -n $lt_cv_sys_max_cmd_len ; then
1751dc9477beSmrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1752dc9477beSmrgelse
1753dc9477beSmrg  AC_MSG_RESULT(none)
1754dc9477beSmrgfi
1755dc9477beSmrgmax_cmd_len=$lt_cv_sys_max_cmd_len
1756dc9477beSmrg_LT_DECL([], [max_cmd_len], [0],
1757dc9477beSmrg    [What is the maximum length of a command?])
1758dc9477beSmrg])# LT_CMD_MAX_LEN
1759c43cc173Smrg
1760dc9477beSmrg# Old name:
1761dc9477beSmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1762dc9477beSmrgdnl aclocal-1.4 backwards compatibility:
1763dc9477beSmrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1764c43cc173Smrg
1765c43cc173Smrg
1766dc9477beSmrg# _LT_HEADER_DLFCN
1767dc9477beSmrg# ----------------
1768dc9477beSmrgm4_defun([_LT_HEADER_DLFCN],
1769dc9477beSmrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1770dc9477beSmrg])# _LT_HEADER_DLFCN
1771c43cc173Smrg
1772c43cc173Smrg
1773dc9477beSmrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1774dc9477beSmrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1775dc9477beSmrg# ----------------------------------------------------------------
1776dc9477beSmrgm4_defun([_LT_TRY_DLOPEN_SELF],
1777dc9477beSmrg[m4_require([_LT_HEADER_DLFCN])dnl
17780eb1301bSmrgif test "$cross_compiling" = yes; then :
1779dc9477beSmrg  [$4]
1780dc9477beSmrgelse
1781dc9477beSmrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1782dc9477beSmrg  lt_status=$lt_dlunknown
1783dc9477beSmrg  cat > conftest.$ac_ext <<_LT_EOF
1784dc9477beSmrg[#line $LINENO "configure"
1785dc9477beSmrg#include "confdefs.h"
1786c43cc173Smrg
1787dc9477beSmrg#if HAVE_DLFCN_H
1788dc9477beSmrg#include <dlfcn.h>
1789dc9477beSmrg#endif
1790c27c18e8Smrg
1791dc9477beSmrg#include <stdio.h>
1792c43cc173Smrg
1793dc9477beSmrg#ifdef RTLD_GLOBAL
1794dc9477beSmrg#  define LT_DLGLOBAL		RTLD_GLOBAL
1795dc9477beSmrg#else
1796dc9477beSmrg#  ifdef DL_GLOBAL
1797dc9477beSmrg#    define LT_DLGLOBAL		DL_GLOBAL
1798dc9477beSmrg#  else
1799dc9477beSmrg#    define LT_DLGLOBAL		0
1800dc9477beSmrg#  endif
1801dc9477beSmrg#endif
1802c43cc173Smrg
1803dc9477beSmrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1804dc9477beSmrg   find out it does not work in some platform. */
1805dc9477beSmrg#ifndef LT_DLLAZY_OR_NOW
1806dc9477beSmrg#  ifdef RTLD_LAZY
1807dc9477beSmrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
1808dc9477beSmrg#  else
1809dc9477beSmrg#    ifdef DL_LAZY
1810dc9477beSmrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
1811dc9477beSmrg#    else
1812dc9477beSmrg#      ifdef RTLD_NOW
1813dc9477beSmrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
1814dc9477beSmrg#      else
1815dc9477beSmrg#        ifdef DL_NOW
1816dc9477beSmrg#          define LT_DLLAZY_OR_NOW	DL_NOW
1817dc9477beSmrg#        else
1818dc9477beSmrg#          define LT_DLLAZY_OR_NOW	0
1819dc9477beSmrg#        endif
1820dc9477beSmrg#      endif
1821dc9477beSmrg#    endif
1822dc9477beSmrg#  endif
1823dc9477beSmrg#endif
1824c43cc173Smrg
18250eb1301bSmrg/* When -fvisbility=hidden is used, assume the code has been annotated
1826dc9477beSmrg   correspondingly for the symbols needed.  */
18270eb1301bSmrg#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1828dc9477beSmrgint fnord () __attribute__((visibility("default")));
1829dc9477beSmrg#endif
1830c43cc173Smrg
1831dc9477beSmrgint fnord () { return 42; }
1832dc9477beSmrgint main ()
1833dc9477beSmrg{
1834dc9477beSmrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1835dc9477beSmrg  int status = $lt_dlunknown;
1836c43cc173Smrg
1837dc9477beSmrg  if (self)
1838dc9477beSmrg    {
1839dc9477beSmrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1840dc9477beSmrg      else
1841dc9477beSmrg        {
1842dc9477beSmrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
1843dc9477beSmrg          else puts (dlerror ());
1844dc9477beSmrg	}
1845dc9477beSmrg      /* dlclose (self); */
1846dc9477beSmrg    }
1847dc9477beSmrg  else
1848dc9477beSmrg    puts (dlerror ());
1849c43cc173Smrg
1850dc9477beSmrg  return status;
1851dc9477beSmrg}]
1852dc9477beSmrg_LT_EOF
18530eb1301bSmrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1854dc9477beSmrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1855dc9477beSmrg    lt_status=$?
1856dc9477beSmrg    case x$lt_status in
1857dc9477beSmrg      x$lt_dlno_uscore) $1 ;;
1858dc9477beSmrg      x$lt_dlneed_uscore) $2 ;;
1859dc9477beSmrg      x$lt_dlunknown|x*) $3 ;;
1860dc9477beSmrg    esac
1861dc9477beSmrg  else :
1862dc9477beSmrg    # compilation failed
1863dc9477beSmrg    $3
1864dc9477beSmrg  fi
1865dc9477beSmrgfi
1866dc9477beSmrgrm -fr conftest*
1867dc9477beSmrg])# _LT_TRY_DLOPEN_SELF
1868c43cc173Smrg
1869c43cc173Smrg
1870dc9477beSmrg# LT_SYS_DLOPEN_SELF
1871dc9477beSmrg# ------------------
1872dc9477beSmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
1873dc9477beSmrg[m4_require([_LT_HEADER_DLFCN])dnl
18740eb1301bSmrgif test "x$enable_dlopen" != xyes; then
1875dc9477beSmrg  enable_dlopen=unknown
1876dc9477beSmrg  enable_dlopen_self=unknown
1877dc9477beSmrg  enable_dlopen_self_static=unknown
1878dc9477beSmrgelse
1879dc9477beSmrg  lt_cv_dlopen=no
1880dc9477beSmrg  lt_cv_dlopen_libs=
1881c43cc173Smrg
1882c43cc173Smrg  case $host_os in
1883dc9477beSmrg  beos*)
18840eb1301bSmrg    lt_cv_dlopen="load_add_on"
1885dc9477beSmrg    lt_cv_dlopen_libs=
1886dc9477beSmrg    lt_cv_dlopen_self=yes
1887dc9477beSmrg    ;;
1888c43cc173Smrg
1889dc9477beSmrg  mingw* | pw32* | cegcc*)
18900eb1301bSmrg    lt_cv_dlopen="LoadLibrary"
1891dc9477beSmrg    lt_cv_dlopen_libs=
1892dc9477beSmrg    ;;
1893c43cc173Smrg
1894dc9477beSmrg  cygwin*)
18950eb1301bSmrg    lt_cv_dlopen="dlopen"
1896dc9477beSmrg    lt_cv_dlopen_libs=
1897dc9477beSmrg    ;;
189806c34b88Smrg
1899dc9477beSmrg  darwin*)
19000eb1301bSmrg  # if libdl is installed we need to link against it
1901dc9477beSmrg    AC_CHECK_LIB([dl], [dlopen],
19020eb1301bSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
19030eb1301bSmrg    lt_cv_dlopen="dyld"
1904dc9477beSmrg    lt_cv_dlopen_libs=
1905dc9477beSmrg    lt_cv_dlopen_self=yes
190606c34b88Smrg    ])
190737eb1ca1Smrg    ;;
1908dc9477beSmrg
1909dc9477beSmrg  *)
1910dc9477beSmrg    AC_CHECK_FUNC([shl_load],
19110eb1301bSmrg	  [lt_cv_dlopen="shl_load"],
1912dc9477beSmrg      [AC_CHECK_LIB([dld], [shl_load],
19130eb1301bSmrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
1914dc9477beSmrg	[AC_CHECK_FUNC([dlopen],
19150eb1301bSmrg	      [lt_cv_dlopen="dlopen"],
1916dc9477beSmrg	  [AC_CHECK_LIB([dl], [dlopen],
19170eb1301bSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1918dc9477beSmrg	    [AC_CHECK_LIB([svld], [dlopen],
19190eb1301bSmrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1920dc9477beSmrg	      [AC_CHECK_LIB([dld], [dld_link],
19210eb1301bSmrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
1922dc9477beSmrg	      ])
1923dc9477beSmrg	    ])
1924dc9477beSmrg	  ])
1925dc9477beSmrg	])
1926dc9477beSmrg      ])
1927c27c18e8Smrg    ;;
1928c27c18e8Smrg  esac
1929c43cc173Smrg
19300eb1301bSmrg  if test "x$lt_cv_dlopen" != xno; then
193144584a44Smrg    enable_dlopen=yes
19320eb1301bSmrg  else
19330eb1301bSmrg    enable_dlopen=no
193406c34b88Smrg  fi
1935b789ec8aSmrg
1936dc9477beSmrg  case $lt_cv_dlopen in
1937dc9477beSmrg  dlopen)
19380eb1301bSmrg    save_CPPFLAGS="$CPPFLAGS"
19390eb1301bSmrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1940b789ec8aSmrg
19410eb1301bSmrg    save_LDFLAGS="$LDFLAGS"
1942dc9477beSmrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1943b789ec8aSmrg
19440eb1301bSmrg    save_LIBS="$LIBS"
1945dc9477beSmrg    LIBS="$lt_cv_dlopen_libs $LIBS"
1946c43cc173Smrg
1947dc9477beSmrg    AC_CACHE_CHECK([whether a program can dlopen itself],
1948dc9477beSmrg	  lt_cv_dlopen_self, [dnl
1949dc9477beSmrg	  _LT_TRY_DLOPEN_SELF(
1950dc9477beSmrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1951dc9477beSmrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1952dc9477beSmrg    ])
1953c43cc173Smrg
19540eb1301bSmrg    if test "x$lt_cv_dlopen_self" = xyes; then
1955dc9477beSmrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
1956dc9477beSmrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1957dc9477beSmrg	  lt_cv_dlopen_self_static, [dnl
1958dc9477beSmrg	  _LT_TRY_DLOPEN_SELF(
1959dc9477beSmrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1960dc9477beSmrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
1961dc9477beSmrg      ])
1962dc9477beSmrg    fi
1963c43cc173Smrg
19640eb1301bSmrg    CPPFLAGS="$save_CPPFLAGS"
19650eb1301bSmrg    LDFLAGS="$save_LDFLAGS"
19660eb1301bSmrg    LIBS="$save_LIBS"
1967dc9477beSmrg    ;;
1968dc9477beSmrg  esac
1969c43cc173Smrg
1970dc9477beSmrg  case $lt_cv_dlopen_self in
1971dc9477beSmrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1972dc9477beSmrg  *) enable_dlopen_self=unknown ;;
1973dc9477beSmrg  esac
197421e67964Smrg
1975dc9477beSmrg  case $lt_cv_dlopen_self_static in
1976dc9477beSmrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1977dc9477beSmrg  *) enable_dlopen_self_static=unknown ;;
1978dc9477beSmrg  esac
1979dc9477beSmrgfi
1980dc9477beSmrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
1981dc9477beSmrg	 [Whether dlopen is supported])
1982dc9477beSmrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
1983dc9477beSmrg	 [Whether dlopen of programs is supported])
1984dc9477beSmrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
1985dc9477beSmrg	 [Whether dlopen of statically linked programs is supported])
1986dc9477beSmrg])# LT_SYS_DLOPEN_SELF
1987c43cc173Smrg
1988dc9477beSmrg# Old name:
1989dc9477beSmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
1990dc9477beSmrgdnl aclocal-1.4 backwards compatibility:
1991dc9477beSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1992c43cc173Smrg
199337eb1ca1Smrg
1994dc9477beSmrg# _LT_COMPILER_C_O([TAGNAME])
1995dc9477beSmrg# ---------------------------
1996dc9477beSmrg# Check to see if options -c and -o are simultaneously supported by compiler.
1997dc9477beSmrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
1998dc9477beSmrgm4_defun([_LT_COMPILER_C_O],
1999dc9477beSmrg[m4_require([_LT_DECL_SED])dnl
2000dc9477beSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2001dc9477beSmrgm4_require([_LT_TAG_COMPILER])dnl
2002dc9477beSmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
2003dc9477beSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
2004dc9477beSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
2005dc9477beSmrg   $RM -r conftest 2>/dev/null
2006dc9477beSmrg   mkdir conftest
2007dc9477beSmrg   cd conftest
2008dc9477beSmrg   mkdir out
2009dc9477beSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2010c27c18e8Smrg
2011dc9477beSmrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
2012dc9477beSmrg   # Insert the option either (1) after the last *FLAGS variable, or
2013dc9477beSmrg   # (2) before a word containing "conftest.", or (3) at the end.
2014dc9477beSmrg   # Note that $ac_compile itself does not contain backslashes and begins
2015dc9477beSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
2016dc9477beSmrg   lt_compile=`echo "$ac_compile" | $SED \
2017dc9477beSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2018dc9477beSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2019dc9477beSmrg   -e 's:$: $lt_compiler_flag:'`
2020dc9477beSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2021dc9477beSmrg   (eval "$lt_compile" 2>out/conftest.err)
2022dc9477beSmrg   ac_status=$?
2023dc9477beSmrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
2024dc9477beSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2025dc9477beSmrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
2026dc9477beSmrg   then
2027dc9477beSmrg     # The compiler can only warn and ignore the option if not recognized
2028dc9477beSmrg     # So say no if there are warnings
2029dc9477beSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
2030dc9477beSmrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
2031dc9477beSmrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
2032dc9477beSmrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
2033dc9477beSmrg     fi
203406c34b88Smrg   fi
2035dc9477beSmrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
2036dc9477beSmrg   $RM conftest*
2037dc9477beSmrg   # SGI C++ compiler will create directory out/ii_files/ for
2038dc9477beSmrg   # template instantiation
2039dc9477beSmrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
2040dc9477beSmrg   $RM out/* && rmdir out
2041dc9477beSmrg   cd ..
2042dc9477beSmrg   $RM -r conftest
2043dc9477beSmrg   $RM conftest*
2044dc9477beSmrg])
2045dc9477beSmrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
2046dc9477beSmrg	[Does compiler simultaneously support -c and -o options?])
2047dc9477beSmrg])# _LT_COMPILER_C_O
2048c27c18e8Smrg
2049c43cc173Smrg
2050dc9477beSmrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
2051dc9477beSmrg# ----------------------------------
2052dc9477beSmrg# Check to see if we can do hard links to lock some files if needed
2053dc9477beSmrgm4_defun([_LT_COMPILER_FILE_LOCKS],
2054dc9477beSmrg[m4_require([_LT_ENABLE_LOCK])dnl
2055dc9477beSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2056dc9477beSmrg_LT_COMPILER_C_O([$1])
205737eb1ca1Smrg
20580eb1301bSmrghard_links="nottested"
20590eb1301bSmrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
2060dc9477beSmrg  # do not overwrite the value of need_locks provided by the user
2061dc9477beSmrg  AC_MSG_CHECKING([if we can lock with hard links])
2062dc9477beSmrg  hard_links=yes
2063dc9477beSmrg  $RM conftest*
2064dc9477beSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2065dc9477beSmrg  touch conftest.a
2066dc9477beSmrg  ln conftest.a conftest.b 2>&5 || hard_links=no
2067dc9477beSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2068dc9477beSmrg  AC_MSG_RESULT([$hard_links])
20690eb1301bSmrg  if test "$hard_links" = no; then
20700eb1301bSmrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
2071dc9477beSmrg    need_locks=warn
2072c43cc173Smrg  fi
2073dc9477beSmrgelse
2074dc9477beSmrg  need_locks=no
2075dc9477beSmrgfi
2076dc9477beSmrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
2077dc9477beSmrg])# _LT_COMPILER_FILE_LOCKS
2078c43cc173Smrg
2079c43cc173Smrg
2080dc9477beSmrg# _LT_CHECK_OBJDIR
2081dc9477beSmrg# ----------------
2082dc9477beSmrgm4_defun([_LT_CHECK_OBJDIR],
2083dc9477beSmrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
2084dc9477beSmrg[rm -f .libs 2>/dev/null
2085dc9477beSmrgmkdir .libs 2>/dev/null
2086dc9477beSmrgif test -d .libs; then
2087dc9477beSmrg  lt_cv_objdir=.libs
208806c34b88Smrgelse
2089dc9477beSmrg  # MS-DOS does not allow filenames that begin with a dot.
2090dc9477beSmrg  lt_cv_objdir=_libs
209106c34b88Smrgfi
2092dc9477beSmrgrmdir .libs 2>/dev/null])
2093dc9477beSmrgobjdir=$lt_cv_objdir
2094dc9477beSmrg_LT_DECL([], [objdir], [0],
2095dc9477beSmrg         [The name of the directory that contains temporary libtool files])dnl
2096dc9477beSmrgm4_pattern_allow([LT_OBJDIR])dnl
20970eb1301bSmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
20980eb1301bSmrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
2099dc9477beSmrg])# _LT_CHECK_OBJDIR
2100c43cc173Smrg
2101c43cc173Smrg
2102dc9477beSmrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
2103dc9477beSmrg# --------------------------------------
2104dc9477beSmrg# Check hardcoding attributes.
2105dc9477beSmrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
2106dc9477beSmrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
2107dc9477beSmrg_LT_TAGVAR(hardcode_action, $1)=
2108dc9477beSmrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
2109dc9477beSmrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
21100eb1301bSmrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
2111c43cc173Smrg
2112dc9477beSmrg  # We can hardcode non-existent directories.
21130eb1301bSmrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
2114dc9477beSmrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
2115dc9477beSmrg     # have to relink, otherwise we might link with an installed library
2116dc9477beSmrg     # when we should be linking with a yet-to-be-installed one
21170eb1301bSmrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
21180eb1301bSmrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
2119dc9477beSmrg    # Linking always hardcodes the temporary library directory.
2120dc9477beSmrg    _LT_TAGVAR(hardcode_action, $1)=relink
2121dc9477beSmrg  else
2122dc9477beSmrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
2123dc9477beSmrg    _LT_TAGVAR(hardcode_action, $1)=immediate
2124dc9477beSmrg  fi
2125dc9477beSmrgelse
2126dc9477beSmrg  # We cannot hardcode anything, or else we can only hardcode existing
2127dc9477beSmrg  # directories.
2128dc9477beSmrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
2129dc9477beSmrgfi
2130dc9477beSmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2131c43cc173Smrg
21320eb1301bSmrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
21330eb1301bSmrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
2134dc9477beSmrg  # Fast installation is not supported
2135dc9477beSmrg  enable_fast_install=no
21360eb1301bSmrgelif test "$shlibpath_overrides_runpath" = yes ||
21370eb1301bSmrg     test "$enable_shared" = no; then
2138dc9477beSmrg  # Fast installation is not necessary
2139dc9477beSmrg  enable_fast_install=needless
2140dc9477beSmrgfi
2141dc9477beSmrg_LT_TAGDECL([], [hardcode_action], [0],
2142dc9477beSmrg    [How to hardcode a shared library path into an executable])
2143dc9477beSmrg])# _LT_LINKER_HARDCODE_LIBPATH
2144c27c18e8Smrg
2145c43cc173Smrg
2146dc9477beSmrg# _LT_CMD_STRIPLIB
2147dc9477beSmrg# ----------------
2148dc9477beSmrgm4_defun([_LT_CMD_STRIPLIB],
2149dc9477beSmrg[m4_require([_LT_DECL_EGREP])
2150dc9477beSmrgstriplib=
2151dc9477beSmrgold_striplib=
2152dc9477beSmrgAC_MSG_CHECKING([whether stripping libraries is possible])
2153dc9477beSmrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2154dc9477beSmrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2155dc9477beSmrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2156dc9477beSmrg  AC_MSG_RESULT([yes])
2157dc9477beSmrgelse
2158dc9477beSmrg# FIXME - insert some real tests, host_os isn't really good enough
215906c34b88Smrg  case $host_os in
2160dc9477beSmrg  darwin*)
21610eb1301bSmrg    if test -n "$STRIP" ; then
2162dc9477beSmrg      striplib="$STRIP -x"
2163dc9477beSmrg      old_striplib="$STRIP -S"
2164dc9477beSmrg      AC_MSG_RESULT([yes])
2165dc9477beSmrg    else
2166dc9477beSmrg      AC_MSG_RESULT([no])
2167dc9477beSmrg    fi
216806c34b88Smrg    ;;
216906c34b88Smrg  *)
2170dc9477beSmrg    AC_MSG_RESULT([no])
217106c34b88Smrg    ;;
217206c34b88Smrg  esac
217306c34b88Smrgfi
2174dc9477beSmrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2175dc9477beSmrg_LT_DECL([], [striplib], [1])
2176dc9477beSmrg])# _LT_CMD_STRIPLIB
2177c43cc173Smrg
2178c43cc173Smrg
2179dc9477beSmrg# _LT_SYS_DYNAMIC_LINKER([TAG])
2180dc9477beSmrg# -----------------------------
2181dc9477beSmrg# PORTME Fill in your ld.so characteristics
2182dc9477beSmrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
2183dc9477beSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2184dc9477beSmrgm4_require([_LT_DECL_EGREP])dnl
2185dc9477beSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2186dc9477beSmrgm4_require([_LT_DECL_OBJDUMP])dnl
218706c34b88Smrgm4_require([_LT_DECL_SED])dnl
2188dc9477beSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
2189dc9477beSmrgAC_MSG_CHECKING([dynamic linker characteristics])
2190dc9477beSmrgm4_if([$1],
2191dc9477beSmrg	[], [
21920eb1301bSmrgif test "$GCC" = yes; then
2193dc9477beSmrg  case $host_os in
21940eb1301bSmrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
21950eb1301bSmrg    *) lt_awk_arg="/^libraries:/" ;;
2196dc9477beSmrg  esac
2197dc9477beSmrg  case $host_os in
21980eb1301bSmrg    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
21990eb1301bSmrg    *) lt_sed_strip_eq="s,=/,/,g" ;;
2200dc9477beSmrg  esac
2201dc9477beSmrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
2202dc9477beSmrg  case $lt_search_path_spec in
2203dc9477beSmrg  *\;*)
2204dc9477beSmrg    # if the path contains ";" then we assume it to be the separator
2205dc9477beSmrg    # otherwise default to the standard path separator (i.e. ":") - it is
2206dc9477beSmrg    # assumed that no part of a normal pathname contains ";" but that should
2207dc9477beSmrg    # okay in the real world where ";" in dirpaths is itself problematic.
2208dc9477beSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
2209dc9477beSmrg    ;;
2210dc9477beSmrg  *)
2211dc9477beSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
2212dc9477beSmrg    ;;
2213dc9477beSmrg  esac
2214dc9477beSmrg  # Ok, now we have the path, separated by spaces, we can step through it
22150eb1301bSmrg  # and add multilib dir if necessary.
2216dc9477beSmrg  lt_tmp_lt_search_path_spec=
22170eb1301bSmrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2218dc9477beSmrg  for lt_sys_path in $lt_search_path_spec; do
22190eb1301bSmrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
22200eb1301bSmrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
22210eb1301bSmrg    else
2222dc9477beSmrg      test -d "$lt_sys_path" && \
2223dc9477beSmrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2224dc9477beSmrg    fi
2225dc9477beSmrg  done
2226dc9477beSmrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
22270eb1301bSmrgBEGIN {RS=" "; FS="/|\n";} {
22280eb1301bSmrg  lt_foo="";
22290eb1301bSmrg  lt_count=0;
2230dc9477beSmrg  for (lt_i = NF; lt_i > 0; lt_i--) {
2231dc9477beSmrg    if ($lt_i != "" && $lt_i != ".") {
2232dc9477beSmrg      if ($lt_i == "..") {
2233dc9477beSmrg        lt_count++;
2234dc9477beSmrg      } else {
2235dc9477beSmrg        if (lt_count == 0) {
22360eb1301bSmrg          lt_foo="/" $lt_i lt_foo;
2237dc9477beSmrg        } else {
2238dc9477beSmrg          lt_count--;
2239dc9477beSmrg        }
2240dc9477beSmrg      }
2241dc9477beSmrg    }
2242dc9477beSmrg  }
2243dc9477beSmrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2244dc9477beSmrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2245dc9477beSmrg}'`
2246dc9477beSmrg  # AWK program above erroneously prepends '/' to C:/dos/paths
2247dc9477beSmrg  # for these hosts.
2248dc9477beSmrg  case $host_os in
2249dc9477beSmrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
22500eb1301bSmrg      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
2251dc9477beSmrg  esac
2252dc9477beSmrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
2253c43cc173Smrgelse
2254dc9477beSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2255dc9477beSmrgfi])
2256dc9477beSmrglibrary_names_spec=
2257dc9477beSmrglibname_spec='lib$name'
2258dc9477beSmrgsoname_spec=
22590eb1301bSmrgshrext_cmds=".so"
2260dc9477beSmrgpostinstall_cmds=
2261dc9477beSmrgpostuninstall_cmds=
2262dc9477beSmrgfinish_cmds=
2263dc9477beSmrgfinish_eval=
2264dc9477beSmrgshlibpath_var=
2265dc9477beSmrgshlibpath_overrides_runpath=unknown
2266dc9477beSmrgversion_type=none
2267dc9477beSmrgdynamic_linker="$host_os ld.so"
2268dc9477beSmrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
2269dc9477beSmrgneed_lib_prefix=unknown
2270dc9477beSmrghardcode_into_libs=no
2271c43cc173Smrg
2272dc9477beSmrg# when you set need_version to no, make sure it does not cause -set_version
2273dc9477beSmrg# flags to be left without arguments
2274dc9477beSmrgneed_version=unknown
2275c43cc173Smrg
2276dc9477beSmrgcase $host_os in
2277dc9477beSmrgaix3*)
2278dc9477beSmrg  version_type=linux # correct to gnu/linux during the next big refactor
22790eb1301bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
2280dc9477beSmrg  shlibpath_var=LIBPATH
2281c27c18e8Smrg
2282dc9477beSmrg  # AIX 3 has no versioning support, so we append a major version to the name.
22830eb1301bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2284dc9477beSmrg  ;;
2285c43cc173Smrg
2286dc9477beSmrgaix[[4-9]]*)
2287dc9477beSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2288dc9477beSmrg  need_lib_prefix=no
2289dc9477beSmrg  need_version=no
2290dc9477beSmrg  hardcode_into_libs=yes
22910eb1301bSmrg  if test "$host_cpu" = ia64; then
2292dc9477beSmrg    # AIX 5 supports IA64
22930eb1301bSmrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
2294dc9477beSmrg    shlibpath_var=LD_LIBRARY_PATH
2295dc9477beSmrg  else
2296dc9477beSmrg    # With GCC up to 2.95.x, collect2 would create an import file
2297dc9477beSmrg    # for dependence libraries.  The import file would start with
22980eb1301bSmrg    # the line `#! .'.  This would cause the generated library to
22990eb1301bSmrg    # depend on `.', always an invalid library.  This was fixed in
2300dc9477beSmrg    # development snapshots of GCC prior to 3.0.
2301dc9477beSmrg    case $host_os in
2302dc9477beSmrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
2303dc9477beSmrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2304dc9477beSmrg	   echo ' yes '
23050eb1301bSmrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
2306dc9477beSmrg	:
2307dc9477beSmrg      else
2308dc9477beSmrg	can_build_shared=no
2309dc9477beSmrg      fi
2310dc9477beSmrg      ;;
2311dc9477beSmrg    esac
23120eb1301bSmrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
2313dc9477beSmrg    # soname into executable. Probably we can add versioning support to
2314dc9477beSmrg    # collect2, so additional links can be useful in future.
23150eb1301bSmrg    if test "$aix_use_runtimelinking" = yes; then
2316dc9477beSmrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2317dc9477beSmrg      # instead of lib<name>.a to let people know that these are not
2318dc9477beSmrg      # typical AIX shared libraries.
23190eb1301bSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
23200eb1301bSmrg    else
2321dc9477beSmrg      # We preserve .a as extension for shared libraries through AIX4.2
2322dc9477beSmrg      # and later when we are not doing run time linking.
23230eb1301bSmrg      library_names_spec='${libname}${release}.a $libname.a'
23240eb1301bSmrg      soname_spec='${libname}${release}${shared_ext}$major'
23250eb1301bSmrg    fi
2326dc9477beSmrg    shlibpath_var=LIBPATH
2327dc9477beSmrg  fi
2328dc9477beSmrg  ;;
2329c43cc173Smrg
2330dc9477beSmrgamigaos*)
2331dc9477beSmrg  case $host_cpu in
2332dc9477beSmrg  powerpc)
2333dc9477beSmrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
2334dc9477beSmrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
23350eb1301bSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
233606c34b88Smrg    ;;
2337dc9477beSmrg  m68k)
2338dc9477beSmrg    library_names_spec='$libname.ixlibrary $libname.a'
2339dc9477beSmrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
23400eb1301bSmrg    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'
234106c34b88Smrg    ;;
2342dc9477beSmrg  esac
2343dc9477beSmrg  ;;
2344c27c18e8Smrg
2345dc9477beSmrgbeos*)
23460eb1301bSmrg  library_names_spec='${libname}${shared_ext}'
2347dc9477beSmrg  dynamic_linker="$host_os ld.so"
2348dc9477beSmrg  shlibpath_var=LIBRARY_PATH
2349dc9477beSmrg  ;;
235006c34b88Smrg
2351dc9477beSmrgbsdi[[45]]*)
2352dc9477beSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2353dc9477beSmrg  need_version=no
23540eb1301bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
23550eb1301bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2356dc9477beSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2357dc9477beSmrg  shlibpath_var=LD_LIBRARY_PATH
2358dc9477beSmrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2359dc9477beSmrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2360dc9477beSmrg  # the default ld.so.conf also contains /usr/contrib/lib and
2361dc9477beSmrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2362dc9477beSmrg  # libtool to hard-code these into programs
2363dc9477beSmrg  ;;
236406c34b88Smrg
2365dc9477beSmrgcygwin* | mingw* | pw32* | cegcc*)
2366dc9477beSmrg  version_type=windows
23670eb1301bSmrg  shrext_cmds=".dll"
2368dc9477beSmrg  need_version=no
2369dc9477beSmrg  need_lib_prefix=no
237006c34b88Smrg
2371dc9477beSmrg  case $GCC,$cc_basename in
2372dc9477beSmrg  yes,*)
2373dc9477beSmrg    # gcc
2374dc9477beSmrg    library_names_spec='$libname.dll.a'
2375dc9477beSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
23760eb1301bSmrg    postinstall_cmds='base_file=`basename \${file}`~
23770eb1301bSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2378dc9477beSmrg      dldir=$destdir/`dirname \$dlpath`~
2379dc9477beSmrg      test -d \$dldir || mkdir -p \$dldir~
2380dc9477beSmrg      $install_prog $dir/$dlname \$dldir/$dlname~
2381dc9477beSmrg      chmod a+x \$dldir/$dlname~
2382dc9477beSmrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2383dc9477beSmrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2384dc9477beSmrg      fi'
2385dc9477beSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2386dc9477beSmrg      dlpath=$dir/\$dldll~
2387dc9477beSmrg       $RM \$dlpath'
2388dc9477beSmrg    shlibpath_overrides_runpath=yes
238906c34b88Smrg
2390dc9477beSmrg    case $host_os in
2391dc9477beSmrg    cygwin*)
2392dc9477beSmrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
23930eb1301bSmrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2394dc9477beSmrgm4_if([$1], [],[
2395dc9477beSmrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
2396dc9477beSmrg      ;;
2397dc9477beSmrg    mingw* | cegcc*)
2398dc9477beSmrg      # MinGW DLLs use traditional 'lib' prefix
23990eb1301bSmrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2400dc9477beSmrg      ;;
2401dc9477beSmrg    pw32*)
2402dc9477beSmrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
24030eb1301bSmrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2404dc9477beSmrg      ;;
2405dc9477beSmrg    esac
2406dc9477beSmrg    dynamic_linker='Win32 ld.exe'
240706c34b88Smrg    ;;
240806c34b88Smrg
2409dc9477beSmrg  *,cl*)
2410dc9477beSmrg    # Native MSVC
2411dc9477beSmrg    libname_spec='$name'
24120eb1301bSmrg    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
24130eb1301bSmrg    library_names_spec='${libname}.dll.lib'
2414dc9477beSmrg
2415dc9477beSmrg    case $build_os in
2416dc9477beSmrg    mingw*)
2417dc9477beSmrg      sys_lib_search_path_spec=
2418dc9477beSmrg      lt_save_ifs=$IFS
2419dc9477beSmrg      IFS=';'
2420dc9477beSmrg      for lt_path in $LIB
242106c34b88Smrg      do
2422dc9477beSmrg        IFS=$lt_save_ifs
2423dc9477beSmrg        # Let DOS variable expansion print the short 8.3 style file name.
2424dc9477beSmrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
2425dc9477beSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
242606c34b88Smrg      done
2427dc9477beSmrg      IFS=$lt_save_ifs
2428dc9477beSmrg      # Convert to MSYS style.
2429dc9477beSmrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
2430dc9477beSmrg      ;;
2431dc9477beSmrg    cygwin*)
2432dc9477beSmrg      # Convert to unix form, then to dos form, then back to unix form
2433dc9477beSmrg      # but this time dos style (no spaces!) so that the unix form looks
2434dc9477beSmrg      # like /cygdrive/c/PROGRA~1:/cygdr...
2435dc9477beSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
2436dc9477beSmrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
2437dc9477beSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2438dc9477beSmrg      ;;
2439dc9477beSmrg    *)
24400eb1301bSmrg      sys_lib_search_path_spec="$LIB"
2441dc9477beSmrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2442dc9477beSmrg        # It is most probably a Windows format PATH.
2443dc9477beSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2444dc9477beSmrg      else
2445dc9477beSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2446dc9477beSmrg      fi
2447dc9477beSmrg      # FIXME: find the short name or the path components, as spaces are
2448dc9477beSmrg      # common. (e.g. "Program Files" -> "PROGRA~1")
2449dc9477beSmrg      ;;
2450dc9477beSmrg    esac
2451c27c18e8Smrg
2452dc9477beSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
24530eb1301bSmrg    postinstall_cmds='base_file=`basename \${file}`~
24540eb1301bSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2455dc9477beSmrg      dldir=$destdir/`dirname \$dlpath`~
2456dc9477beSmrg      test -d \$dldir || mkdir -p \$dldir~
2457dc9477beSmrg      $install_prog $dir/$dlname \$dldir/$dlname'
2458dc9477beSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2459dc9477beSmrg      dlpath=$dir/\$dldll~
2460dc9477beSmrg       $RM \$dlpath'
2461dc9477beSmrg    shlibpath_overrides_runpath=yes
2462dc9477beSmrg    dynamic_linker='Win32 link.exe'
2463dc9477beSmrg    ;;
2464c27c18e8Smrg
2465dc9477beSmrg  *)
2466dc9477beSmrg    # Assume MSVC wrapper
24670eb1301bSmrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
2468dc9477beSmrg    dynamic_linker='Win32 ld.exe'
2469dc9477beSmrg    ;;
2470dc9477beSmrg  esac
2471dc9477beSmrg  # FIXME: first we should search . and the directory the executable is in
2472dc9477beSmrg  shlibpath_var=PATH
2473dc9477beSmrg  ;;
2474c43cc173Smrg
2475dc9477beSmrgdarwin* | rhapsody*)
2476dc9477beSmrg  dynamic_linker="$host_os dyld"
2477dc9477beSmrg  version_type=darwin
2478dc9477beSmrg  need_lib_prefix=no
2479dc9477beSmrg  need_version=no
24800eb1301bSmrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
24810eb1301bSmrg  soname_spec='${libname}${release}${major}$shared_ext'
2482dc9477beSmrg  shlibpath_overrides_runpath=yes
2483dc9477beSmrg  shlibpath_var=DYLD_LIBRARY_PATH
2484dc9477beSmrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2485dc9477beSmrgm4_if([$1], [],[
2486dc9477beSmrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2487dc9477beSmrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2488dc9477beSmrg  ;;
248921e67964Smrg
2490dc9477beSmrgdgux*)
2491dc9477beSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2492dc9477beSmrg  need_lib_prefix=no
2493dc9477beSmrg  need_version=no
24940eb1301bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
24950eb1301bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2496dc9477beSmrg  shlibpath_var=LD_LIBRARY_PATH
2497dc9477beSmrg  ;;
2498c43cc173Smrg
2499dc9477beSmrgfreebsd* | dragonfly*)
2500dc9477beSmrg  # DragonFly does not have aout.  When/if they implement a new
2501dc9477beSmrg  # versioning mechanism, adjust this.
2502dc9477beSmrg  if test -x /usr/bin/objformat; then
2503dc9477beSmrg    objformat=`/usr/bin/objformat`
250421e67964Smrg  else
2505dc9477beSmrg    case $host_os in
2506dc9477beSmrg    freebsd[[23]].*) objformat=aout ;;
2507dc9477beSmrg    *) objformat=elf ;;
2508c43cc173Smrg    esac
250921e67964Smrg  fi
2510dc9477beSmrg  version_type=freebsd-$objformat
2511dc9477beSmrg  case $version_type in
2512dc9477beSmrg    freebsd-elf*)
25130eb1301bSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2514dc9477beSmrg      need_version=no
2515dc9477beSmrg      need_lib_prefix=no
2516dc9477beSmrg      ;;
2517dc9477beSmrg    freebsd-*)
25180eb1301bSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
2519dc9477beSmrg      need_version=yes
2520dc9477beSmrg      ;;
2521dc9477beSmrg  esac
2522dc9477beSmrg  shlibpath_var=LD_LIBRARY_PATH
252306c34b88Smrg  case $host_os in
2524dc9477beSmrg  freebsd2.*)
2525dc9477beSmrg    shlibpath_overrides_runpath=yes
252606c34b88Smrg    ;;
2527dc9477beSmrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2528dc9477beSmrg    shlibpath_overrides_runpath=yes
2529dc9477beSmrg    hardcode_into_libs=yes
253006c34b88Smrg    ;;
2531dc9477beSmrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2532dc9477beSmrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2533dc9477beSmrg    shlibpath_overrides_runpath=no
2534dc9477beSmrg    hardcode_into_libs=yes
253521e67964Smrg    ;;
2536dc9477beSmrg  *) # from 4.6 on, and DragonFly
2537dc9477beSmrg    shlibpath_overrides_runpath=yes
2538dc9477beSmrg    hardcode_into_libs=yes
2539c43cc173Smrg    ;;
2540c43cc173Smrg  esac
2541dc9477beSmrg  ;;
2542c43cc173Smrg
2543dc9477beSmrghaiku*)
2544dc9477beSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2545dc9477beSmrg  need_lib_prefix=no
2546dc9477beSmrg  need_version=no
2547dc9477beSmrg  dynamic_linker="$host_os runtime_loader"
25480eb1301bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
25490eb1301bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2550dc9477beSmrg  shlibpath_var=LIBRARY_PATH
25510eb1301bSmrg  shlibpath_overrides_runpath=yes
2552dc9477beSmrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
2553dc9477beSmrg  hardcode_into_libs=yes
2554dc9477beSmrg  ;;
255521e67964Smrg
2556dc9477beSmrghpux9* | hpux10* | hpux11*)
2557dc9477beSmrg  # Give a soname corresponding to the major version so that dld.sl refuses to
2558dc9477beSmrg  # link against other versions.
2559dc9477beSmrg  version_type=sunos
2560dc9477beSmrg  need_lib_prefix=no
2561dc9477beSmrg  need_version=no
2562dc9477beSmrg  case $host_cpu in
2563dc9477beSmrg  ia64*)
2564dc9477beSmrg    shrext_cmds='.so'
2565dc9477beSmrg    hardcode_into_libs=yes
2566dc9477beSmrg    dynamic_linker="$host_os dld.so"
2567dc9477beSmrg    shlibpath_var=LD_LIBRARY_PATH
2568dc9477beSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
25690eb1301bSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
25700eb1301bSmrg    soname_spec='${libname}${release}${shared_ext}$major'
25710eb1301bSmrg    if test "X$HPUX_IA64_MODE" = X32; then
2572dc9477beSmrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2573dc9477beSmrg    else
2574dc9477beSmrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
257506c34b88Smrg    fi
25760eb1301bSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2577c43cc173Smrg    ;;
2578dc9477beSmrg  hppa*64*)
2579dc9477beSmrg    shrext_cmds='.sl'
2580dc9477beSmrg    hardcode_into_libs=yes
2581dc9477beSmrg    dynamic_linker="$host_os dld.sl"
2582dc9477beSmrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2583dc9477beSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
25840eb1301bSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
25850eb1301bSmrg    soname_spec='${libname}${release}${shared_ext}$major'
2586dc9477beSmrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2587dc9477beSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2588dc9477beSmrg    ;;
2589dc9477beSmrg  *)
2590dc9477beSmrg    shrext_cmds='.sl'
2591dc9477beSmrg    dynamic_linker="$host_os dld.sl"
2592dc9477beSmrg    shlibpath_var=SHLIB_PATH
2593dc9477beSmrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
25940eb1301bSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
25950eb1301bSmrg    soname_spec='${libname}${release}${shared_ext}$major'
2596dc9477beSmrg    ;;
2597dc9477beSmrg  esac
2598dc9477beSmrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
2599dc9477beSmrg  postinstall_cmds='chmod 555 $lib'
2600dc9477beSmrg  # or fails outright, so override atomically:
2601dc9477beSmrg  install_override_mode=555
2602dc9477beSmrg  ;;
2603c43cc173Smrg
2604dc9477beSmrginterix[[3-9]]*)
2605dc9477beSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2606dc9477beSmrg  need_lib_prefix=no
2607dc9477beSmrg  need_version=no
26080eb1301bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
26090eb1301bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2610dc9477beSmrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2611dc9477beSmrg  shlibpath_var=LD_LIBRARY_PATH
2612dc9477beSmrg  shlibpath_overrides_runpath=no
2613dc9477beSmrg  hardcode_into_libs=yes
2614dc9477beSmrg  ;;
2615c43cc173Smrg
2616dc9477beSmrgirix5* | irix6* | nonstopux*)
2617dc9477beSmrg  case $host_os in
2618dc9477beSmrg    nonstopux*) version_type=nonstopux ;;
2619dc9477beSmrg    *)
26200eb1301bSmrg	if test "$lt_cv_prog_gnu_ld" = yes; then
2621dc9477beSmrg		version_type=linux # correct to gnu/linux during the next big refactor
2622dc9477beSmrg	else
2623dc9477beSmrg		version_type=irix
2624dc9477beSmrg	fi ;;
2625dc9477beSmrg  esac
2626dc9477beSmrg  need_lib_prefix=no
2627dc9477beSmrg  need_version=no
26280eb1301bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
26290eb1301bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
2630dc9477beSmrg  case $host_os in
2631dc9477beSmrg  irix5* | nonstopux*)
2632dc9477beSmrg    libsuff= shlibsuff=
2633dc9477beSmrg    ;;
2634dc9477beSmrg  *)
2635dc9477beSmrg    case $LD in # libtool.m4 will add one of these switches to LD
2636dc9477beSmrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2637dc9477beSmrg      libsuff= shlibsuff= libmagic=32-bit;;
2638dc9477beSmrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2639dc9477beSmrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
2640dc9477beSmrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2641dc9477beSmrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
2642dc9477beSmrg    *) libsuff= shlibsuff= libmagic=never-match;;
2643dc9477beSmrg    esac
2644dc9477beSmrg    ;;
2645dc9477beSmrg  esac
2646dc9477beSmrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2647dc9477beSmrg  shlibpath_overrides_runpath=no
26480eb1301bSmrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
26490eb1301bSmrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2650dc9477beSmrg  hardcode_into_libs=yes
2651dc9477beSmrg  ;;
2652c27c18e8Smrg
2653dc9477beSmrg# No shared lib support for Linux oldld, aout, or coff.
2654dc9477beSmrglinux*oldld* | linux*aout* | linux*coff*)
2655dc9477beSmrg  dynamic_linker=no
2656dc9477beSmrg  ;;
265706c34b88Smrg
2658dc9477beSmrg# This must be glibc/ELF.
265944584a44Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
2660dc9477beSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2661dc9477beSmrg  need_lib_prefix=no
2662dc9477beSmrg  need_version=no
26630eb1301bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
26640eb1301bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2665dc9477beSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2666dc9477beSmrg  shlibpath_var=LD_LIBRARY_PATH
2667dc9477beSmrg  shlibpath_overrides_runpath=no
266806c34b88Smrg
2669dc9477beSmrg  # Some binutils ld are patched to set DT_RUNPATH
2670dc9477beSmrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
2671dc9477beSmrg    [lt_cv_shlibpath_overrides_runpath=no
2672dc9477beSmrg    save_LDFLAGS=$LDFLAGS
2673dc9477beSmrg    save_libdir=$libdir
2674dc9477beSmrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2675dc9477beSmrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2676dc9477beSmrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2677dc9477beSmrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2678dc9477beSmrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
2679dc9477beSmrg    LDFLAGS=$save_LDFLAGS
2680dc9477beSmrg    libdir=$save_libdir
2681dc9477beSmrg    ])
2682dc9477beSmrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
268306c34b88Smrg
2684dc9477beSmrg  # This implies no fast_install, which is unacceptable.
2685dc9477beSmrg  # Some rework will be needed to allow for fast_install
2686dc9477beSmrg  # before this can be enabled.
2687dc9477beSmrg  hardcode_into_libs=yes
2688c43cc173Smrg
26890eb1301bSmrg  # Append ld.so.conf contents to the search path
2690dc9477beSmrg  if test -f /etc/ld.so.conf; then
2691dc9477beSmrg    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' ' '`
26920eb1301bSmrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
2693dc9477beSmrg  fi
2694b789ec8aSmrg
2695dc9477beSmrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
2696dc9477beSmrg  # powerpc, because MkLinux only supported shared libraries with the
2697dc9477beSmrg  # GNU dynamic linker.  Since this was broken with cross compilers,
2698dc9477beSmrg  # most powerpc-linux boxes support dynamic linking these days and
2699dc9477beSmrg  # people can always --disable-shared, the test was removed, and we
2700dc9477beSmrg  # assume the GNU/Linux dynamic linker is in use.
2701dc9477beSmrg  dynamic_linker='GNU/Linux ld.so'
2702dc9477beSmrg  ;;
2703b789ec8aSmrg
27040eb1301bSmrgnetbsdelf*-gnu)
27050eb1301bSmrg  version_type=linux
27060eb1301bSmrg  need_lib_prefix=no
27070eb1301bSmrg  need_version=no
27080eb1301bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
27090eb1301bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
27100eb1301bSmrg  shlibpath_var=LD_LIBRARY_PATH
27110eb1301bSmrg  shlibpath_overrides_runpath=no
27120eb1301bSmrg  hardcode_into_libs=yes
27130eb1301bSmrg  dynamic_linker='NetBSD ld.elf_so'
27140eb1301bSmrg  ;;
27150eb1301bSmrg
2716dc9477beSmrgnetbsd*)
2717dc9477beSmrg  version_type=sunos
2718dc9477beSmrg  need_lib_prefix=no
2719dc9477beSmrg  need_version=no
2720dc9477beSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
27210eb1301bSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2722dc9477beSmrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2723dc9477beSmrg    dynamic_linker='NetBSD (a.out) ld.so'
272406c34b88Smrg  else
27250eb1301bSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
27260eb1301bSmrg    soname_spec='${libname}${release}${shared_ext}$major'
2727dc9477beSmrg    dynamic_linker='NetBSD ld.elf_so'
2728b789ec8aSmrg  fi
2729dc9477beSmrg  shlibpath_var=LD_LIBRARY_PATH
2730dc9477beSmrg  shlibpath_overrides_runpath=yes
2731dc9477beSmrg  hardcode_into_libs=yes
2732dc9477beSmrg  ;;
2733c43cc173Smrg
2734dc9477beSmrgnewsos6)
2735dc9477beSmrg  version_type=linux # correct to gnu/linux during the next big refactor
27360eb1301bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2737dc9477beSmrg  shlibpath_var=LD_LIBRARY_PATH
2738dc9477beSmrg  shlibpath_overrides_runpath=yes
2739dc9477beSmrg  ;;
2740c43cc173Smrg
2741dc9477beSmrg*nto* | *qnx*)
2742dc9477beSmrg  version_type=qnx
2743dc9477beSmrg  need_lib_prefix=no
2744dc9477beSmrg  need_version=no
27450eb1301bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
27460eb1301bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2747dc9477beSmrg  shlibpath_var=LD_LIBRARY_PATH
2748dc9477beSmrg  shlibpath_overrides_runpath=no
2749dc9477beSmrg  hardcode_into_libs=yes
2750dc9477beSmrg  dynamic_linker='ldqnx.so'
2751dc9477beSmrg  ;;
2752c43cc173Smrg
27530eb1301bSmrgopenbsd*)
2754dc9477beSmrg  version_type=sunos
27550eb1301bSmrg  sys_lib_dlsearch_path_spec="/usr/lib"
2756dc9477beSmrg  need_lib_prefix=no
27570eb1301bSmrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
27580eb1301bSmrg  case $host_os in
27590eb1301bSmrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
27600eb1301bSmrg    *)				need_version=no  ;;
27610eb1301bSmrg  esac
27620eb1301bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
276344584a44Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
276444584a44Smrg  shlibpath_var=LD_LIBRARY_PATH
27650eb1301bSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
27660eb1301bSmrg    case $host_os in
27670eb1301bSmrg      openbsd2.[[89]] | openbsd2.[[89]].*)
27680eb1301bSmrg	shlibpath_overrides_runpath=no
27690eb1301bSmrg	;;
27700eb1301bSmrg      *)
27710eb1301bSmrg	shlibpath_overrides_runpath=yes
27720eb1301bSmrg	;;
27730eb1301bSmrg      esac
27740eb1301bSmrg  else
27750eb1301bSmrg    shlibpath_overrides_runpath=yes
27760eb1301bSmrg  fi
2777dc9477beSmrg  ;;
2778c43cc173Smrg
2779dc9477beSmrgos2*)
2780dc9477beSmrg  libname_spec='$name'
27810eb1301bSmrg  shrext_cmds=".dll"
2782dc9477beSmrg  need_lib_prefix=no
27830eb1301bSmrg  library_names_spec='$libname${shared_ext} $libname.a'
2784dc9477beSmrg  dynamic_linker='OS/2 ld.exe'
27850eb1301bSmrg  shlibpath_var=LIBPATH
2786dc9477beSmrg  ;;
278706c34b88Smrg
2788dc9477beSmrgosf3* | osf4* | osf5*)
2789dc9477beSmrg  version_type=osf
2790dc9477beSmrg  need_lib_prefix=no
2791dc9477beSmrg  need_version=no
27920eb1301bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
27930eb1301bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2794dc9477beSmrg  shlibpath_var=LD_LIBRARY_PATH
2795dc9477beSmrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
27960eb1301bSmrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2797c27c18e8Smrg  ;;
279806c34b88Smrg
2799dc9477beSmrgrdos*)
2800dc9477beSmrg  dynamic_linker=no
2801dc9477beSmrg  ;;
2802dc9477beSmrg
2803dc9477beSmrgsolaris*)
280406c34b88Smrg  version_type=linux # correct to gnu/linux during the next big refactor
280506c34b88Smrg  need_lib_prefix=no
280606c34b88Smrg  need_version=no
28070eb1301bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
28080eb1301bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2809dc9477beSmrg  shlibpath_var=LD_LIBRARY_PATH
2810dc9477beSmrg  shlibpath_overrides_runpath=yes
281106c34b88Smrg  hardcode_into_libs=yes
2812dc9477beSmrg  # ldd complains unless libraries are executable
2813dc9477beSmrg  postinstall_cmds='chmod +x $lib'
281406c34b88Smrg  ;;
2815c43cc173Smrg
2816dc9477beSmrgsunos4*)
2817dc9477beSmrg  version_type=sunos
28180eb1301bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2819dc9477beSmrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2820dc9477beSmrg  shlibpath_var=LD_LIBRARY_PATH
2821dc9477beSmrg  shlibpath_overrides_runpath=yes
28220eb1301bSmrg  if test "$with_gnu_ld" = yes; then
2823dc9477beSmrg    need_lib_prefix=no
2824dc9477beSmrg  fi
2825dc9477beSmrg  need_version=yes
2826c27c18e8Smrg  ;;
2827c43cc173Smrg
2828dc9477beSmrgsysv4 | sysv4.3*)
282906c34b88Smrg  version_type=linux # correct to gnu/linux during the next big refactor
28300eb1301bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
28310eb1301bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
283206c34b88Smrg  shlibpath_var=LD_LIBRARY_PATH
2833dc9477beSmrg  case $host_vendor in
2834dc9477beSmrg    sni)
2835dc9477beSmrg      shlibpath_overrides_runpath=no
2836dc9477beSmrg      need_lib_prefix=no
2837dc9477beSmrg      runpath_var=LD_RUN_PATH
283806c34b88Smrg      ;;
2839dc9477beSmrg    siemens)
2840dc9477beSmrg      need_lib_prefix=no
284106c34b88Smrg      ;;
2842dc9477beSmrg    motorola)
2843dc9477beSmrg      need_lib_prefix=no
2844dc9477beSmrg      need_version=no
2845dc9477beSmrg      shlibpath_overrides_runpath=no
2846dc9477beSmrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
284706c34b88Smrg      ;;
284806c34b88Smrg  esac
284906c34b88Smrg  ;;
2850c43cc173Smrg
2851dc9477beSmrgsysv4*MP*)
28520eb1301bSmrg  if test -d /usr/nec ;then
2853dc9477beSmrg    version_type=linux # correct to gnu/linux during the next big refactor
28540eb1301bSmrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
28550eb1301bSmrg    soname_spec='$libname${shared_ext}.$major'
2856dc9477beSmrg    shlibpath_var=LD_LIBRARY_PATH
2857dc9477beSmrg  fi
285806c34b88Smrg  ;;
2859c43cc173Smrg
2860dc9477beSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
28610eb1301bSmrg  version_type=freebsd-elf
286206c34b88Smrg  need_lib_prefix=no
286306c34b88Smrg  need_version=no
28640eb1301bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
28650eb1301bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
286606c34b88Smrg  shlibpath_var=LD_LIBRARY_PATH
2867dc9477beSmrg  shlibpath_overrides_runpath=yes
2868dc9477beSmrg  hardcode_into_libs=yes
28690eb1301bSmrg  if test "$with_gnu_ld" = yes; then
2870dc9477beSmrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
2871c27c18e8Smrg  else
2872dc9477beSmrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
287306c34b88Smrg    case $host_os in
2874dc9477beSmrg      sco3.2v5*)
2875dc9477beSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
2876dc9477beSmrg	;;
287706c34b88Smrg    esac
2878c27c18e8Smrg  fi
2879dc9477beSmrg  sys_lib_dlsearch_path_spec='/usr/lib'
288006c34b88Smrg  ;;
2881c43cc173Smrg
2882dc9477beSmrgtpf*)
2883dc9477beSmrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
288406c34b88Smrg  version_type=linux # correct to gnu/linux during the next big refactor
288506c34b88Smrg  need_lib_prefix=no
288606c34b88Smrg  need_version=no
28870eb1301bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
288806c34b88Smrg  shlibpath_var=LD_LIBRARY_PATH
288906c34b88Smrg  shlibpath_overrides_runpath=no
289006c34b88Smrg  hardcode_into_libs=yes
289106c34b88Smrg  ;;
2892c43cc173Smrg
2893dc9477beSmrguts4*)
289406c34b88Smrg  version_type=linux # correct to gnu/linux during the next big refactor
28950eb1301bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
28960eb1301bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2897dc9477beSmrg  shlibpath_var=LD_LIBRARY_PATH
289806c34b88Smrg  ;;
2899c43cc173Smrg
2900dc9477beSmrg*)
290106c34b88Smrg  dynamic_linker=no
290206c34b88Smrg  ;;
2903dc9477beSmrgesac
2904dc9477beSmrgAC_MSG_RESULT([$dynamic_linker])
29050eb1301bSmrgtest "$dynamic_linker" = no && can_build_shared=no
2906c43cc173Smrg
2907dc9477beSmrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
29080eb1301bSmrgif test "$GCC" = yes; then
2909dc9477beSmrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2910dc9477beSmrgfi
2911c43cc173Smrg
29120eb1301bSmrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
29130eb1301bSmrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
2914dc9477beSmrgfi
29150eb1301bSmrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
29160eb1301bSmrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
2917dc9477beSmrgfi
2918c43cc173Smrg
2919dc9477beSmrg_LT_DECL([], [variables_saved_for_relink], [1],
2920dc9477beSmrg    [Variables whose values should be saved in libtool wrapper scripts and
2921dc9477beSmrg    restored at link time])
2922dc9477beSmrg_LT_DECL([], [need_lib_prefix], [0],
2923dc9477beSmrg    [Do we need the "lib" prefix for modules?])
2924dc9477beSmrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
2925dc9477beSmrg_LT_DECL([], [version_type], [0], [Library versioning type])
2926dc9477beSmrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
2927dc9477beSmrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
2928dc9477beSmrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
2929dc9477beSmrg    [Is shlibpath searched before the hard-coded library search path?])
2930dc9477beSmrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
2931dc9477beSmrg_LT_DECL([], [library_names_spec], [1],
2932dc9477beSmrg    [[List of archive names.  First name is the real one, the rest are links.
2933dc9477beSmrg    The last name is the one that the linker finds with -lNAME]])
2934dc9477beSmrg_LT_DECL([], [soname_spec], [1],
2935dc9477beSmrg    [[The coded name of the library, if different from the real name]])
2936dc9477beSmrg_LT_DECL([], [install_override_mode], [1],
2937dc9477beSmrg    [Permission mode override for installation of shared libraries])
2938dc9477beSmrg_LT_DECL([], [postinstall_cmds], [2],
2939dc9477beSmrg    [Command to use after installation of a shared archive])
2940dc9477beSmrg_LT_DECL([], [postuninstall_cmds], [2],
2941dc9477beSmrg    [Command to use after uninstallation of a shared archive])
2942dc9477beSmrg_LT_DECL([], [finish_cmds], [2],
2943dc9477beSmrg    [Commands used to finish a libtool library installation in a directory])
2944dc9477beSmrg_LT_DECL([], [finish_eval], [1],
2945dc9477beSmrg    [[As "finish_cmds", except a single script fragment to be evaled but
2946dc9477beSmrg    not shown]])
2947dc9477beSmrg_LT_DECL([], [hardcode_into_libs], [0],
2948dc9477beSmrg    [Whether we should hardcode library paths into libraries])
2949dc9477beSmrg_LT_DECL([], [sys_lib_search_path_spec], [2],
2950dc9477beSmrg    [Compile-time system search path for libraries])
29510eb1301bSmrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
29520eb1301bSmrg    [Run-time system search path for libraries])
2953dc9477beSmrg])# _LT_SYS_DYNAMIC_LINKER
295421e67964Smrg
295521e67964Smrg
2956dc9477beSmrg# _LT_PATH_TOOL_PREFIX(TOOL)
2957dc9477beSmrg# --------------------------
29580eb1301bSmrg# find a file program which can recognize shared library
2959dc9477beSmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
2960dc9477beSmrg[m4_require([_LT_DECL_EGREP])dnl
2961dc9477beSmrgAC_MSG_CHECKING([for $1])
2962dc9477beSmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
2963dc9477beSmrg[case $MAGIC_CMD in
2964dc9477beSmrg[[\\/*] |  ?:[\\/]*])
29650eb1301bSmrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
2966dc9477beSmrg  ;;
2967dc9477beSmrg*)
29680eb1301bSmrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
29690eb1301bSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2970dc9477beSmrgdnl $ac_dummy forces splitting on constant user-supplied paths.
2971dc9477beSmrgdnl POSIX.2 word splitting is done only on the output of word expansions,
2972dc9477beSmrgdnl not every word.  This closes a longstanding sh security hole.
2973dc9477beSmrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
2974dc9477beSmrg  for ac_dir in $ac_dummy; do
29750eb1301bSmrg    IFS="$lt_save_ifs"
2976dc9477beSmrg    test -z "$ac_dir" && ac_dir=.
29770eb1301bSmrg    if test -f $ac_dir/$1; then
29780eb1301bSmrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
2979dc9477beSmrg      if test -n "$file_magic_test_file"; then
2980dc9477beSmrg	case $deplibs_check_method in
2981dc9477beSmrg	"file_magic "*)
2982dc9477beSmrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
29830eb1301bSmrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2984dc9477beSmrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
2985dc9477beSmrg	    $EGREP "$file_magic_regex" > /dev/null; then
2986dc9477beSmrg	    :
2987dc9477beSmrg	  else
2988dc9477beSmrg	    cat <<_LT_EOF 1>&2
298921e67964Smrg
2990dc9477beSmrg*** Warning: the command libtool uses to detect shared libraries,
2991dc9477beSmrg*** $file_magic_cmd, produces output that libtool cannot recognize.
2992dc9477beSmrg*** The result is that libtool may fail to recognize shared libraries
2993dc9477beSmrg*** as such.  This will affect the creation of libtool libraries that
2994dc9477beSmrg*** depend on shared libraries, but programs linked with such libtool
2995dc9477beSmrg*** libraries will work regardless of this problem.  Nevertheless, you
2996dc9477beSmrg*** may want to report the problem to your system manager and/or to
2997dc9477beSmrg*** bug-libtool@gnu.org
299821e67964Smrg
2999dc9477beSmrg_LT_EOF
3000dc9477beSmrg	  fi ;;
3001dc9477beSmrg	esac
3002dc9477beSmrg      fi
3003dc9477beSmrg      break
3004dc9477beSmrg    fi
3005dc9477beSmrg  done
30060eb1301bSmrg  IFS="$lt_save_ifs"
30070eb1301bSmrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
300806c34b88Smrg  ;;
3009dc9477beSmrgesac])
30100eb1301bSmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3011dc9477beSmrgif test -n "$MAGIC_CMD"; then
3012dc9477beSmrg  AC_MSG_RESULT($MAGIC_CMD)
3013dc9477beSmrgelse
3014dc9477beSmrg  AC_MSG_RESULT(no)
3015dc9477beSmrgfi
3016dc9477beSmrg_LT_DECL([], [MAGIC_CMD], [0],
3017dc9477beSmrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
3018dc9477beSmrg])# _LT_PATH_TOOL_PREFIX
301921e67964Smrg
3020dc9477beSmrg# Old name:
3021dc9477beSmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
3022dc9477beSmrgdnl aclocal-1.4 backwards compatibility:
3023dc9477beSmrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3024dc9477beSmrg
3025dc9477beSmrg
3026dc9477beSmrg# _LT_PATH_MAGIC
3027dc9477beSmrg# --------------
30280eb1301bSmrg# find a file program which can recognize a shared library
3029dc9477beSmrgm4_defun([_LT_PATH_MAGIC],
3030dc9477beSmrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
3031dc9477beSmrgif test -z "$lt_cv_path_MAGIC_CMD"; then
3032dc9477beSmrg  if test -n "$ac_tool_prefix"; then
3033dc9477beSmrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
303406c34b88Smrg  else
3035dc9477beSmrg    MAGIC_CMD=:
303606c34b88Smrg  fi
3037dc9477beSmrgfi
3038dc9477beSmrg])# _LT_PATH_MAGIC
303921e67964Smrg
3040c43cc173Smrg
3041dc9477beSmrg# LT_PATH_LD
3042dc9477beSmrg# ----------
3043dc9477beSmrg# find the pathname to the GNU or non-GNU linker
3044dc9477beSmrgAC_DEFUN([LT_PATH_LD],
3045dc9477beSmrg[AC_REQUIRE([AC_PROG_CC])dnl
3046dc9477beSmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
3047dc9477beSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
3048dc9477beSmrgm4_require([_LT_DECL_SED])dnl
3049dc9477beSmrgm4_require([_LT_DECL_EGREP])dnl
3050dc9477beSmrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
3051c43cc173Smrg
3052dc9477beSmrgAC_ARG_WITH([gnu-ld],
3053dc9477beSmrg    [AS_HELP_STRING([--with-gnu-ld],
3054dc9477beSmrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
30550eb1301bSmrg    [test "$withval" = no || with_gnu_ld=yes],
3056dc9477beSmrg    [with_gnu_ld=no])dnl
3057dc9477beSmrg
3058dc9477beSmrgac_prog=ld
30590eb1301bSmrgif test "$GCC" = yes; then
3060dc9477beSmrg  # Check if gcc -print-prog-name=ld gives a path.
3061dc9477beSmrg  AC_MSG_CHECKING([for ld used by $CC])
3062dc9477beSmrg  case $host in
3063dc9477beSmrg  *-*-mingw*)
30640eb1301bSmrg    # gcc leaves a trailing carriage return which upsets mingw
3065dc9477beSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3066dc9477beSmrg  *)
3067dc9477beSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
306806c34b88Smrg  esac
3069dc9477beSmrg  case $ac_prog in
3070dc9477beSmrg    # Accept absolute paths.
3071dc9477beSmrg    [[\\/]]* | ?:[[\\/]]*)
3072dc9477beSmrg      re_direlt='/[[^/]][[^/]]*/\.\./'
3073dc9477beSmrg      # Canonicalize the pathname of ld
3074dc9477beSmrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
3075dc9477beSmrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
3076dc9477beSmrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
3077dc9477beSmrg      done
30780eb1301bSmrg      test -z "$LD" && LD="$ac_prog"
3079dc9477beSmrg      ;;
3080dc9477beSmrg  "")
3081dc9477beSmrg    # If it fails, then pretend we aren't using GCC.
3082dc9477beSmrg    ac_prog=ld
3083dc9477beSmrg    ;;
3084dc9477beSmrg  *)
3085dc9477beSmrg    # If it is relative, then search for the first ld in PATH.
3086dc9477beSmrg    with_gnu_ld=unknown
3087dc9477beSmrg    ;;
3088dc9477beSmrg  esac
30890eb1301bSmrgelif test "$with_gnu_ld" = yes; then
3090dc9477beSmrg  AC_MSG_CHECKING([for GNU ld])
3091dc9477beSmrgelse
3092dc9477beSmrg  AC_MSG_CHECKING([for non-GNU ld])
3093dc9477beSmrgfi
3094dc9477beSmrgAC_CACHE_VAL(lt_cv_path_LD,
3095dc9477beSmrg[if test -z "$LD"; then
30960eb1301bSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3097dc9477beSmrg  for ac_dir in $PATH; do
30980eb1301bSmrg    IFS="$lt_save_ifs"
3099dc9477beSmrg    test -z "$ac_dir" && ac_dir=.
3100dc9477beSmrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
31010eb1301bSmrg      lt_cv_path_LD="$ac_dir/$ac_prog"
3102dc9477beSmrg      # Check to see if the program is GNU ld.  I'd rather use --version,
3103dc9477beSmrg      # but apparently some variants of GNU ld only accept -v.
3104dc9477beSmrg      # Break only if it was the GNU/non-GNU ld that we prefer.
3105dc9477beSmrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
3106dc9477beSmrg      *GNU* | *'with BFD'*)
31070eb1301bSmrg	test "$with_gnu_ld" != no && break
310806c34b88Smrg	;;
310906c34b88Smrg      *)
31100eb1301bSmrg	test "$with_gnu_ld" != yes && break
311106c34b88Smrg	;;
311206c34b88Smrg      esac
3113dc9477beSmrg    fi
3114dc9477beSmrg  done
31150eb1301bSmrg  IFS="$lt_save_ifs"
3116dc9477beSmrgelse
31170eb1301bSmrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
3118dc9477beSmrgfi])
31190eb1301bSmrgLD="$lt_cv_path_LD"
3120dc9477beSmrgif test -n "$LD"; then
3121dc9477beSmrg  AC_MSG_RESULT($LD)
3122dc9477beSmrgelse
3123dc9477beSmrg  AC_MSG_RESULT(no)
3124dc9477beSmrgfi
3125dc9477beSmrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3126dc9477beSmrg_LT_PATH_LD_GNU
3127dc9477beSmrgAC_SUBST([LD])
312821e67964Smrg
3129dc9477beSmrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
3130dc9477beSmrg])# LT_PATH_LD
313121e67964Smrg
3132dc9477beSmrg# Old names:
3133dc9477beSmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
3134dc9477beSmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
3135dc9477beSmrgdnl aclocal-1.4 backwards compatibility:
3136dc9477beSmrgdnl AC_DEFUN([AM_PROG_LD], [])
3137dc9477beSmrgdnl AC_DEFUN([AC_PROG_LD], [])
313821e67964Smrg
3139c27c18e8Smrg
3140dc9477beSmrg# _LT_PATH_LD_GNU
3141dc9477beSmrg#- --------------
3142dc9477beSmrgm4_defun([_LT_PATH_LD_GNU],
3143dc9477beSmrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3144dc9477beSmrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
3145dc9477beSmrgcase `$LD -v 2>&1 </dev/null` in
3146dc9477beSmrg*GNU* | *'with BFD'*)
3147dc9477beSmrg  lt_cv_prog_gnu_ld=yes
314806c34b88Smrg  ;;
3149dc9477beSmrg*)
3150dc9477beSmrg  lt_cv_prog_gnu_ld=no
315106c34b88Smrg  ;;
3152dc9477beSmrgesac])
3153dc9477beSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
3154dc9477beSmrg])# _LT_PATH_LD_GNU
3155c43cc173Smrg
315606c34b88Smrg
3157dc9477beSmrg# _LT_CMD_RELOAD
3158dc9477beSmrg# --------------
3159dc9477beSmrg# find reload flag for linker
3160dc9477beSmrg#   -- PORTME Some linkers may need a different reload flag.
3161dc9477beSmrgm4_defun([_LT_CMD_RELOAD],
3162dc9477beSmrg[AC_CACHE_CHECK([for $LD option to reload object files],
3163dc9477beSmrg  lt_cv_ld_reload_flag,
3164dc9477beSmrg  [lt_cv_ld_reload_flag='-r'])
3165dc9477beSmrgreload_flag=$lt_cv_ld_reload_flag
3166dc9477beSmrgcase $reload_flag in
3167dc9477beSmrg"" | " "*) ;;
3168dc9477beSmrg*) reload_flag=" $reload_flag" ;;
316906c34b88Smrgesac
3170dc9477beSmrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
3171dc9477beSmrgcase $host_os in
3172dc9477beSmrg  cygwin* | mingw* | pw32* | cegcc*)
31730eb1301bSmrg    if test "$GCC" != yes; then
3174dc9477beSmrg      reload_cmds=false
3175dc9477beSmrg    fi
3176dc9477beSmrg    ;;
3177dc9477beSmrg  darwin*)
31780eb1301bSmrg    if test "$GCC" = yes; then
31790eb1301bSmrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
3180dc9477beSmrg    else
3181dc9477beSmrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
3182dc9477beSmrg    fi
3183dc9477beSmrg    ;;
3184dc9477beSmrgesac
3185dc9477beSmrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
3186dc9477beSmrg_LT_TAGDECL([], [reload_cmds], [2])dnl
3187dc9477beSmrg])# _LT_CMD_RELOAD
318821e67964Smrg
318937eb1ca1Smrg
3190dc9477beSmrg# _LT_CHECK_MAGIC_METHOD
3191dc9477beSmrg# ----------------------
3192dc9477beSmrg# how to check for library dependencies
3193dc9477beSmrg#  -- PORTME fill in with the dynamic library characteristics
3194dc9477beSmrgm4_defun([_LT_CHECK_MAGIC_METHOD],
3195dc9477beSmrg[m4_require([_LT_DECL_EGREP])
3196dc9477beSmrgm4_require([_LT_DECL_OBJDUMP])
3197dc9477beSmrgAC_CACHE_CHECK([how to recognize dependent libraries],
3198dc9477beSmrglt_cv_deplibs_check_method,
3199dc9477beSmrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
3200dc9477beSmrglt_cv_file_magic_test_file=
3201dc9477beSmrglt_cv_deplibs_check_method='unknown'
3202dc9477beSmrg# Need to set the preceding variable on all platforms that support
3203dc9477beSmrg# interlibrary dependencies.
3204dc9477beSmrg# 'none' -- dependencies not supported.
32050eb1301bSmrg# `unknown' -- same as none, but documents that we really don't know.
3206dc9477beSmrg# 'pass_all' -- all dependencies passed with no checks.
3207dc9477beSmrg# 'test_compile' -- check by making test program.
3208dc9477beSmrg# 'file_magic [[regex]]' -- check by looking for files in library path
32090eb1301bSmrg# which responds to the $file_magic_cmd with a given extended regex.
32100eb1301bSmrg# If you have `file' or equivalent on your system and you're not sure
32110eb1301bSmrg# whether `pass_all' will *always* work, you probably want this one.
321221e67964Smrg
3213dc9477beSmrgcase $host_os in
3214dc9477beSmrgaix[[4-9]]*)
3215dc9477beSmrg  lt_cv_deplibs_check_method=pass_all
3216dc9477beSmrg  ;;
3217c43cc173Smrg
3218dc9477beSmrgbeos*)
3219dc9477beSmrg  lt_cv_deplibs_check_method=pass_all
3220dc9477beSmrg  ;;
3221c43cc173Smrg
3222dc9477beSmrgbsdi[[45]]*)
3223dc9477beSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3224dc9477beSmrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
3225dc9477beSmrg  lt_cv_file_magic_test_file=/shlib/libc.so
322606c34b88Smrg  ;;
322706c34b88Smrg
3228dc9477beSmrgcygwin*)
3229dc9477beSmrg  # func_win32_libid is a shell function defined in ltmain.sh
3230dc9477beSmrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3231dc9477beSmrg  lt_cv_file_magic_cmd='func_win32_libid'
3232dc9477beSmrg  ;;
323306c34b88Smrg
3234dc9477beSmrgmingw* | pw32*)
3235dc9477beSmrg  # Base MSYS/MinGW do not provide the 'file' command needed by
3236dc9477beSmrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
3237dc9477beSmrg  # unless we find 'file', for example because we are cross-compiling.
32380eb1301bSmrg  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
32390eb1301bSmrg  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
3240dc9477beSmrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3241dc9477beSmrg    lt_cv_file_magic_cmd='func_win32_libid'
3242dc9477beSmrg  else
3243dc9477beSmrg    # Keep this pattern in sync with the one in func_win32_libid.
3244dc9477beSmrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
3245dc9477beSmrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
3246dc9477beSmrg  fi
324706c34b88Smrg  ;;
3248c43cc173Smrg
3249dc9477beSmrgcegcc*)
3250dc9477beSmrg  # use the weaker test based on 'objdump'. See mingw*.
3251dc9477beSmrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3252dc9477beSmrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
3253dc9477beSmrg  ;;
3254c43cc173Smrg
3255dc9477beSmrgdarwin* | rhapsody*)
3256dc9477beSmrg  lt_cv_deplibs_check_method=pass_all
3257dc9477beSmrg  ;;
3258c43cc173Smrg
3259dc9477beSmrgfreebsd* | dragonfly*)
3260dc9477beSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3261dc9477beSmrg    case $host_cpu in
3262dc9477beSmrg    i*86 )
3263dc9477beSmrg      # Not sure whether the presence of OpenBSD here was a mistake.
3264dc9477beSmrg      # Let's accept both of them until this is cleared up.
3265dc9477beSmrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3266dc9477beSmrg      lt_cv_file_magic_cmd=/usr/bin/file
3267dc9477beSmrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3268dc9477beSmrg      ;;
3269dc9477beSmrg    esac
327006c34b88Smrg  else
3271dc9477beSmrg    lt_cv_deplibs_check_method=pass_all
327206c34b88Smrg  fi
3273dc9477beSmrg  ;;
3274c43cc173Smrg
327506c34b88Smrghaiku*)
327606c34b88Smrg  lt_cv_deplibs_check_method=pass_all
327706c34b88Smrg  ;;
3278c43cc173Smrg
327906c34b88Smrghpux10.20* | hpux11*)
328006c34b88Smrg  lt_cv_file_magic_cmd=/usr/bin/file
328106c34b88Smrg  case $host_cpu in
328206c34b88Smrg  ia64*)
328306c34b88Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
328406c34b88Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
328506c34b88Smrg    ;;
328606c34b88Smrg  hppa*64*)
328706c34b88Smrg    [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]']
328806c34b88Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
328906c34b88Smrg    ;;
329006c34b88Smrg  *)
329106c34b88Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
329206c34b88Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
329306c34b88Smrg    ;;
329406c34b88Smrg  esac
329506c34b88Smrg  ;;
3296c43cc173Smrg
329706c34b88Smrginterix[[3-9]]*)
329806c34b88Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
329906c34b88Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
330006c34b88Smrg  ;;
3301c43cc173Smrg
330206c34b88Smrgirix5* | irix6* | nonstopux*)
330306c34b88Smrg  case $LD in
330406c34b88Smrg  *-32|*"-32 ") libmagic=32-bit;;
330506c34b88Smrg  *-n32|*"-n32 ") libmagic=N32;;
330606c34b88Smrg  *-64|*"-64 ") libmagic=64-bit;;
330706c34b88Smrg  *) libmagic=never-match;;
330806c34b88Smrg  esac
330906c34b88Smrg  lt_cv_deplibs_check_method=pass_all
331006c34b88Smrg  ;;
3311c43cc173Smrg
331206c34b88Smrg# This must be glibc/ELF.
331344584a44Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
331406c34b88Smrg  lt_cv_deplibs_check_method=pass_all
331506c34b88Smrg  ;;
3316c43cc173Smrg
33170eb1301bSmrgnetbsd* | netbsdelf*-gnu)
331806c34b88Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
331906c34b88Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
332006c34b88Smrg  else
332106c34b88Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
332206c34b88Smrg  fi
332306c34b88Smrg  ;;
3324c43cc173Smrg
332506c34b88Smrgnewos6*)
332606c34b88Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
332706c34b88Smrg  lt_cv_file_magic_cmd=/usr/bin/file
332806c34b88Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
332906c34b88Smrg  ;;
3330c27c18e8Smrg
333106c34b88Smrg*nto* | *qnx*)
333206c34b88Smrg  lt_cv_deplibs_check_method=pass_all
333306c34b88Smrg  ;;
3334c27c18e8Smrg
33350eb1301bSmrgopenbsd*)
33360eb1301bSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
333706c34b88Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
333806c34b88Smrg  else
333906c34b88Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
334006c34b88Smrg  fi
334106c34b88Smrg  ;;
334221e67964Smrg
334306c34b88Smrgosf3* | osf4* | osf5*)
334406c34b88Smrg  lt_cv_deplibs_check_method=pass_all
334506c34b88Smrg  ;;
3346c43cc173Smrg
334706c34b88Smrgrdos*)
334806c34b88Smrg  lt_cv_deplibs_check_method=pass_all
334906c34b88Smrg  ;;
3350c43cc173Smrg
335106c34b88Smrgsolaris*)
335206c34b88Smrg  lt_cv_deplibs_check_method=pass_all
335306c34b88Smrg  ;;
3354c43cc173Smrg
335506c34b88Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
335606c34b88Smrg  lt_cv_deplibs_check_method=pass_all
335706c34b88Smrg  ;;
3358c43cc173Smrg
335906c34b88Smrgsysv4 | sysv4.3*)
336006c34b88Smrg  case $host_vendor in
336106c34b88Smrg  motorola)
336206c34b88Smrg    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]]'
336306c34b88Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
336406c34b88Smrg    ;;
336506c34b88Smrg  ncr)
336606c34b88Smrg    lt_cv_deplibs_check_method=pass_all
336706c34b88Smrg    ;;
336806c34b88Smrg  sequent)
336906c34b88Smrg    lt_cv_file_magic_cmd='/bin/file'
337006c34b88Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
337106c34b88Smrg    ;;
337206c34b88Smrg  sni)
337306c34b88Smrg    lt_cv_file_magic_cmd='/bin/file'
337406c34b88Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
337506c34b88Smrg    lt_cv_file_magic_test_file=/lib/libc.so
337606c34b88Smrg    ;;
337706c34b88Smrg  siemens)
337806c34b88Smrg    lt_cv_deplibs_check_method=pass_all
337906c34b88Smrg    ;;
338006c34b88Smrg  pc)
338106c34b88Smrg    lt_cv_deplibs_check_method=pass_all
338206c34b88Smrg    ;;
338306c34b88Smrg  esac
338406c34b88Smrg  ;;
3385c43cc173Smrg
338606c34b88Smrgtpf*)
338706c34b88Smrg  lt_cv_deplibs_check_method=pass_all
338806c34b88Smrg  ;;
338906c34b88Smrgesac
339006c34b88Smrg])
3391c43cc173Smrg
339206c34b88Smrgfile_magic_glob=
339306c34b88Smrgwant_nocaseglob=no
339406c34b88Smrgif test "$build" = "$host"; then
339506c34b88Smrg  case $host_os in
339606c34b88Smrg  mingw* | pw32*)
339706c34b88Smrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
339806c34b88Smrg      want_nocaseglob=yes
339906c34b88Smrg    else
340006c34b88Smrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
340106c34b88Smrg    fi
340206c34b88Smrg    ;;
340306c34b88Smrg  esac
340406c34b88Smrgfi
3405c43cc173Smrg
340606c34b88Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
340706c34b88Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
340806c34b88Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
3409c43cc173Smrg
341006c34b88Smrg_LT_DECL([], [deplibs_check_method], [1],
341106c34b88Smrg    [Method to check whether dependent libraries are shared objects])
341206c34b88Smrg_LT_DECL([], [file_magic_cmd], [1],
341306c34b88Smrg    [Command to use when deplibs_check_method = "file_magic"])
341406c34b88Smrg_LT_DECL([], [file_magic_glob], [1],
341506c34b88Smrg    [How to find potential files when deplibs_check_method = "file_magic"])
341606c34b88Smrg_LT_DECL([], [want_nocaseglob], [1],
341706c34b88Smrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
341806c34b88Smrg])# _LT_CHECK_MAGIC_METHOD
341906c34b88Smrg
342006c34b88Smrg
342106c34b88Smrg# LT_PATH_NM
342206c34b88Smrg# ----------
342306c34b88Smrg# find the pathname to a BSD- or MS-compatible name lister
342406c34b88SmrgAC_DEFUN([LT_PATH_NM],
342506c34b88Smrg[AC_REQUIRE([AC_PROG_CC])dnl
342606c34b88SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
342706c34b88Smrg[if test -n "$NM"; then
342806c34b88Smrg  # Let the user override the test.
34290eb1301bSmrg  lt_cv_path_NM="$NM"
343006c34b88Smrgelse
34310eb1301bSmrg  lt_nm_to_check="${ac_tool_prefix}nm"
343206c34b88Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
343306c34b88Smrg    lt_nm_to_check="$lt_nm_to_check nm"
343406c34b88Smrg  fi
343506c34b88Smrg  for lt_tmp_nm in $lt_nm_to_check; do
34360eb1301bSmrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
343706c34b88Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
34380eb1301bSmrg      IFS="$lt_save_ifs"
343906c34b88Smrg      test -z "$ac_dir" && ac_dir=.
34400eb1301bSmrg      tmp_nm="$ac_dir/$lt_tmp_nm"
34410eb1301bSmrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
344206c34b88Smrg	# Check to see if the nm accepts a BSD-compat flag.
34430eb1301bSmrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
344406c34b88Smrg	#   nm: unknown option "B" ignored
344506c34b88Smrg	# Tru64's nm complains that /dev/null is an invalid object file
34460eb1301bSmrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
34470eb1301bSmrg	*/dev/null* | *'Invalid file or object type'*)
344806c34b88Smrg	  lt_cv_path_NM="$tmp_nm -B"
34490eb1301bSmrg	  break
3450c27c18e8Smrg	  ;;
3451c27c18e8Smrg	*)
345206c34b88Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
345306c34b88Smrg	  */dev/null*)
345406c34b88Smrg	    lt_cv_path_NM="$tmp_nm -p"
34550eb1301bSmrg	    break
345606c34b88Smrg	    ;;
345706c34b88Smrg	  *)
345806c34b88Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
345906c34b88Smrg	    continue # so that we can try to find one that supports BSD flags
346006c34b88Smrg	    ;;
346106c34b88Smrg	  esac
3462c27c18e8Smrg	  ;;
3463c27c18e8Smrg	esac
3464c27c18e8Smrg      fi
346506c34b88Smrg    done
34660eb1301bSmrg    IFS="$lt_save_ifs"
346706c34b88Smrg  done
346806c34b88Smrg  : ${lt_cv_path_NM=no}
346906c34b88Smrgfi])
34700eb1301bSmrgif test "$lt_cv_path_NM" != "no"; then
34710eb1301bSmrg  NM="$lt_cv_path_NM"
347206c34b88Smrgelse
347306c34b88Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
347406c34b88Smrg  if test -n "$DUMPBIN"; then :
347506c34b88Smrg    # Let the user override the test.
347606c34b88Smrg  else
347706c34b88Smrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
34780eb1301bSmrg    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
347906c34b88Smrg    *COFF*)
34800eb1301bSmrg      DUMPBIN="$DUMPBIN -symbols"
3481c27c18e8Smrg      ;;
348206c34b88Smrg    *)
348306c34b88Smrg      DUMPBIN=:
3484c27c18e8Smrg      ;;
348506c34b88Smrg    esac
348606c34b88Smrg  fi
348706c34b88Smrg  AC_SUBST([DUMPBIN])
34880eb1301bSmrg  if test "$DUMPBIN" != ":"; then
34890eb1301bSmrg    NM="$DUMPBIN"
349006c34b88Smrg  fi
349106c34b88Smrgfi
349206c34b88Smrgtest -z "$NM" && NM=nm
349306c34b88SmrgAC_SUBST([NM])
349406c34b88Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3495c43cc173Smrg
349606c34b88SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
349706c34b88Smrg  [lt_cv_nm_interface="BSD nm"
349806c34b88Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
349906c34b88Smrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
350006c34b88Smrg  (eval "$ac_compile" 2>conftest.err)
350106c34b88Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
350206c34b88Smrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
350306c34b88Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
350406c34b88Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
350506c34b88Smrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
350606c34b88Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
350706c34b88Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
350806c34b88Smrg    lt_cv_nm_interface="MS dumpbin"
350906c34b88Smrg  fi
351006c34b88Smrg  rm -f conftest*])
351106c34b88Smrg])# LT_PATH_NM
3512c43cc173Smrg
351306c34b88Smrg# Old names:
351406c34b88SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
351506c34b88SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
351606c34b88Smrgdnl aclocal-1.4 backwards compatibility:
351706c34b88Smrgdnl AC_DEFUN([AM_PROG_NM], [])
351806c34b88Smrgdnl AC_DEFUN([AC_PROG_NM], [])
3519c43cc173Smrg
352006c34b88Smrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
352106c34b88Smrg# --------------------------------
352206c34b88Smrg# how to determine the name of the shared library
352306c34b88Smrg# associated with a specific link library.
352406c34b88Smrg#  -- PORTME fill in with the dynamic library characteristics
352506c34b88Smrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
352606c34b88Smrg[m4_require([_LT_DECL_EGREP])
352706c34b88Smrgm4_require([_LT_DECL_OBJDUMP])
352806c34b88Smrgm4_require([_LT_DECL_DLLTOOL])
352906c34b88SmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
353006c34b88Smrglt_cv_sharedlib_from_linklib_cmd,
353106c34b88Smrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
3532c43cc173Smrg
353306c34b88Smrgcase $host_os in
353406c34b88Smrgcygwin* | mingw* | pw32* | cegcc*)
35350eb1301bSmrg  # two different shell functions defined in ltmain.sh
35360eb1301bSmrg  # decide which to use based on capabilities of $DLLTOOL
353706c34b88Smrg  case `$DLLTOOL --help 2>&1` in
353806c34b88Smrg  *--identify-strict*)
353906c34b88Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
354006c34b88Smrg    ;;
354106c34b88Smrg  *)
354206c34b88Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
354306c34b88Smrg    ;;
354406c34b88Smrg  esac
354506c34b88Smrg  ;;
354606c34b88Smrg*)
354706c34b88Smrg  # fallback: assume linklib IS sharedlib
35480eb1301bSmrg  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
354906c34b88Smrg  ;;
355006c34b88Smrgesac
355106c34b88Smrg])
355206c34b88Smrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
355306c34b88Smrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3554c43cc173Smrg
355506c34b88Smrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
355606c34b88Smrg    [Command to associate shared and link libraries])
355706c34b88Smrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3558c43cc173Smrg
3559c43cc173Smrg
356006c34b88Smrg# _LT_PATH_MANIFEST_TOOL
356106c34b88Smrg# ----------------------
356206c34b88Smrg# locate the manifest tool
356306c34b88Smrgm4_defun([_LT_PATH_MANIFEST_TOOL],
356406c34b88Smrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
356506c34b88Smrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
356606c34b88SmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
356706c34b88Smrg  [lt_cv_path_mainfest_tool=no
356806c34b88Smrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
356906c34b88Smrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
357006c34b88Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
357106c34b88Smrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
357206c34b88Smrg    lt_cv_path_mainfest_tool=yes
357306c34b88Smrg  fi
357406c34b88Smrg  rm -f conftest*])
35750eb1301bSmrgif test "x$lt_cv_path_mainfest_tool" != xyes; then
357606c34b88Smrg  MANIFEST_TOOL=:
357706c34b88Smrgfi
357806c34b88Smrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
357906c34b88Smrg])# _LT_PATH_MANIFEST_TOOL
3580c43cc173Smrg
3581c43cc173Smrg
358206c34b88Smrg# LT_LIB_M
358306c34b88Smrg# --------
358406c34b88Smrg# check for math library
358506c34b88SmrgAC_DEFUN([LT_LIB_M],
358606c34b88Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
358706c34b88SmrgLIBM=
358806c34b88Smrgcase $host in
358906c34b88Smrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
359006c34b88Smrg  # These system don't have libm, or don't need it
359106c34b88Smrg  ;;
359206c34b88Smrg*-ncr-sysv4.3*)
35930eb1301bSmrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
359406c34b88Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
359506c34b88Smrg  ;;
359606c34b88Smrg*)
35970eb1301bSmrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
359806c34b88Smrg  ;;
359906c34b88Smrgesac
360006c34b88SmrgAC_SUBST([LIBM])
360106c34b88Smrg])# LT_LIB_M
360206c34b88Smrg
360306c34b88Smrg# Old name:
360406c34b88SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
360506c34b88Smrgdnl aclocal-1.4 backwards compatibility:
360606c34b88Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
360706c34b88Smrg
360806c34b88Smrg
360906c34b88Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
361006c34b88Smrg# -------------------------------
361106c34b88Smrgm4_defun([_LT_COMPILER_NO_RTTI],
361206c34b88Smrg[m4_require([_LT_TAG_COMPILER])dnl
361306c34b88Smrg
361406c34b88Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
361506c34b88Smrg
36160eb1301bSmrgif test "$GCC" = yes; then
361706c34b88Smrg  case $cc_basename in
361806c34b88Smrg  nvcc*)
361906c34b88Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
362006c34b88Smrg  *)
362106c34b88Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
362206c34b88Smrg  esac
362306c34b88Smrg
362406c34b88Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
362506c34b88Smrg    lt_cv_prog_compiler_rtti_exceptions,
362606c34b88Smrg    [-fno-rtti -fno-exceptions], [],
362706c34b88Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
362806c34b88Smrgfi
362906c34b88Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
363006c34b88Smrg	[Compiler flag to turn off builtin functions])
363106c34b88Smrg])# _LT_COMPILER_NO_RTTI
3632c43cc173Smrg
3633c43cc173Smrg
363406c34b88Smrg# _LT_CMD_GLOBAL_SYMBOLS
363506c34b88Smrg# ----------------------
363606c34b88Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
363706c34b88Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
363806c34b88SmrgAC_REQUIRE([AC_PROG_CC])dnl
363906c34b88SmrgAC_REQUIRE([AC_PROG_AWK])dnl
364006c34b88SmrgAC_REQUIRE([LT_PATH_NM])dnl
364106c34b88SmrgAC_REQUIRE([LT_PATH_LD])dnl
364206c34b88Smrgm4_require([_LT_DECL_SED])dnl
364306c34b88Smrgm4_require([_LT_DECL_EGREP])dnl
364406c34b88Smrgm4_require([_LT_TAG_COMPILER])dnl
3645c43cc173Smrg
364606c34b88Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
364706c34b88SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
364806c34b88SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
364906c34b88Smrg[
365006c34b88Smrg# These are sane defaults that work on at least a few old systems.
365106c34b88Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3652c43cc173Smrg
365306c34b88Smrg# Character class describing NM global symbol codes.
365406c34b88Smrgsymcode='[[BCDEGRST]]'
3655c43cc173Smrg
365606c34b88Smrg# Regexp to match symbols that can be accessed directly from C.
365706c34b88Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
365837eb1ca1Smrg
365906c34b88Smrg# Define system-specific variables.
366006c34b88Smrgcase $host_os in
366106c34b88Smrgaix*)
366206c34b88Smrg  symcode='[[BCDT]]'
366306c34b88Smrg  ;;
366406c34b88Smrgcygwin* | mingw* | pw32* | cegcc*)
366506c34b88Smrg  symcode='[[ABCDGISTW]]'
366606c34b88Smrg  ;;
366706c34b88Smrghpux*)
36680eb1301bSmrg  if test "$host_cpu" = ia64; then
366906c34b88Smrg    symcode='[[ABCDEGRST]]'
3670c27c18e8Smrg  fi
3671c27c18e8Smrg  ;;
367206c34b88Smrgirix* | nonstopux*)
367306c34b88Smrg  symcode='[[BCDEGRST]]'
367406c34b88Smrg  ;;
367506c34b88Smrgosf*)
367606c34b88Smrg  symcode='[[BCDEGQRST]]'
367706c34b88Smrg  ;;
367806c34b88Smrgsolaris*)
367906c34b88Smrg  symcode='[[BDRT]]'
368006c34b88Smrg  ;;
368106c34b88Smrgsco3.2v5*)
368206c34b88Smrg  symcode='[[DT]]'
368306c34b88Smrg  ;;
368406c34b88Smrgsysv4.2uw2*)
368506c34b88Smrg  symcode='[[DT]]'
368606c34b88Smrg  ;;
368706c34b88Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
368806c34b88Smrg  symcode='[[ABDT]]'
368906c34b88Smrg  ;;
369006c34b88Smrgsysv4)
369106c34b88Smrg  symcode='[[DFNSTU]]'
369206c34b88Smrg  ;;
3693c27c18e8Smrgesac
3694c43cc173Smrg
369506c34b88Smrg# If we're using GNU nm, then use its standard symbol codes.
369606c34b88Smrgcase `$NM -V 2>&1` in
369706c34b88Smrg*GNU* | *'with BFD'*)
369806c34b88Smrg  symcode='[[ABCDGIRSTW]]' ;;
369906c34b88Smrgesac
3700c27c18e8Smrg
370106c34b88Smrg# Transform an extracted symbol line into a proper C declaration.
370206c34b88Smrg# Some systems (esp. on ia64) link data and code symbols differently,
370306c34b88Smrg# so use this general approach.
37040eb1301bSmrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3705c27c18e8Smrg
370606c34b88Smrg# Transform an extracted symbol line into symbol name and symbol address
37070eb1301bSmrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
37080eb1301bSmrglt_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'"
3709c43cc173Smrg
371006c34b88Smrg# Handle CRLF in mingw tool chain
371106c34b88Smrgopt_cr=
371206c34b88Smrgcase $build_os in
371306c34b88Smrgmingw*)
371406c34b88Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
371506c34b88Smrg  ;;
371606c34b88Smrgesac
371706c34b88Smrg
371806c34b88Smrg# Try without a prefix underscore, then with it.
371906c34b88Smrgfor ac_symprfx in "" "_"; do
372006c34b88Smrg
372106c34b88Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
372206c34b88Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
372306c34b88Smrg
372406c34b88Smrg  # Write the raw and C identifiers.
372506c34b88Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
37260eb1301bSmrg    # Fake it for dumpbin and say T for any non-static function
37270eb1301bSmrg    # and D for any global variable.
372806c34b88Smrg    # Also find C++ and __fastcall symbols from MSVC++,
372906c34b88Smrg    # which start with @ or ?.
373006c34b88Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
373106c34b88Smrg"     {last_section=section; section=\$ 3};"\
373206c34b88Smrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
373306c34b88Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
373406c34b88Smrg"     \$ 0!~/External *\|/{next};"\
373506c34b88Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
373606c34b88Smrg"     {if(hide[section]) next};"\
37370eb1301bSmrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
37380eb1301bSmrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
37390eb1301bSmrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
37400eb1301bSmrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
374106c34b88Smrg"     ' prfx=^$ac_symprfx]"
374206c34b88Smrg  else
374306c34b88Smrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
374406c34b88Smrg  fi
374506c34b88Smrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
3746c43cc173Smrg
374706c34b88Smrg  # Check to see that the pipe works correctly.
374806c34b88Smrg  pipe_works=no
3749c43cc173Smrg
375006c34b88Smrg  rm -f conftest*
375106c34b88Smrg  cat > conftest.$ac_ext <<_LT_EOF
375206c34b88Smrg#ifdef __cplusplus
375306c34b88Smrgextern "C" {
375406c34b88Smrg#endif
375506c34b88Smrgchar nm_test_var;
375606c34b88Smrgvoid nm_test_func(void);
375706c34b88Smrgvoid nm_test_func(void){}
375806c34b88Smrg#ifdef __cplusplus
375906c34b88Smrg}
376006c34b88Smrg#endif
376106c34b88Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
376206c34b88Smrg_LT_EOF
3763c43cc173Smrg
376406c34b88Smrg  if AC_TRY_EVAL(ac_compile); then
376506c34b88Smrg    # Now try to grab the symbols.
376606c34b88Smrg    nlist=conftest.nm
376706c34b88Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
376806c34b88Smrg      # Try sorting and uniquifying the output.
376906c34b88Smrg      if sort "$nlist" | uniq > "$nlist"T; then
377006c34b88Smrg	mv -f "$nlist"T "$nlist"
377106c34b88Smrg      else
377206c34b88Smrg	rm -f "$nlist"T
377306c34b88Smrg      fi
3774c43cc173Smrg
377506c34b88Smrg      # Make sure that we snagged all the symbols we need.
377606c34b88Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
377706c34b88Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
377806c34b88Smrg	  cat <<_LT_EOF > conftest.$ac_ext
377906c34b88Smrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
37800eb1301bSmrg#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
37810eb1301bSmrg/* DATA imports from DLLs on WIN32 con't be const, because runtime
378206c34b88Smrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
378306c34b88Smrg# define LT@&t@_DLSYM_CONST
37840eb1301bSmrg#elif defined(__osf__)
378506c34b88Smrg/* This system does not cope well with relocations in const data.  */
378606c34b88Smrg# define LT@&t@_DLSYM_CONST
378706c34b88Smrg#else
378806c34b88Smrg# define LT@&t@_DLSYM_CONST const
378906c34b88Smrg#endif
3790c43cc173Smrg
379106c34b88Smrg#ifdef __cplusplus
379206c34b88Smrgextern "C" {
379306c34b88Smrg#endif
3794c43cc173Smrg
379506c34b88Smrg_LT_EOF
379606c34b88Smrg	  # Now generate the symbol file.
379706c34b88Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
3798c27c18e8Smrg
379906c34b88Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
3800c27c18e8Smrg
380106c34b88Smrg/* The mapping between symbol names and symbols.  */
380206c34b88SmrgLT@&t@_DLSYM_CONST struct {
380306c34b88Smrg  const char *name;
380406c34b88Smrg  void       *address;
380506c34b88Smrg}
380606c34b88Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
380706c34b88Smrg{
380806c34b88Smrg  { "@PROGRAM@", (void *) 0 },
380906c34b88Smrg_LT_EOF
38100eb1301bSmrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
381106c34b88Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
381206c34b88Smrg  {0, (void *) 0}
381306c34b88Smrg};
3814c27c18e8Smrg
381506c34b88Smrg/* This works around a problem in FreeBSD linker */
381606c34b88Smrg#ifdef FREEBSD_WORKAROUND
381706c34b88Smrgstatic const void *lt_preloaded_setup() {
381806c34b88Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
381906c34b88Smrg}
382006c34b88Smrg#endif
3821c43cc173Smrg
382206c34b88Smrg#ifdef __cplusplus
382306c34b88Smrg}
382406c34b88Smrg#endif
382506c34b88Smrg_LT_EOF
382606c34b88Smrg	  # Now try linking the two files.
382706c34b88Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
382806c34b88Smrg	  lt_globsym_save_LIBS=$LIBS
382906c34b88Smrg	  lt_globsym_save_CFLAGS=$CFLAGS
38300eb1301bSmrg	  LIBS="conftstm.$ac_objext"
383106c34b88Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
38320eb1301bSmrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
383306c34b88Smrg	    pipe_works=yes
383406c34b88Smrg	  fi
383506c34b88Smrg	  LIBS=$lt_globsym_save_LIBS
383606c34b88Smrg	  CFLAGS=$lt_globsym_save_CFLAGS
383706c34b88Smrg	else
383806c34b88Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
383906c34b88Smrg	fi
384006c34b88Smrg      else
384106c34b88Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
384206c34b88Smrg      fi
384306c34b88Smrg    else
384406c34b88Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
3845c27c18e8Smrg    fi
384606c34b88Smrg  else
384706c34b88Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
384806c34b88Smrg    cat conftest.$ac_ext >&5
384906c34b88Smrg  fi
385006c34b88Smrg  rm -rf conftest* conftst*
3851c43cc173Smrg
385206c34b88Smrg  # Do not use the global_symbol_pipe unless it works.
38530eb1301bSmrg  if test "$pipe_works" = yes; then
385406c34b88Smrg    break
385506c34b88Smrg  else
385606c34b88Smrg    lt_cv_sys_global_symbol_pipe=
385706c34b88Smrg  fi
385806c34b88Smrgdone
385906c34b88Smrg])
386006c34b88Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
386106c34b88Smrg  lt_cv_sys_global_symbol_to_cdecl=
3862c27c18e8Smrgfi
386306c34b88Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
386406c34b88Smrg  AC_MSG_RESULT(failed)
386537eb1ca1Smrgelse
386606c34b88Smrg  AC_MSG_RESULT(ok)
386737eb1ca1Smrgfi
3868c27c18e8Smrg
386906c34b88Smrg# Response file support.
387006c34b88Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
387106c34b88Smrg  nm_file_list_spec='@'
387206c34b88Smrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
387306c34b88Smrg  nm_file_list_spec='@'
387406c34b88Smrgfi
3875c43cc173Smrg
387606c34b88Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
387706c34b88Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
387806c34b88Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
387906c34b88Smrg    [Transform the output of nm in a proper C declaration])
388006c34b88Smrg_LT_DECL([global_symbol_to_c_name_address],
388106c34b88Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
388206c34b88Smrg    [Transform the output of nm in a C name address pair])
388306c34b88Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
388406c34b88Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
388506c34b88Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
388606c34b88Smrg_LT_DECL([], [nm_file_list_spec], [1],
388706c34b88Smrg    [Specify filename containing input files for $NM])
388806c34b88Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
3889c43cc173Smrg
3890c27c18e8Smrg
389106c34b88Smrg# _LT_COMPILER_PIC([TAGNAME])
389206c34b88Smrg# ---------------------------
389306c34b88Smrgm4_defun([_LT_COMPILER_PIC],
389406c34b88Smrg[m4_require([_LT_TAG_COMPILER])dnl
389506c34b88Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
389606c34b88Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
389706c34b88Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
3898c27c18e8Smrg
389906c34b88Smrgm4_if([$1], [CXX], [
390006c34b88Smrg  # C++ specific cases for pic, static, wl, etc.
39010eb1301bSmrg  if test "$GXX" = yes; then
390206c34b88Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
390306c34b88Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3904c27c18e8Smrg
390506c34b88Smrg    case $host_os in
390606c34b88Smrg    aix*)
390706c34b88Smrg      # All AIX code is PIC.
39080eb1301bSmrg      if test "$host_cpu" = ia64; then
390906c34b88Smrg	# AIX 5 now supports IA64 processor
391006c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
391106c34b88Smrg      fi
391206c34b88Smrg      ;;
3913c27c18e8Smrg
391406c34b88Smrg    amigaos*)
391506c34b88Smrg      case $host_cpu in
391606c34b88Smrg      powerpc)
391706c34b88Smrg            # see comment about AmigaOS4 .so support
391806c34b88Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
391906c34b88Smrg        ;;
392006c34b88Smrg      m68k)
392106c34b88Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
39220eb1301bSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
39230eb1301bSmrg            # like `-m68040'.
392406c34b88Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
392506c34b88Smrg        ;;
392606c34b88Smrg      esac
392706c34b88Smrg      ;;
3928c27c18e8Smrg
392906c34b88Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
393006c34b88Smrg      # PIC is the default for these OSes.
393106c34b88Smrg      ;;
393206c34b88Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
393306c34b88Smrg      # This hack is so that the source file can tell whether it is being
393406c34b88Smrg      # built for inclusion in a dll (and should export symbols for example).
393506c34b88Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
393606c34b88Smrg      # (--disable-auto-import) libraries
393706c34b88Smrg      m4_if([$1], [GCJ], [],
393806c34b88Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
393906c34b88Smrg      ;;
394006c34b88Smrg    darwin* | rhapsody*)
394106c34b88Smrg      # PIC is the default on this platform
394206c34b88Smrg      # Common symbols not allowed in MH_DYLIB files
394306c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
394406c34b88Smrg      ;;
394506c34b88Smrg    *djgpp*)
394606c34b88Smrg      # DJGPP does not support shared libraries at all
394706c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
394806c34b88Smrg      ;;
394906c34b88Smrg    haiku*)
395006c34b88Smrg      # PIC is the default for Haiku.
395106c34b88Smrg      # The "-static" flag exists, but is broken.
395206c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
395306c34b88Smrg      ;;
395406c34b88Smrg    interix[[3-9]]*)
395506c34b88Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
395606c34b88Smrg      # Instead, we relocate shared libraries at runtime.
395706c34b88Smrg      ;;
395806c34b88Smrg    sysv4*MP*)
395906c34b88Smrg      if test -d /usr/nec; then
396006c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
396106c34b88Smrg      fi
396206c34b88Smrg      ;;
396306c34b88Smrg    hpux*)
396406c34b88Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
396506c34b88Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
396606c34b88Smrg      # sets the default TLS model and affects inlining.
396706c34b88Smrg      case $host_cpu in
396806c34b88Smrg      hppa*64*)
396906c34b88Smrg	;;
397006c34b88Smrg      *)
397106c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
397206c34b88Smrg	;;
397306c34b88Smrg      esac
397406c34b88Smrg      ;;
397506c34b88Smrg    *qnx* | *nto*)
397606c34b88Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
397706c34b88Smrg      # it will coredump.
397806c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
397906c34b88Smrg      ;;
398006c34b88Smrg    *)
398106c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
398206c34b88Smrg      ;;
398306c34b88Smrg    esac
3984c27c18e8Smrg  else
398506c34b88Smrg    case $host_os in
398606c34b88Smrg      aix[[4-9]]*)
398706c34b88Smrg	# All AIX code is PIC.
39880eb1301bSmrg	if test "$host_cpu" = ia64; then
398906c34b88Smrg	  # AIX 5 now supports IA64 processor
399006c34b88Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
399106c34b88Smrg	else
399206c34b88Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
399306c34b88Smrg	fi
399406c34b88Smrg	;;
399506c34b88Smrg      chorus*)
399606c34b88Smrg	case $cc_basename in
399706c34b88Smrg	cxch68*)
399806c34b88Smrg	  # Green Hills C++ Compiler
399906c34b88Smrg	  # _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"
400006c34b88Smrg	  ;;
400106c34b88Smrg	esac
400206c34b88Smrg	;;
400306c34b88Smrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
400406c34b88Smrg	# This hack is so that the source file can tell whether it is being
400506c34b88Smrg	# built for inclusion in a dll (and should export symbols for example).
400606c34b88Smrg	m4_if([$1], [GCJ], [],
400706c34b88Smrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
400806c34b88Smrg	;;
400906c34b88Smrg      dgux*)
401006c34b88Smrg	case $cc_basename in
401106c34b88Smrg	  ec++*)
401206c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
401306c34b88Smrg	    ;;
401406c34b88Smrg	  ghcx*)
401506c34b88Smrg	    # Green Hills C++ Compiler
401606c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
401706c34b88Smrg	    ;;
401806c34b88Smrg	  *)
401906c34b88Smrg	    ;;
402006c34b88Smrg	esac
402106c34b88Smrg	;;
402206c34b88Smrg      freebsd* | dragonfly*)
402306c34b88Smrg	# FreeBSD uses GNU C++
402406c34b88Smrg	;;
402506c34b88Smrg      hpux9* | hpux10* | hpux11*)
402606c34b88Smrg	case $cc_basename in
402706c34b88Smrg	  CC*)
402806c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40290eb1301bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
40300eb1301bSmrg	    if test "$host_cpu" != ia64; then
403106c34b88Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
403206c34b88Smrg	    fi
403306c34b88Smrg	    ;;
403406c34b88Smrg	  aCC*)
403506c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40360eb1301bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
403706c34b88Smrg	    case $host_cpu in
403806c34b88Smrg	    hppa*64*|ia64*)
403906c34b88Smrg	      # +Z the default
404006c34b88Smrg	      ;;
404106c34b88Smrg	    *)
404206c34b88Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
404306c34b88Smrg	      ;;
404406c34b88Smrg	    esac
404506c34b88Smrg	    ;;
404606c34b88Smrg	  *)
404706c34b88Smrg	    ;;
404806c34b88Smrg	esac
404906c34b88Smrg	;;
405006c34b88Smrg      interix*)
405106c34b88Smrg	# This is c89, which is MS Visual C++ (no shared libs)
405206c34b88Smrg	# Anyone wants to do a port?
405306c34b88Smrg	;;
405406c34b88Smrg      irix5* | irix6* | nonstopux*)
405506c34b88Smrg	case $cc_basename in
405606c34b88Smrg	  CC*)
405706c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
405806c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
405906c34b88Smrg	    # CC pic flag -KPIC is the default.
406006c34b88Smrg	    ;;
406106c34b88Smrg	  *)
406206c34b88Smrg	    ;;
406306c34b88Smrg	esac
406406c34b88Smrg	;;
406544584a44Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
406606c34b88Smrg	case $cc_basename in
406706c34b88Smrg	  KCC*)
406806c34b88Smrg	    # KAI C++ Compiler
406906c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
407006c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
407106c34b88Smrg	    ;;
407206c34b88Smrg	  ecpc* )
40730eb1301bSmrg	    # old Intel C++ for x86_64 which still supported -KPIC.
407406c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
407506c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
407606c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
407706c34b88Smrg	    ;;
407806c34b88Smrg	  icpc* )
407906c34b88Smrg	    # Intel C++, used to be incompatible with GCC.
408006c34b88Smrg	    # ICC 10 doesn't accept -KPIC any more.
408106c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
408206c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
408306c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
408406c34b88Smrg	    ;;
408506c34b88Smrg	  pgCC* | pgcpp*)
408606c34b88Smrg	    # Portland Group C++ compiler
408706c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
408806c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
408906c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
409006c34b88Smrg	    ;;
409106c34b88Smrg	  cxx*)
409206c34b88Smrg	    # Compaq C++
409306c34b88Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
409406c34b88Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
409506c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
409606c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
409706c34b88Smrg	    ;;
409806c34b88Smrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
409906c34b88Smrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
410006c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
410106c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
410206c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
410306c34b88Smrg	    ;;
410406c34b88Smrg	  *)
410506c34b88Smrg	    case `$CC -V 2>&1 | sed 5q` in
410606c34b88Smrg	    *Sun\ C*)
410706c34b88Smrg	      # Sun C++ 5.9
410806c34b88Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
410906c34b88Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
411006c34b88Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
411106c34b88Smrg	      ;;
411206c34b88Smrg	    esac
411306c34b88Smrg	    ;;
411406c34b88Smrg	esac
411506c34b88Smrg	;;
411606c34b88Smrg      lynxos*)
411706c34b88Smrg	;;
411806c34b88Smrg      m88k*)
411906c34b88Smrg	;;
412006c34b88Smrg      mvs*)
412106c34b88Smrg	case $cc_basename in
412206c34b88Smrg	  cxx*)
412306c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
412406c34b88Smrg	    ;;
412506c34b88Smrg	  *)
412606c34b88Smrg	    ;;
412706c34b88Smrg	esac
412806c34b88Smrg	;;
41290eb1301bSmrg      netbsd* | netbsdelf*-gnu)
413006c34b88Smrg	;;
413106c34b88Smrg      *qnx* | *nto*)
413206c34b88Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
413306c34b88Smrg        # it will coredump.
413406c34b88Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
413506c34b88Smrg        ;;
413606c34b88Smrg      osf3* | osf4* | osf5*)
413706c34b88Smrg	case $cc_basename in
413806c34b88Smrg	  KCC*)
413906c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
414006c34b88Smrg	    ;;
414106c34b88Smrg	  RCC*)
414206c34b88Smrg	    # Rational C++ 2.4.1
414306c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
414406c34b88Smrg	    ;;
414506c34b88Smrg	  cxx*)
414606c34b88Smrg	    # Digital/Compaq C++
414706c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
414806c34b88Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
414906c34b88Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
415006c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
415106c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
415206c34b88Smrg	    ;;
415306c34b88Smrg	  *)
415406c34b88Smrg	    ;;
415506c34b88Smrg	esac
415606c34b88Smrg	;;
415706c34b88Smrg      psos*)
415806c34b88Smrg	;;
415906c34b88Smrg      solaris*)
416006c34b88Smrg	case $cc_basename in
416106c34b88Smrg	  CC* | sunCC*)
416206c34b88Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
416306c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
416406c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
416506c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
416606c34b88Smrg	    ;;
416706c34b88Smrg	  gcx*)
416806c34b88Smrg	    # Green Hills C++ Compiler
416906c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
417006c34b88Smrg	    ;;
417106c34b88Smrg	  *)
417206c34b88Smrg	    ;;
417306c34b88Smrg	esac
417406c34b88Smrg	;;
417506c34b88Smrg      sunos4*)
417606c34b88Smrg	case $cc_basename in
417706c34b88Smrg	  CC*)
417806c34b88Smrg	    # Sun C++ 4.x
417906c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
418006c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
418106c34b88Smrg	    ;;
418206c34b88Smrg	  lcc*)
418306c34b88Smrg	    # Lucid
418406c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
418506c34b88Smrg	    ;;
418606c34b88Smrg	  *)
418706c34b88Smrg	    ;;
418806c34b88Smrg	esac
418906c34b88Smrg	;;
419006c34b88Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
419106c34b88Smrg	case $cc_basename in
419206c34b88Smrg	  CC*)
419306c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
419406c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
419506c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
419606c34b88Smrg	    ;;
419706c34b88Smrg	esac
419806c34b88Smrg	;;
419906c34b88Smrg      tandem*)
420006c34b88Smrg	case $cc_basename in
420106c34b88Smrg	  NCC*)
420206c34b88Smrg	    # NonStop-UX NCC 3.20
420306c34b88Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
420406c34b88Smrg	    ;;
420506c34b88Smrg	  *)
420606c34b88Smrg	    ;;
420706c34b88Smrg	esac
420806c34b88Smrg	;;
420906c34b88Smrg      vxworks*)
421006c34b88Smrg	;;
421106c34b88Smrg      *)
421206c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
421306c34b88Smrg	;;
421406c34b88Smrg    esac
4215c27c18e8Smrg  fi
421606c34b88Smrg],
421706c34b88Smrg[
42180eb1301bSmrg  if test "$GCC" = yes; then
421906c34b88Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
422006c34b88Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4221c43cc173Smrg
422206c34b88Smrg    case $host_os in
422306c34b88Smrg      aix*)
422406c34b88Smrg      # All AIX code is PIC.
42250eb1301bSmrg      if test "$host_cpu" = ia64; then
422606c34b88Smrg	# AIX 5 now supports IA64 processor
422706c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
422806c34b88Smrg      fi
422906c34b88Smrg      ;;
4230c43cc173Smrg
423106c34b88Smrg    amigaos*)
423206c34b88Smrg      case $host_cpu in
423306c34b88Smrg      powerpc)
423406c34b88Smrg            # see comment about AmigaOS4 .so support
423506c34b88Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
423606c34b88Smrg        ;;
423706c34b88Smrg      m68k)
423806c34b88Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
42390eb1301bSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
42400eb1301bSmrg            # like `-m68040'.
424106c34b88Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
424206c34b88Smrg        ;;
424306c34b88Smrg      esac
424406c34b88Smrg      ;;
4245c43cc173Smrg
424606c34b88Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
424706c34b88Smrg      # PIC is the default for these OSes.
424806c34b88Smrg      ;;
4249c27c18e8Smrg
425006c34b88Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
425106c34b88Smrg      # This hack is so that the source file can tell whether it is being
425206c34b88Smrg      # built for inclusion in a dll (and should export symbols for example).
425306c34b88Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
425406c34b88Smrg      # (--disable-auto-import) libraries
425506c34b88Smrg      m4_if([$1], [GCJ], [],
425606c34b88Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
425706c34b88Smrg      ;;
4258c43cc173Smrg
425906c34b88Smrg    darwin* | rhapsody*)
426006c34b88Smrg      # PIC is the default on this platform
426106c34b88Smrg      # Common symbols not allowed in MH_DYLIB files
426206c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
426306c34b88Smrg      ;;
4264c43cc173Smrg
426506c34b88Smrg    haiku*)
426606c34b88Smrg      # PIC is the default for Haiku.
426706c34b88Smrg      # The "-static" flag exists, but is broken.
426806c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
426906c34b88Smrg      ;;
4270c43cc173Smrg
427106c34b88Smrg    hpux*)
427206c34b88Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
427306c34b88Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
427406c34b88Smrg      # sets the default TLS model and affects inlining.
427506c34b88Smrg      case $host_cpu in
427606c34b88Smrg      hppa*64*)
427706c34b88Smrg	# +Z the default
427806c34b88Smrg	;;
427906c34b88Smrg      *)
428006c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
428106c34b88Smrg	;;
428206c34b88Smrg      esac
428306c34b88Smrg      ;;
4284c27c18e8Smrg
428506c34b88Smrg    interix[[3-9]]*)
428606c34b88Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
428706c34b88Smrg      # Instead, we relocate shared libraries at runtime.
428806c34b88Smrg      ;;
4289c43cc173Smrg
429006c34b88Smrg    msdosdjgpp*)
429106c34b88Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
429206c34b88Smrg      # on systems that don't support them.
429306c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
429406c34b88Smrg      enable_shared=no
429506c34b88Smrg      ;;
4296c43cc173Smrg
429706c34b88Smrg    *nto* | *qnx*)
429806c34b88Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
429906c34b88Smrg      # it will coredump.
430006c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
430106c34b88Smrg      ;;
4302c27c18e8Smrg
430306c34b88Smrg    sysv4*MP*)
430406c34b88Smrg      if test -d /usr/nec; then
430506c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
430606c34b88Smrg      fi
430706c34b88Smrg      ;;
4308c27c18e8Smrg
430906c34b88Smrg    *)
431006c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
431106c34b88Smrg      ;;
431206c34b88Smrg    esac
4313c43cc173Smrg
431406c34b88Smrg    case $cc_basename in
431506c34b88Smrg    nvcc*) # Cuda Compiler Driver 2.2
431606c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
431706c34b88Smrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
431806c34b88Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
431906c34b88Smrg      fi
432006c34b88Smrg      ;;
432106c34b88Smrg    esac
432206c34b88Smrg  else
432306c34b88Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
432406c34b88Smrg    case $host_os in
432506c34b88Smrg    aix*)
432606c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43270eb1301bSmrg      if test "$host_cpu" = ia64; then
432806c34b88Smrg	# AIX 5 now supports IA64 processor
432906c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
433006c34b88Smrg      else
433106c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
433206c34b88Smrg      fi
433306c34b88Smrg      ;;
4334c27c18e8Smrg
433506c34b88Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
433606c34b88Smrg      # This hack is so that the source file can tell whether it is being
433706c34b88Smrg      # built for inclusion in a dll (and should export symbols for example).
433806c34b88Smrg      m4_if([$1], [GCJ], [],
433906c34b88Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
434006c34b88Smrg      ;;
4341c43cc173Smrg
434206c34b88Smrg    hpux9* | hpux10* | hpux11*)
434306c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
434406c34b88Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
434506c34b88Smrg      # not for PA HP-UX.
434606c34b88Smrg      case $host_cpu in
434706c34b88Smrg      hppa*64*|ia64*)
434806c34b88Smrg	# +Z the default
434906c34b88Smrg	;;
435006c34b88Smrg      *)
435106c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4352c27c18e8Smrg	;;
435306c34b88Smrg      esac
435406c34b88Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
43550eb1301bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
435606c34b88Smrg      ;;
4357c43cc173Smrg
435806c34b88Smrg    irix5* | irix6* | nonstopux*)
435906c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
436006c34b88Smrg      # PIC (with -KPIC) is the default.
436106c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
436206c34b88Smrg      ;;
4363c43cc173Smrg
436444584a44Smrg    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
436506c34b88Smrg      case $cc_basename in
43660eb1301bSmrg      # old Intel for x86_64 which still supported -KPIC.
436706c34b88Smrg      ecc*)
436806c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
436906c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
437006c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
437106c34b88Smrg        ;;
437206c34b88Smrg      # icc used to be incompatible with GCC.
437306c34b88Smrg      # ICC 10 doesn't accept -KPIC any more.
437406c34b88Smrg      icc* | ifort*)
437506c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
437606c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
437706c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
437806c34b88Smrg        ;;
437906c34b88Smrg      # Lahey Fortran 8.1.
438006c34b88Smrg      lf95*)
438106c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
438206c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
438306c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
438406c34b88Smrg	;;
438506c34b88Smrg      nagfor*)
438606c34b88Smrg	# NAG Fortran compiler
438706c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
438806c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
438906c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
439006c34b88Smrg	;;
439106c34b88Smrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
439206c34b88Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
439306c34b88Smrg	# which looks to be a dead project)
439406c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
439506c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
439606c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
439706c34b88Smrg        ;;
439806c34b88Smrg      ccc*)
439906c34b88Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
440006c34b88Smrg        # All Alpha code is PIC.
440106c34b88Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
440206c34b88Smrg        ;;
440306c34b88Smrg      xl* | bgxl* | bgf* | mpixl*)
440406c34b88Smrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
440506c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
440606c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
440706c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
440806c34b88Smrg	;;
440906c34b88Smrg      *)
441006c34b88Smrg	case `$CC -V 2>&1 | sed 5q` in
441106c34b88Smrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
441206c34b88Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
441306c34b88Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
441406c34b88Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
441506c34b88Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
441606c34b88Smrg	  ;;
441706c34b88Smrg	*Sun\ F* | *Sun*Fortran*)
441806c34b88Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
441906c34b88Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
442006c34b88Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
442106c34b88Smrg	  ;;
442206c34b88Smrg	*Sun\ C*)
442306c34b88Smrg	  # Sun C 5.9
442406c34b88Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
442506c34b88Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
442606c34b88Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
442706c34b88Smrg	  ;;
442806c34b88Smrg        *Intel*\ [[CF]]*Compiler*)
442906c34b88Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
443006c34b88Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
443106c34b88Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4432b789ec8aSmrg	  ;;
443306c34b88Smrg	*Portland\ Group*)
443406c34b88Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
443506c34b88Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
443606c34b88Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4437b789ec8aSmrg	  ;;
4438b789ec8aSmrg	esac
4439b789ec8aSmrg	;;
444006c34b88Smrg      esac
444106c34b88Smrg      ;;
4442c43cc173Smrg
444306c34b88Smrg    newsos6)
444406c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
444506c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
444606c34b88Smrg      ;;
4447c27c18e8Smrg
444806c34b88Smrg    *nto* | *qnx*)
444906c34b88Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
445006c34b88Smrg      # it will coredump.
445106c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
445206c34b88Smrg      ;;
4453c43cc173Smrg
445406c34b88Smrg    osf3* | osf4* | osf5*)
445506c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
445606c34b88Smrg      # All OSF/1 code is PIC.
445706c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
445806c34b88Smrg      ;;
4459c43cc173Smrg
446006c34b88Smrg    rdos*)
446106c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
446206c34b88Smrg      ;;
4463c43cc173Smrg
446406c34b88Smrg    solaris*)
446506c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
446606c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
446706c34b88Smrg      case $cc_basename in
446806c34b88Smrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
446906c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
447006c34b88Smrg      *)
447106c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
447206c34b88Smrg      esac
447306c34b88Smrg      ;;
4474c43cc173Smrg
447506c34b88Smrg    sunos4*)
447606c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
447706c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
447806c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
447906c34b88Smrg      ;;
448037eb1ca1Smrg
448106c34b88Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
448206c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
448306c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
448406c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
448506c34b88Smrg      ;;
4486c27c18e8Smrg
448706c34b88Smrg    sysv4*MP*)
44880eb1301bSmrg      if test -d /usr/nec ;then
448906c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
449006c34b88Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
449106c34b88Smrg      fi
449206c34b88Smrg      ;;
4493c43cc173Smrg
449406c34b88Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
449506c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
449606c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
449706c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
449806c34b88Smrg      ;;
4499c27c18e8Smrg
450006c34b88Smrg    unicos*)
450106c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
450206c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
450306c34b88Smrg      ;;
4504c27c18e8Smrg
450506c34b88Smrg    uts4*)
450606c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
450706c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
450806c34b88Smrg      ;;
4509c43cc173Smrg
451006c34b88Smrg    *)
451106c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
451206c34b88Smrg      ;;
451306c34b88Smrg    esac
451406c34b88Smrg  fi
451506c34b88Smrg])
451606c34b88Smrgcase $host_os in
45170eb1301bSmrg  # For platforms which do not support PIC, -DPIC is meaningless:
451806c34b88Smrg  *djgpp*)
451906c34b88Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
452006c34b88Smrg    ;;
452106c34b88Smrg  *)
452206c34b88Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
452306c34b88Smrg    ;;
452406c34b88Smrgesac
4525c27c18e8Smrg
452606c34b88SmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
452706c34b88Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
452806c34b88Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
452906c34b88Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
4530c43cc173Smrg
453106c34b88Smrg#
453206c34b88Smrg# Check to make sure the PIC flag actually works.
453306c34b88Smrg#
453406c34b88Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
453506c34b88Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
453606c34b88Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
453706c34b88Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
453806c34b88Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
453906c34b88Smrg     "" | " "*) ;;
454006c34b88Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
454106c34b88Smrg     esac],
454206c34b88Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
454306c34b88Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
454406c34b88Smrgfi
454506c34b88Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
454606c34b88Smrg	[Additional compiler flags for building library objects])
4547c27c18e8Smrg
454806c34b88Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
454906c34b88Smrg	[How to pass a linker flag through the compiler])
455006c34b88Smrg#
455106c34b88Smrg# Check to make sure the static flag actually works.
455206c34b88Smrg#
455306c34b88Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
455406c34b88Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
455506c34b88Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
455606c34b88Smrg  $lt_tmp_static_flag,
455706c34b88Smrg  [],
455806c34b88Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
455906c34b88Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
456006c34b88Smrg	[Compiler flag to prevent dynamic linking])
456106c34b88Smrg])# _LT_COMPILER_PIC
4562c27c18e8Smrg
4563c27c18e8Smrg
456406c34b88Smrg# _LT_LINKER_SHLIBS([TAGNAME])
456506c34b88Smrg# ----------------------------
456606c34b88Smrg# See if the linker supports building shared libraries.
456706c34b88Smrgm4_defun([_LT_LINKER_SHLIBS],
456806c34b88Smrg[AC_REQUIRE([LT_PATH_LD])dnl
456906c34b88SmrgAC_REQUIRE([LT_PATH_NM])dnl
457006c34b88Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
457106c34b88Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
457206c34b88Smrgm4_require([_LT_DECL_EGREP])dnl
457306c34b88Smrgm4_require([_LT_DECL_SED])dnl
457406c34b88Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
457506c34b88Smrgm4_require([_LT_TAG_COMPILER])dnl
457606c34b88SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
457706c34b88Smrgm4_if([$1], [CXX], [
457806c34b88Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
457906c34b88Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
458006c34b88Smrg  case $host_os in
458106c34b88Smrg  aix[[4-9]]*)
458206c34b88Smrg    # If we're using GNU nm, then we don't want the "-C" option.
45830eb1301bSmrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
45840eb1301bSmrg    # Also, AIX nm treats weak defined symbols like other global defined
45850eb1301bSmrg    # symbols, whereas GNU nm marks them as "W".
458606c34b88Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
45870eb1301bSmrg      _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'
458806c34b88Smrg    else
45890eb1301bSmrg      _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'
459006c34b88Smrg    fi
459106c34b88Smrg    ;;
459206c34b88Smrg  pw32*)
45930eb1301bSmrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
459406c34b88Smrg    ;;
459506c34b88Smrg  cygwin* | mingw* | cegcc*)
459606c34b88Smrg    case $cc_basename in
459706c34b88Smrg    cl*)
459806c34b88Smrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
459906c34b88Smrg      ;;
460006c34b88Smrg    *)
460106c34b88Smrg      _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'
460206c34b88Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
460306c34b88Smrg      ;;
460406c34b88Smrg    esac
460506c34b88Smrg    ;;
46060eb1301bSmrg  linux* | k*bsd*-gnu | gnu*)
46070eb1301bSmrg    _LT_TAGVAR(link_all_deplibs, $1)=no
46080eb1301bSmrg    ;;
460906c34b88Smrg  *)
461006c34b88Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
461106c34b88Smrg    ;;
461206c34b88Smrg  esac
461306c34b88Smrg], [
461406c34b88Smrg  runpath_var=
461506c34b88Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
461606c34b88Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
461706c34b88Smrg  _LT_TAGVAR(archive_cmds, $1)=
461806c34b88Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
461906c34b88Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
462006c34b88Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
462106c34b88Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
462206c34b88Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
462306c34b88Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
462406c34b88Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
462506c34b88Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
462606c34b88Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
462706c34b88Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
462806c34b88Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
462906c34b88Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
463006c34b88Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
463106c34b88Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
463206c34b88Smrg  _LT_TAGVAR(module_cmds, $1)=
463306c34b88Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
463406c34b88Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
463506c34b88Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
463606c34b88Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
463706c34b88Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
463806c34b88Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
463906c34b88Smrg  # included in the symbol list
464006c34b88Smrg  _LT_TAGVAR(include_expsyms, $1)=
464106c34b88Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
46420eb1301bSmrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
46430eb1301bSmrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
46440eb1301bSmrg  # as well as any symbol that contains `d'.
464506c34b88Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
464606c34b88Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
464706c34b88Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
464806c34b88Smrg  # the symbol is explicitly referenced.  Since portable code cannot
464906c34b88Smrg  # rely on this symbol name, it's probably fine to never include it in
465006c34b88Smrg  # preloaded symbol tables.
465106c34b88Smrg  # Exclude shared library initialization/finalization symbols.
465206c34b88Smrgdnl Note also adjust exclude_expsyms for C++ above.
465306c34b88Smrg  extract_expsyms_cmds=
4654c43cc173Smrg
465506c34b88Smrg  case $host_os in
465606c34b88Smrg  cygwin* | mingw* | pw32* | cegcc*)
465706c34b88Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
465806c34b88Smrg    # When not using gcc, we currently assume that we are using
465906c34b88Smrg    # Microsoft Visual C++.
46600eb1301bSmrg    if test "$GCC" != yes; then
466106c34b88Smrg      with_gnu_ld=no
466206c34b88Smrg    fi
466306c34b88Smrg    ;;
466406c34b88Smrg  interix*)
466506c34b88Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
466606c34b88Smrg    with_gnu_ld=yes
466706c34b88Smrg    ;;
46680eb1301bSmrg  openbsd*)
466906c34b88Smrg    with_gnu_ld=no
467006c34b88Smrg    ;;
46710eb1301bSmrg  linux* | k*bsd*-gnu | gnu*)
46720eb1301bSmrg    _LT_TAGVAR(link_all_deplibs, $1)=no
46730eb1301bSmrg    ;;
467406c34b88Smrg  esac
4675c43cc173Smrg
467606c34b88Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
467721e67964Smrg
467806c34b88Smrg  # On some targets, GNU ld is compatible enough with the native linker
467906c34b88Smrg  # that we're better off using the native interface for both.
468006c34b88Smrg  lt_use_gnu_ld_interface=no
46810eb1301bSmrg  if test "$with_gnu_ld" = yes; then
468206c34b88Smrg    case $host_os in
468306c34b88Smrg      aix*)
468406c34b88Smrg	# The AIX port of GNU ld has always aspired to compatibility
468506c34b88Smrg	# with the native linker.  However, as the warning in the GNU ld
468606c34b88Smrg	# block says, versions before 2.19.5* couldn't really create working
468706c34b88Smrg	# shared libraries, regardless of the interface used.
468806c34b88Smrg	case `$LD -v 2>&1` in
468906c34b88Smrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
469006c34b88Smrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
469106c34b88Smrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
4692c27c18e8Smrg	  *)
469306c34b88Smrg	    lt_use_gnu_ld_interface=yes
4694c27c18e8Smrg	    ;;
4695c27c18e8Smrg	esac
4696c27c18e8Smrg	;;
469706c34b88Smrg      *)
469806c34b88Smrg	lt_use_gnu_ld_interface=yes
469906c34b88Smrg	;;
470006c34b88Smrg    esac
470106c34b88Smrg  fi
4702c43cc173Smrg
47030eb1301bSmrg  if test "$lt_use_gnu_ld_interface" = yes; then
470406c34b88Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
47050eb1301bSmrg    wlarc='${wl}'
470606c34b88Smrg
470706c34b88Smrg    # Set some defaults for GNU ld with shared library support. These
470806c34b88Smrg    # are reset later if shared libraries are not supported. Putting them
470906c34b88Smrg    # here allows them to be overridden if necessary.
471006c34b88Smrg    runpath_var=LD_RUN_PATH
47110eb1301bSmrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
47120eb1301bSmrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
471306c34b88Smrg    # ancient GNU ld didn't support --whole-archive et. al.
471406c34b88Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
47150eb1301bSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
471606c34b88Smrg    else
471706c34b88Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
471806c34b88Smrg    fi
471906c34b88Smrg    supports_anon_versioning=no
47200eb1301bSmrg    case `$LD -v 2>&1` in
472106c34b88Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
472206c34b88Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
472306c34b88Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
472406c34b88Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
472506c34b88Smrg      *\ 2.11.*) ;; # other 2.11 versions
472606c34b88Smrg      *) supports_anon_versioning=yes ;;
472706c34b88Smrg    esac
472806c34b88Smrg
472906c34b88Smrg    # See if GNU ld supports shared libraries.
473006c34b88Smrg    case $host_os in
473106c34b88Smrg    aix[[3-9]]*)
473206c34b88Smrg      # On AIX/PPC, the GNU linker is very broken
47330eb1301bSmrg      if test "$host_cpu" != ia64; then
4734c27c18e8Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
473506c34b88Smrg	cat <<_LT_EOF 1>&2
4736c43cc173Smrg
473706c34b88Smrg*** Warning: the GNU linker, at least up to release 2.19, is reported
473806c34b88Smrg*** to be unable to reliably create shared libraries on AIX.
473906c34b88Smrg*** Therefore, libtool is disabling shared libraries support.  If you
474006c34b88Smrg*** really care for shared libraries, you may want to install binutils
474106c34b88Smrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
474206c34b88Smrg*** You will then need to restart the configuration process.
4743c43cc173Smrg
474406c34b88Smrg_LT_EOF
474506c34b88Smrg      fi
474606c34b88Smrg      ;;
4747c43cc173Smrg
474806c34b88Smrg    amigaos*)
474906c34b88Smrg      case $host_cpu in
475006c34b88Smrg      powerpc)
475106c34b88Smrg            # see comment about AmigaOS4 .so support
47520eb1301bSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
475306c34b88Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
475406c34b88Smrg        ;;
475506c34b88Smrg      m68k)
475606c34b88Smrg            _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)'
475706c34b88Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
475806c34b88Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
475906c34b88Smrg        ;;
476006c34b88Smrg      esac
476106c34b88Smrg      ;;
4762c43cc173Smrg
476306c34b88Smrg    beos*)
476406c34b88Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
476506c34b88Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
476606c34b88Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
476706c34b88Smrg	# support --undefined.  This deserves some investigation.  FIXME
47680eb1301bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
476906c34b88Smrg      else
477006c34b88Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
477106c34b88Smrg      fi
477206c34b88Smrg      ;;
477306c34b88Smrg
477406c34b88Smrg    cygwin* | mingw* | pw32* | cegcc*)
477506c34b88Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
477606c34b88Smrg      # as there is no search path for DLLs.
477706c34b88Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
47780eb1301bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
477906c34b88Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
478006c34b88Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
478106c34b88Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
478206c34b88Smrg      _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'
478306c34b88Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
478406c34b88Smrg
478506c34b88Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
47860eb1301bSmrg        _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'
47870eb1301bSmrg	# If the export-symbols file already is a .def file (1st line
47880eb1301bSmrg	# is EXPORTS), use it as is; otherwise, prepend...
47890eb1301bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
47900eb1301bSmrg	  cp $export_symbols $output_objdir/$soname.def;
47910eb1301bSmrg	else
47920eb1301bSmrg	  echo EXPORTS > $output_objdir/$soname.def;
47930eb1301bSmrg	  cat $export_symbols >> $output_objdir/$soname.def;
47940eb1301bSmrg	fi~
47950eb1301bSmrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
479606c34b88Smrg      else
479706c34b88Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
479806c34b88Smrg      fi
479906c34b88Smrg      ;;
480006c34b88Smrg
480106c34b88Smrg    haiku*)
48020eb1301bSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
480306c34b88Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
480406c34b88Smrg      ;;
480506c34b88Smrg
480606c34b88Smrg    interix[[3-9]]*)
480706c34b88Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
480806c34b88Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
48090eb1301bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
48100eb1301bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
481106c34b88Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
481206c34b88Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
481306c34b88Smrg      # default) and relocated if they conflict, which is a slow very memory
481406c34b88Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
481506c34b88Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
481606c34b88Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
48170eb1301bSmrg      _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'
48180eb1301bSmrg      _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'
481906c34b88Smrg      ;;
482006c34b88Smrg
482106c34b88Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
482206c34b88Smrg      tmp_diet=no
48230eb1301bSmrg      if test "$host_os" = linux-dietlibc; then
482406c34b88Smrg	case $cc_basename in
482506c34b88Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
482606c34b88Smrg	esac
482706c34b88Smrg      fi
482806c34b88Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
48290eb1301bSmrg	 && test "$tmp_diet" = no
483006c34b88Smrg      then
483106c34b88Smrg	tmp_addflag=' $pic_flag'
483206c34b88Smrg	tmp_sharedflag='-shared'
483306c34b88Smrg	case $cc_basename,$host_cpu in
483406c34b88Smrg        pgcc*)				# Portland Group C compiler
48350eb1301bSmrg	  _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'
483606c34b88Smrg	  tmp_addflag=' $pic_flag'
483706c34b88Smrg	  ;;
483806c34b88Smrg	pgf77* | pgf90* | pgf95* | pgfortran*)
483906c34b88Smrg					# Portland Group f77 and f90 compilers
48400eb1301bSmrg	  _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'
484106c34b88Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
484206c34b88Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
484306c34b88Smrg	  tmp_addflag=' -i_dynamic' ;;
484406c34b88Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
484506c34b88Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
484606c34b88Smrg	ifc* | ifort*)			# Intel Fortran compiler
484706c34b88Smrg	  tmp_addflag=' -nofor_main' ;;
484806c34b88Smrg	lf95*)				# Lahey Fortran 8.1
484906c34b88Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
485006c34b88Smrg	  tmp_sharedflag='--shared' ;;
485106c34b88Smrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
485206c34b88Smrg	  tmp_sharedflag='-qmkshrobj'
485306c34b88Smrg	  tmp_addflag= ;;
485406c34b88Smrg	nvcc*)	# Cuda Compiler Driver 2.2
48550eb1301bSmrg	  _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'
485606c34b88Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
485706c34b88Smrg	  ;;
485806c34b88Smrg	esac
485906c34b88Smrg	case `$CC -V 2>&1 | sed 5q` in
486006c34b88Smrg	*Sun\ C*)			# Sun C 5.9
48610eb1301bSmrg	  _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'
486206c34b88Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
486306c34b88Smrg	  tmp_sharedflag='-G' ;;
486406c34b88Smrg	*Sun\ F*)			# Sun Fortran 8.3
486506c34b88Smrg	  tmp_sharedflag='-G' ;;
486606c34b88Smrg	esac
48670eb1301bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4868c43cc173Smrg
48690eb1301bSmrg        if test "x$supports_anon_versioning" = xyes; then
487006c34b88Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
48710eb1301bSmrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
48720eb1301bSmrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
48730eb1301bSmrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
487406c34b88Smrg        fi
4875c43cc173Smrg
487606c34b88Smrg	case $cc_basename in
487706c34b88Smrg	xlf* | bgf* | bgxlf* | mpixlf*)
487806c34b88Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
487906c34b88Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
48800eb1301bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
488106c34b88Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
48820eb1301bSmrg	  if test "x$supports_anon_versioning" = xyes; then
488306c34b88Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
48840eb1301bSmrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
48850eb1301bSmrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
48860eb1301bSmrg	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
4887c27c18e8Smrg	  fi
488806c34b88Smrg	  ;;
488906c34b88Smrg	esac
489006c34b88Smrg      else
489106c34b88Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
489206c34b88Smrg      fi
489306c34b88Smrg      ;;
4894c27c18e8Smrg
48950eb1301bSmrg    netbsd* | netbsdelf*-gnu)
489606c34b88Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
489706c34b88Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
489806c34b88Smrg	wlarc=
489906c34b88Smrg      else
49000eb1301bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
49010eb1301bSmrg	_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'
490206c34b88Smrg      fi
490306c34b88Smrg      ;;
4904c27c18e8Smrg
490506c34b88Smrg    solaris*)
490606c34b88Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
490706c34b88Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
490806c34b88Smrg	cat <<_LT_EOF 1>&2
4909c27c18e8Smrg
491006c34b88Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
491106c34b88Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
491206c34b88Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
491306c34b88Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
491406c34b88Smrg*** your PATH or compiler configuration so that the native linker is
491506c34b88Smrg*** used, and then restart.
4916c43cc173Smrg
491706c34b88Smrg_LT_EOF
491806c34b88Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
49190eb1301bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
49200eb1301bSmrg	_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'
492106c34b88Smrg      else
492206c34b88Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
492306c34b88Smrg      fi
492406c34b88Smrg      ;;
4925c43cc173Smrg
492606c34b88Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
492706c34b88Smrg      case `$LD -v 2>&1` in
492806c34b88Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
492906c34b88Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
493006c34b88Smrg	cat <<_LT_EOF 1>&2
4931c27c18e8Smrg
49320eb1301bSmrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
493306c34b88Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
493406c34b88Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
493506c34b88Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
493606c34b88Smrg*** your PATH or compiler configuration so that the native linker is
493706c34b88Smrg*** used, and then restart.
4938c27c18e8Smrg
493906c34b88Smrg_LT_EOF
494006c34b88Smrg	;;
494106c34b88Smrg	*)
494206c34b88Smrg	  # For security reasons, it is highly recommended that you always
494306c34b88Smrg	  # use absolute paths for naming shared libraries, and exclude the
494406c34b88Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
494506c34b88Smrg	  # requires that you compile everything twice, which is a pain.
494606c34b88Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
49470eb1301bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
49480eb1301bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
49490eb1301bSmrg	    _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'
495006c34b88Smrg	  else
495106c34b88Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
495206c34b88Smrg	  fi
495306c34b88Smrg	;;
495406c34b88Smrg      esac
495506c34b88Smrg      ;;
4956c27c18e8Smrg
495706c34b88Smrg    sunos4*)
495806c34b88Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
495906c34b88Smrg      wlarc=
496006c34b88Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
496106c34b88Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
496206c34b88Smrg      ;;
4963c43cc173Smrg
496406c34b88Smrg    *)
496506c34b88Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
49660eb1301bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
49670eb1301bSmrg	_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'
496806c34b88Smrg      else
496906c34b88Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
497006c34b88Smrg      fi
497106c34b88Smrg      ;;
497206c34b88Smrg    esac
4973c43cc173Smrg
49740eb1301bSmrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
497506c34b88Smrg      runpath_var=
497606c34b88Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
497706c34b88Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
497806c34b88Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
497906c34b88Smrg    fi
498006c34b88Smrg  else
498106c34b88Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
498206c34b88Smrg    case $host_os in
498306c34b88Smrg    aix3*)
498406c34b88Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
498506c34b88Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
498606c34b88Smrg      _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'
498706c34b88Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
498806c34b88Smrg      # are no directories specified by -L.
498906c34b88Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
49900eb1301bSmrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
499106c34b88Smrg	# Neither direct hardcoding nor static linking is supported with a
499206c34b88Smrg	# broken collect2.
499306c34b88Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
499406c34b88Smrg      fi
499506c34b88Smrg      ;;
4996c43cc173Smrg
499706c34b88Smrg    aix[[4-9]]*)
49980eb1301bSmrg      if test "$host_cpu" = ia64; then
499906c34b88Smrg	# On IA64, the linker does run time linking by default, so we don't
500006c34b88Smrg	# have to do anything special.
500106c34b88Smrg	aix_use_runtimelinking=no
500206c34b88Smrg	exp_sym_flag='-Bexport'
50030eb1301bSmrg	no_entry_flag=""
500406c34b88Smrg      else
500506c34b88Smrg	# If we're using GNU nm, then we don't want the "-C" option.
50060eb1301bSmrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
50070eb1301bSmrg	# Also, AIX nm treats weak defined symbols like other global
50080eb1301bSmrg	# defined symbols, whereas GNU nm marks them as "W".
500906c34b88Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
50100eb1301bSmrg	  _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'
501106c34b88Smrg	else
50120eb1301bSmrg	  _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'
501306c34b88Smrg	fi
501406c34b88Smrg	aix_use_runtimelinking=no
5015c27c18e8Smrg
501606c34b88Smrg	# Test if we are trying to use run time linking or normal
501706c34b88Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
50180eb1301bSmrg	# need to do runtime linking.
501906c34b88Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
502006c34b88Smrg	  for ld_flag in $LDFLAGS; do
50210eb1301bSmrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
502206c34b88Smrg	    aix_use_runtimelinking=yes
502306c34b88Smrg	    break
502406c34b88Smrg	  fi
502506c34b88Smrg	  done
502606c34b88Smrg	  ;;
502706c34b88Smrg	esac
5028c43cc173Smrg
502906c34b88Smrg	exp_sym_flag='-bexport'
503006c34b88Smrg	no_entry_flag='-bnoentry'
503106c34b88Smrg      fi
5032c43cc173Smrg
503306c34b88Smrg      # When large executables or shared objects are built, AIX ld can
503406c34b88Smrg      # have problems creating the table of contents.  If linking a library
503506c34b88Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
503606c34b88Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
503706c34b88Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5038c43cc173Smrg
503906c34b88Smrg      _LT_TAGVAR(archive_cmds, $1)=''
504006c34b88Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
504106c34b88Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
504206c34b88Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
504306c34b88Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
50440eb1301bSmrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
5045c27c18e8Smrg
50460eb1301bSmrg      if test "$GCC" = yes; then
504706c34b88Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
504806c34b88Smrg	# We only want to do this on AIX 4.2 and lower, the check
504906c34b88Smrg	# below for broken collect2 doesn't work under 4.3+
50500eb1301bSmrg	  collect2name=`${CC} -print-prog-name=collect2`
505106c34b88Smrg	  if test -f "$collect2name" &&
505206c34b88Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
505306c34b88Smrg	  then
505406c34b88Smrg	  # We have reworked collect2
505506c34b88Smrg	  :
505606c34b88Smrg	  else
505706c34b88Smrg	  # We have old collect2
505806c34b88Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
505906c34b88Smrg	  # It fails to find uninstalled libraries when the uninstalled
506006c34b88Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
506106c34b88Smrg	  # to unsupported forces relinking
506206c34b88Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
506306c34b88Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
506406c34b88Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
506506c34b88Smrg	  fi
506606c34b88Smrg	  ;;
506706c34b88Smrg	esac
506806c34b88Smrg	shared_flag='-shared'
50690eb1301bSmrg	if test "$aix_use_runtimelinking" = yes; then
50700eb1301bSmrg	  shared_flag="$shared_flag "'${wl}-G'
507106c34b88Smrg	fi
50720eb1301bSmrg	_LT_TAGVAR(link_all_deplibs, $1)=no
507306c34b88Smrg      else
507406c34b88Smrg	# not using gcc
50750eb1301bSmrg	if test "$host_cpu" = ia64; then
507606c34b88Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
507706c34b88Smrg	# chokes on -Wl,-G. The following line is correct:
507806c34b88Smrg	  shared_flag='-G'
507906c34b88Smrg	else
50800eb1301bSmrg	  if test "$aix_use_runtimelinking" = yes; then
50810eb1301bSmrg	    shared_flag='${wl}-G'
508206c34b88Smrg	  else
50830eb1301bSmrg	    shared_flag='${wl}-bM:SRE'
508406c34b88Smrg	  fi
508506c34b88Smrg	fi
508606c34b88Smrg      fi
5087c27c18e8Smrg
50880eb1301bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
508906c34b88Smrg      # It seems that -bexpall does not export symbols beginning with
509006c34b88Smrg      # underscore (_), so it is better to generate a list of symbols to export.
509106c34b88Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
50920eb1301bSmrg      if test "$aix_use_runtimelinking" = yes; then
509306c34b88Smrg	# Warning - without using the other runtime loading flags (-brtl),
509406c34b88Smrg	# -berok will link without error, but may produce a broken library.
509506c34b88Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
509606c34b88Smrg        # Determine the default libpath from the value encoded in an
509706c34b88Smrg        # empty executable.
509806c34b88Smrg        _LT_SYS_MODULE_PATH_AIX([$1])
50990eb1301bSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
51000eb1301bSmrg        _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"
510106c34b88Smrg      else
51020eb1301bSmrg	if test "$host_cpu" = ia64; then
51030eb1301bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
510406c34b88Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
51050eb1301bSmrg	  _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"
510606c34b88Smrg	else
510706c34b88Smrg	 # Determine the default libpath from the value encoded in an
510806c34b88Smrg	 # empty executable.
510906c34b88Smrg	 _LT_SYS_MODULE_PATH_AIX([$1])
51100eb1301bSmrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
511106c34b88Smrg	  # Warning - without using the other run time loading flags,
511206c34b88Smrg	  # -berok will link without error, but may produce a broken library.
51130eb1301bSmrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
51140eb1301bSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
51150eb1301bSmrg	  if test "$with_gnu_ld" = yes; then
511606c34b88Smrg	    # We only use this code for GNU lds that support --whole-archive.
51170eb1301bSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
511806c34b88Smrg	  else
511906c34b88Smrg	    # Exported symbols can be pulled into shared objects from archives
512006c34b88Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
512106c34b88Smrg	  fi
512206c34b88Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
51230eb1301bSmrg	  # This is similar to how AIX traditionally builds its shared libraries.
51240eb1301bSmrg	  _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'
512506c34b88Smrg	fi
512606c34b88Smrg      fi
512706c34b88Smrg      ;;
5128c27c18e8Smrg
512906c34b88Smrg    amigaos*)
513006c34b88Smrg      case $host_cpu in
513106c34b88Smrg      powerpc)
513206c34b88Smrg            # see comment about AmigaOS4 .so support
51330eb1301bSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
513406c34b88Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
513506c34b88Smrg        ;;
513606c34b88Smrg      m68k)
513706c34b88Smrg            _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)'
513806c34b88Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
513906c34b88Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5140c27c18e8Smrg        ;;
514106c34b88Smrg      esac
514206c34b88Smrg      ;;
5143c43cc173Smrg
514406c34b88Smrg    bsdi[[45]]*)
514506c34b88Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
514606c34b88Smrg      ;;
5147c43cc173Smrg
514806c34b88Smrg    cygwin* | mingw* | pw32* | cegcc*)
514906c34b88Smrg      # When not using gcc, we currently assume that we are using
515006c34b88Smrg      # Microsoft Visual C++.
515106c34b88Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
515206c34b88Smrg      # no search path for DLLs.
5153c27c18e8Smrg      case $cc_basename in
515406c34b88Smrg      cl*)
515506c34b88Smrg	# Native MSVC
515606c34b88Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
515706c34b88Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
515806c34b88Smrg	_LT_TAGVAR(always_export_symbols, $1)=yes
515906c34b88Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
516006c34b88Smrg	# Tell ltmain to make .lib files, not .a files.
516106c34b88Smrg	libext=lib
516206c34b88Smrg	# Tell ltmain to make .dll files, not .so files.
51630eb1301bSmrg	shrext_cmds=".dll"
516406c34b88Smrg	# FIXME: Setting linknames here is a bad hack.
51650eb1301bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
51660eb1301bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
51670eb1301bSmrg	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
51680eb1301bSmrg	  else
51690eb1301bSmrg	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
51700eb1301bSmrg	  fi~
51710eb1301bSmrg	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
51720eb1301bSmrg	  linknames='
517306c34b88Smrg	# The linker will not automatically build a static lib if we build a DLL.
517406c34b88Smrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
517506c34b88Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
517606c34b88Smrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
517706c34b88Smrg	_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'
517806c34b88Smrg	# Don't use ranlib
517906c34b88Smrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
518006c34b88Smrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
51810eb1301bSmrg	  lt_tool_outputfile="@TOOL_OUTPUT@"~
51820eb1301bSmrg	  case $lt_outputfile in
51830eb1301bSmrg	    *.exe|*.EXE) ;;
51840eb1301bSmrg	    *)
51850eb1301bSmrg	      lt_outputfile="$lt_outputfile.exe"
51860eb1301bSmrg	      lt_tool_outputfile="$lt_tool_outputfile.exe"
51870eb1301bSmrg	      ;;
51880eb1301bSmrg	  esac~
51890eb1301bSmrg	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
51900eb1301bSmrg	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
51910eb1301bSmrg	    $RM "$lt_outputfile.manifest";
51920eb1301bSmrg	  fi'
519306c34b88Smrg	;;
519406c34b88Smrg      *)
519506c34b88Smrg	# Assume MSVC wrapper
519606c34b88Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
519706c34b88Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
519806c34b88Smrg	# Tell ltmain to make .lib files, not .a files.
519906c34b88Smrg	libext=lib
520006c34b88Smrg	# Tell ltmain to make .dll files, not .so files.
52010eb1301bSmrg	shrext_cmds=".dll"
520206c34b88Smrg	# FIXME: Setting linknames here is a bad hack.
520306c34b88Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
520406c34b88Smrg	# The linker will automatically build a .lib file if we build a DLL.
520506c34b88Smrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
520606c34b88Smrg	# FIXME: Should let the user specify the lib program.
520706c34b88Smrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
520806c34b88Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
520906c34b88Smrg	;;
5210c27c18e8Smrg      esac
5211c27c18e8Smrg      ;;
5212c43cc173Smrg
521306c34b88Smrg    darwin* | rhapsody*)
521406c34b88Smrg      _LT_DARWIN_LINKER_FEATURES($1)
5215c27c18e8Smrg      ;;
5216c43cc173Smrg
521706c34b88Smrg    dgux*)
521806c34b88Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
521906c34b88Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
522006c34b88Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
522106c34b88Smrg      ;;
5222c27c18e8Smrg
522306c34b88Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
522406c34b88Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
522506c34b88Smrg    # does not break anything, and helps significantly (at the cost of a little
522606c34b88Smrg    # extra space).
522706c34b88Smrg    freebsd2.2*)
522806c34b88Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
522906c34b88Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
523006c34b88Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
523106c34b88Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
523206c34b88Smrg      ;;
5233c27c18e8Smrg
523406c34b88Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
523506c34b88Smrg    freebsd2.*)
523606c34b88Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
523706c34b88Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
523806c34b88Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
523906c34b88Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
524006c34b88Smrg      ;;
5241c27c18e8Smrg
524206c34b88Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
524306c34b88Smrg    freebsd* | dragonfly*)
524406c34b88Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
524506c34b88Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
524606c34b88Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
524706c34b88Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
524806c34b88Smrg      ;;
5249c43cc173Smrg
525006c34b88Smrg    hpux9*)
52510eb1301bSmrg      if test "$GCC" = yes; then
52520eb1301bSmrg	_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'
525306c34b88Smrg      else
52540eb1301bSmrg	_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'
525506c34b88Smrg      fi
52560eb1301bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
525706c34b88Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
525806c34b88Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5259c43cc173Smrg
526006c34b88Smrg      # hardcode_minus_L: Not really in the search PATH,
526106c34b88Smrg      # but as the default location of the library.
526206c34b88Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
52630eb1301bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
526406c34b88Smrg      ;;
5265c43cc173Smrg
526606c34b88Smrg    hpux10*)
52670eb1301bSmrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
52680eb1301bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
526906c34b88Smrg      else
527006c34b88Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
527106c34b88Smrg      fi
52720eb1301bSmrg      if test "$with_gnu_ld" = no; then
52730eb1301bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
527406c34b88Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
527506c34b88Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
527606c34b88Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
52770eb1301bSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
527806c34b88Smrg	# hardcode_minus_L: Not really in the search PATH,
527906c34b88Smrg	# but as the default location of the library.
528006c34b88Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
528106c34b88Smrg      fi
528206c34b88Smrg      ;;
5283b789ec8aSmrg
528406c34b88Smrg    hpux11*)
52850eb1301bSmrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
528606c34b88Smrg	case $host_cpu in
528706c34b88Smrg	hppa*64*)
52880eb1301bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
528906c34b88Smrg	  ;;
529006c34b88Smrg	ia64*)
52910eb1301bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
529206c34b88Smrg	  ;;
529306c34b88Smrg	*)
52940eb1301bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
529506c34b88Smrg	  ;;
529606c34b88Smrg	esac
529706c34b88Smrg      else
529806c34b88Smrg	case $host_cpu in
529906c34b88Smrg	hppa*64*)
53000eb1301bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
530106c34b88Smrg	  ;;
530206c34b88Smrg	ia64*)
53030eb1301bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
530406c34b88Smrg	  ;;
530506c34b88Smrg	*)
530606c34b88Smrg	m4_if($1, [], [
530706c34b88Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
530806c34b88Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
530906c34b88Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
531006c34b88Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
53110eb1301bSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
531206c34b88Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
53130eb1301bSmrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
531406c34b88Smrg	  ;;
531506c34b88Smrg	esac
531606c34b88Smrg      fi
53170eb1301bSmrg      if test "$with_gnu_ld" = no; then
53180eb1301bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
531906c34b88Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5320c43cc173Smrg
532106c34b88Smrg	case $host_cpu in
532206c34b88Smrg	hppa*64*|ia64*)
532306c34b88Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
532406c34b88Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
532506c34b88Smrg	  ;;
532606c34b88Smrg	*)
532706c34b88Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
532806c34b88Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
53290eb1301bSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
533006c34b88Smrg
533106c34b88Smrg	  # hardcode_minus_L: Not really in the search PATH,
533206c34b88Smrg	  # but as the default location of the library.
533306c34b88Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
533406c34b88Smrg	  ;;
533506c34b88Smrg	esac
533606c34b88Smrg      fi
533706c34b88Smrg      ;;
533806c34b88Smrg
533906c34b88Smrg    irix5* | irix6* | nonstopux*)
53400eb1301bSmrg      if test "$GCC" = yes; then
53410eb1301bSmrg	_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'
534206c34b88Smrg	# Try to use the -exported_symbol ld option, if it does not
534306c34b88Smrg	# work, assume that -exports_file does not work either and
534406c34b88Smrg	# implicitly export all symbols.
534506c34b88Smrg	# This should be the same for all languages, so no per-tag cache variable.
534606c34b88Smrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
534706c34b88Smrg	  [lt_cv_irix_exported_symbol],
53480eb1301bSmrg	  [save_LDFLAGS="$LDFLAGS"
53490eb1301bSmrg	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
535006c34b88Smrg	   AC_LINK_IFELSE(
535106c34b88Smrg	     [AC_LANG_SOURCE(
535206c34b88Smrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
535306c34b88Smrg			      [C++], [[int foo (void) { return 0; }]],
535406c34b88Smrg			      [Fortran 77], [[
5355c27c18e8Smrg      subroutine foo
535606c34b88Smrg      end]],
535706c34b88Smrg			      [Fortran], [[
5358c27c18e8Smrg      subroutine foo
535906c34b88Smrg      end]])])],
536006c34b88Smrg	      [lt_cv_irix_exported_symbol=yes],
536106c34b88Smrg	      [lt_cv_irix_exported_symbol=no])
53620eb1301bSmrg           LDFLAGS="$save_LDFLAGS"])
53630eb1301bSmrg	if test "$lt_cv_irix_exported_symbol" = yes; then
53640eb1301bSmrg          _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'
536506c34b88Smrg	fi
536606c34b88Smrg      else
53670eb1301bSmrg	_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'
53680eb1301bSmrg	_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'
536906c34b88Smrg      fi
537006c34b88Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
53710eb1301bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
537206c34b88Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
537306c34b88Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
537406c34b88Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
537506c34b88Smrg      ;;
5376b789ec8aSmrg
53770eb1301bSmrg    netbsd* | netbsdelf*-gnu)
537806c34b88Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
537906c34b88Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
538006c34b88Smrg      else
538106c34b88Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
538206c34b88Smrg      fi
538306c34b88Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
538406c34b88Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
538506c34b88Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
538606c34b88Smrg      ;;
5387b789ec8aSmrg
538806c34b88Smrg    newsos6)
538906c34b88Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
539006c34b88Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
53910eb1301bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
539206c34b88Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
539306c34b88Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
539406c34b88Smrg      ;;
5395c43cc173Smrg
539606c34b88Smrg    *nto* | *qnx*)
539706c34b88Smrg      ;;
5398c43cc173Smrg
53990eb1301bSmrg    openbsd*)
540006c34b88Smrg      if test -f /usr/libexec/ld.so; then
540106c34b88Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
540206c34b88Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
540306c34b88Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
54040eb1301bSmrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
540506c34b88Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
54060eb1301bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
54070eb1301bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
54080eb1301bSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
540906c34b88Smrg	else
54100eb1301bSmrg	  case $host_os in
54110eb1301bSmrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
54120eb1301bSmrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
54130eb1301bSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
54140eb1301bSmrg	     ;;
54150eb1301bSmrg	   *)
54160eb1301bSmrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
54170eb1301bSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
54180eb1301bSmrg	     ;;
54190eb1301bSmrg	  esac
542006c34b88Smrg	fi
542106c34b88Smrg      else
542206c34b88Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
542306c34b88Smrg      fi
542406c34b88Smrg      ;;
5425c43cc173Smrg
542606c34b88Smrg    os2*)
542706c34b88Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
542806c34b88Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
542906c34b88Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
54300eb1301bSmrg      _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'
54310eb1301bSmrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
543206c34b88Smrg      ;;
5433c43cc173Smrg
543406c34b88Smrg    osf3*)
54350eb1301bSmrg      if test "$GCC" = yes; then
54360eb1301bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
54370eb1301bSmrg	_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'
543806c34b88Smrg      else
543906c34b88Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
54400eb1301bSmrg	_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'
544106c34b88Smrg      fi
544206c34b88Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
54430eb1301bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
544406c34b88Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
544506c34b88Smrg      ;;
5446c43cc173Smrg
544706c34b88Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
54480eb1301bSmrg      if test "$GCC" = yes; then
54490eb1301bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
54500eb1301bSmrg	_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'
54510eb1301bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
545206c34b88Smrg      else
545306c34b88Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
54540eb1301bSmrg	_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'
545506c34b88Smrg	_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~
54560eb1301bSmrg	$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'
545706c34b88Smrg
545806c34b88Smrg	# Both c and cxx compiler support -rpath directly
545906c34b88Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
546006c34b88Smrg      fi
546106c34b88Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
546206c34b88Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
546306c34b88Smrg      ;;
546406c34b88Smrg
546506c34b88Smrg    solaris*)
546606c34b88Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
54670eb1301bSmrg      if test "$GCC" = yes; then
54680eb1301bSmrg	wlarc='${wl}'
54690eb1301bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
547006c34b88Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
54710eb1301bSmrg	  $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'
547206c34b88Smrg      else
547306c34b88Smrg	case `$CC -V 2>&1` in
547406c34b88Smrg	*"Compilers 5.0"*)
547506c34b88Smrg	  wlarc=''
54760eb1301bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
547706c34b88Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
54780eb1301bSmrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
547906c34b88Smrg	  ;;
548006c34b88Smrg	*)
54810eb1301bSmrg	  wlarc='${wl}'
54820eb1301bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
548306c34b88Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
54840eb1301bSmrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
548506c34b88Smrg	  ;;
548606c34b88Smrg	esac
548706c34b88Smrg      fi
548806c34b88Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
548906c34b88Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
549006c34b88Smrg      case $host_os in
549106c34b88Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
549206c34b88Smrg      *)
549306c34b88Smrg	# The compiler driver will combine and reorder linker options,
54940eb1301bSmrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
549506c34b88Smrg	# but is careful enough not to reorder.
549606c34b88Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
54970eb1301bSmrg	if test "$GCC" = yes; then
54980eb1301bSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
549906c34b88Smrg	else
550006c34b88Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
550106c34b88Smrg	fi
550206c34b88Smrg	;;
550306c34b88Smrg      esac
550406c34b88Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
550506c34b88Smrg      ;;
5506c43cc173Smrg
550706c34b88Smrg    sunos4*)
55080eb1301bSmrg      if test "x$host_vendor" = xsequent; then
550906c34b88Smrg	# Use $CC to link under sequent, because it throws in some extra .o
551006c34b88Smrg	# files that make .init and .fini sections work.
55110eb1301bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
551206c34b88Smrg      else
551306c34b88Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
551406c34b88Smrg      fi
551506c34b88Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
551606c34b88Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
551706c34b88Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
551806c34b88Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
551906c34b88Smrg      ;;
5520c43cc173Smrg
552106c34b88Smrg    sysv4)
552206c34b88Smrg      case $host_vendor in
552306c34b88Smrg	sni)
552406c34b88Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
552506c34b88Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
552606c34b88Smrg	;;
552706c34b88Smrg	siemens)
552806c34b88Smrg	  ## LD is ld it makes a PLAMLIB
552906c34b88Smrg	  ## CC just makes a GrossModule.
553006c34b88Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
553106c34b88Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
553206c34b88Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
553306c34b88Smrg        ;;
553406c34b88Smrg	motorola)
553506c34b88Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
553606c34b88Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
553706c34b88Smrg	;;
553806c34b88Smrg      esac
553906c34b88Smrg      runpath_var='LD_RUN_PATH'
554006c34b88Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
554106c34b88Smrg      ;;
5542c43cc173Smrg
554306c34b88Smrg    sysv4.3*)
554406c34b88Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
554506c34b88Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
554606c34b88Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
554706c34b88Smrg      ;;
5548c43cc173Smrg
554906c34b88Smrg    sysv4*MP*)
555006c34b88Smrg      if test -d /usr/nec; then
555106c34b88Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
555206c34b88Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
555306c34b88Smrg	runpath_var=LD_RUN_PATH
555406c34b88Smrg	hardcode_runpath_var=yes
555506c34b88Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
555606c34b88Smrg      fi
555706c34b88Smrg      ;;
5558c43cc173Smrg
555906c34b88Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
55600eb1301bSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
556106c34b88Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
556206c34b88Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
556306c34b88Smrg      runpath_var='LD_RUN_PATH'
5564c43cc173Smrg
55650eb1301bSmrg      if test "$GCC" = yes; then
55660eb1301bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55670eb1301bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
556806c34b88Smrg      else
55690eb1301bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55700eb1301bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
557106c34b88Smrg      fi
557206c34b88Smrg      ;;
5573c43cc173Smrg
557406c34b88Smrg    sysv5* | sco3.2v5* | sco5v6*)
55750eb1301bSmrg      # Note: We can NOT use -z defs as we might desire, because we do not
557606c34b88Smrg      # link with -lc, and that would cause any symbols used from libc to
557706c34b88Smrg      # always be unresolved, which means just about no library would
557806c34b88Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
557906c34b88Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
558006c34b88Smrg      # as -z defs.
55810eb1301bSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
55820eb1301bSmrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
558306c34b88Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
558406c34b88Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55850eb1301bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
558606c34b88Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
558706c34b88Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
55880eb1301bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
558906c34b88Smrg      runpath_var='LD_RUN_PATH'
5590c43cc173Smrg
55910eb1301bSmrg      if test "$GCC" = yes; then
55920eb1301bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55930eb1301bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
559406c34b88Smrg      else
55950eb1301bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55960eb1301bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
559706c34b88Smrg      fi
5598c27c18e8Smrg      ;;
5599c43cc173Smrg
560006c34b88Smrg    uts4*)
560106c34b88Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
560206c34b88Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
560306c34b88Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
560406c34b88Smrg      ;;
5605c27c18e8Smrg
560606c34b88Smrg    *)
560706c34b88Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
5608c27c18e8Smrg      ;;
5609c27c18e8Smrg    esac
5610c43cc173Smrg
56110eb1301bSmrg    if test x$host_vendor = xsni; then
561206c34b88Smrg      case $host in
561306c34b88Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
56140eb1301bSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
561506c34b88Smrg	;;
561606c34b88Smrg      esac
5617c27c18e8Smrg    fi
561806c34b88Smrg  fi
5619c27c18e8Smrg])
562006c34b88SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
56210eb1301bSmrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
5622c43cc173Smrg
562306c34b88Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
562406c34b88Smrg
562506c34b88Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
562606c34b88Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
562706c34b88Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
562806c34b88Smrg    [The commands to extract the exported symbol list from a shared archive])
562906c34b88Smrg
563006c34b88Smrg#
563106c34b88Smrg# Do we need to explicitly link libc?
563206c34b88Smrg#
563306c34b88Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
563406c34b88Smrgx|xyes)
563506c34b88Smrg  # Assume -lc should be added
563606c34b88Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
563706c34b88Smrg
56380eb1301bSmrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
563906c34b88Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
564006c34b88Smrg    *'~'*)
564106c34b88Smrg      # FIXME: we may have to deal with multi-command sequences.
564206c34b88Smrg      ;;
564306c34b88Smrg    '$CC '*)
564406c34b88Smrg      # Test whether the compiler implicitly links with -lc since on some
564506c34b88Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
564606c34b88Smrg      # to ld, don't add -lc before -lgcc.
564706c34b88Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
564806c34b88Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
564906c34b88Smrg	[$RM conftest*
565006c34b88Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
565106c34b88Smrg
565206c34b88Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
565306c34b88Smrg	  soname=conftest
565406c34b88Smrg	  lib=conftest
565506c34b88Smrg	  libobjs=conftest.$ac_objext
565606c34b88Smrg	  deplibs=
565706c34b88Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
565806c34b88Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
565906c34b88Smrg	  compiler_flags=-v
566006c34b88Smrg	  linker_flags=-v
566106c34b88Smrg	  verstring=
566206c34b88Smrg	  output_objdir=.
566306c34b88Smrg	  libname=conftest
566406c34b88Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
566506c34b88Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
566606c34b88Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
566706c34b88Smrg	  then
566806c34b88Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
566906c34b88Smrg	  else
567006c34b88Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
567106c34b88Smrg	  fi
567206c34b88Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
567306c34b88Smrg	else
567406c34b88Smrg	  cat conftest.err 1>&5
567506c34b88Smrg	fi
567606c34b88Smrg	$RM conftest*
567706c34b88Smrg	])
567806c34b88Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
567906c34b88Smrg      ;;
568006c34b88Smrg    esac
568106c34b88Smrg  fi
568206c34b88Smrg  ;;
568306c34b88Smrgesac
5684c27c18e8Smrg
568506c34b88Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
568606c34b88Smrg    [Whether or not to add -lc for building shared libraries])
568706c34b88Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
568806c34b88Smrg    [enable_shared_with_static_runtimes], [0],
568906c34b88Smrg    [Whether or not to disallow shared libs when runtime libs are static])
569006c34b88Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
569106c34b88Smrg    [Compiler flag to allow reflexive dlopens])
569206c34b88Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
569306c34b88Smrg    [Compiler flag to generate shared objects directly from archives])
569406c34b88Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
569506c34b88Smrg    [Whether the compiler copes with passing no objects directly])
569606c34b88Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
569706c34b88Smrg    [Create an old-style archive from a shared archive])
569806c34b88Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
569906c34b88Smrg    [Create a temporary old-style archive to link instead of a shared archive])
570006c34b88Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
570106c34b88Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
570206c34b88Smrg_LT_TAGDECL([], [module_cmds], [2],
570306c34b88Smrg    [Commands used to build a loadable module if different from building
570406c34b88Smrg    a shared archive.])
570506c34b88Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
570606c34b88Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
570706c34b88Smrg    [Whether we are building with GNU ld or not])
570806c34b88Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
570906c34b88Smrg    [Flag that allows shared libraries with undefined symbols to be built])
571006c34b88Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
571106c34b88Smrg    [Flag that enforces no undefined symbols])
571206c34b88Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
571306c34b88Smrg    [Flag to hardcode $libdir into a binary during linking.
571406c34b88Smrg    This must work even if $libdir does not exist])
571506c34b88Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
571606c34b88Smrg    [Whether we need a single "-rpath" flag with a separated argument])
571706c34b88Smrg_LT_TAGDECL([], [hardcode_direct], [0],
57180eb1301bSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
571906c34b88Smrg    DIR into the resulting binary])
572006c34b88Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
57210eb1301bSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
572206c34b88Smrg    DIR into the resulting binary and the resulting library dependency is
57230eb1301bSmrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
572406c34b88Smrg    library is relocated])
572506c34b88Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
572606c34b88Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
572706c34b88Smrg    into the resulting binary])
572806c34b88Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
572906c34b88Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
573006c34b88Smrg    into the resulting binary])
573106c34b88Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
573206c34b88Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
573306c34b88Smrg    into the library and all subsequent libraries and executables linked
573406c34b88Smrg    against it])
573506c34b88Smrg_LT_TAGDECL([], [inherit_rpath], [0],
573606c34b88Smrg    [Set to yes if linker adds runtime paths of dependent libraries
573706c34b88Smrg    to runtime path list])
573806c34b88Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
573906c34b88Smrg    [Whether libtool must link a program against all its dependency libraries])
574006c34b88Smrg_LT_TAGDECL([], [always_export_symbols], [0],
574106c34b88Smrg    [Set to "yes" if exported symbols are required])
574206c34b88Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
574306c34b88Smrg    [The commands to list exported symbols])
574406c34b88Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
574506c34b88Smrg    [Symbols that should not be listed in the preloaded symbols])
574606c34b88Smrg_LT_TAGDECL([], [include_expsyms], [1],
574706c34b88Smrg    [Symbols that must always be exported])
574806c34b88Smrg_LT_TAGDECL([], [prelink_cmds], [2],
574906c34b88Smrg    [Commands necessary for linking programs (against libraries) with templates])
575006c34b88Smrg_LT_TAGDECL([], [postlink_cmds], [2],
575106c34b88Smrg    [Commands necessary for finishing linking programs])
575206c34b88Smrg_LT_TAGDECL([], [file_list_spec], [1],
575306c34b88Smrg    [Specify filename containing input files])
575406c34b88Smrgdnl FIXME: Not yet implemented
575506c34b88Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
575606c34b88Smrgdnl    [Compiler flag to generate thread safe objects])
575706c34b88Smrg])# _LT_LINKER_SHLIBS
5758c27c18e8Smrg
5759c43cc173Smrg
576006c34b88Smrg# _LT_LANG_C_CONFIG([TAG])
576106c34b88Smrg# ------------------------
576206c34b88Smrg# Ensure that the configuration variables for a C compiler are suitably
576306c34b88Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
57640eb1301bSmrg# the compiler configuration to `libtool'.
576506c34b88Smrgm4_defun([_LT_LANG_C_CONFIG],
576606c34b88Smrg[m4_require([_LT_DECL_EGREP])dnl
57670eb1301bSmrglt_save_CC="$CC"
576806c34b88SmrgAC_LANG_PUSH(C)
5769c43cc173Smrg
577006c34b88Smrg# Source file extension for C test sources.
577106c34b88Smrgac_ext=c
5772c43cc173Smrg
577306c34b88Smrg# Object file extension for compiled C test sources.
5774c27c18e8Smrgobjext=o
5775c27c18e8Smrg_LT_TAGVAR(objext, $1)=$objext
5776c27c18e8Smrg
577706c34b88Smrg# Code to be used in simple compile tests
577806c34b88Smrglt_simple_compile_test_code="int some_variable = 0;"
5779c43cc173Smrg
578006c34b88Smrg# Code to be used in simple link tests
578106c34b88Smrglt_simple_link_test_code='int main(){return(0);}'
5782c43cc173Smrg
578306c34b88Smrg_LT_TAG_COMPILER
578406c34b88Smrg# Save the default compiler, since it gets overwritten when the other
578506c34b88Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
578606c34b88Smrgcompiler_DEFAULT=$CC
5787c27c18e8Smrg
578806c34b88Smrg# save warnings/boilerplate of simple test code
578906c34b88Smrg_LT_COMPILER_BOILERPLATE
579006c34b88Smrg_LT_LINKER_BOILERPLATE
5791c27c18e8Smrg
579206c34b88Smrgif test -n "$compiler"; then
579306c34b88Smrg  _LT_COMPILER_NO_RTTI($1)
579406c34b88Smrg  _LT_COMPILER_PIC($1)
579506c34b88Smrg  _LT_COMPILER_C_O($1)
579606c34b88Smrg  _LT_COMPILER_FILE_LOCKS($1)
579706c34b88Smrg  _LT_LINKER_SHLIBS($1)
579806c34b88Smrg  _LT_SYS_DYNAMIC_LINKER($1)
579906c34b88Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
580006c34b88Smrg  LT_SYS_DLOPEN_SELF
580106c34b88Smrg  _LT_CMD_STRIPLIB
5802c27c18e8Smrg
58030eb1301bSmrg  # Report which library types will actually be built
580406c34b88Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
580506c34b88Smrg  AC_MSG_RESULT([$can_build_shared])
5806c27c18e8Smrg
580706c34b88Smrg  AC_MSG_CHECKING([whether to build shared libraries])
58080eb1301bSmrg  test "$can_build_shared" = "no" && enable_shared=no
5809c27c18e8Smrg
581006c34b88Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
581106c34b88Smrg  # are all built from PIC.
581206c34b88Smrg  case $host_os in
581306c34b88Smrg  aix3*)
58140eb1301bSmrg    test "$enable_shared" = yes && enable_static=no
581506c34b88Smrg    if test -n "$RANLIB"; then
581606c34b88Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
581706c34b88Smrg      postinstall_cmds='$RANLIB $lib'
581806c34b88Smrg    fi
581906c34b88Smrg    ;;
5820c43cc173Smrg
582106c34b88Smrg  aix[[4-9]]*)
58220eb1301bSmrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
58230eb1301bSmrg      test "$enable_shared" = yes && enable_static=no
582406c34b88Smrg    fi
582506c34b88Smrg    ;;
582606c34b88Smrg  esac
582706c34b88Smrg  AC_MSG_RESULT([$enable_shared])
5828c43cc173Smrg
582906c34b88Smrg  AC_MSG_CHECKING([whether to build static libraries])
583006c34b88Smrg  # Make sure either enable_shared or enable_static is yes.
58310eb1301bSmrg  test "$enable_shared" = yes || enable_static=yes
583206c34b88Smrg  AC_MSG_RESULT([$enable_static])
5833c43cc173Smrg
583406c34b88Smrg  _LT_CONFIG($1)
583506c34b88Smrgfi
583606c34b88SmrgAC_LANG_POP
58370eb1301bSmrgCC="$lt_save_CC"
583806c34b88Smrg])# _LT_LANG_C_CONFIG
583937eb1ca1Smrg
584006c34b88Smrg
584106c34b88Smrg# _LT_LANG_CXX_CONFIG([TAG])
584206c34b88Smrg# --------------------------
584306c34b88Smrg# Ensure that the configuration variables for a C++ compiler are suitably
584406c34b88Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
58450eb1301bSmrg# the compiler configuration to `libtool'.
584606c34b88Smrgm4_defun([_LT_LANG_CXX_CONFIG],
584706c34b88Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
584806c34b88Smrgm4_require([_LT_DECL_EGREP])dnl
584906c34b88Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
58500eb1301bSmrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
58510eb1301bSmrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
58520eb1301bSmrg    (test "X$CXX" != "Xg++"))) ; then
585306c34b88Smrg  AC_PROG_CXXCPP
585406c34b88Smrgelse
585506c34b88Smrg  _lt_caught_CXX_error=yes
585637eb1ca1Smrgfi
5857c27c18e8Smrg
585806c34b88SmrgAC_LANG_PUSH(C++)
5859c27c18e8Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
5860c27c18e8Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
5861c27c18e8Smrg_LT_TAGVAR(always_export_symbols, $1)=no
5862c27c18e8Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
586306c34b88Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
5864c27c18e8Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
5865c27c18e8Smrg_LT_TAGVAR(hardcode_direct, $1)=no
5866c27c18e8Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
5867c27c18e8Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5868c27c18e8Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
5869c27c18e8Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
587006c34b88Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5871c27c18e8Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
5872c27c18e8Smrg_LT_TAGVAR(inherit_rpath, $1)=no
5873c27c18e8Smrg_LT_TAGVAR(module_cmds, $1)=
5874c27c18e8Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
5875c27c18e8Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
5876c27c18e8Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
587737eb1ca1Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
587837eb1ca1Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
5879c27c18e8Smrg_LT_TAGVAR(no_undefined_flag, $1)=
5880c27c18e8Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
5881c27c18e8Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5882c27c18e8Smrg
588306c34b88Smrg# Source file extension for C++ test sources.
588406c34b88Smrgac_ext=cpp
5885c27c18e8Smrg
588606c34b88Smrg# Object file extension for compiled C++ test sources.
5887c27c18e8Smrgobjext=o
5888c27c18e8Smrg_LT_TAGVAR(objext, $1)=$objext
5889c27c18e8Smrg
5890c27c18e8Smrg# No sense in running all these tests if we already determined that
589106c34b88Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
5892c27c18e8Smrg# are currently assumed to apply to all compilers on this platform,
5893c27c18e8Smrg# and will be corrupted by setting them based on a non-working compiler.
58940eb1301bSmrgif test "$_lt_caught_CXX_error" != yes; then
5895c27c18e8Smrg  # Code to be used in simple compile tests
589606c34b88Smrg  lt_simple_compile_test_code="int some_variable = 0;"
5897c43cc173Smrg
5898c27c18e8Smrg  # Code to be used in simple link tests
589906c34b88Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
5900c43cc173Smrg
5901c27c18e8Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
5902c27c18e8Smrg  _LT_TAG_COMPILER
5903c43cc173Smrg
5904c27c18e8Smrg  # save warnings/boilerplate of simple test code
5905c27c18e8Smrg  _LT_COMPILER_BOILERPLATE
5906c27c18e8Smrg  _LT_LINKER_BOILERPLATE
5907c43cc173Smrg
5908c27c18e8Smrg  # Allow CC to be a program name with arguments.
590906c34b88Smrg  lt_save_CC=$CC
5910b789ec8aSmrg  lt_save_CFLAGS=$CFLAGS
591106c34b88Smrg  lt_save_LD=$LD
591206c34b88Smrg  lt_save_GCC=$GCC
591306c34b88Smrg  GCC=$GXX
591406c34b88Smrg  lt_save_with_gnu_ld=$with_gnu_ld
591506c34b88Smrg  lt_save_path_LD=$lt_cv_path_LD
591606c34b88Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
591706c34b88Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
591806c34b88Smrg  else
591906c34b88Smrg    $as_unset lt_cv_prog_gnu_ld
592006c34b88Smrg  fi
592106c34b88Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
592206c34b88Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
592306c34b88Smrg  else
592406c34b88Smrg    $as_unset lt_cv_path_LD
592506c34b88Smrg  fi
592606c34b88Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
592706c34b88Smrg  CC=${CXX-"c++"}
592806c34b88Smrg  CFLAGS=$CXXFLAGS
5929c27c18e8Smrg  compiler=$CC
5930c27c18e8Smrg  _LT_TAGVAR(compiler, $1)=$CC
5931c27c18e8Smrg  _LT_CC_BASENAME([$compiler])
5932c27c18e8Smrg
5933c27c18e8Smrg  if test -n "$compiler"; then
593406c34b88Smrg    # We don't want -fno-exception when compiling C++ code, so set the
593506c34b88Smrg    # no_builtin_flag separately
59360eb1301bSmrg    if test "$GXX" = yes; then
593706c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
593806c34b88Smrg    else
593906c34b88Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
594006c34b88Smrg    fi
5941c27c18e8Smrg
59420eb1301bSmrg    if test "$GXX" = yes; then
594306c34b88Smrg      # Set up default GNU C++ configuration
5944c27c18e8Smrg
594506c34b88Smrg      LT_PATH_LD
594606c34b88Smrg
594706c34b88Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
594806c34b88Smrg      # archiving commands below assume that GNU ld is being used.
59490eb1301bSmrg      if test "$with_gnu_ld" = yes; then
59500eb1301bSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
59510eb1301bSmrg        _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'
595206c34b88Smrg
59530eb1301bSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
59540eb1301bSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
595506c34b88Smrg
595606c34b88Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
595706c34b88Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
595806c34b88Smrg        #     investigate it a little bit more. (MM)
59590eb1301bSmrg        wlarc='${wl}'
596006c34b88Smrg
596106c34b88Smrg        # ancient GNU ld didn't support --whole-archive et. al.
596206c34b88Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
596306c34b88Smrg	  $GREP 'no-whole-archive' > /dev/null; then
59640eb1301bSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
596506c34b88Smrg        else
596606c34b88Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
596706c34b88Smrg        fi
596806c34b88Smrg      else
596906c34b88Smrg        with_gnu_ld=no
597006c34b88Smrg        wlarc=
597106c34b88Smrg
597206c34b88Smrg        # A generic and very simple default shared library creation
597306c34b88Smrg        # command for GNU C++ for the case where it uses the native
597406c34b88Smrg        # linker, instead of GNU ld.  If possible, this setting should
597506c34b88Smrg        # overridden to take advantage of the native linker features on
597606c34b88Smrg        # the platform it is being used on.
597706c34b88Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
597806c34b88Smrg      fi
597906c34b88Smrg
598006c34b88Smrg      # Commands to make compiler produce verbose output that lists
598106c34b88Smrg      # what "hidden" libraries, object files and flags are used when
598206c34b88Smrg      # linking a shared library.
598306c34b88Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
598406c34b88Smrg
598506c34b88Smrg    else
598606c34b88Smrg      GXX=no
598706c34b88Smrg      with_gnu_ld=no
598806c34b88Smrg      wlarc=
598906c34b88Smrg    fi
599006c34b88Smrg
599106c34b88Smrg    # PORTME: fill in a description of your system's C++ link characteristics
599206c34b88Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
599306c34b88Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
5994c43cc173Smrg    case $host_os in
5995c27c18e8Smrg      aix3*)
599606c34b88Smrg        # FIXME: insert proper C++ library support
599706c34b88Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
5998c27c18e8Smrg        ;;
599921e67964Smrg      aix[[4-9]]*)
60000eb1301bSmrg        if test "$host_cpu" = ia64; then
600106c34b88Smrg          # On IA64, the linker does run time linking by default, so we don't
600206c34b88Smrg          # have to do anything special.
600306c34b88Smrg          aix_use_runtimelinking=no
600406c34b88Smrg          exp_sym_flag='-Bexport'
60050eb1301bSmrg          no_entry_flag=""
600606c34b88Smrg        else
600706c34b88Smrg          aix_use_runtimelinking=no
6008c27c18e8Smrg
600906c34b88Smrg          # Test if we are trying to use run time linking or normal
601006c34b88Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
60110eb1301bSmrg          # need to do runtime linking.
601206c34b88Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
601306c34b88Smrg	    for ld_flag in $LDFLAGS; do
601406c34b88Smrg	      case $ld_flag in
601506c34b88Smrg	      *-brtl*)
601606c34b88Smrg	        aix_use_runtimelinking=yes
601706c34b88Smrg	        break
601806c34b88Smrg	        ;;
601906c34b88Smrg	      esac
602006c34b88Smrg	    done
602106c34b88Smrg	    ;;
602206c34b88Smrg          esac
6023c27c18e8Smrg
602406c34b88Smrg          exp_sym_flag='-bexport'
602506c34b88Smrg          no_entry_flag='-bnoentry'
602606c34b88Smrg        fi
6027c27c18e8Smrg
602806c34b88Smrg        # When large executables or shared objects are built, AIX ld can
602906c34b88Smrg        # have problems creating the table of contents.  If linking a library
603006c34b88Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
603106c34b88Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
603206c34b88Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6033c27c18e8Smrg
603406c34b88Smrg        _LT_TAGVAR(archive_cmds, $1)=''
603506c34b88Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
603606c34b88Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
603706c34b88Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
603806c34b88Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
60390eb1301bSmrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6040c27c18e8Smrg
60410eb1301bSmrg        if test "$GXX" = yes; then
604206c34b88Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
604306c34b88Smrg          # We only want to do this on AIX 4.2 and lower, the check
604406c34b88Smrg          # below for broken collect2 doesn't work under 4.3+
60450eb1301bSmrg	  collect2name=`${CC} -print-prog-name=collect2`
604606c34b88Smrg	  if test -f "$collect2name" &&
604706c34b88Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
604806c34b88Smrg	  then
604906c34b88Smrg	    # We have reworked collect2
605006c34b88Smrg	    :
605106c34b88Smrg	  else
605206c34b88Smrg	    # We have old collect2
605306c34b88Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
605406c34b88Smrg	    # It fails to find uninstalled libraries when the uninstalled
605506c34b88Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
605606c34b88Smrg	    # to unsupported forces relinking
605706c34b88Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
605806c34b88Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
605906c34b88Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
606006c34b88Smrg	  fi
606106c34b88Smrg          esac
606206c34b88Smrg          shared_flag='-shared'
60630eb1301bSmrg	  if test "$aix_use_runtimelinking" = yes; then
60640eb1301bSmrg	    shared_flag="$shared_flag "'${wl}-G'
606506c34b88Smrg	  fi
606606c34b88Smrg        else
606706c34b88Smrg          # not using gcc
60680eb1301bSmrg          if test "$host_cpu" = ia64; then
606906c34b88Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
607006c34b88Smrg	  # chokes on -Wl,-G. The following line is correct:
607106c34b88Smrg	  shared_flag='-G'
607206c34b88Smrg          else
60730eb1301bSmrg	    if test "$aix_use_runtimelinking" = yes; then
60740eb1301bSmrg	      shared_flag='${wl}-G'
607506c34b88Smrg	    else
60760eb1301bSmrg	      shared_flag='${wl}-bM:SRE'
607706c34b88Smrg	    fi
607806c34b88Smrg          fi
607906c34b88Smrg        fi
608021e67964Smrg
60810eb1301bSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
608206c34b88Smrg        # It seems that -bexpall does not export symbols beginning with
608306c34b88Smrg        # underscore (_), so it is better to generate a list of symbols to
608406c34b88Smrg	# export.
608506c34b88Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
60860eb1301bSmrg        if test "$aix_use_runtimelinking" = yes; then
608706c34b88Smrg          # Warning - without using the other runtime loading flags (-brtl),
608806c34b88Smrg          # -berok will link without error, but may produce a broken library.
60890eb1301bSmrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
609006c34b88Smrg          # Determine the default libpath from the value encoded in an empty
609106c34b88Smrg          # executable.
609206c34b88Smrg          _LT_SYS_MODULE_PATH_AIX([$1])
60930eb1301bSmrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
609421e67964Smrg
60950eb1301bSmrg          _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"
609606c34b88Smrg        else
60970eb1301bSmrg          if test "$host_cpu" = ia64; then
60980eb1301bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
609906c34b88Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
61000eb1301bSmrg	    _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"
610106c34b88Smrg          else
610206c34b88Smrg	    # Determine the default libpath from the value encoded in an
610306c34b88Smrg	    # empty executable.
610406c34b88Smrg	    _LT_SYS_MODULE_PATH_AIX([$1])
61050eb1301bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
610606c34b88Smrg	    # Warning - without using the other run time loading flags,
610706c34b88Smrg	    # -berok will link without error, but may produce a broken library.
61080eb1301bSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
61090eb1301bSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
61100eb1301bSmrg	    if test "$with_gnu_ld" = yes; then
611106c34b88Smrg	      # We only use this code for GNU lds that support --whole-archive.
61120eb1301bSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
611306c34b88Smrg	    else
611406c34b88Smrg	      # Exported symbols can be pulled into shared objects from archives
611506c34b88Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
611606c34b88Smrg	    fi
611706c34b88Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
61180eb1301bSmrg	    # This is similar to how AIX traditionally builds its shared
61190eb1301bSmrg	    # libraries.
61200eb1301bSmrg	    _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'
612106c34b88Smrg          fi
612206c34b88Smrg        fi
612306c34b88Smrg        ;;
612421e67964Smrg
612506c34b88Smrg      beos*)
612606c34b88Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
612706c34b88Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
612806c34b88Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
612906c34b88Smrg	  # support --undefined.  This deserves some investigation.  FIXME
61300eb1301bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
613106c34b88Smrg	else
613206c34b88Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
613306c34b88Smrg	fi
613406c34b88Smrg	;;
613521e67964Smrg
613606c34b88Smrg      chorus*)
613706c34b88Smrg        case $cc_basename in
613806c34b88Smrg          *)
613906c34b88Smrg	  # FIXME: insert proper C++ library support
614006c34b88Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
614106c34b88Smrg	  ;;
614206c34b88Smrg        esac
614306c34b88Smrg        ;;
6144c27c18e8Smrg
614506c34b88Smrg      cygwin* | mingw* | pw32* | cegcc*)
614606c34b88Smrg	case $GXX,$cc_basename in
614706c34b88Smrg	,cl* | no,cl*)
614806c34b88Smrg	  # Native MSVC
614906c34b88Smrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
615006c34b88Smrg	  # no search path for DLLs.
615106c34b88Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
615206c34b88Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
615306c34b88Smrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
615406c34b88Smrg	  _LT_TAGVAR(file_list_spec, $1)='@'
615506c34b88Smrg	  # Tell ltmain to make .lib files, not .a files.
615606c34b88Smrg	  libext=lib
615706c34b88Smrg	  # Tell ltmain to make .dll files, not .so files.
61580eb1301bSmrg	  shrext_cmds=".dll"
615906c34b88Smrg	  # FIXME: Setting linknames here is a bad hack.
61600eb1301bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
61610eb1301bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
61620eb1301bSmrg	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
61630eb1301bSmrg	    else
61640eb1301bSmrg	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
61650eb1301bSmrg	    fi~
61660eb1301bSmrg	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
61670eb1301bSmrg	    linknames='
616806c34b88Smrg	  # The linker will not automatically build a static lib if we build a DLL.
616906c34b88Smrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
617006c34b88Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
617106c34b88Smrg	  # Don't use ranlib
617206c34b88Smrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
617306c34b88Smrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
61740eb1301bSmrg	    lt_tool_outputfile="@TOOL_OUTPUT@"~
61750eb1301bSmrg	    case $lt_outputfile in
61760eb1301bSmrg	      *.exe|*.EXE) ;;
61770eb1301bSmrg	      *)
61780eb1301bSmrg		lt_outputfile="$lt_outputfile.exe"
61790eb1301bSmrg		lt_tool_outputfile="$lt_tool_outputfile.exe"
61800eb1301bSmrg		;;
61810eb1301bSmrg	    esac~
61820eb1301bSmrg	    func_to_tool_file "$lt_outputfile"~
61830eb1301bSmrg	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
61840eb1301bSmrg	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
61850eb1301bSmrg	      $RM "$lt_outputfile.manifest";
61860eb1301bSmrg	    fi'
618706c34b88Smrg	  ;;
618806c34b88Smrg	*)
618906c34b88Smrg	  # g++
619006c34b88Smrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
619106c34b88Smrg	  # as there is no search path for DLLs.
619206c34b88Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
61930eb1301bSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
619406c34b88Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
619506c34b88Smrg	  _LT_TAGVAR(always_export_symbols, $1)=no
619606c34b88Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6197c27c18e8Smrg
619806c34b88Smrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
61990eb1301bSmrg	    _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'
62000eb1301bSmrg	    # If the export-symbols file already is a .def file (1st line
62010eb1301bSmrg	    # is EXPORTS), use it as is; otherwise, prepend...
62020eb1301bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
62030eb1301bSmrg	      cp $export_symbols $output_objdir/$soname.def;
62040eb1301bSmrg	    else
62050eb1301bSmrg	      echo EXPORTS > $output_objdir/$soname.def;
62060eb1301bSmrg	      cat $export_symbols >> $output_objdir/$soname.def;
62070eb1301bSmrg	    fi~
62080eb1301bSmrg	    $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'
620906c34b88Smrg	  else
621006c34b88Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
621106c34b88Smrg	  fi
621206c34b88Smrg	  ;;
621306c34b88Smrg	esac
621406c34b88Smrg	;;
621506c34b88Smrg      darwin* | rhapsody*)
621606c34b88Smrg        _LT_DARWIN_LINKER_FEATURES($1)
621706c34b88Smrg	;;
6218c27c18e8Smrg
621906c34b88Smrg      dgux*)
622006c34b88Smrg        case $cc_basename in
622106c34b88Smrg          ec++*)
622206c34b88Smrg	    # FIXME: insert proper C++ library support
622306c34b88Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
622406c34b88Smrg	    ;;
622506c34b88Smrg          ghcx*)
622606c34b88Smrg	    # Green Hills C++ Compiler
622706c34b88Smrg	    # FIXME: insert proper C++ library support
622806c34b88Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
622906c34b88Smrg	    ;;
623006c34b88Smrg          *)
623106c34b88Smrg	    # FIXME: insert proper C++ library support
623206c34b88Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
623306c34b88Smrg	    ;;
623406c34b88Smrg        esac
623506c34b88Smrg        ;;
6236c27c18e8Smrg
623706c34b88Smrg      freebsd2.*)
623806c34b88Smrg        # C++ shared libraries reported to be fairly broken before
623906c34b88Smrg	# switch to ELF
624006c34b88Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
624106c34b88Smrg        ;;
6242c27c18e8Smrg
624306c34b88Smrg      freebsd-elf*)
624406c34b88Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
624506c34b88Smrg        ;;
6246c27c18e8Smrg
624706c34b88Smrg      freebsd* | dragonfly*)
624806c34b88Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
624906c34b88Smrg        # conventions
625006c34b88Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
625106c34b88Smrg        ;;
6252c27c18e8Smrg
625306c34b88Smrg      haiku*)
62540eb1301bSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
625506c34b88Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
625606c34b88Smrg        ;;
6257c27c18e8Smrg
625806c34b88Smrg      hpux9*)
62590eb1301bSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
626006c34b88Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
62610eb1301bSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
626206c34b88Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
626306c34b88Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
626406c34b88Smrg				             # but as the default
626506c34b88Smrg				             # location of the library.
6266c27c18e8Smrg
626706c34b88Smrg        case $cc_basename in
626806c34b88Smrg          CC*)
626906c34b88Smrg            # FIXME: insert proper C++ library support
627006c34b88Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
627106c34b88Smrg            ;;
627206c34b88Smrg          aCC*)
62730eb1301bSmrg            _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'
627406c34b88Smrg            # Commands to make compiler produce verbose output that lists
627506c34b88Smrg            # what "hidden" libraries, object files and flags are used when
627606c34b88Smrg            # linking a shared library.
627706c34b88Smrg            #
627806c34b88Smrg            # There doesn't appear to be a way to prevent this compiler from
627906c34b88Smrg            # explicitly linking system object files so we need to strip them
628006c34b88Smrg            # from the output so that they don't get included in the library
628106c34b88Smrg            # dependencies.
62820eb1301bSmrg            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"'
628306c34b88Smrg            ;;
628406c34b88Smrg          *)
62850eb1301bSmrg            if test "$GXX" = yes; then
62860eb1301bSmrg              _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'
628706c34b88Smrg            else
628806c34b88Smrg              # FIXME: insert proper C++ library support
628906c34b88Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
629006c34b88Smrg            fi
629106c34b88Smrg            ;;
629206c34b88Smrg        esac
629306c34b88Smrg        ;;
6294c27c18e8Smrg
629506c34b88Smrg      hpux10*|hpux11*)
62960eb1301bSmrg        if test $with_gnu_ld = no; then
62970eb1301bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
629806c34b88Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6299c27c18e8Smrg
630006c34b88Smrg          case $host_cpu in
630106c34b88Smrg            hppa*64*|ia64*)
630206c34b88Smrg              ;;
630306c34b88Smrg            *)
63040eb1301bSmrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
630506c34b88Smrg              ;;
630606c34b88Smrg          esac
630706c34b88Smrg        fi
630806c34b88Smrg        case $host_cpu in
630906c34b88Smrg          hppa*64*|ia64*)
631006c34b88Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
631106c34b88Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
631206c34b88Smrg            ;;
631306c34b88Smrg          *)
631406c34b88Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
631506c34b88Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
631606c34b88Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
631706c34b88Smrg					         # but as the default
631806c34b88Smrg					         # location of the library.
631906c34b88Smrg            ;;
632006c34b88Smrg        esac
6321c27c18e8Smrg
632206c34b88Smrg        case $cc_basename in
632306c34b88Smrg          CC*)
632406c34b88Smrg	    # FIXME: insert proper C++ library support
632506c34b88Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
632606c34b88Smrg	    ;;
632706c34b88Smrg          aCC*)
632806c34b88Smrg	    case $host_cpu in
632906c34b88Smrg	      hppa*64*)
63300eb1301bSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
633106c34b88Smrg	        ;;
633206c34b88Smrg	      ia64*)
63330eb1301bSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
633406c34b88Smrg	        ;;
633506c34b88Smrg	      *)
63360eb1301bSmrg	        _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'
633706c34b88Smrg	        ;;
633806c34b88Smrg	    esac
633906c34b88Smrg	    # Commands to make compiler produce verbose output that lists
634006c34b88Smrg	    # what "hidden" libraries, object files and flags are used when
634106c34b88Smrg	    # linking a shared library.
634206c34b88Smrg	    #
634306c34b88Smrg	    # There doesn't appear to be a way to prevent this compiler from
634406c34b88Smrg	    # explicitly linking system object files so we need to strip them
634506c34b88Smrg	    # from the output so that they don't get included in the library
634606c34b88Smrg	    # dependencies.
63470eb1301bSmrg	    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"'
634806c34b88Smrg	    ;;
634906c34b88Smrg          *)
63500eb1301bSmrg	    if test "$GXX" = yes; then
63510eb1301bSmrg	      if test $with_gnu_ld = no; then
635206c34b88Smrg	        case $host_cpu in
635306c34b88Smrg	          hppa*64*)
63540eb1301bSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
635506c34b88Smrg	            ;;
635606c34b88Smrg	          ia64*)
63570eb1301bSmrg	            _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'
635806c34b88Smrg	            ;;
635906c34b88Smrg	          *)
63600eb1301bSmrg	            _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'
636106c34b88Smrg	            ;;
636206c34b88Smrg	        esac
636306c34b88Smrg	      fi
636406c34b88Smrg	    else
636506c34b88Smrg	      # FIXME: insert proper C++ library support
636606c34b88Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
636706c34b88Smrg	    fi
636806c34b88Smrg	    ;;
636906c34b88Smrg        esac
637006c34b88Smrg        ;;
6371c27c18e8Smrg
637206c34b88Smrg      interix[[3-9]]*)
637306c34b88Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
637406c34b88Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
63750eb1301bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
63760eb1301bSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
637706c34b88Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
637806c34b88Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
637906c34b88Smrg	# default) and relocated if they conflict, which is a slow very memory
638006c34b88Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
638106c34b88Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
638206c34b88Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
63830eb1301bSmrg	_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'
63840eb1301bSmrg	_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'
638506c34b88Smrg	;;
638606c34b88Smrg      irix5* | irix6*)
638706c34b88Smrg        case $cc_basename in
638806c34b88Smrg          CC*)
638906c34b88Smrg	    # SGI C++
63900eb1301bSmrg	    _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'
6391f1ee322dSmrg
639206c34b88Smrg	    # Archives containing C++ object files must be created using
639306c34b88Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
639406c34b88Smrg	    # necessary to make sure instantiated templates are included
639506c34b88Smrg	    # in the archive.
639606c34b88Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
639706c34b88Smrg	    ;;
639806c34b88Smrg          *)
63990eb1301bSmrg	    if test "$GXX" = yes; then
64000eb1301bSmrg	      if test "$with_gnu_ld" = no; then
64010eb1301bSmrg	        _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'
640206c34b88Smrg	      else
64030eb1301bSmrg	        _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'
640406c34b88Smrg	      fi
640506c34b88Smrg	    fi
640606c34b88Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
640706c34b88Smrg	    ;;
640806c34b88Smrg        esac
64090eb1301bSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
641006c34b88Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
641106c34b88Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
641206c34b88Smrg        ;;
6413f1ee322dSmrg
641444584a44Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
641506c34b88Smrg        case $cc_basename in
641606c34b88Smrg          KCC*)
641706c34b88Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6418f1ee322dSmrg
641906c34b88Smrg	    # KCC will only create a shared library if the output file
642006c34b88Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
642106c34b88Smrg	    # to its proper name (with version) after linking.
64220eb1301bSmrg	    _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'
64230eb1301bSmrg	    _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'
642406c34b88Smrg	    # Commands to make compiler produce verbose output that lists
642506c34b88Smrg	    # what "hidden" libraries, object files and flags are used when
642606c34b88Smrg	    # linking a shared library.
642706c34b88Smrg	    #
642806c34b88Smrg	    # There doesn't appear to be a way to prevent this compiler from
642906c34b88Smrg	    # explicitly linking system object files so we need to strip them
643006c34b88Smrg	    # from the output so that they don't get included in the library
643106c34b88Smrg	    # dependencies.
64320eb1301bSmrg	    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"'
6433f1ee322dSmrg
64340eb1301bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
64350eb1301bSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6436f1ee322dSmrg
643706c34b88Smrg	    # Archives containing C++ object files must be created using
643806c34b88Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
643906c34b88Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
644006c34b88Smrg	    ;;
644106c34b88Smrg	  icpc* | ecpc* )
644206c34b88Smrg	    # Intel C++
644306c34b88Smrg	    with_gnu_ld=yes
644406c34b88Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
644506c34b88Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
644606c34b88Smrg	    # earlier do not add the objects themselves.
644706c34b88Smrg	    case `$CC -V 2>&1` in
644806c34b88Smrg	      *"Version 7."*)
64490eb1301bSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
64500eb1301bSmrg		_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'
645106c34b88Smrg		;;
645206c34b88Smrg	      *)  # Version 8.0 or newer
645306c34b88Smrg	        tmp_idyn=
645406c34b88Smrg	        case $host_cpu in
645506c34b88Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
645606c34b88Smrg		esac
64570eb1301bSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
64580eb1301bSmrg		_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'
645906c34b88Smrg		;;
646006c34b88Smrg	    esac
646106c34b88Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
64620eb1301bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
64630eb1301bSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
64640eb1301bSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
646506c34b88Smrg	    ;;
646606c34b88Smrg          pgCC* | pgcpp*)
646706c34b88Smrg            # Portland Group C++ compiler
646806c34b88Smrg	    case `$CC -V` in
646906c34b88Smrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
647006c34b88Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
64710eb1301bSmrg		rm -rf $tpldir~
64720eb1301bSmrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
64730eb1301bSmrg		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
647406c34b88Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
64750eb1301bSmrg		rm -rf $tpldir~
64760eb1301bSmrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
64770eb1301bSmrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
64780eb1301bSmrg		$RANLIB $oldlib'
647906c34b88Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
64800eb1301bSmrg		rm -rf $tpldir~
64810eb1301bSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
64820eb1301bSmrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
648306c34b88Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
64840eb1301bSmrg		rm -rf $tpldir~
64850eb1301bSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
64860eb1301bSmrg		$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'
648706c34b88Smrg	      ;;
648806c34b88Smrg	    *) # Version 6 and above use weak symbols
64890eb1301bSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
64900eb1301bSmrg	      _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'
649106c34b88Smrg	      ;;
649206c34b88Smrg	    esac
6493f1ee322dSmrg
64940eb1301bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
64950eb1301bSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
64960eb1301bSmrg	    _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'
649706c34b88Smrg            ;;
649806c34b88Smrg	  cxx*)
649906c34b88Smrg	    # Compaq C++
65000eb1301bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
65010eb1301bSmrg	    _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'
6502f1ee322dSmrg
650306c34b88Smrg	    runpath_var=LD_RUN_PATH
650406c34b88Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
650506c34b88Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6506f1ee322dSmrg
650706c34b88Smrg	    # Commands to make compiler produce verbose output that lists
650806c34b88Smrg	    # what "hidden" libraries, object files and flags are used when
650906c34b88Smrg	    # linking a shared library.
651006c34b88Smrg	    #
651106c34b88Smrg	    # There doesn't appear to be a way to prevent this compiler from
651206c34b88Smrg	    # explicitly linking system object files so we need to strip them
651306c34b88Smrg	    # from the output so that they don't get included in the library
651406c34b88Smrg	    # dependencies.
65150eb1301bSmrg	    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'
651606c34b88Smrg	    ;;
651706c34b88Smrg	  xl* | mpixl* | bgxl*)
651806c34b88Smrg	    # IBM XL 8.0 on PPC, with GNU ld
65190eb1301bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
65200eb1301bSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
65210eb1301bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
65220eb1301bSmrg	    if test "x$supports_anon_versioning" = xyes; then
652306c34b88Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
65240eb1301bSmrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
65250eb1301bSmrg		echo "local: *; };" >> $output_objdir/$libname.ver~
65260eb1301bSmrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
652706c34b88Smrg	    fi
652806c34b88Smrg	    ;;
652906c34b88Smrg	  *)
653006c34b88Smrg	    case `$CC -V 2>&1 | sed 5q` in
653106c34b88Smrg	    *Sun\ C*)
653206c34b88Smrg	      # Sun C++ 5.9
653306c34b88Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
65340eb1301bSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
65350eb1301bSmrg	      _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'
653606c34b88Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
65370eb1301bSmrg	      _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'
653806c34b88Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
6539f1ee322dSmrg
654006c34b88Smrg	      # Not sure whether something based on
654106c34b88Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
654206c34b88Smrg	      # would be better.
654306c34b88Smrg	      output_verbose_link_cmd='func_echo_all'
6544f1ee322dSmrg
654506c34b88Smrg	      # Archives containing C++ object files must be created using
654606c34b88Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
654706c34b88Smrg	      # necessary to make sure instantiated templates are included
654806c34b88Smrg	      # in the archive.
654906c34b88Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
655006c34b88Smrg	      ;;
655106c34b88Smrg	    esac
655206c34b88Smrg	    ;;
655306c34b88Smrg	esac
655406c34b88Smrg	;;
6555f1ee322dSmrg
655606c34b88Smrg      lynxos*)
655706c34b88Smrg        # FIXME: insert proper C++ library support
655806c34b88Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
655906c34b88Smrg	;;
6560f1ee322dSmrg
656106c34b88Smrg      m88k*)
656206c34b88Smrg        # FIXME: insert proper C++ library support
656306c34b88Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
656406c34b88Smrg	;;
6565f1ee322dSmrg
656606c34b88Smrg      mvs*)
656706c34b88Smrg        case $cc_basename in
656806c34b88Smrg          cxx*)
656906c34b88Smrg	    # FIXME: insert proper C++ library support
657006c34b88Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
657106c34b88Smrg	    ;;
657206c34b88Smrg	  *)
657306c34b88Smrg	    # FIXME: insert proper C++ library support
657406c34b88Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
657506c34b88Smrg	    ;;
657606c34b88Smrg	esac
657706c34b88Smrg	;;
6578f1ee322dSmrg
657906c34b88Smrg      netbsd*)
658006c34b88Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
658106c34b88Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
658206c34b88Smrg	  wlarc=
658306c34b88Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
658406c34b88Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
658506c34b88Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
658606c34b88Smrg	fi
658706c34b88Smrg	# Workaround some broken pre-1.5 toolchains
658806c34b88Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
658906c34b88Smrg	;;
6590f1ee322dSmrg
659106c34b88Smrg      *nto* | *qnx*)
659206c34b88Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
659306c34b88Smrg	;;
6594c27c18e8Smrg
65950eb1301bSmrg      openbsd2*)
65960eb1301bSmrg        # C++ shared libraries are fairly broken
65970eb1301bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
65980eb1301bSmrg	;;
65990eb1301bSmrg
66000eb1301bSmrg      openbsd*)
660106c34b88Smrg	if test -f /usr/libexec/ld.so; then
660206c34b88Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
660306c34b88Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
660406c34b88Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
660506c34b88Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
66060eb1301bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
66070eb1301bSmrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
66080eb1301bSmrg	    _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'
66090eb1301bSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
66100eb1301bSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
661106c34b88Smrg	  fi
661206c34b88Smrg	  output_verbose_link_cmd=func_echo_all
661306c34b88Smrg	else
661406c34b88Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
661506c34b88Smrg	fi
661606c34b88Smrg	;;
661721e67964Smrg
661806c34b88Smrg      osf3* | osf4* | osf5*)
661906c34b88Smrg        case $cc_basename in
662006c34b88Smrg          KCC*)
662106c34b88Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
662221e67964Smrg
662306c34b88Smrg	    # KCC will only create a shared library if the output file
662406c34b88Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
662506c34b88Smrg	    # to its proper name (with version) after linking.
66260eb1301bSmrg	    _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'
662721e67964Smrg
66280eb1301bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
662906c34b88Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
663021e67964Smrg
663106c34b88Smrg	    # Archives containing C++ object files must be created using
663206c34b88Smrg	    # the KAI C++ compiler.
663306c34b88Smrg	    case $host in
663406c34b88Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
663506c34b88Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
663606c34b88Smrg	    esac
663706c34b88Smrg	    ;;
663806c34b88Smrg          RCC*)
663906c34b88Smrg	    # Rational C++ 2.4.1
664006c34b88Smrg	    # FIXME: insert proper C++ library support
664106c34b88Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
664206c34b88Smrg	    ;;
664306c34b88Smrg          cxx*)
664406c34b88Smrg	    case $host in
664506c34b88Smrg	      osf3*)
66460eb1301bSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
66470eb1301bSmrg	        _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'
66480eb1301bSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
664906c34b88Smrg		;;
665006c34b88Smrg	      *)
665106c34b88Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
66520eb1301bSmrg	        _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'
665306c34b88Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
66540eb1301bSmrg	          echo "-hidden">> $lib.exp~
66550eb1301bSmrg	          $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~
66560eb1301bSmrg	          $RM $lib.exp'
665706c34b88Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
665806c34b88Smrg		;;
665906c34b88Smrg	    esac
666021e67964Smrg
666106c34b88Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
666221e67964Smrg
666306c34b88Smrg	    # Commands to make compiler produce verbose output that lists
666406c34b88Smrg	    # what "hidden" libraries, object files and flags are used when
666506c34b88Smrg	    # linking a shared library.
666606c34b88Smrg	    #
666706c34b88Smrg	    # There doesn't appear to be a way to prevent this compiler from
666806c34b88Smrg	    # explicitly linking system object files so we need to strip them
666906c34b88Smrg	    # from the output so that they don't get included in the library
667006c34b88Smrg	    # dependencies.
66710eb1301bSmrg	    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"'
667206c34b88Smrg	    ;;
667306c34b88Smrg	  *)
66740eb1301bSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
66750eb1301bSmrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
667606c34b88Smrg	      case $host in
667706c34b88Smrg	        osf3*)
66780eb1301bSmrg	          _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'
667906c34b88Smrg		  ;;
668006c34b88Smrg	        *)
66810eb1301bSmrg	          _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'
668206c34b88Smrg		  ;;
668306c34b88Smrg	      esac
668421e67964Smrg
66850eb1301bSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
668606c34b88Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
668721e67964Smrg
668806c34b88Smrg	      # Commands to make compiler produce verbose output that lists
668906c34b88Smrg	      # what "hidden" libraries, object files and flags are used when
669006c34b88Smrg	      # linking a shared library.
669106c34b88Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
669221e67964Smrg
669306c34b88Smrg	    else
669406c34b88Smrg	      # FIXME: insert proper C++ library support
669506c34b88Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
669606c34b88Smrg	    fi
669706c34b88Smrg	    ;;
669806c34b88Smrg        esac
669906c34b88Smrg        ;;
670021e67964Smrg
670106c34b88Smrg      psos*)
670206c34b88Smrg        # FIXME: insert proper C++ library support
670306c34b88Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
670406c34b88Smrg        ;;
670521e67964Smrg
670606c34b88Smrg      sunos4*)
670706c34b88Smrg        case $cc_basename in
670806c34b88Smrg          CC*)
670906c34b88Smrg	    # Sun C++ 4.x
671006c34b88Smrg	    # FIXME: insert proper C++ library support
671106c34b88Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
671206c34b88Smrg	    ;;
671306c34b88Smrg          lcc*)
671406c34b88Smrg	    # Lucid
671506c34b88Smrg	    # FIXME: insert proper C++ library support
671606c34b88Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
671706c34b88Smrg	    ;;
671806c34b88Smrg          *)
671906c34b88Smrg	    # FIXME: insert proper C++ library support
672006c34b88Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
672106c34b88Smrg	    ;;
672206c34b88Smrg        esac
672306c34b88Smrg        ;;
672421e67964Smrg
672506c34b88Smrg      solaris*)
672606c34b88Smrg        case $cc_basename in
672706c34b88Smrg          CC* | sunCC*)
672806c34b88Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
672906c34b88Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
673006c34b88Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
67310eb1301bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
673206c34b88Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
67330eb1301bSmrg	      $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'
6734f1ee322dSmrg
673506c34b88Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
673606c34b88Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
673706c34b88Smrg	    case $host_os in
673806c34b88Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
673906c34b88Smrg	      *)
674006c34b88Smrg		# The compiler driver will combine and reorder linker options,
67410eb1301bSmrg		# but understands `-z linker_flag'.
674206c34b88Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
674306c34b88Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
674406c34b88Smrg	        ;;
674506c34b88Smrg	    esac
674606c34b88Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6747f1ee322dSmrg
674806c34b88Smrg	    output_verbose_link_cmd='func_echo_all'
674921e67964Smrg
675006c34b88Smrg	    # Archives containing C++ object files must be created using
675106c34b88Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
675206c34b88Smrg	    # necessary to make sure instantiated templates are included
675306c34b88Smrg	    # in the archive.
675406c34b88Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
675506c34b88Smrg	    ;;
675606c34b88Smrg          gcx*)
675706c34b88Smrg	    # Green Hills C++ Compiler
67580eb1301bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
675921e67964Smrg
676006c34b88Smrg	    # The C++ compiler must be used to create the archive.
676106c34b88Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
676206c34b88Smrg	    ;;
676306c34b88Smrg          *)
676406c34b88Smrg	    # GNU C++ compiler with Solaris linker
67650eb1301bSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
67660eb1301bSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
676706c34b88Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
67680eb1301bSmrg	        _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'
676906c34b88Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
67700eb1301bSmrg		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
677121e67964Smrg
677206c34b88Smrg	        # Commands to make compiler produce verbose output that lists
677306c34b88Smrg	        # what "hidden" libraries, object files and flags are used when
677406c34b88Smrg	        # linking a shared library.
677506c34b88Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
677606c34b88Smrg	      else
67770eb1301bSmrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
677806c34b88Smrg	        # platform.
67790eb1301bSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
678006c34b88Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
67810eb1301bSmrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
678221e67964Smrg
678306c34b88Smrg	        # Commands to make compiler produce verbose output that lists
678406c34b88Smrg	        # what "hidden" libraries, object files and flags are used when
678506c34b88Smrg	        # linking a shared library.
678606c34b88Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
678706c34b88Smrg	      fi
678821e67964Smrg
67890eb1301bSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
679006c34b88Smrg	      case $host_os in
679106c34b88Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
679206c34b88Smrg		*)
67930eb1301bSmrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
679406c34b88Smrg		  ;;
679506c34b88Smrg	      esac
679606c34b88Smrg	    fi
679706c34b88Smrg	    ;;
679806c34b88Smrg        esac
679906c34b88Smrg        ;;
680021e67964Smrg
680106c34b88Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
68020eb1301bSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
680306c34b88Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
680406c34b88Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
680506c34b88Smrg      runpath_var='LD_RUN_PATH'
680621e67964Smrg
680706c34b88Smrg      case $cc_basename in
680806c34b88Smrg        CC*)
68090eb1301bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68100eb1301bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
681106c34b88Smrg	  ;;
681206c34b88Smrg	*)
68130eb1301bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68140eb1301bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
681506c34b88Smrg	  ;;
681606c34b88Smrg      esac
681706c34b88Smrg      ;;
681821e67964Smrg
681906c34b88Smrg      sysv5* | sco3.2v5* | sco5v6*)
68200eb1301bSmrg	# Note: We can NOT use -z defs as we might desire, because we do not
682106c34b88Smrg	# link with -lc, and that would cause any symbols used from libc to
682206c34b88Smrg	# always be unresolved, which means just about no library would
682306c34b88Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
682406c34b88Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
682506c34b88Smrg	# as -z defs.
68260eb1301bSmrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
68270eb1301bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
682806c34b88Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
682906c34b88Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
68300eb1301bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
683106c34b88Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
683206c34b88Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
68330eb1301bSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
683406c34b88Smrg	runpath_var='LD_RUN_PATH'
6835c27c18e8Smrg
683606c34b88Smrg	case $cc_basename in
683706c34b88Smrg          CC*)
68380eb1301bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68390eb1301bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
684006c34b88Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
68410eb1301bSmrg	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
684206c34b88Smrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
68430eb1301bSmrg	      '"$_LT_TAGVAR(reload_cmds, $1)"
684406c34b88Smrg	    ;;
684506c34b88Smrg	  *)
68460eb1301bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68470eb1301bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
684806c34b88Smrg	    ;;
684906c34b88Smrg	esac
685006c34b88Smrg      ;;
685121e67964Smrg
685206c34b88Smrg      tandem*)
685306c34b88Smrg        case $cc_basename in
685406c34b88Smrg          NCC*)
685506c34b88Smrg	    # NonStop-UX NCC 3.20
685606c34b88Smrg	    # FIXME: insert proper C++ library support
685706c34b88Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
685806c34b88Smrg	    ;;
685906c34b88Smrg          *)
686006c34b88Smrg	    # FIXME: insert proper C++ library support
686106c34b88Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
686206c34b88Smrg	    ;;
686306c34b88Smrg        esac
686406c34b88Smrg        ;;
6865c27c18e8Smrg
686606c34b88Smrg      vxworks*)
686706c34b88Smrg        # FIXME: insert proper C++ library support
686806c34b88Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
686906c34b88Smrg        ;;
6870c27c18e8Smrg
687106c34b88Smrg      *)
687206c34b88Smrg        # FIXME: insert proper C++ library support
687306c34b88Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
687406c34b88Smrg        ;;
687506c34b88Smrg    esac
6876c27c18e8Smrg
687706c34b88Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
68780eb1301bSmrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6879c27c18e8Smrg
68800eb1301bSmrg    _LT_TAGVAR(GCC, $1)="$GXX"
68810eb1301bSmrg    _LT_TAGVAR(LD, $1)="$LD"
6882c27c18e8Smrg
688306c34b88Smrg    ## CAVEAT EMPTOR:
688406c34b88Smrg    ## There is no encapsulation within the following macros, do not change
688506c34b88Smrg    ## the running order or otherwise move them around unless you know exactly
688606c34b88Smrg    ## what you are doing...
688706c34b88Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
688806c34b88Smrg    _LT_COMPILER_PIC($1)
688906c34b88Smrg    _LT_COMPILER_C_O($1)
689006c34b88Smrg    _LT_COMPILER_FILE_LOCKS($1)
689106c34b88Smrg    _LT_LINKER_SHLIBS($1)
689206c34b88Smrg    _LT_SYS_DYNAMIC_LINKER($1)
689306c34b88Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
689421e67964Smrg
689506c34b88Smrg    _LT_CONFIG($1)
689606c34b88Smrg  fi # test -n "$compiler"
689721e67964Smrg
689806c34b88Smrg  CC=$lt_save_CC
689906c34b88Smrg  CFLAGS=$lt_save_CFLAGS
690006c34b88Smrg  LDCXX=$LD
690106c34b88Smrg  LD=$lt_save_LD
690206c34b88Smrg  GCC=$lt_save_GCC
690306c34b88Smrg  with_gnu_ld=$lt_save_with_gnu_ld
690406c34b88Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
690506c34b88Smrg  lt_cv_path_LD=$lt_save_path_LD
690606c34b88Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
690706c34b88Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
69080eb1301bSmrgfi # test "$_lt_caught_CXX_error" != yes
690921e67964Smrg
691006c34b88SmrgAC_LANG_POP
691106c34b88Smrg])# _LT_LANG_CXX_CONFIG
6912c27c18e8Smrg
6913b789ec8aSmrg
691406c34b88Smrg# _LT_FUNC_STRIPNAME_CNF
691506c34b88Smrg# ----------------------
691606c34b88Smrg# func_stripname_cnf prefix suffix name
691706c34b88Smrg# strip PREFIX and SUFFIX off of NAME.
691806c34b88Smrg# PREFIX and SUFFIX must not contain globbing or regex special
691906c34b88Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
692006c34b88Smrg# dot (in which case that matches only a dot).
692106c34b88Smrg#
692206c34b88Smrg# This function is identical to the (non-XSI) version of func_stripname,
692306c34b88Smrg# except this one can be used by m4 code that may be executed by configure,
692406c34b88Smrg# rather than the libtool script.
692506c34b88Smrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
692606c34b88SmrgAC_REQUIRE([_LT_DECL_SED])
692706c34b88SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
692806c34b88Smrgfunc_stripname_cnf ()
692906c34b88Smrg{
69300eb1301bSmrg  case ${2} in
69310eb1301bSmrg  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
69320eb1301bSmrg  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
693306c34b88Smrg  esac
693406c34b88Smrg} # func_stripname_cnf
693506c34b88Smrg])# _LT_FUNC_STRIPNAME_CNF
6936b789ec8aSmrg
693706c34b88Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
693806c34b88Smrg# ---------------------------------
693906c34b88Smrg# Figure out "hidden" library dependencies from verbose
694006c34b88Smrg# compiler output when linking a shared library.
694106c34b88Smrg# Parse the compiler output and extract the necessary
694206c34b88Smrg# objects, libraries and library flags.
694306c34b88Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
694406c34b88Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
694506c34b88SmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
694606c34b88Smrg# Dependencies to place before and after the object being linked:
694706c34b88Smrg_LT_TAGVAR(predep_objects, $1)=
694806c34b88Smrg_LT_TAGVAR(postdep_objects, $1)=
694906c34b88Smrg_LT_TAGVAR(predeps, $1)=
695006c34b88Smrg_LT_TAGVAR(postdeps, $1)=
695106c34b88Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
6952c27c18e8Smrg
695306c34b88Smrgdnl we can't use the lt_simple_compile_test_code here,
695406c34b88Smrgdnl because it contains code intended for an executable,
695506c34b88Smrgdnl not a library.  It's possible we should let each
695606c34b88Smrgdnl tag define a new lt_????_link_test_code variable,
695706c34b88Smrgdnl but it's only used here...
695806c34b88Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
695906c34b88Smrgint a;
696006c34b88Smrgvoid foo (void) { a = 0; }
696106c34b88Smrg_LT_EOF
696206c34b88Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
696306c34b88Smrgclass Foo
696406c34b88Smrg{
696506c34b88Smrgpublic:
696606c34b88Smrg  Foo (void) { a = 0; }
696706c34b88Smrgprivate:
696806c34b88Smrg  int a;
696906c34b88Smrg};
697006c34b88Smrg_LT_EOF
697106c34b88Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
697206c34b88Smrg      subroutine foo
697306c34b88Smrg      implicit none
697406c34b88Smrg      integer*4 a
697506c34b88Smrg      a=0
697606c34b88Smrg      return
697706c34b88Smrg      end
697806c34b88Smrg_LT_EOF
697906c34b88Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
698006c34b88Smrg      subroutine foo
698106c34b88Smrg      implicit none
698206c34b88Smrg      integer a
698306c34b88Smrg      a=0
698406c34b88Smrg      return
698506c34b88Smrg      end
698606c34b88Smrg_LT_EOF
698706c34b88Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
698806c34b88Smrgpublic class foo {
698906c34b88Smrg  private int a;
699006c34b88Smrg  public void bar (void) {
699106c34b88Smrg    a = 0;
699206c34b88Smrg  }
699306c34b88Smrg};
699406c34b88Smrg_LT_EOF
699506c34b88Smrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
699606c34b88Smrgpackage foo
699706c34b88Smrgfunc foo() {
699806c34b88Smrg}
699906c34b88Smrg_LT_EOF
700006c34b88Smrg])
7001c27c18e8Smrg
700206c34b88Smrg_lt_libdeps_save_CFLAGS=$CFLAGS
700306c34b88Smrgcase "$CC $CFLAGS " in #(
700406c34b88Smrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
700506c34b88Smrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
700606c34b88Smrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
700706c34b88Smrgesac
7008c27c18e8Smrg
700906c34b88Smrgdnl Parse the compiler output and extract the necessary
701006c34b88Smrgdnl objects, libraries and library flags.
701106c34b88Smrgif AC_TRY_EVAL(ac_compile); then
701206c34b88Smrg  # Parse the compiler output and extract the necessary
701306c34b88Smrg  # objects, libraries and library flags.
7014c27c18e8Smrg
701506c34b88Smrg  # Sentinel used to keep track of whether or not we are before
701606c34b88Smrg  # the conftest object file.
701706c34b88Smrg  pre_test_object_deps_done=no
7018c27c18e8Smrg
701906c34b88Smrg  for p in `eval "$output_verbose_link_cmd"`; do
70200eb1301bSmrg    case ${prev}${p} in
702106c34b88Smrg
702206c34b88Smrg    -L* | -R* | -l*)
702306c34b88Smrg       # Some compilers place space between "-{L,R}" and the path.
702406c34b88Smrg       # Remove the space.
70250eb1301bSmrg       if test $p = "-L" ||
70260eb1301bSmrg          test $p = "-R"; then
702706c34b88Smrg	 prev=$p
702806c34b88Smrg	 continue
702906c34b88Smrg       fi
703006c34b88Smrg
703106c34b88Smrg       # Expand the sysroot to ease extracting the directories later.
703206c34b88Smrg       if test -z "$prev"; then
703306c34b88Smrg         case $p in
703406c34b88Smrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
703506c34b88Smrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
703606c34b88Smrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
703706c34b88Smrg         esac
703806c34b88Smrg       fi
703906c34b88Smrg       case $p in
704006c34b88Smrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
704106c34b88Smrg       esac
70420eb1301bSmrg       if test "$pre_test_object_deps_done" = no; then
70430eb1301bSmrg	 case ${prev} in
704406c34b88Smrg	 -L | -R)
704506c34b88Smrg	   # Internal compiler library paths should come after those
704606c34b88Smrg	   # provided the user.  The postdeps already come after the
704706c34b88Smrg	   # user supplied libs so there is no need to process them.
704806c34b88Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
70490eb1301bSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
705006c34b88Smrg	   else
70510eb1301bSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
705206c34b88Smrg	   fi
705306c34b88Smrg	   ;;
705406c34b88Smrg	 # The "-l" case would never come before the object being
705506c34b88Smrg	 # linked, so don't bother handling this case.
705606c34b88Smrg	 esac
705706c34b88Smrg       else
705806c34b88Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
70590eb1301bSmrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
706006c34b88Smrg	 else
70610eb1301bSmrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
706206c34b88Smrg	 fi
706306c34b88Smrg       fi
706406c34b88Smrg       prev=
706506c34b88Smrg       ;;
7066c27c18e8Smrg
706706c34b88Smrg    *.lto.$objext) ;; # Ignore GCC LTO objects
706806c34b88Smrg    *.$objext)
706906c34b88Smrg       # This assumes that the test object file only shows up
707006c34b88Smrg       # once in the compiler output.
707106c34b88Smrg       if test "$p" = "conftest.$objext"; then
707206c34b88Smrg	 pre_test_object_deps_done=yes
707306c34b88Smrg	 continue
707406c34b88Smrg       fi
7075c27c18e8Smrg
70760eb1301bSmrg       if test "$pre_test_object_deps_done" = no; then
707706c34b88Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
70780eb1301bSmrg	   _LT_TAGVAR(predep_objects, $1)="$p"
707906c34b88Smrg	 else
708006c34b88Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
708106c34b88Smrg	 fi
708206c34b88Smrg       else
708306c34b88Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
70840eb1301bSmrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
708506c34b88Smrg	 else
708606c34b88Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
708706c34b88Smrg	 fi
708806c34b88Smrg       fi
708906c34b88Smrg       ;;
7090c27c18e8Smrg
709106c34b88Smrg    *) ;; # Ignore the rest.
7092c27c18e8Smrg
709306c34b88Smrg    esac
709406c34b88Smrg  done
7095c27c18e8Smrg
709606c34b88Smrg  # Clean up.
709706c34b88Smrg  rm -f a.out a.exe
7098b789ec8aSmrgelse
709906c34b88Smrg  echo "libtool.m4: error: problem compiling $1 test program"
7100b789ec8aSmrgfi
7101c27c18e8Smrg
710206c34b88Smrg$RM -f confest.$objext
710306c34b88SmrgCFLAGS=$_lt_libdeps_save_CFLAGS
710421e67964Smrg
710506c34b88Smrg# PORTME: override above test on systems where it is broken
710606c34b88Smrgm4_if([$1], [CXX],
710706c34b88Smrg[case $host_os in
710806c34b88Smrginterix[[3-9]]*)
710906c34b88Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
711006c34b88Smrg  # hack all around it, let's just trust "g++" to DTRT.
711106c34b88Smrg  _LT_TAGVAR(predep_objects,$1)=
711206c34b88Smrg  _LT_TAGVAR(postdep_objects,$1)=
711306c34b88Smrg  _LT_TAGVAR(postdeps,$1)=
711406c34b88Smrg  ;;
71150eb1301bSmrg
71160eb1301bSmrglinux*)
71170eb1301bSmrg  case `$CC -V 2>&1 | sed 5q` in
71180eb1301bSmrg  *Sun\ C*)
71190eb1301bSmrg    # Sun C++ 5.9
71200eb1301bSmrg
71210eb1301bSmrg    # The more standards-conforming stlport4 library is
71220eb1301bSmrg    # incompatible with the Cstd library. Avoid specifying
71230eb1301bSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
71240eb1301bSmrg    # -library=stlport4 depends on it.
71250eb1301bSmrg    case " $CXX $CXXFLAGS " in
71260eb1301bSmrg    *" -library=stlport4 "*)
71270eb1301bSmrg      solaris_use_stlport4=yes
71280eb1301bSmrg      ;;
71290eb1301bSmrg    esac
71300eb1301bSmrg
71310eb1301bSmrg    if test "$solaris_use_stlport4" != yes; then
71320eb1301bSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
71330eb1301bSmrg    fi
71340eb1301bSmrg    ;;
71350eb1301bSmrg  esac
71360eb1301bSmrg  ;;
71370eb1301bSmrg
71380eb1301bSmrgsolaris*)
71390eb1301bSmrg  case $cc_basename in
71400eb1301bSmrg  CC* | sunCC*)
71410eb1301bSmrg    # The more standards-conforming stlport4 library is
71420eb1301bSmrg    # incompatible with the Cstd library. Avoid specifying
71430eb1301bSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
71440eb1301bSmrg    # -library=stlport4 depends on it.
71450eb1301bSmrg    case " $CXX $CXXFLAGS " in
71460eb1301bSmrg    *" -library=stlport4 "*)
71470eb1301bSmrg      solaris_use_stlport4=yes
71480eb1301bSmrg      ;;
71490eb1301bSmrg    esac
71500eb1301bSmrg
71510eb1301bSmrg    # Adding this requires a known-good setup of shared libraries for
71520eb1301bSmrg    # Sun compiler versions before 5.6, else PIC objects from an old
71530eb1301bSmrg    # archive will be linked into the output, leading to subtle bugs.
71540eb1301bSmrg    if test "$solaris_use_stlport4" != yes; then
71550eb1301bSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
71560eb1301bSmrg    fi
71570eb1301bSmrg    ;;
71580eb1301bSmrg  esac
71590eb1301bSmrg  ;;
716044584a44Smrgesac
716144584a44Smrg])
716221e67964Smrg
716306c34b88Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
716406c34b88Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
716506c34b88Smrgesac
716606c34b88Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
716706c34b88Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
71680eb1301bSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
716906c34b88Smrgfi
717006c34b88Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
717106c34b88Smrg    [The directories searched by this compiler when creating a shared library])
717206c34b88Smrg_LT_TAGDECL([], [predep_objects], [1],
717306c34b88Smrg    [Dependencies to place before and after the objects being linked to
717406c34b88Smrg    create a shared library])
717506c34b88Smrg_LT_TAGDECL([], [postdep_objects], [1])
717606c34b88Smrg_LT_TAGDECL([], [predeps], [1])
717706c34b88Smrg_LT_TAGDECL([], [postdeps], [1])
717806c34b88Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
717906c34b88Smrg    [The library search path used internally by the compiler when linking
718006c34b88Smrg    a shared library])
718106c34b88Smrg])# _LT_SYS_HIDDEN_LIBDEPS
718221e67964Smrg
718321e67964Smrg
718406c34b88Smrg# _LT_LANG_F77_CONFIG([TAG])
718506c34b88Smrg# --------------------------
718606c34b88Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
718706c34b88Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
71880eb1301bSmrg# to write the compiler configuration to `libtool'.
718906c34b88Smrgm4_defun([_LT_LANG_F77_CONFIG],
719006c34b88Smrg[AC_LANG_PUSH(Fortran 77)
71910eb1301bSmrgif test -z "$F77" || test "X$F77" = "Xno"; then
719206c34b88Smrg  _lt_disable_F77=yes
719306c34b88Smrgfi
719421e67964Smrg
719506c34b88Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
719606c34b88Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
719706c34b88Smrg_LT_TAGVAR(always_export_symbols, $1)=no
719806c34b88Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
719906c34b88Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
720006c34b88Smrg_LT_TAGVAR(hardcode_direct, $1)=no
720106c34b88Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
720206c34b88Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
720306c34b88Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
720406c34b88Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
720506c34b88Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
720606c34b88Smrg_LT_TAGVAR(inherit_rpath, $1)=no
720706c34b88Smrg_LT_TAGVAR(module_cmds, $1)=
720806c34b88Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
720906c34b88Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
721006c34b88Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
721106c34b88Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
721206c34b88Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
721306c34b88Smrg_LT_TAGVAR(no_undefined_flag, $1)=
721406c34b88Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
721506c34b88Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
721621e67964Smrg
721706c34b88Smrg# Source file extension for f77 test sources.
721806c34b88Smrgac_ext=f
721921e67964Smrg
722006c34b88Smrg# Object file extension for compiled f77 test sources.
722106c34b88Smrgobjext=o
722206c34b88Smrg_LT_TAGVAR(objext, $1)=$objext
722321e67964Smrg
722406c34b88Smrg# No sense in running all these tests if we already determined that
722506c34b88Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
722606c34b88Smrg# are currently assumed to apply to all compilers on this platform,
722706c34b88Smrg# and will be corrupted by setting them based on a non-working compiler.
72280eb1301bSmrgif test "$_lt_disable_F77" != yes; then
722906c34b88Smrg  # Code to be used in simple compile tests
723006c34b88Smrg  lt_simple_compile_test_code="\
723106c34b88Smrg      subroutine t
723206c34b88Smrg      return
723306c34b88Smrg      end
723406c34b88Smrg"
723521e67964Smrg
723606c34b88Smrg  # Code to be used in simple link tests
723706c34b88Smrg  lt_simple_link_test_code="\
723806c34b88Smrg      program t
723906c34b88Smrg      end
724006c34b88Smrg"
7241c27c18e8Smrg
724206c34b88Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
724306c34b88Smrg  _LT_TAG_COMPILER
7244c27c18e8Smrg
724506c34b88Smrg  # save warnings/boilerplate of simple test code
724606c34b88Smrg  _LT_COMPILER_BOILERPLATE
724706c34b88Smrg  _LT_LINKER_BOILERPLATE
724821e67964Smrg
724906c34b88Smrg  # Allow CC to be a program name with arguments.
72500eb1301bSmrg  lt_save_CC="$CC"
725106c34b88Smrg  lt_save_GCC=$GCC
725206c34b88Smrg  lt_save_CFLAGS=$CFLAGS
725306c34b88Smrg  CC=${F77-"f77"}
725406c34b88Smrg  CFLAGS=$FFLAGS
725506c34b88Smrg  compiler=$CC
725606c34b88Smrg  _LT_TAGVAR(compiler, $1)=$CC
725706c34b88Smrg  _LT_CC_BASENAME([$compiler])
725806c34b88Smrg  GCC=$G77
725906c34b88Smrg  if test -n "$compiler"; then
726006c34b88Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
726106c34b88Smrg    AC_MSG_RESULT([$can_build_shared])
726221e67964Smrg
726306c34b88Smrg    AC_MSG_CHECKING([whether to build shared libraries])
72640eb1301bSmrg    test "$can_build_shared" = "no" && enable_shared=no
7265c27c18e8Smrg
726606c34b88Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
726706c34b88Smrg    # are all built from PIC.
726806c34b88Smrg    case $host_os in
726906c34b88Smrg      aix3*)
72700eb1301bSmrg        test "$enable_shared" = yes && enable_static=no
727106c34b88Smrg        if test -n "$RANLIB"; then
727206c34b88Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
727306c34b88Smrg          postinstall_cmds='$RANLIB $lib'
727406c34b88Smrg        fi
727506c34b88Smrg        ;;
727606c34b88Smrg      aix[[4-9]]*)
72770eb1301bSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
72780eb1301bSmrg	  test "$enable_shared" = yes && enable_static=no
727906c34b88Smrg	fi
728006c34b88Smrg        ;;
728106c34b88Smrg    esac
728206c34b88Smrg    AC_MSG_RESULT([$enable_shared])
728321e67964Smrg
728406c34b88Smrg    AC_MSG_CHECKING([whether to build static libraries])
728506c34b88Smrg    # Make sure either enable_shared or enable_static is yes.
72860eb1301bSmrg    test "$enable_shared" = yes || enable_static=yes
728706c34b88Smrg    AC_MSG_RESULT([$enable_static])
728821e67964Smrg
72890eb1301bSmrg    _LT_TAGVAR(GCC, $1)="$G77"
72900eb1301bSmrg    _LT_TAGVAR(LD, $1)="$LD"
729121e67964Smrg
729206c34b88Smrg    ## CAVEAT EMPTOR:
729306c34b88Smrg    ## There is no encapsulation within the following macros, do not change
729406c34b88Smrg    ## the running order or otherwise move them around unless you know exactly
729506c34b88Smrg    ## what you are doing...
729606c34b88Smrg    _LT_COMPILER_PIC($1)
729706c34b88Smrg    _LT_COMPILER_C_O($1)
729806c34b88Smrg    _LT_COMPILER_FILE_LOCKS($1)
729906c34b88Smrg    _LT_LINKER_SHLIBS($1)
730006c34b88Smrg    _LT_SYS_DYNAMIC_LINKER($1)
730106c34b88Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7302c27c18e8Smrg
730306c34b88Smrg    _LT_CONFIG($1)
730406c34b88Smrg  fi # test -n "$compiler"
7305c27c18e8Smrg
730606c34b88Smrg  GCC=$lt_save_GCC
73070eb1301bSmrg  CC="$lt_save_CC"
73080eb1301bSmrg  CFLAGS="$lt_save_CFLAGS"
73090eb1301bSmrgfi # test "$_lt_disable_F77" != yes
7310c27c18e8Smrg
731106c34b88SmrgAC_LANG_POP
731206c34b88Smrg])# _LT_LANG_F77_CONFIG
731321e67964Smrg
731421e67964Smrg
731506c34b88Smrg# _LT_LANG_FC_CONFIG([TAG])
731606c34b88Smrg# -------------------------
731706c34b88Smrg# Ensure that the configuration variables for a Fortran compiler are
731806c34b88Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
73190eb1301bSmrg# to write the compiler configuration to `libtool'.
732006c34b88Smrgm4_defun([_LT_LANG_FC_CONFIG],
732106c34b88Smrg[AC_LANG_PUSH(Fortran)
732221e67964Smrg
73230eb1301bSmrgif test -z "$FC" || test "X$FC" = "Xno"; then
732406c34b88Smrg  _lt_disable_FC=yes
732506c34b88Smrgfi
732621e67964Smrg
732706c34b88Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
732806c34b88Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
732906c34b88Smrg_LT_TAGVAR(always_export_symbols, $1)=no
733006c34b88Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
733106c34b88Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
733206c34b88Smrg_LT_TAGVAR(hardcode_direct, $1)=no
733306c34b88Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
733406c34b88Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
733506c34b88Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
733606c34b88Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
733706c34b88Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
733806c34b88Smrg_LT_TAGVAR(inherit_rpath, $1)=no
733906c34b88Smrg_LT_TAGVAR(module_cmds, $1)=
734006c34b88Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
734106c34b88Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
734206c34b88Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
734306c34b88Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
734406c34b88Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
734506c34b88Smrg_LT_TAGVAR(no_undefined_flag, $1)=
734606c34b88Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
734706c34b88Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
734821e67964Smrg
734906c34b88Smrg# Source file extension for fc test sources.
735006c34b88Smrgac_ext=${ac_fc_srcext-f}
735121e67964Smrg
735206c34b88Smrg# Object file extension for compiled fc test sources.
735306c34b88Smrgobjext=o
735406c34b88Smrg_LT_TAGVAR(objext, $1)=$objext
735521e67964Smrg
735606c34b88Smrg# No sense in running all these tests if we already determined that
735706c34b88Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
735806c34b88Smrg# are currently assumed to apply to all compilers on this platform,
735906c34b88Smrg# and will be corrupted by setting them based on a non-working compiler.
73600eb1301bSmrgif test "$_lt_disable_FC" != yes; then
736106c34b88Smrg  # Code to be used in simple compile tests
736206c34b88Smrg  lt_simple_compile_test_code="\
736306c34b88Smrg      subroutine t
736406c34b88Smrg      return
736506c34b88Smrg      end
736606c34b88Smrg"
736721e67964Smrg
736806c34b88Smrg  # Code to be used in simple link tests
736906c34b88Smrg  lt_simple_link_test_code="\
737006c34b88Smrg      program t
737106c34b88Smrg      end
737206c34b88Smrg"
737321e67964Smrg
737406c34b88Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
737506c34b88Smrg  _LT_TAG_COMPILER
737621e67964Smrg
737706c34b88Smrg  # save warnings/boilerplate of simple test code
737806c34b88Smrg  _LT_COMPILER_BOILERPLATE
737906c34b88Smrg  _LT_LINKER_BOILERPLATE
738021e67964Smrg
738106c34b88Smrg  # Allow CC to be a program name with arguments.
73820eb1301bSmrg  lt_save_CC="$CC"
738306c34b88Smrg  lt_save_GCC=$GCC
738406c34b88Smrg  lt_save_CFLAGS=$CFLAGS
738506c34b88Smrg  CC=${FC-"f95"}
738606c34b88Smrg  CFLAGS=$FCFLAGS
738706c34b88Smrg  compiler=$CC
738806c34b88Smrg  GCC=$ac_cv_fc_compiler_gnu
738921e67964Smrg
739006c34b88Smrg  _LT_TAGVAR(compiler, $1)=$CC
739106c34b88Smrg  _LT_CC_BASENAME([$compiler])
7392c27c18e8Smrg
739306c34b88Smrg  if test -n "$compiler"; then
739406c34b88Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
739506c34b88Smrg    AC_MSG_RESULT([$can_build_shared])
739606c34b88Smrg
739706c34b88Smrg    AC_MSG_CHECKING([whether to build shared libraries])
73980eb1301bSmrg    test "$can_build_shared" = "no" && enable_shared=no
739906c34b88Smrg
740006c34b88Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
740106c34b88Smrg    # are all built from PIC.
740206c34b88Smrg    case $host_os in
740306c34b88Smrg      aix3*)
74040eb1301bSmrg        test "$enable_shared" = yes && enable_static=no
740506c34b88Smrg        if test -n "$RANLIB"; then
740606c34b88Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
740706c34b88Smrg          postinstall_cmds='$RANLIB $lib'
740806c34b88Smrg        fi
740906c34b88Smrg        ;;
741006c34b88Smrg      aix[[4-9]]*)
74110eb1301bSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
74120eb1301bSmrg	  test "$enable_shared" = yes && enable_static=no
7413c27c18e8Smrg	fi
741406c34b88Smrg        ;;
741506c34b88Smrg    esac
741606c34b88Smrg    AC_MSG_RESULT([$enable_shared])
741721e67964Smrg
741806c34b88Smrg    AC_MSG_CHECKING([whether to build static libraries])
741906c34b88Smrg    # Make sure either enable_shared or enable_static is yes.
74200eb1301bSmrg    test "$enable_shared" = yes || enable_static=yes
742106c34b88Smrg    AC_MSG_RESULT([$enable_static])
742221e67964Smrg
74230eb1301bSmrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
74240eb1301bSmrg    _LT_TAGVAR(LD, $1)="$LD"
742521e67964Smrg
742606c34b88Smrg    ## CAVEAT EMPTOR:
742706c34b88Smrg    ## There is no encapsulation within the following macros, do not change
742806c34b88Smrg    ## the running order or otherwise move them around unless you know exactly
742906c34b88Smrg    ## what you are doing...
743006c34b88Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
743106c34b88Smrg    _LT_COMPILER_PIC($1)
743206c34b88Smrg    _LT_COMPILER_C_O($1)
743306c34b88Smrg    _LT_COMPILER_FILE_LOCKS($1)
743406c34b88Smrg    _LT_LINKER_SHLIBS($1)
743506c34b88Smrg    _LT_SYS_DYNAMIC_LINKER($1)
743606c34b88Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7437c27c18e8Smrg
743806c34b88Smrg    _LT_CONFIG($1)
743906c34b88Smrg  fi # test -n "$compiler"
744021e67964Smrg
744106c34b88Smrg  GCC=$lt_save_GCC
744206c34b88Smrg  CC=$lt_save_CC
744306c34b88Smrg  CFLAGS=$lt_save_CFLAGS
74440eb1301bSmrgfi # test "$_lt_disable_FC" != yes
744521e67964Smrg
744606c34b88SmrgAC_LANG_POP
744706c34b88Smrg])# _LT_LANG_FC_CONFIG
744821e67964Smrg
744921e67964Smrg
745006c34b88Smrg# _LT_LANG_GCJ_CONFIG([TAG])
745106c34b88Smrg# --------------------------
745206c34b88Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
745306c34b88Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
74540eb1301bSmrg# to write the compiler configuration to `libtool'.
745506c34b88Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
745606c34b88Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
745706c34b88SmrgAC_LANG_SAVE
745821e67964Smrg
745906c34b88Smrg# Source file extension for Java test sources.
746006c34b88Smrgac_ext=java
746121e67964Smrg
746206c34b88Smrg# Object file extension for compiled Java test sources.
746306c34b88Smrgobjext=o
746406c34b88Smrg_LT_TAGVAR(objext, $1)=$objext
746521e67964Smrg
746606c34b88Smrg# Code to be used in simple compile tests
746706c34b88Smrglt_simple_compile_test_code="class foo {}"
746821e67964Smrg
746906c34b88Smrg# Code to be used in simple link tests
747006c34b88Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
747121e67964Smrg
747206c34b88Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
747306c34b88Smrg_LT_TAG_COMPILER
747421e67964Smrg
747506c34b88Smrg# save warnings/boilerplate of simple test code
747606c34b88Smrg_LT_COMPILER_BOILERPLATE
747706c34b88Smrg_LT_LINKER_BOILERPLATE
747821e67964Smrg
747906c34b88Smrg# Allow CC to be a program name with arguments.
748006c34b88Smrglt_save_CC=$CC
748106c34b88Smrglt_save_CFLAGS=$CFLAGS
748206c34b88Smrglt_save_GCC=$GCC
748306c34b88SmrgGCC=yes
748406c34b88SmrgCC=${GCJ-"gcj"}
748506c34b88SmrgCFLAGS=$GCJFLAGS
748606c34b88Smrgcompiler=$CC
748706c34b88Smrg_LT_TAGVAR(compiler, $1)=$CC
74880eb1301bSmrg_LT_TAGVAR(LD, $1)="$LD"
748906c34b88Smrg_LT_CC_BASENAME([$compiler])
749021e67964Smrg
749106c34b88Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
749206c34b88Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
749321e67964Smrg
749406c34b88Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
749506c34b88Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
749606c34b88Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
749721e67964Smrg
749806c34b88Smrgif test -n "$compiler"; then
749906c34b88Smrg  _LT_COMPILER_NO_RTTI($1)
750006c34b88Smrg  _LT_COMPILER_PIC($1)
750106c34b88Smrg  _LT_COMPILER_C_O($1)
750206c34b88Smrg  _LT_COMPILER_FILE_LOCKS($1)
750306c34b88Smrg  _LT_LINKER_SHLIBS($1)
750406c34b88Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
750521e67964Smrg
750606c34b88Smrg  _LT_CONFIG($1)
750706c34b88Smrgfi
750821e67964Smrg
750906c34b88SmrgAC_LANG_RESTORE
751021e67964Smrg
751106c34b88SmrgGCC=$lt_save_GCC
751206c34b88SmrgCC=$lt_save_CC
751306c34b88SmrgCFLAGS=$lt_save_CFLAGS
751406c34b88Smrg])# _LT_LANG_GCJ_CONFIG
751521e67964Smrg
751621e67964Smrg
751706c34b88Smrg# _LT_LANG_GO_CONFIG([TAG])
751806c34b88Smrg# --------------------------
751906c34b88Smrg# Ensure that the configuration variables for the GNU Go compiler
752006c34b88Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
75210eb1301bSmrg# to write the compiler configuration to `libtool'.
752206c34b88Smrgm4_defun([_LT_LANG_GO_CONFIG],
752306c34b88Smrg[AC_REQUIRE([LT_PROG_GO])dnl
752406c34b88SmrgAC_LANG_SAVE
752506c34b88Smrg
752606c34b88Smrg# Source file extension for Go test sources.
752706c34b88Smrgac_ext=go
752821e67964Smrg
752906c34b88Smrg# Object file extension for compiled Go test sources.
753006c34b88Smrgobjext=o
753106c34b88Smrg_LT_TAGVAR(objext, $1)=$objext
753221e67964Smrg
753306c34b88Smrg# Code to be used in simple compile tests
753406c34b88Smrglt_simple_compile_test_code="package main; func main() { }"
753521e67964Smrg
753606c34b88Smrg# Code to be used in simple link tests
753706c34b88Smrglt_simple_link_test_code='package main; func main() { }'
753821e67964Smrg
753906c34b88Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
754006c34b88Smrg_LT_TAG_COMPILER
754121e67964Smrg
754206c34b88Smrg# save warnings/boilerplate of simple test code
754306c34b88Smrg_LT_COMPILER_BOILERPLATE
754406c34b88Smrg_LT_LINKER_BOILERPLATE
7545c27c18e8Smrg
754606c34b88Smrg# Allow CC to be a program name with arguments.
754706c34b88Smrglt_save_CC=$CC
754806c34b88Smrglt_save_CFLAGS=$CFLAGS
754906c34b88Smrglt_save_GCC=$GCC
755006c34b88SmrgGCC=yes
755106c34b88SmrgCC=${GOC-"gccgo"}
755206c34b88SmrgCFLAGS=$GOFLAGS
755306c34b88Smrgcompiler=$CC
755406c34b88Smrg_LT_TAGVAR(compiler, $1)=$CC
75550eb1301bSmrg_LT_TAGVAR(LD, $1)="$LD"
755606c34b88Smrg_LT_CC_BASENAME([$compiler])
755721e67964Smrg
755806c34b88Smrg# Go did not exist at the time GCC didn't implicitly link libc in.
755906c34b88Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
756021e67964Smrg
756106c34b88Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
756206c34b88Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
756306c34b88Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
756421e67964Smrg
756506c34b88Smrgif test -n "$compiler"; then
756606c34b88Smrg  _LT_COMPILER_NO_RTTI($1)
756706c34b88Smrg  _LT_COMPILER_PIC($1)
756806c34b88Smrg  _LT_COMPILER_C_O($1)
756906c34b88Smrg  _LT_COMPILER_FILE_LOCKS($1)
757006c34b88Smrg  _LT_LINKER_SHLIBS($1)
757106c34b88Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
757221e67964Smrg
757306c34b88Smrg  _LT_CONFIG($1)
757406c34b88Smrgfi
757521e67964Smrg
757606c34b88SmrgAC_LANG_RESTORE
7577c27c18e8Smrg
757806c34b88SmrgGCC=$lt_save_GCC
757906c34b88SmrgCC=$lt_save_CC
758006c34b88SmrgCFLAGS=$lt_save_CFLAGS
758106c34b88Smrg])# _LT_LANG_GO_CONFIG
7582c27c18e8Smrg
7583c27c18e8Smrg
758406c34b88Smrg# _LT_LANG_RC_CONFIG([TAG])
758506c34b88Smrg# -------------------------
758606c34b88Smrg# Ensure that the configuration variables for the Windows resource compiler
758706c34b88Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
75880eb1301bSmrg# to write the compiler configuration to `libtool'.
758906c34b88Smrgm4_defun([_LT_LANG_RC_CONFIG],
759006c34b88Smrg[AC_REQUIRE([LT_PROG_RC])dnl
759106c34b88SmrgAC_LANG_SAVE
7592c27c18e8Smrg
759306c34b88Smrg# Source file extension for RC test sources.
759406c34b88Smrgac_ext=rc
7595c27c18e8Smrg
759606c34b88Smrg# Object file extension for compiled RC test sources.
759706c34b88Smrgobjext=o
759806c34b88Smrg_LT_TAGVAR(objext, $1)=$objext
7599c27c18e8Smrg
760006c34b88Smrg# Code to be used in simple compile tests
760106c34b88Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
7602c27c18e8Smrg
760306c34b88Smrg# Code to be used in simple link tests
76040eb1301bSmrglt_simple_link_test_code="$lt_simple_compile_test_code"
7605c27c18e8Smrg
760606c34b88Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
760706c34b88Smrg_LT_TAG_COMPILER
7608c27c18e8Smrg
760906c34b88Smrg# save warnings/boilerplate of simple test code
761006c34b88Smrg_LT_COMPILER_BOILERPLATE
761106c34b88Smrg_LT_LINKER_BOILERPLATE
7612c27c18e8Smrg
761306c34b88Smrg# Allow CC to be a program name with arguments.
76140eb1301bSmrglt_save_CC="$CC"
761506c34b88Smrglt_save_CFLAGS=$CFLAGS
761606c34b88Smrglt_save_GCC=$GCC
761706c34b88SmrgGCC=
761806c34b88SmrgCC=${RC-"windres"}
761906c34b88SmrgCFLAGS=
762006c34b88Smrgcompiler=$CC
762106c34b88Smrg_LT_TAGVAR(compiler, $1)=$CC
762206c34b88Smrg_LT_CC_BASENAME([$compiler])
762306c34b88Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
7624c27c18e8Smrg
762506c34b88Smrgif test -n "$compiler"; then
762606c34b88Smrg  :
762706c34b88Smrg  _LT_CONFIG($1)
762806c34b88Smrgfi
7629c27c18e8Smrg
763006c34b88SmrgGCC=$lt_save_GCC
763106c34b88SmrgAC_LANG_RESTORE
763206c34b88SmrgCC=$lt_save_CC
763306c34b88SmrgCFLAGS=$lt_save_CFLAGS
763406c34b88Smrg])# _LT_LANG_RC_CONFIG
7635c27c18e8Smrg
7636c27c18e8Smrg
763706c34b88Smrg# LT_PROG_GCJ
763806c34b88Smrg# -----------
763906c34b88SmrgAC_DEFUN([LT_PROG_GCJ],
764006c34b88Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
764106c34b88Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
764206c34b88Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
76430eb1301bSmrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
764406c34b88Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
764506c34b88Smrg])
7646c27c18e8Smrg
764706c34b88Smrg# Old name:
764806c34b88SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
764906c34b88Smrgdnl aclocal-1.4 backwards compatibility:
765006c34b88Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
765121e67964Smrg
765221e67964Smrg
765306c34b88Smrg# LT_PROG_GO
765406c34b88Smrg# ----------
765506c34b88SmrgAC_DEFUN([LT_PROG_GO],
765606c34b88Smrg[AC_CHECK_TOOL(GOC, gccgo,)
765706c34b88Smrg])
7658c27c18e8Smrg
765921e67964Smrg
766006c34b88Smrg# LT_PROG_RC
766106c34b88Smrg# ----------
766206c34b88SmrgAC_DEFUN([LT_PROG_RC],
766306c34b88Smrg[AC_CHECK_TOOL(RC, windres,)
766406c34b88Smrg])
766521e67964Smrg
766606c34b88Smrg# Old name:
766706c34b88SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
766806c34b88Smrgdnl aclocal-1.4 backwards compatibility:
766906c34b88Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
767021e67964Smrg
767121e67964Smrg
767206c34b88Smrg# _LT_DECL_EGREP
767306c34b88Smrg# --------------
767406c34b88Smrg# If we don't have a new enough Autoconf to choose the best grep
767506c34b88Smrg# available, choose the one first in the user's PATH.
767606c34b88Smrgm4_defun([_LT_DECL_EGREP],
767706c34b88Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
767806c34b88SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
767906c34b88Smrgtest -z "$GREP" && GREP=grep
768006c34b88Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
768106c34b88Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
768206c34b88Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
768306c34b88Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
768406c34b88SmrgAC_SUBST([GREP])
768506c34b88Smrg])
768621e67964Smrg
768706c34b88Smrg
768806c34b88Smrg# _LT_DECL_OBJDUMP
768906c34b88Smrg# --------------
769006c34b88Smrg# If we don't have a new enough Autoconf to choose the best objdump
769106c34b88Smrg# available, choose the one first in the user's PATH.
769206c34b88Smrgm4_defun([_LT_DECL_OBJDUMP],
769306c34b88Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
769406c34b88Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
769506c34b88Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
769606c34b88SmrgAC_SUBST([OBJDUMP])
769721e67964Smrg])
769821e67964Smrg
769906c34b88Smrg# _LT_DECL_DLLTOOL
770006c34b88Smrg# ----------------
770106c34b88Smrg# Ensure DLLTOOL variable is set.
770206c34b88Smrgm4_defun([_LT_DECL_DLLTOOL],
770306c34b88Smrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
770406c34b88Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
770506c34b88Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
770606c34b88SmrgAC_SUBST([DLLTOOL])
770706c34b88Smrg])
770821e67964Smrg
770906c34b88Smrg# _LT_DECL_SED
771006c34b88Smrg# ------------
771106c34b88Smrg# Check for a fully-functional sed program, that truncates
771206c34b88Smrg# as few characters as possible.  Prefer GNU sed if found.
771306c34b88Smrgm4_defun([_LT_DECL_SED],
771406c34b88Smrg[AC_PROG_SED
771506c34b88Smrgtest -z "$SED" && SED=sed
771606c34b88SmrgXsed="$SED -e 1s/^X//"
771706c34b88Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
771806c34b88Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
771906c34b88Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
772006c34b88Smrg])# _LT_DECL_SED
772121e67964Smrg
772206c34b88Smrgm4_ifndef([AC_PROG_SED], [
772306c34b88Smrg# NOTE: This macro has been submitted for inclusion into   #
772406c34b88Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
772506c34b88Smrg#  a released version of Autoconf we should remove this    #
772606c34b88Smrg#  macro and use it instead.                               #
772721e67964Smrg
772806c34b88Smrgm4_defun([AC_PROG_SED],
772906c34b88Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
773006c34b88SmrgAC_CACHE_VAL(lt_cv_path_SED,
773106c34b88Smrg[# Loop through the user's path and test for sed and gsed.
773206c34b88Smrg# Then use that list of sed's as ones to test for truncation.
773306c34b88Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
773406c34b88Smrgfor as_dir in $PATH
773506c34b88Smrgdo
773606c34b88Smrg  IFS=$as_save_IFS
773706c34b88Smrg  test -z "$as_dir" && as_dir=.
773806c34b88Smrg  for lt_ac_prog in sed gsed; do
773906c34b88Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
774006c34b88Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
774106c34b88Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
774206c34b88Smrg      fi
774306c34b88Smrg    done
774406c34b88Smrg  done
774506c34b88Smrgdone
774606c34b88SmrgIFS=$as_save_IFS
774706c34b88Smrglt_ac_max=0
774806c34b88Smrglt_ac_count=0
774906c34b88Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
775006c34b88Smrg# along with /bin/sed that truncates output.
775106c34b88Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
77520eb1301bSmrg  test ! -f $lt_ac_sed && continue
775306c34b88Smrg  cat /dev/null > conftest.in
775406c34b88Smrg  lt_ac_count=0
775506c34b88Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
775606c34b88Smrg  # Check for GNU sed and select it if it is found.
775706c34b88Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
775806c34b88Smrg    lt_cv_path_SED=$lt_ac_sed
775906c34b88Smrg    break
776006c34b88Smrg  fi
776106c34b88Smrg  while true; do
776206c34b88Smrg    cat conftest.in conftest.in >conftest.tmp
776306c34b88Smrg    mv conftest.tmp conftest.in
776406c34b88Smrg    cp conftest.in conftest.nl
776506c34b88Smrg    echo >>conftest.nl
776606c34b88Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
776706c34b88Smrg    cmp -s conftest.out conftest.nl || break
776806c34b88Smrg    # 10000 chars as input seems more than enough
77690eb1301bSmrg    test $lt_ac_count -gt 10 && break
777006c34b88Smrg    lt_ac_count=`expr $lt_ac_count + 1`
77710eb1301bSmrg    if test $lt_ac_count -gt $lt_ac_max; then
777206c34b88Smrg      lt_ac_max=$lt_ac_count
777306c34b88Smrg      lt_cv_path_SED=$lt_ac_sed
777406c34b88Smrg    fi
777506c34b88Smrg  done
777606c34b88Smrgdone
777721e67964Smrg])
777806c34b88SmrgSED=$lt_cv_path_SED
777906c34b88SmrgAC_SUBST([SED])
778006c34b88SmrgAC_MSG_RESULT([$SED])
778106c34b88Smrg])#AC_PROG_SED
778206c34b88Smrg])#m4_ifndef
7783c43cc173Smrg
778406c34b88Smrg# Old name:
778506c34b88SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
778606c34b88Smrgdnl aclocal-1.4 backwards compatibility:
778706c34b88Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
7788c27c18e8Smrg
7789c27c18e8Smrg
779006c34b88Smrg# _LT_CHECK_SHELL_FEATURES
779106c34b88Smrg# ------------------------
779206c34b88Smrg# Find out whether the shell is Bourne or XSI compatible,
779306c34b88Smrg# or has some other useful features.
779406c34b88Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
77950eb1301bSmrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
77960eb1301bSmrg# Try some XSI features
77970eb1301bSmrgxsi_shell=no
77980eb1301bSmrg( _lt_dummy="a/b/c"
77990eb1301bSmrg  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
78000eb1301bSmrg      = c,a/b,b/c, \
78010eb1301bSmrg    && eval 'test $(( 1 + 1 )) -eq 2 \
78020eb1301bSmrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
78030eb1301bSmrg  && xsi_shell=yes
78040eb1301bSmrgAC_MSG_RESULT([$xsi_shell])
78050eb1301bSmrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
78060eb1301bSmrg
78070eb1301bSmrgAC_MSG_CHECKING([whether the shell understands "+="])
78080eb1301bSmrglt_shell_append=no
78090eb1301bSmrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
78100eb1301bSmrg    >/dev/null 2>&1 \
78110eb1301bSmrg  && lt_shell_append=yes
78120eb1301bSmrgAC_MSG_RESULT([$lt_shell_append])
78130eb1301bSmrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
78140eb1301bSmrg
78150eb1301bSmrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
781606c34b88Smrg  lt_unset=unset
781706c34b88Smrgelse
781806c34b88Smrg  lt_unset=false
781906c34b88Smrgfi
782006c34b88Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
782106c34b88Smrg
782206c34b88Smrg# test EBCDIC or ASCII
782306c34b88Smrgcase `echo X|tr X '\101'` in
782406c34b88Smrg A) # ASCII based system
782506c34b88Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
782606c34b88Smrg  lt_SP2NL='tr \040 \012'
782706c34b88Smrg  lt_NL2SP='tr \015\012 \040\040'
782806c34b88Smrg  ;;
782906c34b88Smrg *) # EBCDIC based system
783006c34b88Smrg  lt_SP2NL='tr \100 \n'
783106c34b88Smrg  lt_NL2SP='tr \r\n \100\100'
783206c34b88Smrg  ;;
783306c34b88Smrgesac
783406c34b88Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
783506c34b88Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
783606c34b88Smrg])# _LT_CHECK_SHELL_FEATURES
783706c34b88Smrg
783806c34b88Smrg
78390eb1301bSmrg# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
78400eb1301bSmrg# ------------------------------------------------------
78410eb1301bSmrg# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
78420eb1301bSmrg# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
78430eb1301bSmrgm4_defun([_LT_PROG_FUNCTION_REPLACE],
78440eb1301bSmrg[dnl {
78450eb1301bSmrgsed -e '/^$1 ()$/,/^} # $1 /c\
78460eb1301bSmrg$1 ()\
78470eb1301bSmrg{\
78480eb1301bSmrgm4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
78490eb1301bSmrg} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
78500eb1301bSmrg  && mv -f "$cfgfile.tmp" "$cfgfile" \
78510eb1301bSmrg    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
78520eb1301bSmrgtest 0 -eq $? || _lt_function_replace_fail=:
78530eb1301bSmrg])
78540eb1301bSmrg
78550eb1301bSmrg
78560eb1301bSmrg# _LT_PROG_REPLACE_SHELLFNS
78570eb1301bSmrg# -------------------------
78580eb1301bSmrg# Replace existing portable implementations of several shell functions with
78590eb1301bSmrg# equivalent extended shell implementations where those features are available..
78600eb1301bSmrgm4_defun([_LT_PROG_REPLACE_SHELLFNS],
78610eb1301bSmrg[if test x"$xsi_shell" = xyes; then
78620eb1301bSmrg  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
78630eb1301bSmrg    case ${1} in
78640eb1301bSmrg      */*) func_dirname_result="${1%/*}${2}" ;;
78650eb1301bSmrg      *  ) func_dirname_result="${3}" ;;
78660eb1301bSmrg    esac])
78670eb1301bSmrg
78680eb1301bSmrg  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
78690eb1301bSmrg    func_basename_result="${1##*/}"])
78700eb1301bSmrg
78710eb1301bSmrg  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
78720eb1301bSmrg    case ${1} in
78730eb1301bSmrg      */*) func_dirname_result="${1%/*}${2}" ;;
78740eb1301bSmrg      *  ) func_dirname_result="${3}" ;;
78750eb1301bSmrg    esac
78760eb1301bSmrg    func_basename_result="${1##*/}"])
78770eb1301bSmrg
78780eb1301bSmrg  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
78790eb1301bSmrg    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
78800eb1301bSmrg    # positional parameters, so assign one to ordinary parameter first.
78810eb1301bSmrg    func_stripname_result=${3}
78820eb1301bSmrg    func_stripname_result=${func_stripname_result#"${1}"}
78830eb1301bSmrg    func_stripname_result=${func_stripname_result%"${2}"}])
78840eb1301bSmrg
78850eb1301bSmrg  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
78860eb1301bSmrg    func_split_long_opt_name=${1%%=*}
78870eb1301bSmrg    func_split_long_opt_arg=${1#*=}])
78880eb1301bSmrg
78890eb1301bSmrg  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
78900eb1301bSmrg    func_split_short_opt_arg=${1#??}
78910eb1301bSmrg    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
78920eb1301bSmrg
78930eb1301bSmrg  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
78940eb1301bSmrg    case ${1} in
78950eb1301bSmrg      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
78960eb1301bSmrg      *)    func_lo2o_result=${1} ;;
78970eb1301bSmrg    esac])
78980eb1301bSmrg
78990eb1301bSmrg  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
79000eb1301bSmrg
79010eb1301bSmrg  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
79020eb1301bSmrg
79030eb1301bSmrg  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
79040eb1301bSmrgfi
79050eb1301bSmrg
79060eb1301bSmrgif test x"$lt_shell_append" = xyes; then
79070eb1301bSmrg  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
79080eb1301bSmrg
79090eb1301bSmrg  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
79100eb1301bSmrg    func_quote_for_eval "${2}"
79110eb1301bSmrgdnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
79120eb1301bSmrg    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
79130eb1301bSmrg
79140eb1301bSmrg  # Save a `func_append' function call where possible by direct use of '+='
79150eb1301bSmrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
79160eb1301bSmrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
79170eb1301bSmrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
79180eb1301bSmrg  test 0 -eq $? || _lt_function_replace_fail=:
79190eb1301bSmrgelse
79200eb1301bSmrg  # Save a `func_append' function call even when '+=' is not available
79210eb1301bSmrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
79220eb1301bSmrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
79230eb1301bSmrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
79240eb1301bSmrg  test 0 -eq $? || _lt_function_replace_fail=:
79250eb1301bSmrgfi
79260eb1301bSmrg
79270eb1301bSmrgif test x"$_lt_function_replace_fail" = x":"; then
79280eb1301bSmrg  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
79290eb1301bSmrgfi
79300eb1301bSmrg])
79310eb1301bSmrg
793206c34b88Smrg# _LT_PATH_CONVERSION_FUNCTIONS
793306c34b88Smrg# -----------------------------
79340eb1301bSmrg# Determine which file name conversion functions should be used by
793506c34b88Smrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
793606c34b88Smrg# for certain cross-compile configurations and native mingw.
793706c34b88Smrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
793806c34b88Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
793906c34b88SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
794006c34b88SmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
794106c34b88SmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
794206c34b88Smrg[case $host in
794306c34b88Smrg  *-*-mingw* )
794406c34b88Smrg    case $build in
794506c34b88Smrg      *-*-mingw* ) # actually msys
794606c34b88Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
794706c34b88Smrg        ;;
794806c34b88Smrg      *-*-cygwin* )
794906c34b88Smrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
795006c34b88Smrg        ;;
795106c34b88Smrg      * ) # otherwise, assume *nix
795206c34b88Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
795306c34b88Smrg        ;;
795406c34b88Smrg    esac
795506c34b88Smrg    ;;
795606c34b88Smrg  *-*-cygwin* )
795706c34b88Smrg    case $build in
795806c34b88Smrg      *-*-mingw* ) # actually msys
795906c34b88Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
796006c34b88Smrg        ;;
796106c34b88Smrg      *-*-cygwin* )
796206c34b88Smrg        lt_cv_to_host_file_cmd=func_convert_file_noop
796306c34b88Smrg        ;;
796406c34b88Smrg      * ) # otherwise, assume *nix
796506c34b88Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
796606c34b88Smrg        ;;
796706c34b88Smrg    esac
796806c34b88Smrg    ;;
796906c34b88Smrg  * ) # unhandled hosts (and "normal" native builds)
797006c34b88Smrg    lt_cv_to_host_file_cmd=func_convert_file_noop
797106c34b88Smrg    ;;
797206c34b88Smrgesac
797306c34b88Smrg])
797406c34b88Smrgto_host_file_cmd=$lt_cv_to_host_file_cmd
797506c34b88SmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
797606c34b88Smrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
797706c34b88Smrg         [0], [convert $build file names to $host format])dnl
797806c34b88Smrg
797906c34b88SmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
798006c34b88SmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
798106c34b88Smrg[#assume ordinary cross tools, or native build.
798206c34b88Smrglt_cv_to_tool_file_cmd=func_convert_file_noop
798306c34b88Smrgcase $host in
798406c34b88Smrg  *-*-mingw* )
798506c34b88Smrg    case $build in
798606c34b88Smrg      *-*-mingw* ) # actually msys
798706c34b88Smrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
798806c34b88Smrg        ;;
798906c34b88Smrg    esac
799006c34b88Smrg    ;;
799106c34b88Smrgesac
799206c34b88Smrg])
799306c34b88Smrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
799406c34b88SmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
799506c34b88Smrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
799606c34b88Smrg         [0], [convert $build files to toolchain format])dnl
799706c34b88Smrg])# _LT_PATH_CONVERSION_FUNCTIONS
7998c43cc173Smrg
799906c34b88Smrg# Helper functions for option handling.                    -*- Autoconf -*-
800006c34b88Smrg#
80010eb1301bSmrg#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
80020eb1301bSmrg#   Inc.
800306c34b88Smrg#   Written by Gary V. Vaughan, 2004
800406c34b88Smrg#
800506c34b88Smrg# This file is free software; the Free Software Foundation gives
800606c34b88Smrg# unlimited permission to copy and/or distribute it, with or without
800706c34b88Smrg# modifications, as long as this notice is preserved.
8008c43cc173Smrg
80090eb1301bSmrg# serial 7 ltoptions.m4
8010c43cc173Smrg
801106c34b88Smrg# This is to help aclocal find these macros, as it can't see m4_define.
801206c34b88SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
8013f1ee322dSmrg
8014f1ee322dSmrg
801506c34b88Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
801606c34b88Smrg# ------------------------------------------
801706c34b88Smrgm4_define([_LT_MANGLE_OPTION],
801806c34b88Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
801989069ce9Smrg
8020c43cc173Smrg
802106c34b88Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
802206c34b88Smrg# ---------------------------------------
802306c34b88Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
802406c34b88Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
802506c34b88Smrg# saved as a flag.
802606c34b88Smrgm4_define([_LT_SET_OPTION],
802706c34b88Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
802806c34b88Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
802906c34b88Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
80300eb1301bSmrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
803106c34b88Smrg])
8032c43cc173Smrg
8033c43cc173Smrg
803406c34b88Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
803506c34b88Smrg# ------------------------------------------------------------
803606c34b88Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
803706c34b88Smrgm4_define([_LT_IF_OPTION],
803806c34b88Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
8039c43cc173Smrg
8040c27c18e8Smrg
804106c34b88Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
804206c34b88Smrg# -------------------------------------------------------
804306c34b88Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
804406c34b88Smrg# are set.
804506c34b88Smrgm4_define([_LT_UNLESS_OPTIONS],
804606c34b88Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
804706c34b88Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
804806c34b88Smrg		      [m4_define([$0_found])])])[]dnl
804906c34b88Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
805006c34b88Smrg])[]dnl
805106c34b88Smrg])
805221e67964Smrg
805321e67964Smrg
805406c34b88Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
805506c34b88Smrg# ----------------------------------------
805606c34b88Smrg# OPTION-LIST is a space-separated list of Libtool options associated
805706c34b88Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
805806c34b88Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
805906c34b88Smrg# the unknown option and exit.
806006c34b88Smrgm4_defun([_LT_SET_OPTIONS],
806106c34b88Smrg[# Set options
806206c34b88Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
806306c34b88Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
806421e67964Smrg
806506c34b88Smrgm4_if([$1],[LT_INIT],[
806606c34b88Smrg  dnl
806706c34b88Smrg  dnl Simply set some default values (i.e off) if boolean options were not
806806c34b88Smrg  dnl specified:
806906c34b88Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
807006c34b88Smrg  ])
807106c34b88Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
807206c34b88Smrg  ])
807306c34b88Smrg  dnl
807406c34b88Smrg  dnl If no reference was made to various pairs of opposing options, then
807506c34b88Smrg  dnl we run the default mode handler for the pair.  For example, if neither
80760eb1301bSmrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
807706c34b88Smrg  dnl archives by default:
807806c34b88Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
807906c34b88Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
808006c34b88Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
808106c34b88Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
80820eb1301bSmrg  		   [_LT_ENABLE_FAST_INSTALL])
808306c34b88Smrg  ])
808406c34b88Smrg])# _LT_SET_OPTIONS
8085c43cc173Smrg
8086c43cc173Smrg
8087c43cc173Smrg
808806c34b88Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
808906c34b88Smrg# -----------------------------------------
809006c34b88Smrgm4_define([_LT_MANGLE_DEFUN],
809106c34b88Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
8092c43cc173Smrg
8093c43cc173Smrg
809406c34b88Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
809506c34b88Smrg# -----------------------------------------------
809606c34b88Smrgm4_define([LT_OPTION_DEFINE],
809706c34b88Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
809806c34b88Smrg])# LT_OPTION_DEFINE
8099c43cc173Smrg
8100c43cc173Smrg
810106c34b88Smrg# dlopen
810206c34b88Smrg# ------
810306c34b88SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
810406c34b88Smrg])
8105c43cc173Smrg
810606c34b88SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
810706c34b88Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
810806c34b88SmrgAC_DIAGNOSE([obsolete],
810906c34b88Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
81100eb1301bSmrgput the `dlopen' option into LT_INIT's first parameter.])
811106c34b88Smrg])
8112c43cc173Smrg
811306c34b88Smrgdnl aclocal-1.4 backwards compatibility:
811406c34b88Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
8115c43cc173Smrg
8116c43cc173Smrg
811706c34b88Smrg# win32-dll
811806c34b88Smrg# ---------
811906c34b88Smrg# Declare package support for building win32 dll's.
812006c34b88SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
812106c34b88Smrg[enable_win32_dll=yes
8122c43cc173Smrg
812306c34b88Smrgcase $host in
812406c34b88Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
812506c34b88Smrg  AC_CHECK_TOOL(AS, as, false)
812606c34b88Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
812706c34b88Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
812806c34b88Smrg  ;;
812906c34b88Smrgesac
8130c27c18e8Smrg
813106c34b88Smrgtest -z "$AS" && AS=as
813206c34b88Smrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
813389069ce9Smrg
813406c34b88Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
813506c34b88Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
813689069ce9Smrg
813706c34b88Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
813806c34b88Smrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
813906c34b88Smrg])# win32-dll
8140c43cc173Smrg
814106c34b88SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
814206c34b88Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
814306c34b88Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
814406c34b88SmrgAC_DIAGNOSE([obsolete],
814506c34b88Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
81460eb1301bSmrgput the `win32-dll' option into LT_INIT's first parameter.])
814706c34b88Smrg])
8148c43cc173Smrg
814906c34b88Smrgdnl aclocal-1.4 backwards compatibility:
815006c34b88Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
8151c43cc173Smrg
8152c43cc173Smrg
815306c34b88Smrg# _LT_ENABLE_SHARED([DEFAULT])
815406c34b88Smrg# ----------------------------
81550eb1301bSmrg# implement the --enable-shared flag, and supports the `shared' and
81560eb1301bSmrg# `disable-shared' LT_INIT options.
81570eb1301bSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
815806c34b88Smrgm4_define([_LT_ENABLE_SHARED],
815906c34b88Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
816006c34b88SmrgAC_ARG_ENABLE([shared],
816106c34b88Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
816206c34b88Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
816306c34b88Smrg    [p=${PACKAGE-default}
816406c34b88Smrg    case $enableval in
816506c34b88Smrg    yes) enable_shared=yes ;;
816606c34b88Smrg    no) enable_shared=no ;;
816706c34b88Smrg    *)
816806c34b88Smrg      enable_shared=no
816906c34b88Smrg      # Look at the argument we got.  We use all the common list separators.
81700eb1301bSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
817106c34b88Smrg      for pkg in $enableval; do
81720eb1301bSmrg	IFS="$lt_save_ifs"
817306c34b88Smrg	if test "X$pkg" = "X$p"; then
817406c34b88Smrg	  enable_shared=yes
817506c34b88Smrg	fi
817606c34b88Smrg      done
81770eb1301bSmrg      IFS="$lt_save_ifs"
817806c34b88Smrg      ;;
817906c34b88Smrg    esac],
818006c34b88Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
8181c43cc173Smrg
818206c34b88Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
818306c34b88Smrg	[Whether or not to build shared libraries])
818406c34b88Smrg])# _LT_ENABLE_SHARED
8185c43cc173Smrg
818606c34b88SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
818706c34b88SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
8188c43cc173Smrg
818906c34b88Smrg# Old names:
819006c34b88SmrgAC_DEFUN([AC_ENABLE_SHARED],
819106c34b88Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
819206c34b88Smrg])
8193c43cc173Smrg
819406c34b88SmrgAC_DEFUN([AC_DISABLE_SHARED],
819506c34b88Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
819606c34b88Smrg])
8197c43cc173Smrg
819806c34b88SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
819906c34b88SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
8200c43cc173Smrg
820106c34b88Smrgdnl aclocal-1.4 backwards compatibility:
820206c34b88Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
820306c34b88Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
8204c43cc173Smrg
8205c43cc173Smrg
8206c27c18e8Smrg
820706c34b88Smrg# _LT_ENABLE_STATIC([DEFAULT])
820806c34b88Smrg# ----------------------------
82090eb1301bSmrg# implement the --enable-static flag, and support the `static' and
82100eb1301bSmrg# `disable-static' LT_INIT options.
82110eb1301bSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
821206c34b88Smrgm4_define([_LT_ENABLE_STATIC],
821306c34b88Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
821406c34b88SmrgAC_ARG_ENABLE([static],
821506c34b88Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
821606c34b88Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
821706c34b88Smrg    [p=${PACKAGE-default}
821806c34b88Smrg    case $enableval in
821906c34b88Smrg    yes) enable_static=yes ;;
822006c34b88Smrg    no) enable_static=no ;;
822106c34b88Smrg    *)
822206c34b88Smrg     enable_static=no
822306c34b88Smrg      # Look at the argument we got.  We use all the common list separators.
82240eb1301bSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
822506c34b88Smrg      for pkg in $enableval; do
82260eb1301bSmrg	IFS="$lt_save_ifs"
822706c34b88Smrg	if test "X$pkg" = "X$p"; then
822806c34b88Smrg	  enable_static=yes
822906c34b88Smrg	fi
823006c34b88Smrg      done
82310eb1301bSmrg      IFS="$lt_save_ifs"
823206c34b88Smrg      ;;
823306c34b88Smrg    esac],
823406c34b88Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
823589069ce9Smrg
823606c34b88Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
823706c34b88Smrg	[Whether or not to build static libraries])
823806c34b88Smrg])# _LT_ENABLE_STATIC
8239c43cc173Smrg
824006c34b88SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
824106c34b88SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
824289069ce9Smrg
824306c34b88Smrg# Old names:
824406c34b88SmrgAC_DEFUN([AC_ENABLE_STATIC],
824506c34b88Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
824606c34b88Smrg])
8247c43cc173Smrg
824806c34b88SmrgAC_DEFUN([AC_DISABLE_STATIC],
824906c34b88Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
825006c34b88Smrg])
8251c27c18e8Smrg
825206c34b88SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
825306c34b88SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
8254c43cc173Smrg
825506c34b88Smrgdnl aclocal-1.4 backwards compatibility:
825606c34b88Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
825706c34b88Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
8258c27c18e8Smrg
8259c43cc173Smrg
8260b789ec8aSmrg
826106c34b88Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
826206c34b88Smrg# ----------------------------------
82630eb1301bSmrg# implement the --enable-fast-install flag, and support the `fast-install'
82640eb1301bSmrg# and `disable-fast-install' LT_INIT options.
82650eb1301bSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
826606c34b88Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
826706c34b88Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
826806c34b88SmrgAC_ARG_ENABLE([fast-install],
826906c34b88Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
827006c34b88Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
827106c34b88Smrg    [p=${PACKAGE-default}
827206c34b88Smrg    case $enableval in
827306c34b88Smrg    yes) enable_fast_install=yes ;;
827406c34b88Smrg    no) enable_fast_install=no ;;
827506c34b88Smrg    *)
827606c34b88Smrg      enable_fast_install=no
827706c34b88Smrg      # Look at the argument we got.  We use all the common list separators.
82780eb1301bSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
827906c34b88Smrg      for pkg in $enableval; do
82800eb1301bSmrg	IFS="$lt_save_ifs"
828106c34b88Smrg	if test "X$pkg" = "X$p"; then
828206c34b88Smrg	  enable_fast_install=yes
828306c34b88Smrg	fi
828406c34b88Smrg      done
82850eb1301bSmrg      IFS="$lt_save_ifs"
828606c34b88Smrg      ;;
828706c34b88Smrg    esac],
828806c34b88Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
828989069ce9Smrg
829006c34b88Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
829106c34b88Smrg	 [Whether or not to optimize for fast installation])dnl
829206c34b88Smrg])# _LT_ENABLE_FAST_INSTALL
829389069ce9Smrg
829406c34b88SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
829506c34b88SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
8296f1ee322dSmrg
829706c34b88Smrg# Old names:
829806c34b88SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
829906c34b88Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
830006c34b88SmrgAC_DIAGNOSE([obsolete],
830106c34b88Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
83020eb1301bSmrgthe `fast-install' option into LT_INIT's first parameter.])
830306c34b88Smrg])
8304f1ee322dSmrg
830506c34b88SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
830606c34b88Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
830706c34b88SmrgAC_DIAGNOSE([obsolete],
830806c34b88Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
83090eb1301bSmrgthe `disable-fast-install' option into LT_INIT's first parameter.])
831006c34b88Smrg])
831189069ce9Smrg
831206c34b88Smrgdnl aclocal-1.4 backwards compatibility:
831306c34b88Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
831406c34b88Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
831589069ce9Smrg
8316c43cc173Smrg
831706c34b88Smrg# _LT_WITH_PIC([MODE])
831806c34b88Smrg# --------------------
83190eb1301bSmrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
832006c34b88Smrg# LT_INIT options.
83210eb1301bSmrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
832206c34b88Smrgm4_define([_LT_WITH_PIC],
832306c34b88Smrg[AC_ARG_WITH([pic],
832406c34b88Smrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
832506c34b88Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
832606c34b88Smrg    [lt_p=${PACKAGE-default}
832706c34b88Smrg    case $withval in
832806c34b88Smrg    yes|no) pic_mode=$withval ;;
832906c34b88Smrg    *)
833006c34b88Smrg      pic_mode=default
833106c34b88Smrg      # Look at the argument we got.  We use all the common list separators.
83320eb1301bSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
833306c34b88Smrg      for lt_pkg in $withval; do
83340eb1301bSmrg	IFS="$lt_save_ifs"
833506c34b88Smrg	if test "X$lt_pkg" = "X$lt_p"; then
833606c34b88Smrg	  pic_mode=yes
833706c34b88Smrg	fi
833806c34b88Smrg      done
83390eb1301bSmrg      IFS="$lt_save_ifs"
834006c34b88Smrg      ;;
834106c34b88Smrg    esac],
83420eb1301bSmrg    [pic_mode=default])
83430eb1301bSmrg
83440eb1301bSmrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
8345c43cc173Smrg
834606c34b88Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
834706c34b88Smrg])# _LT_WITH_PIC
834837eb1ca1Smrg
834906c34b88SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
835006c34b88SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
835189069ce9Smrg
835206c34b88Smrg# Old name:
835306c34b88SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
835406c34b88Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
835506c34b88SmrgAC_DIAGNOSE([obsolete],
835606c34b88Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
83570eb1301bSmrgput the `pic-only' option into LT_INIT's first parameter.])
835806c34b88Smrg])
835989069ce9Smrg
836006c34b88Smrgdnl aclocal-1.4 backwards compatibility:
836106c34b88Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
836289069ce9Smrg
836389069ce9Smrg
836406c34b88Smrgm4_define([_LTDL_MODE], [])
836506c34b88SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
836606c34b88Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
836706c34b88SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
836806c34b88Smrg		 [m4_define([_LTDL_MODE], [recursive])])
836906c34b88SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
837006c34b88Smrg		 [m4_define([_LTDL_MODE], [subproject])])
837106c34b88Smrg
837206c34b88Smrgm4_define([_LTDL_TYPE], [])
837306c34b88SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
837406c34b88Smrg		 [m4_define([_LTDL_TYPE], [installable])])
837506c34b88SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
837606c34b88Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
837706c34b88Smrg
837806c34b88Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
8379b789ec8aSmrg#
83800eb1301bSmrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
838106c34b88Smrg# Written by Gary V. Vaughan, 2004
8382b789ec8aSmrg#
838306c34b88Smrg# This file is free software; the Free Software Foundation gives
838406c34b88Smrg# unlimited permission to copy and/or distribute it, with or without
838506c34b88Smrg# modifications, as long as this notice is preserved.
838689069ce9Smrg
838706c34b88Smrg# serial 6 ltsugar.m4
8388f1ee322dSmrg
838906c34b88Smrg# This is to help aclocal find these macros, as it can't see m4_define.
839006c34b88SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
839189069ce9Smrg
839206c34b88Smrg
839306c34b88Smrg# lt_join(SEP, ARG1, [ARG2...])
839406c34b88Smrg# -----------------------------
839506c34b88Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
839606c34b88Smrg# associated separator.
839706c34b88Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
839806c34b88Smrg# versions in m4sugar had bugs.
839906c34b88Smrgm4_define([lt_join],
840006c34b88Smrg[m4_if([$#], [1], [],
840106c34b88Smrg       [$#], [2], [[$2]],
840206c34b88Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
840306c34b88Smrgm4_define([_lt_join],
840406c34b88Smrg[m4_if([$#$2], [2], [],
840506c34b88Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
840606c34b88Smrg
840706c34b88Smrg
840806c34b88Smrg# lt_car(LIST)
840906c34b88Smrg# lt_cdr(LIST)
841006c34b88Smrg# ------------
841106c34b88Smrg# Manipulate m4 lists.
841206c34b88Smrg# These macros are necessary as long as will still need to support
84130eb1301bSmrg# Autoconf-2.59 which quotes differently.
841406c34b88Smrgm4_define([lt_car], [[$1]])
841506c34b88Smrgm4_define([lt_cdr],
841606c34b88Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
841706c34b88Smrg       [$#], 1, [],
841806c34b88Smrg       [m4_dquote(m4_shift($@))])])
841906c34b88Smrgm4_define([lt_unquote], $1)
842006c34b88Smrg
842106c34b88Smrg
842206c34b88Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
842306c34b88Smrg# ------------------------------------------
84240eb1301bSmrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
842506c34b88Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
842606c34b88Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
842706c34b88Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
842806c34b88Smrg# than defined and empty).
8429b789ec8aSmrg#
843006c34b88Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
843106c34b88Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
843206c34b88Smrgm4_define([lt_append],
843306c34b88Smrg[m4_define([$1],
843406c34b88Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
843506c34b88Smrg
843606c34b88Smrg
843706c34b88Smrg
843806c34b88Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
843906c34b88Smrg# ----------------------------------------------------------
844006c34b88Smrg# Produce a SEP delimited list of all paired combinations of elements of
844106c34b88Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
844206c34b88Smrg# has the form PREFIXmINFIXSUFFIXn.
844306c34b88Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
844406c34b88Smrgm4_define([lt_combine],
844506c34b88Smrg[m4_if(m4_eval([$# > 3]), [1],
844606c34b88Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
844706c34b88Smrg[[m4_foreach([_Lt_prefix], [$2],
844806c34b88Smrg	     [m4_foreach([_Lt_suffix],
844906c34b88Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
845006c34b88Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
845106c34b88Smrg
845206c34b88Smrg
845306c34b88Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
845406c34b88Smrg# -----------------------------------------------------------------------
845506c34b88Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
845606c34b88Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
845706c34b88Smrgm4_define([lt_if_append_uniq],
845806c34b88Smrg[m4_ifdef([$1],
845906c34b88Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
846006c34b88Smrg		 [lt_append([$1], [$2], [$3])$4],
846106c34b88Smrg		 [$5])],
846206c34b88Smrg	  [lt_append([$1], [$2], [$3])$4])])
846306c34b88Smrg
846406c34b88Smrg
846506c34b88Smrg# lt_dict_add(DICT, KEY, VALUE)
846606c34b88Smrg# -----------------------------
846706c34b88Smrgm4_define([lt_dict_add],
846806c34b88Smrg[m4_define([$1($2)], [$3])])
846906c34b88Smrg
847006c34b88Smrg
847106c34b88Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
847206c34b88Smrg# --------------------------------------------
847306c34b88Smrgm4_define([lt_dict_add_subkey],
847406c34b88Smrg[m4_define([$1($2:$3)], [$4])])
847506c34b88Smrg
847606c34b88Smrg
847706c34b88Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
847806c34b88Smrg# ----------------------------------
847906c34b88Smrgm4_define([lt_dict_fetch],
848006c34b88Smrg[m4_ifval([$3],
848106c34b88Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
848206c34b88Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
8483c43cc173Smrg
8484c43cc173Smrg
848506c34b88Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
848606c34b88Smrg# -----------------------------------------------------------------
848706c34b88Smrgm4_define([lt_if_dict_fetch],
848806c34b88Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
848906c34b88Smrg	[$5],
849006c34b88Smrg    [$6])])
849106c34b88Smrg
849206c34b88Smrg
849306c34b88Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
849406c34b88Smrg# --------------------------------------------------------------
849506c34b88Smrgm4_define([lt_dict_filter],
849606c34b88Smrg[m4_if([$5], [], [],
849706c34b88Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
849806c34b88Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
849906c34b88Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
850006c34b88Smrg])
850106c34b88Smrg
850206c34b88Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
8503b789ec8aSmrg#
85040eb1301bSmrg#   Copyright (C) 2004 Free Software Foundation, Inc.
850506c34b88Smrg#   Written by Scott James Remnant, 2004
8506b789ec8aSmrg#
850706c34b88Smrg# This file is free software; the Free Software Foundation gives
850806c34b88Smrg# unlimited permission to copy and/or distribute it, with or without
850906c34b88Smrg# modifications, as long as this notice is preserved.
851006c34b88Smrg
851106c34b88Smrg# @configure_input@
851206c34b88Smrg
85130eb1301bSmrg# serial 3337 ltversion.m4
851406c34b88Smrg# This file is part of GNU Libtool
851506c34b88Smrg
85160eb1301bSmrgm4_define([LT_PACKAGE_VERSION], [2.4.2])
85170eb1301bSmrgm4_define([LT_PACKAGE_REVISION], [1.3337])
851806c34b88Smrg
851906c34b88SmrgAC_DEFUN([LTVERSION_VERSION],
85200eb1301bSmrg[macro_version='2.4.2'
85210eb1301bSmrgmacro_revision='1.3337'
852206c34b88Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
852306c34b88Smrg_LT_DECL(, macro_revision, 0)
852406c34b88Smrg])
852506c34b88Smrg
852606c34b88Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
8527b789ec8aSmrg#
85280eb1301bSmrg#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
852906c34b88Smrg#   Written by Scott James Remnant, 2004.
853006c34b88Smrg#
853106c34b88Smrg# This file is free software; the Free Software Foundation gives
853206c34b88Smrg# unlimited permission to copy and/or distribute it, with or without
853306c34b88Smrg# modifications, as long as this notice is preserved.
8534b789ec8aSmrg
853506c34b88Smrg# serial 5 lt~obsolete.m4
853606c34b88Smrg
853706c34b88Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
8538b789ec8aSmrg#
85390eb1301bSmrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
854006c34b88Smrg# which have later been changed to m4_define as they aren't part of the
854106c34b88Smrg# exported API, or moved to Autoconf or Automake where they belong.
8542b789ec8aSmrg#
854306c34b88Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
854406c34b88Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
854506c34b88Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
854606c34b88Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
854706c34b88Smrg# and doesn't know about Autoconf macros at all.)
8548b789ec8aSmrg#
854906c34b88Smrg# So we provide this file, which has a silly filename so it's always
855006c34b88Smrg# included after everything else.  This provides aclocal with the
855106c34b88Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
855206c34b88Smrg# because those macros already exist, or will be overwritten later.
85530eb1301bSmrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
855406c34b88Smrg#
855506c34b88Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
855606c34b88Smrg# Yes, that means every name once taken will need to remain here until
855706c34b88Smrg# we give up compatibility with versions before 1.7, at which point
855806c34b88Smrg# we need to keep only those names which we still refer to.
8559b789ec8aSmrg
856006c34b88Smrg# This is to help aclocal find these macros, as it can't see m4_define.
856106c34b88SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
856206c34b88Smrg
856306c34b88Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
856406c34b88Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
856506c34b88Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
856606c34b88Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
856706c34b88Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
856806c34b88Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
856906c34b88Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
857006c34b88Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
857106c34b88Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
857206c34b88Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
857306c34b88Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
857406c34b88Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
857506c34b88Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
857606c34b88Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
857706c34b88Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
857806c34b88Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
857906c34b88Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
858006c34b88Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
858106c34b88Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
858206c34b88Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
858306c34b88Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
858406c34b88Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
858506c34b88Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
858606c34b88Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
858706c34b88Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
858806c34b88Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
858906c34b88Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
859006c34b88Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
859106c34b88Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
859206c34b88Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
859306c34b88Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
859406c34b88Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
859506c34b88Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
859606c34b88Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
859706c34b88Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
859806c34b88Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
859906c34b88Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
860006c34b88Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
860106c34b88Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
860206c34b88Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
860306c34b88Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
860406c34b88Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
860506c34b88Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
860606c34b88Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
860706c34b88Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
860806c34b88Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
860906c34b88Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
861006c34b88Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
861106c34b88Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
861206c34b88Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
861306c34b88Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
861406c34b88Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
861506c34b88Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
861606c34b88Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
861706c34b88Smrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
861806c34b88Smrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
861906c34b88Smrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
862006c34b88Smrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
862106c34b88Smrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
862206c34b88Smrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
862306c34b88Smrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
862406c34b88Smrg
862506c34b88Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
862606c34b88Smrg# serial 1 (pkg-config-0.24)
862706c34b88Smrg# 
862806c34b88Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
8629b789ec8aSmrg#
863006c34b88Smrg# This program is free software; you can redistribute it and/or modify
863106c34b88Smrg# it under the terms of the GNU General Public License as published by
863206c34b88Smrg# the Free Software Foundation; either version 2 of the License, or
863306c34b88Smrg# (at your option) any later version.
8634b789ec8aSmrg#
863506c34b88Smrg# This program is distributed in the hope that it will be useful, but
863606c34b88Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
863706c34b88Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
863806c34b88Smrg# General Public License for more details.
8639b789ec8aSmrg#
864006c34b88Smrg# You should have received a copy of the GNU General Public License
864106c34b88Smrg# along with this program; if not, write to the Free Software
864206c34b88Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
864306c34b88Smrg#
864406c34b88Smrg# As a special exception to the GNU General Public License, if you
864506c34b88Smrg# distribute this file as part of a program that contains a
864606c34b88Smrg# configuration script generated by Autoconf, you may include it under
864706c34b88Smrg# the same distribution terms that you use for the rest of that program.
864806c34b88Smrg
864906c34b88Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
865006c34b88Smrg# ----------------------------------
865106c34b88SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
865206c34b88Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
8653dc9477beSmrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
8654dc9477beSmrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
865506c34b88SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
865606c34b88SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
865706c34b88SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
865806c34b88Smrg
865906c34b88Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
866006c34b88Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
866106c34b88Smrgfi
866206c34b88Smrgif test -n "$PKG_CONFIG"; then
866306c34b88Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
866406c34b88Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
866506c34b88Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
866606c34b88Smrg		AC_MSG_RESULT([yes])
866706c34b88Smrg	else
866806c34b88Smrg		AC_MSG_RESULT([no])
866906c34b88Smrg		PKG_CONFIG=""
867006c34b88Smrg	fi
867106c34b88Smrgfi[]dnl
867206c34b88Smrg])# PKG_PROG_PKG_CONFIG
8673b789ec8aSmrg
867406c34b88Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
8675b789ec8aSmrg#
867606c34b88Smrg# Check to see whether a particular set of modules exists.  Similar
867706c34b88Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
8678b789ec8aSmrg#
867906c34b88Smrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
868006c34b88Smrg# only at the first occurence in configure.ac, so if the first place
868106c34b88Smrg# it's called might be skipped (such as if it is within an "if", you
868206c34b88Smrg# have to call PKG_CHECK_EXISTS manually
868306c34b88Smrg# --------------------------------------------------------------
868406c34b88SmrgAC_DEFUN([PKG_CHECK_EXISTS],
868506c34b88Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
868606c34b88Smrgif test -n "$PKG_CONFIG" && \
868706c34b88Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
868806c34b88Smrg  m4_default([$2], [:])
868906c34b88Smrgm4_ifvaln([$3], [else
869006c34b88Smrg  $3])dnl
869106c34b88Smrgfi])
8692b789ec8aSmrg
869306c34b88Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
869406c34b88Smrg# ---------------------------------------------
869506c34b88Smrgm4_define([_PKG_CONFIG],
869606c34b88Smrg[if test -n "$$1"; then
869706c34b88Smrg    pkg_cv_[]$1="$$1"
869806c34b88Smrg elif test -n "$PKG_CONFIG"; then
869906c34b88Smrg    PKG_CHECK_EXISTS([$3],
8700dc9477beSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
8701dc9477beSmrg		      test "x$?" != "x0" && pkg_failed=yes ],
870206c34b88Smrg		     [pkg_failed=yes])
870306c34b88Smrg else
870406c34b88Smrg    pkg_failed=untried
870506c34b88Smrgfi[]dnl
870606c34b88Smrg])# _PKG_CONFIG
870706c34b88Smrg
870806c34b88Smrg# _PKG_SHORT_ERRORS_SUPPORTED
870906c34b88Smrg# -----------------------------
871006c34b88SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
871106c34b88Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
871206c34b88Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
871306c34b88Smrg        _pkg_short_errors_supported=yes
871406c34b88Smrgelse
871506c34b88Smrg        _pkg_short_errors_supported=no
871606c34b88Smrgfi[]dnl
871706c34b88Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
871806c34b88Smrg
871906c34b88Smrg
872006c34b88Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
872106c34b88Smrg# [ACTION-IF-NOT-FOUND])
8722f1ee322dSmrg#
8723f1ee322dSmrg#
872406c34b88Smrg# Note that if there is a possibility the first call to
872506c34b88Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
872606c34b88Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
8727f1ee322dSmrg#
8728f1ee322dSmrg#
872906c34b88Smrg# --------------------------------------------------------------
873006c34b88SmrgAC_DEFUN([PKG_CHECK_MODULES],
873106c34b88Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
873206c34b88SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
873306c34b88SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
8734f1ee322dSmrg
873506c34b88Smrgpkg_failed=no
873606c34b88SmrgAC_MSG_CHECKING([for $1])
873706c34b88Smrg
873806c34b88Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
873906c34b88Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
874006c34b88Smrg
874106c34b88Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
874206c34b88Smrgand $1[]_LIBS to avoid the need to call pkg-config.
874306c34b88SmrgSee the pkg-config man page for more details.])
874406c34b88Smrg
874506c34b88Smrgif test $pkg_failed = yes; then
874606c34b88Smrg   	AC_MSG_RESULT([no])
874706c34b88Smrg        _PKG_SHORT_ERRORS_SUPPORTED
874806c34b88Smrg        if test $_pkg_short_errors_supported = yes; then
8749dc9477beSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
875006c34b88Smrg        else 
8751dc9477beSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
875206c34b88Smrg        fi
875306c34b88Smrg	# Put the nasty error message in config.log where it belongs
875406c34b88Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
875506c34b88Smrg
875606c34b88Smrg	m4_default([$4], [AC_MSG_ERROR(
875706c34b88Smrg[Package requirements ($2) were not met:
875806c34b88Smrg
875906c34b88Smrg$$1_PKG_ERRORS
876006c34b88Smrg
876106c34b88SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
876206c34b88Smrginstalled software in a non-standard prefix.
876306c34b88Smrg
8764dc9477beSmrg_PKG_TEXT])[]dnl
876506c34b88Smrg        ])
876606c34b88Smrgelif test $pkg_failed = untried; then
876706c34b88Smrg     	AC_MSG_RESULT([no])
876806c34b88Smrg	m4_default([$4], [AC_MSG_FAILURE(
876906c34b88Smrg[The pkg-config script could not be found or is too old.  Make sure it
877006c34b88Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
877106c34b88Smrgpath to pkg-config.
877206c34b88Smrg
877306c34b88Smrg_PKG_TEXT
877406c34b88Smrg
8775dc9477beSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
877606c34b88Smrg        ])
877706c34b88Smrgelse
877806c34b88Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
877906c34b88Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
878006c34b88Smrg        AC_MSG_RESULT([yes])
878106c34b88Smrg	$3
878206c34b88Smrgfi[]dnl
878306c34b88Smrg])# PKG_CHECK_MODULES
878406c34b88Smrg
87850eb1301bSmrg# Copyright (C) 2002-2013 Free Software Foundation, Inc.
878644584a44Smrg#
878744584a44Smrg# This file is free software; the Free Software Foundation
878844584a44Smrg# gives unlimited permission to copy and/or distribute it,
878944584a44Smrg# with or without modifications, as long as this notice is preserved.
879006c34b88Smrg
879144584a44Smrg# AM_AUTOMAKE_VERSION(VERSION)
879244584a44Smrg# ----------------------------
879344584a44Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
879444584a44Smrg# generated from the m4 files accompanying Automake X.Y.
879544584a44Smrg# (This private macro should not be called outside this file.)
879644584a44SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
87970eb1301bSmrg[am__api_version='1.14'
879844584a44Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
879944584a44Smrgdnl require some minimum version.  Point them to the right macro.
88000eb1301bSmrgm4_if([$1], [1.14.1], [],
880144584a44Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
880244584a44Smrg])
880344584a44Smrg
880444584a44Smrg# _AM_AUTOCONF_VERSION(VERSION)
880544584a44Smrg# -----------------------------
880644584a44Smrg# aclocal traces this macro to find the Autoconf version.
880744584a44Smrg# This is a private macro too.  Using m4_define simplifies
880844584a44Smrg# the logic in aclocal, which can simply ignore this definition.
880944584a44Smrgm4_define([_AM_AUTOCONF_VERSION], [])
881044584a44Smrg
881144584a44Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
881244584a44Smrg# -------------------------------
881344584a44Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
881444584a44Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
881544584a44SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
88160eb1301bSmrg[AM_AUTOMAKE_VERSION([1.14.1])dnl
881744584a44Smrgm4_ifndef([AC_AUTOCONF_VERSION],
881844584a44Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
881944584a44Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
882044584a44Smrg
882144584a44Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
882244584a44Smrg
88230eb1301bSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
8824b789ec8aSmrg#
882544584a44Smrg# This file is free software; the Free Software Foundation
882644584a44Smrg# gives unlimited permission to copy and/or distribute it,
882744584a44Smrg# with or without modifications, as long as this notice is preserved.
882844584a44Smrg
882944584a44Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
883044584a44Smrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
883144584a44Smrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
8832b789ec8aSmrg#
883344584a44Smrg# Of course, Automake must honor this variable whenever it calls a
883444584a44Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
883544584a44Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
883644584a44Smrg# depending on how configure is run.  This is pretty annoying, since
883744584a44Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
883844584a44Smrg# source directory, any form will work fine, but in subdirectories a
883944584a44Smrg# relative path needs to be adjusted first.
8840b789ec8aSmrg#
884144584a44Smrg# $ac_aux_dir/missing
884244584a44Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
884344584a44Smrg# $top_srcdir/$ac_aux_dir/missing
884444584a44Smrg#    fails if $ac_aux_dir is absolute,
884544584a44Smrg#    fails when called from a subdirectory in a VPATH build with
884644584a44Smrg#          a relative $ac_aux_dir
8847f1ee322dSmrg#
884844584a44Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
884944584a44Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
885044584a44Smrg# harmless because $srcdir is '.', but things will broke when you
885144584a44Smrg# start a VPATH build or use an absolute $srcdir.
885206c34b88Smrg#
885344584a44Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
885444584a44Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
885544584a44Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
885644584a44Smrg# and then we would define $MISSING as
885744584a44Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
885844584a44Smrg# This will work as long as MISSING is not called from configure, because
885944584a44Smrg# unfortunately $(top_srcdir) has no meaning in configure.
886044584a44Smrg# However there are other variables, like CC, which are often used in
886144584a44Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
886244584a44Smrg#
886344584a44Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
886444584a44Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
886544584a44Smrg# configured tree to be moved without reconfiguration.
886606c34b88Smrg
886744584a44SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
88680eb1301bSmrg[dnl Rely on autoconf to set up CDPATH properly.
88690eb1301bSmrgAC_PREREQ([2.50])dnl
88700eb1301bSmrg# expand $ac_aux_dir to an absolute path
88710eb1301bSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
887244584a44Smrg])
887306c34b88Smrg
887444584a44Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
887544584a44Smrg
88760eb1301bSmrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
887744584a44Smrg#
887844584a44Smrg# This file is free software; the Free Software Foundation
887944584a44Smrg# gives unlimited permission to copy and/or distribute it,
888044584a44Smrg# with or without modifications, as long as this notice is preserved.
888144584a44Smrg
888244584a44Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
888344584a44Smrg# -------------------------------------
888444584a44Smrg# Define a conditional.
888544584a44SmrgAC_DEFUN([AM_CONDITIONAL],
888644584a44Smrg[AC_PREREQ([2.52])dnl
888744584a44Smrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
888844584a44Smrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
888944584a44SmrgAC_SUBST([$1_TRUE])dnl
889044584a44SmrgAC_SUBST([$1_FALSE])dnl
889144584a44Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
889244584a44Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
889344584a44Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
889444584a44Smrgif $2; then
889544584a44Smrg  $1_TRUE=
889644584a44Smrg  $1_FALSE='#'
889706c34b88Smrgelse
889844584a44Smrg  $1_TRUE='#'
889944584a44Smrg  $1_FALSE=
890006c34b88Smrgfi
890144584a44SmrgAC_CONFIG_COMMANDS_PRE(
890244584a44Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
890344584a44Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
890444584a44SmrgUsually this means the macro was only invoked conditionally.]])
890544584a44Smrgfi])])
890606c34b88Smrg
89070eb1301bSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
8908b789ec8aSmrg#
890944584a44Smrg# This file is free software; the Free Software Foundation
891044584a44Smrg# gives unlimited permission to copy and/or distribute it,
891144584a44Smrg# with or without modifications, as long as this notice is preserved.
8912b789ec8aSmrg
891306c34b88Smrg
891444584a44Smrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
891544584a44Smrg# written in clear, in which case automake, when reading aclocal.m4,
891644584a44Smrg# will think it sees a *use*, and therefore will trigger all it's
891744584a44Smrg# C support machinery.  Also note that it means that autoscan, seeing
891844584a44Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
8919c43cc173Smrg
8920c43cc173Smrg
892144584a44Smrg# _AM_DEPENDENCIES(NAME)
892244584a44Smrg# ----------------------
892344584a44Smrg# See how the compiler implements dependency checking.
892444584a44Smrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
892544584a44Smrg# We try a few techniques and use that to set a single cache variable.
892644584a44Smrg#
892744584a44Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
892844584a44Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
892944584a44Smrg# dependency, and given that the user is not expected to run this macro,
893044584a44Smrg# just rely on AC_PROG_CC.
893144584a44SmrgAC_DEFUN([_AM_DEPENDENCIES],
893244584a44Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
893344584a44SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
893444584a44SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
893544584a44SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
893637eb1ca1Smrg
893744584a44Smrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
893844584a44Smrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
893944584a44Smrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
894044584a44Smrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
894144584a44Smrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
894244584a44Smrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
894344584a44Smrg                    [depcc="$$1"   am_compiler_list=])
8944b789ec8aSmrg
894544584a44SmrgAC_CACHE_CHECK([dependency style of $depcc],
894644584a44Smrg               [am_cv_$1_dependencies_compiler_type],
894744584a44Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
894844584a44Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
894944584a44Smrg  # making bogus files that we don't know about and never remove.  For
895044584a44Smrg  # instance it was reported that on HP-UX the gcc test will end up
895144584a44Smrg  # making a dummy file named 'D' -- because '-MD' means "put the output
895244584a44Smrg  # in D".
895344584a44Smrg  rm -rf conftest.dir
895444584a44Smrg  mkdir conftest.dir
895544584a44Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
895644584a44Smrg  # using a relative directory.
895744584a44Smrg  cp "$am_depcomp" conftest.dir
895844584a44Smrg  cd conftest.dir
895944584a44Smrg  # We will build objects and dependencies in a subdirectory because
896044584a44Smrg  # it helps to detect inapplicable dependency modes.  For instance
896144584a44Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
896244584a44Smrg  # side effect of compilation, but ICC will put the dependencies in
896344584a44Smrg  # the current directory while Tru64 will put them in the object
896444584a44Smrg  # directory.
896544584a44Smrg  mkdir sub
8966b789ec8aSmrg
896744584a44Smrg  am_cv_$1_dependencies_compiler_type=none
896844584a44Smrg  if test "$am_compiler_list" = ""; then
896944584a44Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
897044584a44Smrg  fi
897144584a44Smrg  am__universal=false
897244584a44Smrg  m4_case([$1], [CC],
897344584a44Smrg    [case " $depcc " in #(
897444584a44Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
897544584a44Smrg     esac],
897644584a44Smrg    [CXX],
897744584a44Smrg    [case " $depcc " in #(
897844584a44Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
897944584a44Smrg     esac])
898044584a44Smrg
898144584a44Smrg  for depmode in $am_compiler_list; do
898244584a44Smrg    # Setup a source with many dependencies, because some compilers
898344584a44Smrg    # like to wrap large dependency lists on column 80 (with \), and
898444584a44Smrg    # we should not choose a depcomp mode which is confused by this.
898544584a44Smrg    #
898644584a44Smrg    # We need to recreate these files for each test, as the compiler may
898744584a44Smrg    # overwrite some of them when testing with obscure command lines.
898844584a44Smrg    # This happens at least with the AIX C compiler.
898944584a44Smrg    : > sub/conftest.c
899044584a44Smrg    for i in 1 2 3 4 5 6; do
899144584a44Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
899244584a44Smrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
899344584a44Smrg      # Solaris 10 /bin/sh.
899444584a44Smrg      echo '/* dummy */' > sub/conftst$i.h
899544584a44Smrg    done
899644584a44Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
899744584a44Smrg
899844584a44Smrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
899944584a44Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
900044584a44Smrg    # handle '-M -o', and we need to detect this.  Also, some Intel
900144584a44Smrg    # versions had trouble with output in subdirs.
900244584a44Smrg    am__obj=sub/conftest.${OBJEXT-o}
900344584a44Smrg    am__minus_obj="-o $am__obj"
900444584a44Smrg    case $depmode in
900544584a44Smrg    gcc)
900644584a44Smrg      # This depmode causes a compiler race in universal mode.
900744584a44Smrg      test "$am__universal" = false || continue
900844584a44Smrg      ;;
900944584a44Smrg    nosideeffect)
901044584a44Smrg      # After this tag, mechanisms are not by side-effect, so they'll
901144584a44Smrg      # only be used when explicitly requested.
901244584a44Smrg      if test "x$enable_dependency_tracking" = xyes; then
901344584a44Smrg	continue
901444584a44Smrg      else
901544584a44Smrg	break
901644584a44Smrg      fi
901744584a44Smrg      ;;
901844584a44Smrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
901944584a44Smrg      # This compiler won't grok '-c -o', but also, the minuso test has
902044584a44Smrg      # not run yet.  These depmodes are late enough in the game, and
902144584a44Smrg      # so weak that their functioning should not be impacted.
902244584a44Smrg      am__obj=conftest.${OBJEXT-o}
902344584a44Smrg      am__minus_obj=
902444584a44Smrg      ;;
902544584a44Smrg    none) break ;;
902606c34b88Smrg    esac
902744584a44Smrg    if depmode=$depmode \
902844584a44Smrg       source=sub/conftest.c object=$am__obj \
902944584a44Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
903044584a44Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
903144584a44Smrg         >/dev/null 2>conftest.err &&
903244584a44Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
903344584a44Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
903444584a44Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
903544584a44Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
903644584a44Smrg      # icc doesn't choke on unknown options, it will just issue warnings
903744584a44Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
903844584a44Smrg      # that says an option was ignored or not supported.
903944584a44Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
904044584a44Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
904144584a44Smrg      # The diagnosis changed in icc 8.0:
904244584a44Smrg      #   icc: Command line remark: option '-MP' not supported
904344584a44Smrg      if (grep 'ignoring option' conftest.err ||
904444584a44Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
904544584a44Smrg        am_cv_$1_dependencies_compiler_type=$depmode
904644584a44Smrg        break
904744584a44Smrg      fi
904844584a44Smrg    fi
904944584a44Smrg  done
905044584a44Smrg
905144584a44Smrg  cd ..
905244584a44Smrg  rm -rf conftest.dir
905344584a44Smrgelse
905444584a44Smrg  am_cv_$1_dependencies_compiler_type=none
905506c34b88Smrgfi
905644584a44Smrg])
905744584a44SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
905844584a44SmrgAM_CONDITIONAL([am__fastdep$1], [
905944584a44Smrg  test "x$enable_dependency_tracking" != xno \
906044584a44Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
906144584a44Smrg])
9062c43cc173Smrg
906306c34b88Smrg
906444584a44Smrg# AM_SET_DEPDIR
906544584a44Smrg# -------------
906644584a44Smrg# Choose a directory name for dependency files.
906744584a44Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
906844584a44SmrgAC_DEFUN([AM_SET_DEPDIR],
906944584a44Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
907044584a44SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
907144584a44Smrg])
907206c34b88Smrg
907306c34b88Smrg
907444584a44Smrg# AM_DEP_TRACK
907544584a44Smrg# ------------
907644584a44SmrgAC_DEFUN([AM_DEP_TRACK],
907744584a44Smrg[AC_ARG_ENABLE([dependency-tracking], [dnl
907844584a44SmrgAS_HELP_STRING(
907944584a44Smrg  [--enable-dependency-tracking],
908044584a44Smrg  [do not reject slow dependency extractors])
908144584a44SmrgAS_HELP_STRING(
908244584a44Smrg  [--disable-dependency-tracking],
908344584a44Smrg  [speeds up one-time build])])
908444584a44Smrgif test "x$enable_dependency_tracking" != xno; then
908544584a44Smrg  am_depcomp="$ac_aux_dir/depcomp"
908644584a44Smrg  AMDEPBACKSLASH='\'
908744584a44Smrg  am__nodep='_no'
908844584a44Smrgfi
908944584a44SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
909044584a44SmrgAC_SUBST([AMDEPBACKSLASH])dnl
909144584a44Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
909244584a44SmrgAC_SUBST([am__nodep])dnl
909344584a44Smrg_AM_SUBST_NOTMAKE([am__nodep])dnl
909444584a44Smrg])
909506c34b88Smrg
909644584a44Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
909706c34b88Smrg
90980eb1301bSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
9099f1ee322dSmrg#
910044584a44Smrg# This file is free software; the Free Software Foundation
910144584a44Smrg# gives unlimited permission to copy and/or distribute it,
910244584a44Smrg# with or without modifications, as long as this notice is preserved.
9103c43cc173Smrg
9104c43cc173Smrg
910544584a44Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
910644584a44Smrg# ------------------------------
910744584a44SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
910844584a44Smrg[{
910944584a44Smrg  # Older Autoconf quotes --file arguments for eval, but not when files
911044584a44Smrg  # are listed without --file.  Let's play safe and only enable the eval
911144584a44Smrg  # if we detect the quoting.
911244584a44Smrg  case $CONFIG_FILES in
911344584a44Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
911444584a44Smrg  *)   set x $CONFIG_FILES ;;
911544584a44Smrg  esac
911644584a44Smrg  shift
911744584a44Smrg  for mf
911844584a44Smrg  do
911944584a44Smrg    # Strip MF so we end up with the name of the file.
912044584a44Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
912144584a44Smrg    # Check whether this is an Automake generated Makefile or not.
912244584a44Smrg    # We used to match only the files named 'Makefile.in', but
912344584a44Smrg    # some people rename them; so instead we look at the file content.
912444584a44Smrg    # Grep'ing the first line is not enough: some people post-process
912544584a44Smrg    # each Makefile.in and add a new line on top of each file to say so.
912644584a44Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
912744584a44Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
912844584a44Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
912944584a44Smrg      dirpart=`AS_DIRNAME("$mf")`
913044584a44Smrg    else
913144584a44Smrg      continue
913244584a44Smrg    fi
913344584a44Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
913444584a44Smrg    # from the Makefile without running 'make'.
913544584a44Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
913644584a44Smrg    test -z "$DEPDIR" && continue
913744584a44Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
913844584a44Smrg    test -z "$am__include" && continue
913944584a44Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
914044584a44Smrg    # Find all dependency output files, they are included files with
914144584a44Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
914244584a44Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
914344584a44Smrg    # expansion.
914444584a44Smrg    for file in `sed -n "
914544584a44Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
914644584a44Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
914744584a44Smrg      # Make sure the directory exists.
914844584a44Smrg      test -f "$dirpart/$file" && continue
914944584a44Smrg      fdir=`AS_DIRNAME(["$file"])`
915044584a44Smrg      AS_MKDIR_P([$dirpart/$fdir])
915144584a44Smrg      # echo "creating $dirpart/$file"
915244584a44Smrg      echo '# dummy' > "$dirpart/$file"
915344584a44Smrg    done
915444584a44Smrg  done
915544584a44Smrg}
915644584a44Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
9157b789ec8aSmrg
9158c43cc173Smrg
915944584a44Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
916044584a44Smrg# -----------------------------
916144584a44Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
916244584a44Smrg#
916344584a44Smrg# This code is only required when automatic dependency tracking
916444584a44Smrg# is enabled.  FIXME.  This creates each '.P' file that we will
916544584a44Smrg# need in order to bootstrap the dependency handling code.
916644584a44SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
916744584a44Smrg[AC_CONFIG_COMMANDS([depfiles],
916844584a44Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
916944584a44Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
917044584a44Smrg])
9171c43cc173Smrg
917244584a44Smrg# Do all the work for Automake.                             -*- Autoconf -*-
91733e256790Smrg
91740eb1301bSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
917506c34b88Smrg#
917644584a44Smrg# This file is free software; the Free Software Foundation
917744584a44Smrg# gives unlimited permission to copy and/or distribute it,
917844584a44Smrg# with or without modifications, as long as this notice is preserved.
9179c43cc173Smrg
918044584a44Smrg# This macro actually does too much.  Some checks are only needed if
918144584a44Smrg# your package does certain things.  But this isn't really a big deal.
9182c43cc173Smrg
918344584a44Smrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
918444584a44Smrgm4_define([AC_PROG_CC],
918544584a44Smrgm4_defn([AC_PROG_CC])
918644584a44Smrg[_AM_PROG_CC_C_O
918744584a44Smrg])
918821e67964Smrg
918944584a44Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
919044584a44Smrg# AM_INIT_AUTOMAKE([OPTIONS])
919144584a44Smrg# -----------------------------------------------
919244584a44Smrg# The call with PACKAGE and VERSION arguments is the old style
919344584a44Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
919444584a44Smrg# and VERSION should now be passed to AC_INIT and removed from
919544584a44Smrg# the call to AM_INIT_AUTOMAKE.
919644584a44Smrg# We support both call styles for the transition.  After
919744584a44Smrg# the next Automake release, Autoconf can make the AC_INIT
919844584a44Smrg# arguments mandatory, and then we can depend on a new Autoconf
919944584a44Smrg# release and drop the old call support.
920044584a44SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
920144584a44Smrg[AC_PREREQ([2.65])dnl
920244584a44Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
920344584a44Smrgdnl the ones we care about.
920444584a44Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
920544584a44SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
920644584a44SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
920744584a44Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
920844584a44Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
920944584a44Smrg  # is not polluted with repeated "-I."
921044584a44Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
921144584a44Smrg  # test to see if srcdir already configured
921244584a44Smrg  if test -f $srcdir/config.status; then
921344584a44Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
921444584a44Smrg  fi
921506c34b88Smrgfi
9216c43cc173Smrg
921744584a44Smrg# test whether we have cygpath
921844584a44Smrgif test -z "$CYGPATH_W"; then
921944584a44Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
922044584a44Smrg    CYGPATH_W='cygpath -w'
922144584a44Smrg  else
922244584a44Smrg    CYGPATH_W=echo
922344584a44Smrg  fi
922406c34b88Smrgfi
922544584a44SmrgAC_SUBST([CYGPATH_W])
9226c43cc173Smrg
922744584a44Smrg# Define the identity of the package.
922844584a44Smrgdnl Distinguish between old-style and new-style calls.
922944584a44Smrgm4_ifval([$2],
923044584a44Smrg[AC_DIAGNOSE([obsolete],
923144584a44Smrg             [$0: two- and three-arguments forms are deprecated.])
923244584a44Smrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
923344584a44Smrg AC_SUBST([PACKAGE], [$1])dnl
923444584a44Smrg AC_SUBST([VERSION], [$2])],
923544584a44Smrg[_AM_SET_OPTIONS([$1])dnl
923644584a44Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
923744584a44Smrgm4_if(
923844584a44Smrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
923944584a44Smrg  [ok:ok],,
924044584a44Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
924144584a44Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
924244584a44Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
9243c43cc173Smrg
924444584a44Smrg_AM_IF_OPTION([no-define],,
924544584a44Smrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
924644584a44Smrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
9247c43cc173Smrg
924844584a44Smrg# Some tools Automake needs.
924944584a44SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
925044584a44SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
925144584a44SmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
925244584a44SmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
925344584a44SmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
925444584a44SmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
925544584a44SmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
925644584a44SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
925744584a44SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
925844584a44SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
925944584a44Smrg# For better backward compatibility.  To be removed once Automake 1.9.x
926044584a44Smrg# dies out for good.  For more background, see:
926144584a44Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
926244584a44Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
926344584a44SmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
92640eb1301bSmrg# We need awk for the "check" target.  The system "awk" is bad on
92650eb1301bSmrg# some platforms.
926644584a44SmrgAC_REQUIRE([AC_PROG_AWK])dnl
926744584a44SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
926844584a44SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
926944584a44Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
927044584a44Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
927144584a44Smrg			     [_AM_PROG_TAR([v7])])])
927244584a44Smrg_AM_IF_OPTION([no-dependencies],,
927344584a44Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
927444584a44Smrg		  [_AM_DEPENDENCIES([CC])],
927544584a44Smrg		  [m4_define([AC_PROG_CC],
927644584a44Smrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
927744584a44SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
927844584a44Smrg		  [_AM_DEPENDENCIES([CXX])],
927944584a44Smrg		  [m4_define([AC_PROG_CXX],
928044584a44Smrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
928144584a44SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
928244584a44Smrg		  [_AM_DEPENDENCIES([OBJC])],
928344584a44Smrg		  [m4_define([AC_PROG_OBJC],
928444584a44Smrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
928544584a44SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
928644584a44Smrg		  [_AM_DEPENDENCIES([OBJCXX])],
928744584a44Smrg		  [m4_define([AC_PROG_OBJCXX],
928844584a44Smrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
928944584a44Smrg])
929044584a44SmrgAC_REQUIRE([AM_SILENT_RULES])dnl
929144584a44Smrgdnl The testsuite driver may need to know about EXEEXT, so add the
929244584a44Smrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
929344584a44Smrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
929444584a44SmrgAC_CONFIG_COMMANDS_PRE(dnl
929544584a44Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
929644584a44Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
929721e67964Smrg
929844584a44Smrg# POSIX will say in a future version that running "rm -f" with no argument
929944584a44Smrg# is OK; and we want to be able to make that assumption in our Makefile
930044584a44Smrg# recipes.  So use an aggressive probe to check that the usage we want is
930144584a44Smrg# actually supported "in the wild" to an acceptable degree.
930244584a44Smrg# See automake bug#10828.
930344584a44Smrg# To make any issue more visible, cause the running configure to be aborted
930444584a44Smrg# by default if the 'rm' program in use doesn't match our expectations; the
930544584a44Smrg# user can still override this though.
930644584a44Smrgif rm -f && rm -fr && rm -rf; then : OK; else
930744584a44Smrg  cat >&2 <<'END'
930844584a44SmrgOops!
930944584a44Smrg
931044584a44SmrgYour 'rm' program seems unable to run without file operands specified
931144584a44Smrgon the command line, even when the '-f' option is present.  This is contrary
931244584a44Smrgto the behaviour of most rm programs out there, and not conforming with
931344584a44Smrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
931444584a44Smrg
931544584a44SmrgPlease tell bug-automake@gnu.org about your system, including the value
931644584a44Smrgof your $PATH and any error possibly output before this message.  This
931744584a44Smrgcan help us improve future automake versions.
9318f1ee322dSmrg
931944584a44SmrgEND
932044584a44Smrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
932144584a44Smrg    echo 'Configuration will proceed anyway, since you have set the' >&2
932244584a44Smrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
932344584a44Smrg    echo >&2
932444584a44Smrg  else
932544584a44Smrg    cat >&2 <<'END'
932644584a44SmrgAborting the configuration process, to ensure you take notice of the issue.
932744584a44Smrg
932844584a44SmrgYou can download and install GNU coreutils to get an 'rm' implementation
932944584a44Smrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
933044584a44Smrg
933144584a44SmrgIf you want to complete the configuration process using your problematic
933244584a44Smrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
933344584a44Smrgto "yes", and re-run configure.
933444584a44Smrg
933544584a44SmrgEND
933644584a44Smrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
933744584a44Smrg  fi
93380eb1301bSmrgfi])
9339f1ee322dSmrg
934044584a44Smrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
934144584a44Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
934244584a44Smrgdnl mangled by Autoconf and run in a shell conditional statement.
934344584a44Smrgm4_define([_AC_COMPILER_EXEEXT],
934444584a44Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
9345f1ee322dSmrg
934644584a44Smrg# When config.status generates a header, we must update the stamp-h file.
934744584a44Smrg# This file resides in the same directory as the config header
934844584a44Smrg# that is generated.  The stamp files are numbered to have different names.
9349f1ee322dSmrg
935044584a44Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
935144584a44Smrg# loop where config.status creates the headers, so we can generate
935244584a44Smrg# our stamp files there.
935344584a44SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
935444584a44Smrg[# Compute $1's index in $config_headers.
935544584a44Smrg_am_arg=$1
935644584a44Smrg_am_stamp_count=1
935744584a44Smrgfor _am_header in $config_headers :; do
935844584a44Smrg  case $_am_header in
935944584a44Smrg    $_am_arg | $_am_arg:* )
936044584a44Smrg      break ;;
936144584a44Smrg    * )
936244584a44Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
936344584a44Smrg  esac
936444584a44Smrgdone
936544584a44Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
936644584a44Smrg
93670eb1301bSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
936806c34b88Smrg#
936944584a44Smrg# This file is free software; the Free Software Foundation
937044584a44Smrg# gives unlimited permission to copy and/or distribute it,
937144584a44Smrg# with or without modifications, as long as this notice is preserved.
937244584a44Smrg
937344584a44Smrg# AM_PROG_INSTALL_SH
937444584a44Smrg# ------------------
937544584a44Smrg# Define $install_sh.
937644584a44SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
937744584a44Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
93780eb1301bSmrgif test x"${install_sh}" != xset; then
937944584a44Smrg  case $am_aux_dir in
938044584a44Smrg  *\ * | *\	*)
938144584a44Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
938244584a44Smrg  *)
938344584a44Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
938444584a44Smrg  esac
938544584a44Smrgfi
938644584a44SmrgAC_SUBST([install_sh])])
938744584a44Smrg
93880eb1301bSmrg# Copyright (C) 2003-2013 Free Software Foundation, Inc.
938906c34b88Smrg#
939044584a44Smrg# This file is free software; the Free Software Foundation
939144584a44Smrg# gives unlimited permission to copy and/or distribute it,
939244584a44Smrg# with or without modifications, as long as this notice is preserved.
9393f1ee322dSmrg
939444584a44Smrg# Check whether the underlying file-system supports filenames
939544584a44Smrg# with a leading dot.  For instance MS-DOS doesn't.
939644584a44SmrgAC_DEFUN([AM_SET_LEADING_DOT],
939744584a44Smrg[rm -rf .tst 2>/dev/null
939844584a44Smrgmkdir .tst 2>/dev/null
939944584a44Smrgif test -d .tst; then
940044584a44Smrg  am__leading_dot=.
940106c34b88Smrgelse
940244584a44Smrg  am__leading_dot=_
940306c34b88Smrgfi
940444584a44Smrgrmdir .tst 2>/dev/null
940544584a44SmrgAC_SUBST([am__leading_dot])])
9406f1ee322dSmrg
940744584a44Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
940806c34b88Smrg
94090eb1301bSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
9410f1ee322dSmrg#
941144584a44Smrg# This file is free software; the Free Software Foundation
941244584a44Smrg# gives unlimited permission to copy and/or distribute it,
941344584a44Smrg# with or without modifications, as long as this notice is preserved.
9414f1ee322dSmrg
941544584a44Smrg# AM_MAKE_INCLUDE()
941644584a44Smrg# -----------------
941744584a44Smrg# Check to see how make treats includes.
941844584a44SmrgAC_DEFUN([AM_MAKE_INCLUDE],
941944584a44Smrg[am_make=${MAKE-make}
942044584a44Smrgcat > confinc << 'END'
942144584a44Smrgam__doit:
942244584a44Smrg	@echo this is the am__doit target
942344584a44Smrg.PHONY: am__doit
942444584a44SmrgEND
942544584a44Smrg# If we don't find an include directive, just comment out the code.
942644584a44SmrgAC_MSG_CHECKING([for style of include used by $am_make])
942744584a44Smrgam__include="#"
942844584a44Smrgam__quote=
942944584a44Smrg_am_result=none
943044584a44Smrg# First try GNU make style include.
943144584a44Smrgecho "include confinc" > confmf
943244584a44Smrg# Ignore all kinds of additional output from 'make'.
943344584a44Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
943444584a44Smrg*the\ am__doit\ target*)
943544584a44Smrg  am__include=include
943644584a44Smrg  am__quote=
943744584a44Smrg  _am_result=GNU
943844584a44Smrg  ;;
943944584a44Smrgesac
944044584a44Smrg# Now try BSD make style include.
944144584a44Smrgif test "$am__include" = "#"; then
944244584a44Smrg   echo '.include "confinc"' > confmf
944344584a44Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
944444584a44Smrg   *the\ am__doit\ target*)
944544584a44Smrg     am__include=.include
944644584a44Smrg     am__quote="\""
944744584a44Smrg     _am_result=BSD
944844584a44Smrg     ;;
944944584a44Smrg   esac
9450f1ee322dSmrgfi
945144584a44SmrgAC_SUBST([am__include])
945244584a44SmrgAC_SUBST([am__quote])
945344584a44SmrgAC_MSG_RESULT([$_am_result])
945444584a44Smrgrm -f confinc confmf
945544584a44Smrg])
9456f1ee322dSmrg
945744584a44Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
9458f1ee322dSmrg
94590eb1301bSmrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
946006c34b88Smrg#
946144584a44Smrg# This file is free software; the Free Software Foundation
946244584a44Smrg# gives unlimited permission to copy and/or distribute it,
946344584a44Smrg# with or without modifications, as long as this notice is preserved.
9464f1ee322dSmrg
946544584a44Smrg# AM_MISSING_PROG(NAME, PROGRAM)
946644584a44Smrg# ------------------------------
946744584a44SmrgAC_DEFUN([AM_MISSING_PROG],
946844584a44Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
946944584a44Smrg$1=${$1-"${am_missing_run}$2"}
947044584a44SmrgAC_SUBST($1)])
947144584a44Smrg
947244584a44Smrg# AM_MISSING_HAS_RUN
947344584a44Smrg# ------------------
947444584a44Smrg# Define MISSING if not defined so far and test if it is modern enough.
947544584a44Smrg# If it is, set am_missing_run to use it, otherwise, to nothing.
947644584a44SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
947744584a44Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
947844584a44SmrgAC_REQUIRE_AUX_FILE([missing])dnl
947944584a44Smrgif test x"${MISSING+set}" != xset; then
948044584a44Smrg  case $am_aux_dir in
948144584a44Smrg  *\ * | *\	*)
948244584a44Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
948344584a44Smrg  *)
948444584a44Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
948544584a44Smrg  esac
948644584a44Smrgfi
948744584a44Smrg# Use eval to expand $SHELL
948844584a44Smrgif eval "$MISSING --is-lightweight"; then
948944584a44Smrg  am_missing_run="$MISSING "
9490f1ee322dSmrgelse
949144584a44Smrg  am_missing_run=
949244584a44Smrg  AC_MSG_WARN(['missing' script is too old or missing])
9493f1ee322dSmrgfi
949444584a44Smrg])
9495f1ee322dSmrg
949644584a44Smrg# Helper functions for option handling.                     -*- Autoconf -*-
949744584a44Smrg
94980eb1301bSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
949906c34b88Smrg#
950044584a44Smrg# This file is free software; the Free Software Foundation
950144584a44Smrg# gives unlimited permission to copy and/or distribute it,
950244584a44Smrg# with or without modifications, as long as this notice is preserved.
950344584a44Smrg
950444584a44Smrg# _AM_MANGLE_OPTION(NAME)
950544584a44Smrg# -----------------------
950644584a44SmrgAC_DEFUN([_AM_MANGLE_OPTION],
950744584a44Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
950844584a44Smrg
950944584a44Smrg# _AM_SET_OPTION(NAME)
951044584a44Smrg# --------------------
951144584a44Smrg# Set option NAME.  Presently that only means defining a flag for this option.
951244584a44SmrgAC_DEFUN([_AM_SET_OPTION],
951344584a44Smrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
951444584a44Smrg
951544584a44Smrg# _AM_SET_OPTIONS(OPTIONS)
951644584a44Smrg# ------------------------
951744584a44Smrg# OPTIONS is a space-separated list of Automake options.
951844584a44SmrgAC_DEFUN([_AM_SET_OPTIONS],
951944584a44Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
952044584a44Smrg
952144584a44Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
952244584a44Smrg# -------------------------------------------
952344584a44Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
952444584a44SmrgAC_DEFUN([_AM_IF_OPTION],
952544584a44Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
952644584a44Smrg
95270eb1301bSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
952806c34b88Smrg#
952944584a44Smrg# This file is free software; the Free Software Foundation
953044584a44Smrg# gives unlimited permission to copy and/or distribute it,
953144584a44Smrg# with or without modifications, as long as this notice is preserved.
953244584a44Smrg
953344584a44Smrg# _AM_PROG_CC_C_O
953444584a44Smrg# ---------------
953544584a44Smrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
953644584a44Smrg# to automatically call this.
953744584a44SmrgAC_DEFUN([_AM_PROG_CC_C_O],
953844584a44Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
953944584a44SmrgAC_REQUIRE_AUX_FILE([compile])dnl
954044584a44SmrgAC_LANG_PUSH([C])dnl
954144584a44SmrgAC_CACHE_CHECK(
954244584a44Smrg  [whether $CC understands -c and -o together],
954344584a44Smrg  [am_cv_prog_cc_c_o],
954444584a44Smrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
954544584a44Smrg  # Make sure it works both with $CC and with simple cc.
954644584a44Smrg  # Following AC_PROG_CC_C_O, we do the test twice because some
954744584a44Smrg  # compilers refuse to overwrite an existing .o file with -o,
954844584a44Smrg  # though they will create one.
954944584a44Smrg  am_cv_prog_cc_c_o=yes
955044584a44Smrg  for am_i in 1 2; do
955144584a44Smrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
955244584a44Smrg         && test -f conftest2.$ac_objext; then
955344584a44Smrg      : OK
955444584a44Smrg    else
955544584a44Smrg      am_cv_prog_cc_c_o=no
955644584a44Smrg      break
955744584a44Smrg    fi
955844584a44Smrg  done
955944584a44Smrg  rm -f core conftest*
956044584a44Smrg  unset am_i])
956144584a44Smrgif test "$am_cv_prog_cc_c_o" != yes; then
956244584a44Smrg   # Losing compiler, so override with the script.
956344584a44Smrg   # FIXME: It is wrong to rewrite CC.
956444584a44Smrg   # But if we don't then we get into trouble of one sort or another.
956544584a44Smrg   # A longer-term fix would be to have automake use am__CC in this case,
956644584a44Smrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
956744584a44Smrg   CC="$am_aux_dir/compile $CC"
956844584a44Smrgfi
956944584a44SmrgAC_LANG_POP([C])])
957044584a44Smrg
957144584a44Smrg# For backward compatibility.
957244584a44SmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
957344584a44Smrg
95740eb1301bSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
957506c34b88Smrg#
957644584a44Smrg# This file is free software; the Free Software Foundation
957744584a44Smrg# gives unlimited permission to copy and/or distribute it,
957844584a44Smrg# with or without modifications, as long as this notice is preserved.
957906c34b88Smrg
958044584a44Smrg# AM_RUN_LOG(COMMAND)
958144584a44Smrg# -------------------
958244584a44Smrg# Run COMMAND, save the exit status in ac_status, and log it.
958344584a44Smrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
958444584a44SmrgAC_DEFUN([AM_RUN_LOG],
958544584a44Smrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
958644584a44Smrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
958744584a44Smrg   ac_status=$?
958844584a44Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
958944584a44Smrg   (exit $ac_status); }])
9590f1ee322dSmrg
959144584a44Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
959244584a44Smrg
95930eb1301bSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
959406c34b88Smrg#
959544584a44Smrg# This file is free software; the Free Software Foundation
959644584a44Smrg# gives unlimited permission to copy and/or distribute it,
959744584a44Smrg# with or without modifications, as long as this notice is preserved.
9598f1ee322dSmrg
959944584a44Smrg# AM_SANITY_CHECK
960044584a44Smrg# ---------------
960144584a44SmrgAC_DEFUN([AM_SANITY_CHECK],
960244584a44Smrg[AC_MSG_CHECKING([whether build environment is sane])
960344584a44Smrg# Reject unsafe characters in $srcdir or the absolute working directory
960444584a44Smrg# name.  Accept space and tab only in the latter.
960544584a44Smrgam_lf='
960644584a44Smrg'
960744584a44Smrgcase `pwd` in
960844584a44Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
960944584a44Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
961044584a44Smrgesac
961144584a44Smrgcase $srcdir in
961244584a44Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
961344584a44Smrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
961444584a44Smrgesac
961544584a44Smrg
961644584a44Smrg# Do 'set' in a subshell so we don't clobber the current shell's
961744584a44Smrg# arguments.  Must try -L first in case configure is actually a
961844584a44Smrg# symlink; some systems play weird games with the mod time of symlinks
961944584a44Smrg# (eg FreeBSD returns the mod time of the symlink's containing
962044584a44Smrg# directory).
962144584a44Smrgif (
962244584a44Smrg   am_has_slept=no
962344584a44Smrg   for am_try in 1 2; do
962444584a44Smrg     echo "timestamp, slept: $am_has_slept" > conftest.file
962544584a44Smrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
962644584a44Smrg     if test "$[*]" = "X"; then
962744584a44Smrg	# -L didn't work.
962844584a44Smrg	set X `ls -t "$srcdir/configure" conftest.file`
962944584a44Smrg     fi
963044584a44Smrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
963144584a44Smrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
963244584a44Smrg
963344584a44Smrg	# If neither matched, then we have a broken ls.  This can happen
963444584a44Smrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
963544584a44Smrg	# broken ls alias from the environment.  This has actually
963644584a44Smrg	# happened.  Such a system could not be considered "sane".
963744584a44Smrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
963844584a44Smrg  alias in your environment])
963944584a44Smrg     fi
964044584a44Smrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
964144584a44Smrg       break
964244584a44Smrg     fi
964344584a44Smrg     # Just in case.
964444584a44Smrg     sleep 1
964544584a44Smrg     am_has_slept=yes
964644584a44Smrg   done
964744584a44Smrg   test "$[2]" = conftest.file
964844584a44Smrg   )
964944584a44Smrgthen
965044584a44Smrg   # Ok.
965144584a44Smrg   :
965206c34b88Smrgelse
965344584a44Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
965444584a44SmrgCheck your system clock])
96553e256790Smrgfi
965644584a44SmrgAC_MSG_RESULT([yes])
965744584a44Smrg# If we didn't sleep, we still need to ensure time stamps of config.status and
965844584a44Smrg# generated files are strictly newer.
965944584a44Smrgam_sleep_pid=
966044584a44Smrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
966144584a44Smrg  ( sleep 1 ) &
966244584a44Smrg  am_sleep_pid=$!
966306c34b88Smrgfi
966444584a44SmrgAC_CONFIG_COMMANDS_PRE(
966544584a44Smrg  [AC_MSG_CHECKING([that generated files are newer than configure])
966644584a44Smrg   if test -n "$am_sleep_pid"; then
966744584a44Smrg     # Hide warnings about reused PIDs.
966844584a44Smrg     wait $am_sleep_pid 2>/dev/null
966906c34b88Smrg   fi
967044584a44Smrg   AC_MSG_RESULT([done])])
967144584a44Smrgrm -f conftest.file
967244584a44Smrg])
967337eb1ca1Smrg
96740eb1301bSmrg# Copyright (C) 2009-2013 Free Software Foundation, Inc.
9675b789ec8aSmrg#
967644584a44Smrg# This file is free software; the Free Software Foundation
967744584a44Smrg# gives unlimited permission to copy and/or distribute it,
967844584a44Smrg# with or without modifications, as long as this notice is preserved.
9679f1ee322dSmrg
968044584a44Smrg# AM_SILENT_RULES([DEFAULT])
968144584a44Smrg# --------------------------
968244584a44Smrg# Enable less verbose build rules; with the default set to DEFAULT
968344584a44Smrg# ("yes" being less verbose, "no" or empty being verbose).
968444584a44SmrgAC_DEFUN([AM_SILENT_RULES],
968544584a44Smrg[AC_ARG_ENABLE([silent-rules], [dnl
968644584a44SmrgAS_HELP_STRING(
968744584a44Smrg  [--enable-silent-rules],
968844584a44Smrg  [less verbose build output (undo: "make V=1")])
968944584a44SmrgAS_HELP_STRING(
969044584a44Smrg  [--disable-silent-rules],
969144584a44Smrg  [verbose build output (undo: "make V=0")])dnl
969244584a44Smrg])
969344584a44Smrgcase $enable_silent_rules in @%:@ (((
969444584a44Smrg  yes) AM_DEFAULT_VERBOSITY=0;;
969544584a44Smrg   no) AM_DEFAULT_VERBOSITY=1;;
969644584a44Smrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
969744584a44Smrgesac
969844584a44Smrgdnl
969944584a44Smrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
970044584a44Smrgdnl do not support nested variable expansions.
970144584a44Smrgdnl See automake bug#9928 and bug#10237.
970244584a44Smrgam_make=${MAKE-make}
970344584a44SmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
970444584a44Smrg   [am_cv_make_support_nested_variables],
970544584a44Smrg   [if AS_ECHO([['TRUE=$(BAR$(V))
970644584a44SmrgBAR0=false
970744584a44SmrgBAR1=true
970844584a44SmrgV=1
970944584a44Smrgam__doit:
971044584a44Smrg	@$(TRUE)
971144584a44Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
971244584a44Smrg  am_cv_make_support_nested_variables=yes
971306c34b88Smrgelse
971444584a44Smrg  am_cv_make_support_nested_variables=no
971506c34b88Smrgfi])
971644584a44Smrgif test $am_cv_make_support_nested_variables = yes; then
971744584a44Smrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
971844584a44Smrg  AM_V='$(V)'
971944584a44Smrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
972044584a44Smrgelse
972144584a44Smrg  AM_V=$AM_DEFAULT_VERBOSITY
972244584a44Smrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
972344584a44Smrgfi
972444584a44SmrgAC_SUBST([AM_V])dnl
972544584a44SmrgAM_SUBST_NOTMAKE([AM_V])dnl
972644584a44SmrgAC_SUBST([AM_DEFAULT_V])dnl
972744584a44SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
972844584a44SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
972944584a44SmrgAM_BACKSLASH='\'
973044584a44SmrgAC_SUBST([AM_BACKSLASH])dnl
973144584a44Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
973244584a44Smrg])
973337eb1ca1Smrg
97340eb1301bSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
973506c34b88Smrg#
973644584a44Smrg# This file is free software; the Free Software Foundation
973744584a44Smrg# gives unlimited permission to copy and/or distribute it,
973844584a44Smrg# with or without modifications, as long as this notice is preserved.
973937eb1ca1Smrg
974044584a44Smrg# AM_PROG_INSTALL_STRIP
974144584a44Smrg# ---------------------
974244584a44Smrg# One issue with vendor 'install' (even GNU) is that you can't
974344584a44Smrg# specify the program used to strip binaries.  This is especially
974444584a44Smrg# annoying in cross-compiling environments, where the build's strip
974544584a44Smrg# is unlikely to handle the host's binaries.
974644584a44Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
974744584a44Smrg# always use install-sh in "make install-strip", and initialize
974844584a44Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
974944584a44SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
975044584a44Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
975144584a44Smrg# Installed binaries are usually stripped using 'strip' when the user
975244584a44Smrg# run "make install-strip".  However 'strip' might not be the right
975344584a44Smrg# tool to use in cross-compilation environments, therefore Automake
975444584a44Smrg# will honor the 'STRIP' environment variable to overrule this program.
975544584a44Smrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
975644584a44Smrgif test "$cross_compiling" != no; then
975744584a44Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
975806c34b88Smrgfi
975944584a44SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
976044584a44SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
976137eb1ca1Smrg
97620eb1301bSmrg# Copyright (C) 2006-2013 Free Software Foundation, Inc.
976306c34b88Smrg#
976444584a44Smrg# This file is free software; the Free Software Foundation
976544584a44Smrg# gives unlimited permission to copy and/or distribute it,
976644584a44Smrg# with or without modifications, as long as this notice is preserved.
976744584a44Smrg
976844584a44Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
976944584a44Smrg# ---------------------------
977044584a44Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
977144584a44Smrg# This macro is traced by Automake.
977244584a44SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
977344584a44Smrg
977444584a44Smrg# AM_SUBST_NOTMAKE(VARIABLE)
977544584a44Smrg# --------------------------
977644584a44Smrg# Public sister of _AM_SUBST_NOTMAKE.
977744584a44SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
977844584a44Smrg
977944584a44Smrg# Check how to create a tarball.                            -*- Autoconf -*-
978044584a44Smrg
97810eb1301bSmrg# Copyright (C) 2004-2013 Free Software Foundation, Inc.
978206c34b88Smrg#
978344584a44Smrg# This file is free software; the Free Software Foundation
978444584a44Smrg# gives unlimited permission to copy and/or distribute it,
978544584a44Smrg# with or without modifications, as long as this notice is preserved.
9786f1ee322dSmrg
978744584a44Smrg# _AM_PROG_TAR(FORMAT)
978844584a44Smrg# --------------------
978944584a44Smrg# Check how to create a tarball in format FORMAT.
979044584a44Smrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
979189069ce9Smrg#
979244584a44Smrg# Substitute a variable $(am__tar) that is a command
979344584a44Smrg# writing to stdout a FORMAT-tarball containing the directory
979444584a44Smrg# $tardir.
979544584a44Smrg#     tardir=directory && $(am__tar) > result.tar
979689069ce9Smrg#
979744584a44Smrg# Substitute a variable $(am__untar) that extract such
979844584a44Smrg# a tarball read from stdin.
979944584a44Smrg#     $(am__untar) < result.tar
980089069ce9Smrg#
980144584a44SmrgAC_DEFUN([_AM_PROG_TAR],
980244584a44Smrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
980344584a44Smrg# in the wild :-(  We should find a proper way to deprecate it ...
980444584a44SmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
980506c34b88Smrg
980644584a44Smrg# We'll loop over all known methods to create a tar archive until one works.
980744584a44Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
9808dc9477beSmrg
980944584a44Smrgm4_if([$1], [v7],
981044584a44Smrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
9811dc9477beSmrg
981244584a44Smrg  [m4_case([$1],
981344584a44Smrg    [ustar],
981444584a44Smrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
981544584a44Smrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
981644584a44Smrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
981744584a44Smrg      # and bug#13588).
981844584a44Smrg      am_max_uid=2097151 # 2^21 - 1
981944584a44Smrg      am_max_gid=$am_max_uid
982044584a44Smrg      # The $UID and $GID variables are not portable, so we need to resort
982144584a44Smrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
982244584a44Smrg      # below are definitely unexpected, so allow the users to see them
982344584a44Smrg      # (that is, avoid stderr redirection).
982444584a44Smrg      am_uid=`id -u || echo unknown`
982544584a44Smrg      am_gid=`id -g || echo unknown`
982644584a44Smrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
982744584a44Smrg      if test $am_uid -le $am_max_uid; then
982844584a44Smrg         AC_MSG_RESULT([yes])
982944584a44Smrg      else
983044584a44Smrg         AC_MSG_RESULT([no])
983144584a44Smrg         _am_tools=none
983244584a44Smrg      fi
983344584a44Smrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
983444584a44Smrg      if test $am_gid -le $am_max_gid; then
983544584a44Smrg         AC_MSG_RESULT([yes])
983644584a44Smrg      else
983744584a44Smrg        AC_MSG_RESULT([no])
983844584a44Smrg        _am_tools=none
983944584a44Smrg      fi],
9840dc9477beSmrg
984144584a44Smrg  [pax],
984244584a44Smrg    [],
9843dc9477beSmrg
984444584a44Smrg  [m4_fatal([Unknown tar format])])
9845dc9477beSmrg
984644584a44Smrg  AC_MSG_CHECKING([how to create a $1 tar archive])
9847dc9477beSmrg
984844584a44Smrg  # Go ahead even if we have the value already cached.  We do so because we
984944584a44Smrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
985044584a44Smrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
9851dc9477beSmrg
985244584a44Smrg  for _am_tool in $_am_tools; do
985344584a44Smrg    case $_am_tool in
985444584a44Smrg    gnutar)
985544584a44Smrg      for _am_tar in tar gnutar gtar; do
985644584a44Smrg        AM_RUN_LOG([$_am_tar --version]) && break
985744584a44Smrg      done
985844584a44Smrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
985944584a44Smrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
986044584a44Smrg      am__untar="$_am_tar -xf -"
986144584a44Smrg      ;;
986244584a44Smrg    plaintar)
986344584a44Smrg      # Must skip GNU tar: if it does not support --format= it doesn't create
986444584a44Smrg      # ustar tarball either.
986544584a44Smrg      (tar --version) >/dev/null 2>&1 && continue
986644584a44Smrg      am__tar='tar chf - "$$tardir"'
986744584a44Smrg      am__tar_='tar chf - "$tardir"'
986844584a44Smrg      am__untar='tar xf -'
986944584a44Smrg      ;;
987044584a44Smrg    pax)
987144584a44Smrg      am__tar='pax -L -x $1 -w "$$tardir"'
987244584a44Smrg      am__tar_='pax -L -x $1 -w "$tardir"'
987344584a44Smrg      am__untar='pax -r'
987444584a44Smrg      ;;
987544584a44Smrg    cpio)
987644584a44Smrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
987744584a44Smrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
987844584a44Smrg      am__untar='cpio -i -H $1 -d'
987944584a44Smrg      ;;
988044584a44Smrg    none)
988144584a44Smrg      am__tar=false
988244584a44Smrg      am__tar_=false
988344584a44Smrg      am__untar=false
988444584a44Smrg      ;;
988544584a44Smrg    esac
9886dc9477beSmrg
988744584a44Smrg    # If the value was cached, stop now.  We just wanted to have am__tar
988844584a44Smrg    # and am__untar set.
988944584a44Smrg    test -n "${am_cv_prog_tar_$1}" && break
9890dc9477beSmrg
989144584a44Smrg    # tar/untar a dummy directory, and stop if the command works.
989244584a44Smrg    rm -rf conftest.dir
989344584a44Smrg    mkdir conftest.dir
989444584a44Smrg    echo GrepMe > conftest.dir/file
989544584a44Smrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
989644584a44Smrg    rm -rf conftest.dir
989744584a44Smrg    if test -s conftest.tar; then
989844584a44Smrg      AM_RUN_LOG([$am__untar <conftest.tar])
989944584a44Smrg      AM_RUN_LOG([cat conftest.dir/file])
990044584a44Smrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
990144584a44Smrg    fi
990244584a44Smrg  done
990344584a44Smrg  rm -rf conftest.dir
9904dc9477beSmrg
990544584a44Smrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
990644584a44Smrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
9907dc9477beSmrg
990844584a44SmrgAC_SUBST([am__tar])
990944584a44SmrgAC_SUBST([am__untar])
991044584a44Smrg]) # _AM_PROG_TAR
9911dc9477beSmrg
991244584a44Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
991344584a44Smrgdnl
99140eb1301bSmrgdnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
991544584a44Smrgdnl
991644584a44Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
991744584a44Smrgdnl copy of this software and associated documentation files (the "Software"),
991844584a44Smrgdnl to deal in the Software without restriction, including without limitation
991944584a44Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
992044584a44Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
992144584a44Smrgdnl Software is furnished to do so, subject to the following conditions:
992244584a44Smrgdnl
992344584a44Smrgdnl The above copyright notice and this permission notice (including the next
992444584a44Smrgdnl paragraph) shall be included in all copies or substantial portions of the
992544584a44Smrgdnl Software.
992644584a44Smrgdnl
992744584a44Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
992844584a44Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
992944584a44Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
993044584a44Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
993144584a44Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
993244584a44Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
993344584a44Smrgdnl DEALINGS IN THE SOFTWARE.
9934dc9477beSmrg
993544584a44Smrg# XORG_MACROS_VERSION(required-version)
993644584a44Smrg# -------------------------------------
9937dc9477beSmrg# Minimum version: 1.1.0
9938dc9477beSmrg#
993944584a44Smrg# If you're using a macro added in Version 1.1 or newer, include this in
994044584a44Smrg# your configure.ac with the minimum required version, such as:
994144584a44Smrg# XORG_MACROS_VERSION(1.1)
9942dc9477beSmrg#
994344584a44Smrg# To ensure that this macro is defined, also add:
994444584a44Smrg# m4_ifndef([XORG_MACROS_VERSION],
994544584a44Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9946dc9477beSmrg#
9947dc9477beSmrg#
994844584a44Smrg# See the "minimum version" comment for each macro you use to see what
994944584a44Smrg# version you require.
995044584a44Smrgm4_defun([XORG_MACROS_VERSION],[
995144584a44Smrgm4_define([vers_have], [1.19.0])
995244584a44Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
995344584a44Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
995444584a44Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
995544584a44Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
995644584a44Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
995744584a44Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
995844584a44Smrgm4_undefine([vers_have])
995944584a44Smrgm4_undefine([maj_have])
996044584a44Smrgm4_undefine([maj_needed])
996144584a44Smrg]) # XORG_MACROS_VERSION
9962dc9477beSmrg
996344584a44Smrg# XORG_PROG_RAWCPP()
996444584a44Smrg# ------------------
996544584a44Smrg# Minimum version: 1.0.0
996644584a44Smrg#
996744584a44Smrg# Find cpp program and necessary flags for use in pre-processing text files
996844584a44Smrg# such as man pages and config files
996944584a44SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
997044584a44SmrgAC_REQUIRE([AC_PROG_CPP])
997144584a44SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
997244584a44Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9973dc9477beSmrg
997444584a44Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
997544584a44Smrg# which is not the best choice for supporting other OS'es, but covers most
997644584a44Smrg# of the ones we need for now.
997744584a44SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
997844584a44SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
997944584a44Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
998044584a44Smrg	AC_MSG_RESULT([no])
9981dc9477beSmrgelse
998244584a44Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
998344584a44Smrg		RAWCPPFLAGS=-undef
998444584a44Smrg		AC_MSG_RESULT([yes])
998544584a44Smrg	# under Cygwin unix is still defined even with -undef
998644584a44Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
998744584a44Smrg		RAWCPPFLAGS="-undef -ansi"
998844584a44Smrg		AC_MSG_RESULT([yes, with -ansi])
998944584a44Smrg	else
999044584a44Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
999144584a44Smrg	fi
9992dc9477beSmrgfi
999344584a44Smrgrm -f conftest.$ac_ext
9994dc9477beSmrg
999544584a44SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
999644584a44SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
999744584a44Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
999844584a44Smrg	AC_MSG_RESULT([no])
999944584a44Smrgelse
1000044584a44Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1000144584a44Smrg		TRADITIONALCPPFLAGS="-traditional"
1000244584a44Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1000344584a44Smrg		AC_MSG_RESULT([yes])
1000444584a44Smrg	else
1000544584a44Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1000644584a44Smrg	fi
10007dc9477beSmrgfi
1000844584a44Smrgrm -f conftest.$ac_ext
1000944584a44SmrgAC_SUBST(RAWCPPFLAGS)
1001044584a44SmrgAC_SUBST(TRADITIONALCPPFLAGS)
1001144584a44Smrg]) # XORG_PROG_RAWCPP
10012dc9477beSmrg
1001344584a44Smrg# XORG_MANPAGE_SECTIONS()
1001444584a44Smrg# -----------------------
1001544584a44Smrg# Minimum version: 1.0.0
1001644584a44Smrg#
1001744584a44Smrg# Determine which sections man pages go in for the different man page types
1001844584a44Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1001944584a44Smrg# Not sure if there's any better way than just hardcoding by OS name.
1002044584a44Smrg# Override default settings by setting environment variables
1002144584a44Smrg# Added MAN_SUBSTS in version 1.8
1002244584a44Smrg# Added AC_PROG_SED in version 1.8
10023dc9477beSmrg
1002444584a44SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1002544584a44SmrgAC_REQUIRE([AC_CANONICAL_HOST])
1002644584a44SmrgAC_REQUIRE([AC_PROG_SED])
10027dc9477beSmrg
1002844584a44Smrgif test x$APP_MAN_SUFFIX = x    ; then
1002944584a44Smrg    APP_MAN_SUFFIX=1
1003044584a44Smrgfi
1003144584a44Smrgif test x$APP_MAN_DIR = x    ; then
1003244584a44Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1003344584a44Smrgfi
10034dc9477beSmrg
1003544584a44Smrgif test x$LIB_MAN_SUFFIX = x    ; then
1003644584a44Smrg    LIB_MAN_SUFFIX=3
1003744584a44Smrgfi
1003844584a44Smrgif test x$LIB_MAN_DIR = x    ; then
1003944584a44Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1004044584a44Smrgfi
10041dc9477beSmrg
1004244584a44Smrgif test x$FILE_MAN_SUFFIX = x    ; then
1004344584a44Smrg    case $host_os in
100440eb1301bSmrg	# Solaris 2.0 - 11 use SysV man page sections
100450eb1301bSmrg	solaris2.?|solaris2.1[[01]])	FILE_MAN_SUFFIX=4  ;;
100460eb1301bSmrg	*)				FILE_MAN_SUFFIX=5  ;;
1004744584a44Smrg    esac
1004844584a44Smrgfi
1004944584a44Smrgif test x$FILE_MAN_DIR = x    ; then
1005044584a44Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
10051dc9477beSmrgfi
10052dc9477beSmrg
1005344584a44Smrgif test x$MISC_MAN_SUFFIX = x    ; then
1005444584a44Smrg    case $host_os in
100550eb1301bSmrg	# Solaris 2.0 - 11 use SysV man page sections
100560eb1301bSmrg	solaris2.?|solaris2.1[[01]])	MISC_MAN_SUFFIX=5  ;;
100570eb1301bSmrg	*)				MISC_MAN_SUFFIX=7  ;;
1005844584a44Smrg    esac
1005944584a44Smrgfi
1006044584a44Smrgif test x$MISC_MAN_DIR = x    ; then
1006144584a44Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1006244584a44Smrgfi
10063dc9477beSmrg
1006444584a44Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1006544584a44Smrg    case $host_os in
100660eb1301bSmrg	# Solaris 2.0 - 11 use SysV man page sections
100670eb1301bSmrg	solaris2.?|solaris2.1[[01]])	DRIVER_MAN_SUFFIX=7  ;;
100680eb1301bSmrg	*)				DRIVER_MAN_SUFFIX=4  ;;
1006944584a44Smrg    esac
1007044584a44Smrgfi
1007144584a44Smrgif test x$DRIVER_MAN_DIR = x    ; then
1007244584a44Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1007344584a44Smrgfi
10074dc9477beSmrg
1007544584a44Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1007644584a44Smrg    case $host_os in
100770eb1301bSmrg	# Solaris 2.0 - 11 use SysV man page sections
100780eb1301bSmrg	solaris2.?|solaris2.1[[01]])	ADMIN_MAN_SUFFIX=1m ;;
100790eb1301bSmrg	*)				ADMIN_MAN_SUFFIX=8  ;;
1008044584a44Smrg    esac
1008144584a44Smrgfi
1008244584a44Smrgif test x$ADMIN_MAN_DIR = x    ; then
1008344584a44Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1008444584a44Smrgfi
10085dc9477beSmrg
10086dc9477beSmrg
1008744584a44SmrgAC_SUBST([APP_MAN_SUFFIX])
1008844584a44SmrgAC_SUBST([LIB_MAN_SUFFIX])
1008944584a44SmrgAC_SUBST([FILE_MAN_SUFFIX])
1009044584a44SmrgAC_SUBST([MISC_MAN_SUFFIX])
1009144584a44SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1009244584a44SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1009344584a44SmrgAC_SUBST([APP_MAN_DIR])
1009444584a44SmrgAC_SUBST([LIB_MAN_DIR])
1009544584a44SmrgAC_SUBST([FILE_MAN_DIR])
1009644584a44SmrgAC_SUBST([MISC_MAN_DIR])
1009744584a44SmrgAC_SUBST([DRIVER_MAN_DIR])
1009844584a44SmrgAC_SUBST([ADMIN_MAN_DIR])
10099dc9477beSmrg
1010044584a44SmrgXORG_MAN_PAGE="X Version 11"
1010144584a44SmrgAC_SUBST([XORG_MAN_PAGE])
1010244584a44SmrgMAN_SUBSTS="\
1010344584a44Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1010444584a44Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1010544584a44Smrg	-e 's|__xservername__|Xorg|g' \
1010644584a44Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
1010744584a44Smrg	-e 's|__projectroot__|\$(prefix)|g' \
1010844584a44Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
1010944584a44Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
1011044584a44Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
1011144584a44Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
1011244584a44Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
1011344584a44Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
1011444584a44Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
1011544584a44SmrgAC_SUBST([MAN_SUBSTS])
10116dc9477beSmrg
1011744584a44Smrg]) # XORG_MANPAGE_SECTIONS
10118dc9477beSmrg
1011944584a44Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
1012044584a44Smrg# ------------------------
1012144584a44Smrg# Minimum version: 1.7.0
1012244584a44Smrg#
1012344584a44Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
1012444584a44Smrg# provided by xorg-sgml-doctools, if installed.
1012544584a44SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
1012644584a44SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
1012744584a44SmrgXORG_SGML_PATH=
1012844584a44SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
1012944584a44Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
1013044584a44Smrg    [m4_ifval([$1],[:],
1013144584a44Smrg        [if test x"$cross_compiling" != x"yes" ; then
1013244584a44Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
1013344584a44Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
1013444584a44Smrg         fi])
1013544584a44Smrg    ])
10136dc9477beSmrg
1013744584a44Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
1013844584a44Smrg# the path and the name of the doc stylesheet
1013944584a44Smrgif test "x$XORG_SGML_PATH" != "x" ; then
1014044584a44Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
1014144584a44Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
1014244584a44Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
1014344584a44Smrgelse
1014444584a44Smrg   AC_MSG_RESULT([no])
10145dc9477beSmrgfi
10146dc9477beSmrg
1014744584a44SmrgAC_SUBST(XORG_SGML_PATH)
1014844584a44SmrgAC_SUBST(STYLESHEET_SRCDIR)
1014944584a44SmrgAC_SUBST(XSL_STYLESHEET)
1015044584a44SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
1015144584a44Smrg]) # XORG_CHECK_SGML_DOCTOOLS
10152dc9477beSmrg
1015344584a44Smrg# XORG_CHECK_LINUXDOC
1015444584a44Smrg# -------------------
1015544584a44Smrg# Minimum version: 1.0.0
1015644584a44Smrg#
1015744584a44Smrg# Defines the variable MAKE_TEXT if the necessary tools and
1015844584a44Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1015944584a44Smrg# Whether or not the necessary tools and files are found can be checked
1016044584a44Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1016144584a44SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1016244584a44SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1016344584a44SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
10164dc9477beSmrg
1016544584a44SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
10166dc9477beSmrg
1016744584a44SmrgAC_MSG_CHECKING([whether to build documentation])
10168dc9477beSmrg
1016944584a44Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
1017044584a44Smrg   BUILDDOC=yes
1017144584a44Smrgelse
1017244584a44Smrg   BUILDDOC=no
1017344584a44Smrgfi
10174dc9477beSmrg
1017544584a44SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
10176dc9477beSmrg
1017744584a44SmrgAC_MSG_RESULT([$BUILDDOC])
10178dc9477beSmrg
1017944584a44SmrgAC_MSG_CHECKING([whether to build pdf documentation])
1018044584a44Smrg
1018144584a44Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
1018244584a44Smrg   BUILDPDFDOC=yes
10183dc9477beSmrgelse
1018444584a44Smrg   BUILDPDFDOC=no
10185dc9477beSmrgfi
10186dc9477beSmrg
1018744584a44SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10188dc9477beSmrg
1018944584a44SmrgAC_MSG_RESULT([$BUILDPDFDOC])
10190dc9477beSmrg
1019144584a44SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
1019244584a44SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1019344584a44SmrgMAKE_PDF="$PS2PDF"
1019444584a44SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
10195dc9477beSmrg
1019644584a44SmrgAC_SUBST(MAKE_TEXT)
1019744584a44SmrgAC_SUBST(MAKE_PS)
1019844584a44SmrgAC_SUBST(MAKE_PDF)
1019944584a44SmrgAC_SUBST(MAKE_HTML)
1020044584a44Smrg]) # XORG_CHECK_LINUXDOC
10201dc9477beSmrg
1020244584a44Smrg# XORG_CHECK_DOCBOOK
1020344584a44Smrg# -------------------
1020444584a44Smrg# Minimum version: 1.0.0
1020544584a44Smrg#
1020644584a44Smrg# Checks for the ability to build output formats from SGML DocBook source.
1020744584a44Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1020844584a44Smrg# indicates whether the necessary tools and files are found and, if set,
1020944584a44Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1021044584a44SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1021144584a44SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10212dc9477beSmrg
1021344584a44SmrgBUILDTXTDOC=no
1021444584a44SmrgBUILDPDFDOC=no
1021544584a44SmrgBUILDPSDOC=no
1021644584a44SmrgBUILDHTMLDOC=no
1021744584a44Smrg
1021844584a44SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1021944584a44SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1022044584a44SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1022144584a44SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1022244584a44Smrg
1022344584a44SmrgAC_MSG_CHECKING([whether to build text documentation])
1022444584a44Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
1022544584a44Smrg   test x$BUILD_TXTDOC != xno; then
1022644584a44Smrg	BUILDTXTDOC=yes
10227dc9477beSmrgfi
1022844584a44SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1022944584a44SmrgAC_MSG_RESULT([$BUILDTXTDOC])
10230dc9477beSmrg
1023144584a44SmrgAC_MSG_CHECKING([whether to build PDF documentation])
1023244584a44Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
1023344584a44Smrg   test x$BUILD_PDFDOC != xno; then
1023444584a44Smrg	BUILDPDFDOC=yes
1023544584a44Smrgfi
1023644584a44SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1023744584a44SmrgAC_MSG_RESULT([$BUILDPDFDOC])
10238dc9477beSmrg
1023944584a44SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
1024044584a44Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
1024144584a44Smrg   test x$BUILD_PSDOC != xno; then
1024244584a44Smrg	BUILDPSDOC=yes
1024344584a44Smrgfi
1024444584a44SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1024544584a44SmrgAC_MSG_RESULT([$BUILDPSDOC])
1024644584a44Smrg
1024744584a44SmrgAC_MSG_CHECKING([whether to build HTML documentation])
1024844584a44Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
1024944584a44Smrg   test x$BUILD_HTMLDOC != xno; then
1025044584a44Smrg	BUILDHTMLDOC=yes
1025144584a44Smrgfi
1025244584a44SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1025344584a44SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1025444584a44Smrg
1025544584a44SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1025644584a44SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1025744584a44SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1025844584a44SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1025944584a44Smrg
1026044584a44SmrgAC_SUBST(MAKE_TEXT)
1026144584a44SmrgAC_SUBST(MAKE_PS)
1026244584a44SmrgAC_SUBST(MAKE_PDF)
1026344584a44SmrgAC_SUBST(MAKE_HTML)
1026444584a44Smrg]) # XORG_CHECK_DOCBOOK
1026544584a44Smrg
1026644584a44Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
1026744584a44Smrg# ----------------
1026844584a44Smrg# Minimum version: 1.5.0
1026944584a44Smrg# Minimum version for optional DEFAULT argument: 1.11.0
10270dc9477beSmrg#
1027144584a44Smrg# Documentation tools are not always available on all platforms and sometimes
1027244584a44Smrg# not at the appropriate level. This macro enables a module to test for the
1027344584a44Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1027444584a44Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
1027544584a44Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
1027644584a44Smrg# --with-xmlto assumes 'auto'.
10277dc9477beSmrg#
1027844584a44Smrg# Interface to module:
1027944584a44Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
1028044584a44Smrg# XMLTO:	returns the path of the xmlto program found
1028144584a44Smrg#		returns the path set by the user in the environment
1028244584a44Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
1028344584a44Smrg#		'no' user instructs the module not to use xmlto
10284dc9477beSmrg#
1028544584a44Smrg# Added in version 1.10.0
1028644584a44Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
1028744584a44Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
10288dc9477beSmrg#
1028944584a44Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
10290dc9477beSmrg#
1029144584a44SmrgAC_DEFUN([XORG_WITH_XMLTO],[
1029244584a44SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
1029344584a44Smrgm4_define([_defopt], m4_default([$2], [auto]))
1029444584a44SmrgAC_ARG_WITH(xmlto,
1029544584a44Smrg	AS_HELP_STRING([--with-xmlto],
1029644584a44Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
1029744584a44Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
1029844584a44Smrgm4_undefine([_defopt])
10299dc9477beSmrg
1030044584a44Smrgif test "x$use_xmlto" = x"auto"; then
1030144584a44Smrg   AC_PATH_PROG([XMLTO], [xmlto])
1030244584a44Smrg   if test "x$XMLTO" = "x"; then
1030344584a44Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
1030444584a44Smrg	have_xmlto=no
1030544584a44Smrg   else
1030644584a44Smrg        have_xmlto=yes
1030744584a44Smrg   fi
1030844584a44Smrgelif test "x$use_xmlto" = x"yes" ; then
1030944584a44Smrg   AC_PATH_PROG([XMLTO], [xmlto])
1031044584a44Smrg   if test "x$XMLTO" = "x"; then
1031144584a44Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
1031244584a44Smrg   fi
1031344584a44Smrg   have_xmlto=yes
1031444584a44Smrgelif test "x$use_xmlto" = x"no" ; then
1031544584a44Smrg   if test "x$XMLTO" != "x"; then
1031644584a44Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
1031744584a44Smrg   fi
1031844584a44Smrg   have_xmlto=no
1031944584a44Smrgelse
1032044584a44Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
10321dc9477beSmrgfi
10322dc9477beSmrg
1032344584a44Smrg# Test for a minimum version of xmlto, if provided.
1032444584a44Smrgm4_ifval([$1],
1032544584a44Smrg[if test "$have_xmlto" = yes; then
1032644584a44Smrg    # scrape the xmlto version
1032744584a44Smrg    AC_MSG_CHECKING([the xmlto version])
1032844584a44Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
1032944584a44Smrg    AC_MSG_RESULT([$xmlto_version])
1033044584a44Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
1033144584a44Smrg        [if test "x$use_xmlto" = xauto; then
1033244584a44Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
1033344584a44Smrg            have_xmlto=no
1033444584a44Smrg        else
1033544584a44Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
1033644584a44Smrg        fi])
1033744584a44Smrgfi])
1033844584a44Smrg
1033944584a44Smrg# Test for the ability of xmlto to generate a text target
103400eb1301bSmrg#
103410eb1301bSmrg# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the
103420eb1301bSmrg# following test for empty XML docbook files.
103430eb1301bSmrg# For compatibility reasons use the following empty XML docbook file and if
103440eb1301bSmrg# it fails try it again with a non-empty XML file.
1034544584a44Smrghave_xmlto_text=no
1034644584a44Smrgcat > conftest.xml << "EOF"
1034744584a44SmrgEOF
1034844584a44SmrgAS_IF([test "$have_xmlto" = yes],
1034944584a44Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1035044584a44Smrg             [have_xmlto_text=yes],
103510eb1301bSmrg             [# Try it again with a non-empty XML file.
103520eb1301bSmrg              cat > conftest.xml << "EOF"
103530eb1301bSmrg<x></x>
103540eb1301bSmrgEOF
103550eb1301bSmrg              AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
103560eb1301bSmrg                    [have_xmlto_text=yes],
103570eb1301bSmrg                    [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])])
1035844584a44Smrgrm -f conftest.xml
1035944584a44SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
1036044584a44SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
1036144584a44Smrg]) # XORG_WITH_XMLTO
1036244584a44Smrg
1036344584a44Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
1036444584a44Smrg# --------------------------------------------
1036544584a44Smrg# Minimum version: 1.12.0
1036644584a44Smrg# Minimum version for optional DEFAULT argument: 1.12.0
10367dc9477beSmrg#
1036844584a44Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
1036944584a44Smrg# XML-based language used for the transformation of XML documents.
1037044584a44Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
1037144584a44Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
1037244584a44Smrg# The XSLT processor is often used as a standalone tool for transformations.
1037344584a44Smrg# It should not be assumed that this tool is used only to work with documnetation.
1037444584a44Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
10375dc9477beSmrg#
1037644584a44Smrg# Interface to module:
1037744584a44Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
1037844584a44Smrg# XSLTPROC:	 returns the path of the xsltproc program found
1037944584a44Smrg#		 returns the path set by the user in the environment
1038044584a44Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
1038144584a44Smrg#		  'no' user instructs the module not to use xsltproc
1038244584a44Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
10383dc9477beSmrg#
1038444584a44Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
10385dc9477beSmrg#
1038644584a44SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
1038744584a44SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
1038844584a44Smrg# Preserves the interface, should it be implemented later
1038944584a44Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
1039044584a44Smrgm4_define([_defopt], m4_default([$2], [auto]))
1039144584a44SmrgAC_ARG_WITH(xsltproc,
1039244584a44Smrg	AS_HELP_STRING([--with-xsltproc],
1039344584a44Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
1039444584a44Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
1039544584a44Smrgm4_undefine([_defopt])
10396dc9477beSmrg
1039744584a44Smrgif test "x$use_xsltproc" = x"auto"; then
1039844584a44Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
1039944584a44Smrg   if test "x$XSLTPROC" = "x"; then
1040044584a44Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
1040144584a44Smrg	have_xsltproc=no
1040244584a44Smrg   else
1040344584a44Smrg        have_xsltproc=yes
1040444584a44Smrg   fi
1040544584a44Smrgelif test "x$use_xsltproc" = x"yes" ; then
1040644584a44Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
1040744584a44Smrg   if test "x$XSLTPROC" = "x"; then
1040844584a44Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
1040944584a44Smrg   fi
1041044584a44Smrg   have_xsltproc=yes
1041144584a44Smrgelif test "x$use_xsltproc" = x"no" ; then
1041244584a44Smrg   if test "x$XSLTPROC" != "x"; then
1041344584a44Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
1041444584a44Smrg   fi
1041544584a44Smrg   have_xsltproc=no
1041644584a44Smrgelse
1041744584a44Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
1041844584a44Smrgfi
10419dc9477beSmrg
1042044584a44SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
1042144584a44Smrg]) # XORG_WITH_XSLTPROC
1042244584a44Smrg
1042344584a44Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
1042444584a44Smrg# ----------------------------------------
1042544584a44Smrg# Minimum version: 1.15.0
10426dc9477beSmrg#
1042744584a44Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
1042844584a44Smrg# scanning arbitrary text files, extracting information from those text files,
1042944584a44Smrg# and printing reports based on that information.
10430dc9477beSmrg#
1043144584a44Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
10432dc9477beSmrg#
1043344584a44Smrg# Interface to module:
1043444584a44Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
1043544584a44Smrg# PERL:	     returns the path of the perl program found
1043644584a44Smrg#	     returns the path set by the user in the environment
1043744584a44Smrg# --with-perl: 'yes' user instructs the module to use perl
1043844584a44Smrg#	       'no' user instructs the module not to use perl
1043944584a44Smrg# have_perl: returns yes if perl found in PATH or no
10440dc9477beSmrg#
1044144584a44Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
1044244584a44Smrg#
1044344584a44SmrgAC_DEFUN([XORG_WITH_PERL],[
1044444584a44SmrgAC_ARG_VAR([PERL], [Path to perl command])
1044544584a44Smrg# Preserves the interface, should it be implemented later
1044644584a44Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
1044744584a44Smrgm4_define([_defopt], m4_default([$2], [auto]))
1044844584a44SmrgAC_ARG_WITH(perl,
1044944584a44Smrg	AS_HELP_STRING([--with-perl],
1045044584a44Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
1045144584a44Smrg	   [use_perl=$withval], [use_perl=]_defopt)
1045244584a44Smrgm4_undefine([_defopt])
10453dc9477beSmrg
1045444584a44Smrgif test "x$use_perl" = x"auto"; then
1045544584a44Smrg   AC_PATH_PROG([PERL], [perl])
1045644584a44Smrg   if test "x$PERL" = "x"; then
1045744584a44Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
1045844584a44Smrg	have_perl=no
1045944584a44Smrg   else
1046044584a44Smrg        have_perl=yes
1046144584a44Smrg   fi
1046244584a44Smrgelif test "x$use_perl" = x"yes" ; then
1046344584a44Smrg   AC_PATH_PROG([PERL], [perl])
1046444584a44Smrg   if test "x$PERL" = "x"; then
1046544584a44Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
1046644584a44Smrg   fi
1046744584a44Smrg   have_perl=yes
1046844584a44Smrgelif test "x$use_perl" = x"no" ; then
1046944584a44Smrg   if test "x$PERL" != "x"; then
1047044584a44Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
1047144584a44Smrg   fi
1047244584a44Smrg   have_perl=no
1047344584a44Smrgelse
1047444584a44Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
1047544584a44Smrgfi
10476dc9477beSmrg
1047744584a44SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
1047844584a44Smrg]) # XORG_WITH_PERL
10479dc9477beSmrg
1048044584a44Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
1048144584a44Smrg# ----------------
1048244584a44Smrg# Minimum version: 1.5.0
1048344584a44Smrg# Minimum version for optional DEFAULT argument: 1.11.0
10484dc9477beSmrg#
1048544584a44Smrg# Documentation tools are not always available on all platforms and sometimes
1048644584a44Smrg# not at the appropriate level. This macro enables a module to test for the
1048744584a44Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1048844584a44Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
1048944584a44Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
1049044584a44Smrg# --with-asciidoc assumes 'auto'.
10491dc9477beSmrg#
1049244584a44Smrg# Interface to module:
1049344584a44Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
1049444584a44Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
1049544584a44Smrg#		 returns the path set by the user in the environment
1049644584a44Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
1049744584a44Smrg#		  'no' user instructs the module not to use asciidoc
10498dc9477beSmrg#
1049944584a44Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
10500dc9477beSmrg#
1050144584a44SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
1050244584a44SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
1050344584a44Smrgm4_define([_defopt], m4_default([$2], [auto]))
1050444584a44SmrgAC_ARG_WITH(asciidoc,
1050544584a44Smrg	AS_HELP_STRING([--with-asciidoc],
1050644584a44Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
1050744584a44Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
1050844584a44Smrgm4_undefine([_defopt])
10509dc9477beSmrg
1051044584a44Smrgif test "x$use_asciidoc" = x"auto"; then
1051144584a44Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1051244584a44Smrg   if test "x$ASCIIDOC" = "x"; then
1051344584a44Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
1051444584a44Smrg	have_asciidoc=no
1051544584a44Smrg   else
1051644584a44Smrg        have_asciidoc=yes
1051744584a44Smrg   fi
1051844584a44Smrgelif test "x$use_asciidoc" = x"yes" ; then
1051944584a44Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1052044584a44Smrg   if test "x$ASCIIDOC" = "x"; then
1052144584a44Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
1052244584a44Smrg   fi
1052344584a44Smrg   have_asciidoc=yes
1052444584a44Smrgelif test "x$use_asciidoc" = x"no" ; then
1052544584a44Smrg   if test "x$ASCIIDOC" != "x"; then
1052644584a44Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
1052744584a44Smrg   fi
1052844584a44Smrg   have_asciidoc=no
10529dc9477beSmrgelse
1053044584a44Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
10531dc9477beSmrgfi
1053244584a44Smrgm4_ifval([$1],
1053344584a44Smrg[if test "$have_asciidoc" = yes; then
1053444584a44Smrg    # scrape the asciidoc version
1053544584a44Smrg    AC_MSG_CHECKING([the asciidoc version])
1053644584a44Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
1053744584a44Smrg    AC_MSG_RESULT([$asciidoc_version])
1053844584a44Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
1053944584a44Smrg        [if test "x$use_asciidoc" = xauto; then
1054044584a44Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
1054144584a44Smrg            have_asciidoc=no
1054244584a44Smrg        else
1054344584a44Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
1054444584a44Smrg        fi])
1054544584a44Smrgfi])
1054644584a44SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
1054744584a44Smrg]) # XORG_WITH_ASCIIDOC
10548dc9477beSmrg
1054944584a44Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
1055044584a44Smrg# -------------------------------------------
1055144584a44Smrg# Minimum version: 1.5.0
1055244584a44Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1055344584a44Smrg# Minimum version for optional DOT checking: 1.18.0
10554dc9477beSmrg#
1055544584a44Smrg# Documentation tools are not always available on all platforms and sometimes
1055644584a44Smrg# not at the appropriate level. This macro enables a module to test for the
1055744584a44Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1055844584a44Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
1055944584a44Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
1056044584a44Smrg# --with-doxygen assumes 'auto'.
1056144584a44Smrg#
1056244584a44Smrg# Interface to module:
1056344584a44Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
1056444584a44Smrg# DOXYGEN:	 returns the path of the doxygen program found
1056544584a44Smrg#		 returns the path set by the user in the environment
1056644584a44Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
1056744584a44Smrg#		  'no' user instructs the module not to use doxygen
1056844584a44Smrg#
1056944584a44Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
1057044584a44Smrg#
1057144584a44SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
1057244584a44SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
1057344584a44SmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
1057444584a44Smrgm4_define([_defopt], m4_default([$2], [auto]))
1057544584a44SmrgAC_ARG_WITH(doxygen,
1057644584a44Smrg	AS_HELP_STRING([--with-doxygen],
1057744584a44Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
1057844584a44Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
1057944584a44Smrgm4_undefine([_defopt])
10580dc9477beSmrg
1058144584a44Smrgif test "x$use_doxygen" = x"auto"; then
1058244584a44Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1058344584a44Smrg   if test "x$DOXYGEN" = "x"; then
1058444584a44Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
1058544584a44Smrg	have_doxygen=no
1058644584a44Smrg   else
1058744584a44Smrg        have_doxygen=yes
1058844584a44Smrg   fi
1058944584a44Smrgelif test "x$use_doxygen" = x"yes" ; then
1059044584a44Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1059144584a44Smrg   if test "x$DOXYGEN" = "x"; then
1059244584a44Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
1059344584a44Smrg   fi
1059444584a44Smrg   have_doxygen=yes
1059544584a44Smrgelif test "x$use_doxygen" = x"no" ; then
1059644584a44Smrg   if test "x$DOXYGEN" != "x"; then
1059744584a44Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
1059844584a44Smrg   fi
1059944584a44Smrg   have_doxygen=no
1060044584a44Smrgelse
1060144584a44Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
1060244584a44Smrgfi
1060344584a44Smrgm4_ifval([$1],
1060444584a44Smrg[if test "$have_doxygen" = yes; then
1060544584a44Smrg    # scrape the doxygen version
1060644584a44Smrg    AC_MSG_CHECKING([the doxygen version])
1060744584a44Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
1060844584a44Smrg    AC_MSG_RESULT([$doxygen_version])
1060944584a44Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
1061044584a44Smrg        [if test "x$use_doxygen" = xauto; then
1061144584a44Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
1061244584a44Smrg            have_doxygen=no
1061344584a44Smrg        else
1061444584a44Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
1061544584a44Smrg        fi])
1061644584a44Smrgfi])
10617dc9477beSmrg
1061844584a44Smrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
1061944584a44Smrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
1062044584a44Smrgdnl 	HAVE_DOT = @HAVE_DOT@
1062144584a44SmrgHAVE_DOT=no
1062244584a44Smrgif test "x$have_doxygen" = "xyes"; then
1062344584a44Smrg  AC_PATH_PROG([DOT], [dot])
1062444584a44Smrg    if test "x$DOT" != "x"; then
1062544584a44Smrg      HAVE_DOT=yes
1062644584a44Smrg    fi
1062744584a44Smrgfi
10628dc9477beSmrg
1062944584a44SmrgAC_SUBST([HAVE_DOT])
1063044584a44SmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
1063144584a44SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
1063244584a44Smrg]) # XORG_WITH_DOXYGEN
10633dc9477beSmrg
1063444584a44Smrg# XORG_WITH_GROFF([DEFAULT])
1063544584a44Smrg# ----------------
1063644584a44Smrg# Minimum version: 1.6.0
1063744584a44Smrg# Minimum version for optional DEFAULT argument: 1.11.0
10638dc9477beSmrg#
1063944584a44Smrg# Documentation tools are not always available on all platforms and sometimes
1064044584a44Smrg# not at the appropriate level. This macro enables a module to test for the
1064144584a44Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1064244584a44Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
1064344584a44Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
1064444584a44Smrg# --with-groff assumes 'auto'.
1064544584a44Smrg#
1064644584a44Smrg# Interface to module:
1064744584a44Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
1064844584a44Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
1064944584a44Smrg# HAVE_GROFF_MS: the -ms macros package
1065044584a44Smrg# GROFF:	 returns the path of the groff program found
1065144584a44Smrg#		 returns the path set by the user in the environment
1065244584a44Smrg# --with-groff:	 'yes' user instructs the module to use groff
1065344584a44Smrg#		 'no' user instructs the module not to use groff
1065444584a44Smrg#
1065544584a44Smrg# Added in version 1.9.0:
1065644584a44Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
1065744584a44Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
1065844584a44Smrg#		   psselect from the psutils package.
1065944584a44Smrg#		   the ghostcript package. Refer to the grohtml man pages
1066044584a44Smrg#
1066144584a44Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
1066244584a44Smrg#
1066344584a44Smrg# OS and distros often splits groff in a basic and full package, the former
1066444584a44Smrg# having the groff program and the later having devices, fonts and macros
1066544584a44Smrg# Checking for the groff executable is not enough.
1066644584a44Smrg#
1066744584a44Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
1066844584a44Smrg# unset HAVE_GROFF or GROFF env variables.
1066944584a44Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
1067044584a44Smrg#
1067144584a44SmrgAC_DEFUN([XORG_WITH_GROFF],[
1067244584a44SmrgAC_ARG_VAR([GROFF], [Path to groff command])
1067344584a44Smrgm4_define([_defopt], m4_default([$1], [auto]))
1067444584a44SmrgAC_ARG_WITH(groff,
1067544584a44Smrg	AS_HELP_STRING([--with-groff],
1067644584a44Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
1067744584a44Smrg	   [use_groff=$withval], [use_groff=]_defopt)
1067844584a44Smrgm4_undefine([_defopt])
10679dc9477beSmrg
1068044584a44Smrgif test "x$use_groff" = x"auto"; then
1068144584a44Smrg   AC_PATH_PROG([GROFF], [groff])
1068244584a44Smrg   if test "x$GROFF" = "x"; then
1068344584a44Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
1068444584a44Smrg	have_groff=no
1068544584a44Smrg   else
1068644584a44Smrg        have_groff=yes
1068744584a44Smrg   fi
1068844584a44Smrgelif test "x$use_groff" = x"yes" ; then
1068944584a44Smrg   AC_PATH_PROG([GROFF], [groff])
1069044584a44Smrg   if test "x$GROFF" = "x"; then
1069144584a44Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
1069244584a44Smrg   fi
1069344584a44Smrg   have_groff=yes
1069444584a44Smrgelif test "x$use_groff" = x"no" ; then
1069544584a44Smrg   if test "x$GROFF" != "x"; then
1069644584a44Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
1069744584a44Smrg   fi
1069844584a44Smrg   have_groff=no
1069944584a44Smrgelse
1070044584a44Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
1070144584a44Smrgfi
10702dc9477beSmrg
1070344584a44Smrg# We have groff, test for the presence of the macro packages
1070444584a44Smrgif test "x$have_groff" = x"yes"; then
1070544584a44Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
1070644584a44Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
1070744584a44Smrg        groff_ms_works=yes
1070844584a44Smrg    else
1070944584a44Smrg        groff_ms_works=no
1071044584a44Smrg    fi
1071144584a44Smrg    AC_MSG_RESULT([$groff_ms_works])
1071244584a44Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
1071344584a44Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
1071444584a44Smrg        groff_mm_works=yes
1071544584a44Smrg    else
1071644584a44Smrg        groff_mm_works=no
1071744584a44Smrg    fi
1071844584a44Smrg    AC_MSG_RESULT([$groff_mm_works])
1071944584a44Smrgfi
10720dc9477beSmrg
1072144584a44Smrg# We have groff, test for HTML dependencies, one command per package
1072244584a44Smrgif test "x$have_groff" = x"yes"; then
1072344584a44Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
1072444584a44Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
1072544584a44Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
1072644584a44Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
1072744584a44Smrg      have_groff_html=yes
1072844584a44Smrg   else
1072944584a44Smrg      have_groff_html=no
1073044584a44Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
1073144584a44Smrg   fi
1073244584a44Smrgfi
10733dc9477beSmrg
1073444584a44Smrg# Set Automake conditionals for Makefiles
1073544584a44SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
1073644584a44SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
1073744584a44SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
1073844584a44SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
1073944584a44Smrg]) # XORG_WITH_GROFF
10740dc9477beSmrg
1074144584a44Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
1074244584a44Smrg# ---------------------------------------
1074344584a44Smrg# Minimum version: 1.6.0
1074444584a44Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1074544584a44Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
1074644584a44Smrg#
1074744584a44Smrg# Documentation tools are not always available on all platforms and sometimes
1074844584a44Smrg# not at the appropriate level. This macro enables a module to test for the
1074944584a44Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1075044584a44Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
1075144584a44Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
1075244584a44Smrg# --with-fop assumes 'auto'.
1075344584a44Smrg#
1075444584a44Smrg# Interface to module:
1075544584a44Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
1075644584a44Smrg# FOP:	 	returns the path of the fop program found
1075744584a44Smrg#		returns the path set by the user in the environment
1075844584a44Smrg# --with-fop: 	'yes' user instructs the module to use fop
1075944584a44Smrg#		'no' user instructs the module not to use fop
1076044584a44Smrg#
1076144584a44Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
1076244584a44Smrg#
1076344584a44SmrgAC_DEFUN([XORG_WITH_FOP],[
1076444584a44SmrgAC_ARG_VAR([FOP], [Path to fop command])
1076544584a44Smrgm4_define([_defopt], m4_default([$2], [auto]))
1076644584a44SmrgAC_ARG_WITH(fop,
1076744584a44Smrg	AS_HELP_STRING([--with-fop],
1076844584a44Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
1076944584a44Smrg	   [use_fop=$withval], [use_fop=]_defopt)
1077044584a44Smrgm4_undefine([_defopt])
10771dc9477beSmrg
1077244584a44Smrgif test "x$use_fop" = x"auto"; then
1077344584a44Smrg   AC_PATH_PROG([FOP], [fop])
1077444584a44Smrg   if test "x$FOP" = "x"; then
1077544584a44Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
1077644584a44Smrg	have_fop=no
1077744584a44Smrg   else
1077844584a44Smrg        have_fop=yes
1077944584a44Smrg   fi
1078044584a44Smrgelif test "x$use_fop" = x"yes" ; then
1078144584a44Smrg   AC_PATH_PROG([FOP], [fop])
1078244584a44Smrg   if test "x$FOP" = "x"; then
1078344584a44Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
1078444584a44Smrg   fi
1078544584a44Smrg   have_fop=yes
1078644584a44Smrgelif test "x$use_fop" = x"no" ; then
1078744584a44Smrg   if test "x$FOP" != "x"; then
1078844584a44Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
1078944584a44Smrg   fi
1079044584a44Smrg   have_fop=no
10791dc9477beSmrgelse
1079244584a44Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
10793dc9477beSmrgfi
10794dc9477beSmrg
1079544584a44Smrg# Test for a minimum version of fop, if provided.
1079644584a44Smrgm4_ifval([$1],
1079744584a44Smrg[if test "$have_fop" = yes; then
1079844584a44Smrg    # scrape the fop version
1079944584a44Smrg    AC_MSG_CHECKING([for fop minimum version])
1080044584a44Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
1080144584a44Smrg    AC_MSG_RESULT([$fop_version])
1080244584a44Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
1080344584a44Smrg        [if test "x$use_fop" = xauto; then
1080444584a44Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
1080544584a44Smrg            have_fop=no
1080644584a44Smrg        else
1080744584a44Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
1080844584a44Smrg        fi])
1080944584a44Smrgfi])
1081044584a44SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
1081144584a44Smrg]) # XORG_WITH_FOP
1081244584a44Smrg
1081344584a44Smrg# XORG_WITH_M4([MIN-VERSION])
1081444584a44Smrg# ---------------------------
1081544584a44Smrg# Minimum version: 1.19.0
1081644584a44Smrg#
1081744584a44Smrg# This macro attempts to locate an m4 macro processor which supports
1081844584a44Smrg# -I option and is only useful for modules relying on M4 in order to
1081944584a44Smrg# expand macros in source code files.
1082044584a44Smrg#
1082144584a44Smrg# Interface to module:
1082244584a44Smrg# M4:	 	returns the path of the m4 program found
1082344584a44Smrg#		returns the path set by the user in the environment
1082444584a44Smrg#
1082544584a44SmrgAC_DEFUN([XORG_WITH_M4], [
1082644584a44SmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
1082744584a44Smrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
1082844584a44Smrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
1082944584a44Smrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
1083044584a44Smrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
1083144584a44Smrg   [$PATH:/usr/gnu/bin])])
10832dc9477beSmrg
1083344584a44SmrgAC_SUBST([M4], [$ac_cv_path_M4])
1083444584a44Smrg]) # XORG_WITH_M4
10835dc9477beSmrg
1083644584a44Smrg# XORG_WITH_PS2PDF([DEFAULT])
1083744584a44Smrg# ----------------
1083844584a44Smrg# Minimum version: 1.6.0
1083944584a44Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1084044584a44Smrg#
1084144584a44Smrg# Documentation tools are not always available on all platforms and sometimes
1084244584a44Smrg# not at the appropriate level. This macro enables a module to test for the
1084344584a44Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1084444584a44Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
1084544584a44Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
1084644584a44Smrg# --with-ps2pdf assumes 'auto'.
1084744584a44Smrg#
1084844584a44Smrg# Interface to module:
1084944584a44Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
1085044584a44Smrg# PS2PDF:	returns the path of the ps2pdf program found
1085144584a44Smrg#		returns the path set by the user in the environment
1085244584a44Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
1085344584a44Smrg#		 'no' user instructs the module not to use ps2pdf
1085444584a44Smrg#
1085544584a44Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
1085644584a44Smrg#
1085744584a44SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
1085844584a44SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
1085944584a44Smrgm4_define([_defopt], m4_default([$1], [auto]))
1086044584a44SmrgAC_ARG_WITH(ps2pdf,
1086144584a44Smrg	AS_HELP_STRING([--with-ps2pdf],
1086244584a44Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
1086344584a44Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
1086444584a44Smrgm4_undefine([_defopt])
10865dc9477beSmrg
1086644584a44Smrgif test "x$use_ps2pdf" = x"auto"; then
1086744584a44Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1086844584a44Smrg   if test "x$PS2PDF" = "x"; then
1086944584a44Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
1087044584a44Smrg	have_ps2pdf=no
1087144584a44Smrg   else
1087244584a44Smrg        have_ps2pdf=yes
1087344584a44Smrg   fi
1087444584a44Smrgelif test "x$use_ps2pdf" = x"yes" ; then
1087544584a44Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1087644584a44Smrg   if test "x$PS2PDF" = "x"; then
1087744584a44Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
1087844584a44Smrg   fi
1087944584a44Smrg   have_ps2pdf=yes
1088044584a44Smrgelif test "x$use_ps2pdf" = x"no" ; then
1088144584a44Smrg   if test "x$PS2PDF" != "x"; then
1088244584a44Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
1088344584a44Smrg   fi
1088444584a44Smrg   have_ps2pdf=no
1088544584a44Smrgelse
1088644584a44Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
10887dc9477beSmrgfi
1088844584a44SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
1088944584a44Smrg]) # XORG_WITH_PS2PDF
10890dc9477beSmrg
1089144584a44Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
1089244584a44Smrg# ----------------
1089344584a44Smrg# Minimum version: 1.6.0
10894dc9477beSmrg#
1089544584a44Smrg# Documentation tools are not always available on all platforms and sometimes
1089644584a44Smrg# not at the appropriate level. This macro enables a builder to skip all
1089744584a44Smrg# documentation targets except traditional man pages.
1089844584a44Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1089944584a44Smrg# maximum flexibilty in controlling documentation building.
1090044584a44Smrg# Refer to:
1090144584a44Smrg# XORG_WITH_XMLTO         --with-xmlto
1090244584a44Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1090344584a44Smrg# XORG_WITH_DOXYGEN       --with-doxygen
1090444584a44Smrg# XORG_WITH_FOP           --with-fop
1090544584a44Smrg# XORG_WITH_GROFF         --with-groff
1090644584a44Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
1090744584a44Smrg#
1090844584a44Smrg# Interface to module:
1090944584a44Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
1091044584a44Smrg# --enable-docs: 'yes' user instructs the module to generate docs
1091144584a44Smrg#		 'no' user instructs the module not to generate docs
1091244584a44Smrg# parm1:	specify the default value, yes or no.
1091344584a44Smrg#
1091444584a44SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
1091544584a44Smrgm4_define([docs_default], m4_default([$1], [yes]))
1091644584a44SmrgAC_ARG_ENABLE(docs,
1091744584a44Smrg	AS_HELP_STRING([--enable-docs],
1091844584a44Smrg	   [Enable building the documentation (default: ]docs_default[)]),
1091944584a44Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
1092044584a44Smrgm4_undefine([docs_default])
1092144584a44SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
1092244584a44SmrgAC_MSG_CHECKING([whether to build documentation])
1092344584a44SmrgAC_MSG_RESULT([$build_docs])
1092444584a44Smrg]) # XORG_ENABLE_DOCS
10925dc9477beSmrg
1092644584a44Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
1092744584a44Smrg# ----------------
1092844584a44Smrg# Minimum version: 1.6.0
1092944584a44Smrg#
1093044584a44Smrg# This macro enables a builder to skip all developer documentation.
1093144584a44Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1093244584a44Smrg# maximum flexibilty in controlling documentation building.
1093344584a44Smrg# Refer to:
1093444584a44Smrg# XORG_WITH_XMLTO         --with-xmlto
1093544584a44Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1093644584a44Smrg# XORG_WITH_DOXYGEN       --with-doxygen
1093744584a44Smrg# XORG_WITH_FOP           --with-fop
1093844584a44Smrg# XORG_WITH_GROFF         --with-groff
1093944584a44Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
1094044584a44Smrg#
1094144584a44Smrg# Interface to module:
1094244584a44Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
1094344584a44Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
1094444584a44Smrg#			'no' user instructs the module not to generate developer docs
1094544584a44Smrg# parm1:		specify the default value, yes or no.
1094644584a44Smrg#
1094744584a44SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
1094844584a44Smrgm4_define([devel_default], m4_default([$1], [yes]))
1094944584a44SmrgAC_ARG_ENABLE(devel-docs,
1095044584a44Smrg	AS_HELP_STRING([--enable-devel-docs],
1095144584a44Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
1095244584a44Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
1095344584a44Smrgm4_undefine([devel_default])
1095444584a44SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
1095544584a44SmrgAC_MSG_CHECKING([whether to build developer documentation])
1095644584a44SmrgAC_MSG_RESULT([$build_devel_docs])
1095744584a44Smrg]) # XORG_ENABLE_DEVEL_DOCS
10958dc9477beSmrg
1095944584a44Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
1096044584a44Smrg# ----------------
1096144584a44Smrg# Minimum version: 1.6.0
1096244584a44Smrg#
1096344584a44Smrg# This macro enables a builder to skip all functional specification targets.
1096444584a44Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1096544584a44Smrg# maximum flexibilty in controlling documentation building.
1096644584a44Smrg# Refer to:
1096744584a44Smrg# XORG_WITH_XMLTO         --with-xmlto
1096844584a44Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1096944584a44Smrg# XORG_WITH_DOXYGEN       --with-doxygen
1097044584a44Smrg# XORG_WITH_FOP           --with-fop
1097144584a44Smrg# XORG_WITH_GROFF         --with-groff
1097244584a44Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
1097344584a44Smrg#
1097444584a44Smrg# Interface to module:
1097544584a44Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
1097644584a44Smrg# --enable-specs:	'yes' user instructs the module to generate specs
1097744584a44Smrg#			'no' user instructs the module not to generate specs
1097844584a44Smrg# parm1:		specify the default value, yes or no.
1097944584a44Smrg#
1098044584a44SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
1098144584a44Smrgm4_define([spec_default], m4_default([$1], [yes]))
1098244584a44SmrgAC_ARG_ENABLE(specs,
1098344584a44Smrg	AS_HELP_STRING([--enable-specs],
1098444584a44Smrg	   [Enable building the specs (default: ]spec_default[)]),
1098544584a44Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
1098644584a44Smrgm4_undefine([spec_default])
1098744584a44SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
1098844584a44SmrgAC_MSG_CHECKING([whether to build functional specifications])
1098944584a44SmrgAC_MSG_RESULT([$build_specs])
1099044584a44Smrg]) # XORG_ENABLE_SPECS
10991dc9477beSmrg
1099244584a44Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
1099344584a44Smrg# ----------------------------------------------
1099444584a44Smrg# Minimum version: 1.13.0
1099544584a44Smrg#
1099644584a44Smrg# This macro enables a builder to enable/disable unit testing
1099744584a44Smrg# It makes no assumption about the test cases implementation
1099844584a44Smrg# Test cases may or may not use Automake "Support for test suites"
1099944584a44Smrg# They may or may not use the software utility library GLib
1100044584a44Smrg#
1100144584a44Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
1100244584a44Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
1100344584a44Smrg# The variable enable_unit_tests is used by other macros in this file.
1100444584a44Smrg#
1100544584a44Smrg# Interface to module:
1100644584a44Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
1100744584a44Smrg# enable_unit_tests:    used in configure.ac for additional configuration
1100844584a44Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
1100944584a44Smrg#			'no' user instructs the module not to build tests
1101044584a44Smrg# parm1:		specify the default value, yes or no.
1101106c34b88Smrg#
1101244584a44SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
1101344584a44SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
1101444584a44SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
1101544584a44SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
1101644584a44Smrgm4_define([_defopt], m4_default([$1], [auto]))
1101744584a44SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
1101844584a44Smrg	[Enable building unit test cases (default: ]_defopt[)]),
1101944584a44Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
1102044584a44Smrgm4_undefine([_defopt])
1102144584a44SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
1102244584a44SmrgAC_MSG_CHECKING([whether to build unit test cases])
1102344584a44SmrgAC_MSG_RESULT([$enable_unit_tests])
1102444584a44Smrg]) # XORG_ENABLE_UNIT_TESTS
11025b789ec8aSmrg
1102644584a44Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
1102744584a44Smrg# ------------------------------------------------------
1102844584a44Smrg# Minimum version: 1.17.0
1102944584a44Smrg#
1103044584a44Smrg# This macro enables a builder to enable/disable integration testing
1103144584a44Smrg# It makes no assumption about the test cases' implementation
1103244584a44Smrg# Test cases may or may not use Automake "Support for test suites"
1103344584a44Smrg#
1103444584a44Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
1103544584a44Smrg# usually requires less dependencies and may be built and run under less
1103644584a44Smrg# stringent environments than integration tests.
1103744584a44Smrg#
1103844584a44Smrg# Interface to module:
1103944584a44Smrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
1104044584a44Smrg# enable_integration_tests:   used in configure.ac for additional configuration
1104144584a44Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests
1104244584a44Smrg#                             'no' user instructs the module not to build tests
1104344584a44Smrg# parm1:                      specify the default value, yes or no.
1104444584a44Smrg#
1104544584a44SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
1104644584a44SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
1104744584a44Smrgm4_define([_defopt], m4_default([$1], [auto]))
1104844584a44SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
1104944584a44Smrg	[Enable building integration test cases (default: ]_defopt[)]),
1105044584a44Smrg	[enable_integration_tests=$enableval],
1105144584a44Smrg	[enable_integration_tests=]_defopt)
1105244584a44Smrgm4_undefine([_defopt])
1105344584a44SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
1105444584a44Smrg	[test "x$enable_integration_tests" != xno])
1105544584a44SmrgAC_MSG_CHECKING([whether to build unit test cases])
1105644584a44SmrgAC_MSG_RESULT([$enable_integration_tests])
1105744584a44Smrg]) # XORG_ENABLE_INTEGRATION_TESTS
11058b789ec8aSmrg
1105944584a44Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
1106044584a44Smrg# ----------------------------------------
1106144584a44Smrg# Minimum version: 1.13.0
11062dc9477beSmrg#
1106344584a44Smrg# GLib is a library which provides advanced data structures and functions.
1106444584a44Smrg# This macro enables a module to test for the presence of Glib.
1106544584a44Smrg#
1106644584a44Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
1106744584a44Smrg# Otherwise the value of $enable_unit_tests is blank.
1106844584a44Smrg#
1106944584a44Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
1107044584a44Smrg# test support usually requires less dependencies and may be built and run under
1107144584a44Smrg# less stringent environments than integration tests.
1107244584a44Smrg#
1107344584a44Smrg# Interface to module:
1107444584a44Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
1107544584a44Smrg# with_glib: used in configure.ac to know if GLib has been found
1107644584a44Smrg# --with-glib:	'yes' user instructs the module to use glib
1107744584a44Smrg#		'no' user instructs the module not to use glib
1107844584a44Smrg#
1107944584a44SmrgAC_DEFUN([XORG_WITH_GLIB],[
1108044584a44SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
1108144584a44Smrgm4_define([_defopt], m4_default([$2], [auto]))
1108244584a44SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
1108344584a44Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
1108444584a44Smrg	[with_glib=$withval], [with_glib=]_defopt)
1108544584a44Smrgm4_undefine([_defopt])
11086b789ec8aSmrg
1108744584a44Smrghave_glib=no
1108844584a44Smrg# Do not probe GLib if user explicitly disabled unit testing
1108944584a44Smrgif test "x$enable_unit_tests" != x"no"; then
1109044584a44Smrg  # Do not probe GLib if user explicitly disabled it
1109144584a44Smrg  if test "x$with_glib" != x"no"; then
1109244584a44Smrg    m4_ifval(
1109344584a44Smrg      [$1],
1109444584a44Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
1109544584a44Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
1109644584a44Smrg    )
1109744584a44Smrg  fi
1109844584a44Smrgfi
11099b789ec8aSmrg
1110044584a44Smrg# Not having GLib when unit testing has been explicitly requested is an error
1110144584a44Smrgif test "x$enable_unit_tests" = x"yes"; then
1110244584a44Smrg  if test "x$have_glib" = x"no"; then
1110344584a44Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1110406c34b88Smrg  fi
1110506c34b88Smrgfi
11106b789ec8aSmrg
1110744584a44Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
1110844584a44Smrgif test "x$enable_unit_tests" = x"no"; then
1110944584a44Smrg  if test "x$with_glib" = x"yes"; then
1111044584a44Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1111106c34b88Smrg  fi
1111206c34b88Smrgfi
11113b789ec8aSmrg
1111444584a44Smrg# Not having GLib when it has been explicitly requested is an error
1111544584a44Smrgif test "x$with_glib" = x"yes"; then
1111644584a44Smrg  if test "x$have_glib" = x"no"; then
1111744584a44Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
1111844584a44Smrg  fi
1111944584a44Smrgfi
11120b789ec8aSmrg
1112144584a44SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
1112244584a44Smrg]) # XORG_WITH_GLIB
1112344584a44Smrg
1112444584a44Smrg# XORG_LD_WRAP([required|optional])
1112544584a44Smrg# ---------------------------------
1112644584a44Smrg# Minimum version: 1.13.0
1112744584a44Smrg#
1112844584a44Smrg# Check if linker supports -wrap, passed via compiler flags
1112944584a44Smrg#
1113044584a44Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
1113144584a44Smrg# Otherwise the value of $enable_unit_tests is blank.
1113244584a44Smrg#
1113344584a44Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior
1113444584a44Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
1113544584a44Smrg# available, an argument of "optional" allows use when some unit tests require
1113644584a44Smrg# ld -wrap and others do not.
1113744584a44Smrg#
1113844584a44SmrgAC_DEFUN([XORG_LD_WRAP],[
1113944584a44SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
1114044584a44Smrg    [AC_LANG_PROGRAM([#include <stdlib.h>
1114144584a44Smrg                      void __wrap_exit(int status) { return; }],
1114244584a44Smrg                     [exit(0);])])
1114344584a44Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
1114444584a44Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
1114544584a44Smrg  if test "x$have_ld_wrap" = x"no"; then
1114644584a44Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
1114744584a44Smrg  fi
1114844584a44Smrgfi
1114944584a44SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
1115044584a44Smrg#
1115144584a44Smrg]) # XORG_LD_WRAP
1115244584a44Smrg
1115344584a44Smrg# XORG_CHECK_LINKER_FLAGS
1115444584a44Smrg# -----------------------
1115544584a44Smrg# SYNOPSIS
1115644584a44Smrg#
1115744584a44Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
1115844584a44Smrg#
1115944584a44Smrg# DESCRIPTION
1116044584a44Smrg#
1116144584a44Smrg#   Check whether the given linker FLAGS work with the current language's
1116244584a44Smrg#   linker, or whether they give an error.
1116344584a44Smrg#
1116444584a44Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
1116544584a44Smrg#   success/failure.
1116644584a44Smrg#
1116744584a44Smrg#   PROGRAM-SOURCE is the program source to link with, if needed
1116844584a44Smrg#
1116944584a44Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
1117044584a44Smrg#
1117144584a44Smrg# LICENSE
1117244584a44Smrg#
1117344584a44Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
1117444584a44Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
1117544584a44Smrg#   Copyright (c) 2009 Matteo Frigo
1117644584a44Smrg#
1117744584a44Smrg#   This program is free software: you can redistribute it and/or modify it
1117844584a44Smrg#   under the terms of the GNU General Public License as published by the
1117944584a44Smrg#   Free Software Foundation, either version 3 of the License, or (at your
1118044584a44Smrg#   option) any later version.
1118144584a44Smrg#
1118244584a44Smrg#   This program is distributed in the hope that it will be useful, but
1118344584a44Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
1118444584a44Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
1118544584a44Smrg#   Public License for more details.
1118644584a44Smrg#
1118744584a44Smrg#   You should have received a copy of the GNU General Public License along
1118844584a44Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
1118944584a44Smrg#
1119044584a44Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
1119144584a44Smrg#   gives unlimited permission to copy, distribute and modify the configure
1119244584a44Smrg#   scripts that are the output of Autoconf when processing the Macro. You
1119344584a44Smrg#   need not follow the terms of the GNU General Public License when using
1119444584a44Smrg#   or distributing such scripts, even though portions of the text of the
1119544584a44Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
1119644584a44Smrg#   all other use of the material that constitutes the Autoconf Macro.
1119744584a44Smrg#
1119844584a44Smrg#   This special exception to the GPL applies to versions of the Autoconf
1119944584a44Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
1120044584a44Smrg#   modified version of the Autoconf Macro, you may extend this special
1120144584a44Smrg#   exception to the GPL to apply to your modified version as well.#
1120244584a44SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
1120344584a44Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
1120444584a44Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
1120544584a44SmrgAS_LITERAL_IF([$1],
1120644584a44Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
1120744584a44Smrg      ax_save_FLAGS=$LDFLAGS
1120844584a44Smrg      LDFLAGS="$1"
1120944584a44Smrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
1121044584a44Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1121144584a44Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1121244584a44Smrg      LDFLAGS=$ax_save_FLAGS])],
1121344584a44Smrg  [ax_save_FLAGS=$LDFLAGS
1121444584a44Smrg   LDFLAGS="$1"
1121544584a44Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
1121644584a44Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1121744584a44Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1121844584a44Smrg   LDFLAGS=$ax_save_FLAGS])
1121944584a44Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
1122044584a44SmrgAC_MSG_RESULT($xorg_check_linker_flags)
1122144584a44Smrgif test "x$xorg_check_linker_flags" = xyes; then
1122244584a44Smrg	m4_default([$2], :)
1122344584a44Smrgelse
1122444584a44Smrg	m4_default([$3], :)
1122544584a44Smrgfi
1122644584a44Smrg]) # XORG_CHECK_LINKER_FLAGS
11227b789ec8aSmrg
1122844584a44Smrg# XORG_MEMORY_CHECK_FLAGS
1122944584a44Smrg# -----------------------
1123044584a44Smrg# Minimum version: 1.16.0
1123144584a44Smrg#
1123244584a44Smrg# This macro attempts to find appropriate memory checking functionality
1123344584a44Smrg# for various platforms which unit testing code may use to catch various
1123444584a44Smrg# forms of memory allocation and access errors in testing.
1123544584a44Smrg#
1123644584a44Smrg# Interface to module:
1123744584a44Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
1123844584a44Smrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
1123944584a44Smrg#
1124044584a44Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
1124144584a44Smrg#
1124244584a44SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
11243b789ec8aSmrg
1124444584a44SmrgAC_REQUIRE([AC_CANONICAL_HOST])
1124544584a44SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
1124644584a44Smrg           [Environment variables to enable memory checking in tests])
1124789069ce9Smrg
1124844584a44Smrg# Check for different types of support on different platforms
1124944584a44Smrgcase $host_os in
1125044584a44Smrg    solaris*)
1125144584a44Smrg        AC_CHECK_LIB([umem], [umem_alloc],
1125244584a44Smrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
1125344584a44Smrg        ;;
1125444584a44Smrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
1125544584a44Smrg        # both directly and inverted, so should not be 0 or 255.
1125644584a44Smrg        malloc_debug_env='MALLOC_PERTURB_=15'
1125744584a44Smrg        ;;
1125844584a44Smrg    darwin*)
1125944584a44Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
1126044584a44Smrg        ;;
1126144584a44Smrg    *bsd*)
1126244584a44Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
1126344584a44Smrg        ;;
1126444584a44Smrgesac
11265b789ec8aSmrg
1126644584a44Smrg# User supplied flags override default flags
1126744584a44Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
1126844584a44Smrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
1126944584a44Smrgfi
11270b789ec8aSmrg
1127144584a44SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
1127244584a44Smrg]) # XORG_WITH_LINT
11273dc9477beSmrg
1127444584a44Smrg# XORG_CHECK_MALLOC_ZERO
1127544584a44Smrg# ----------------------
1127644584a44Smrg# Minimum version: 1.0.0
1127789069ce9Smrg#
1127844584a44Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1127944584a44Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1128044584a44Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1128144584a44SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1128244584a44SmrgAC_ARG_ENABLE(malloc0returnsnull,
1128344584a44Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1128444584a44Smrg		       [malloc(0) returns NULL (default: auto)]),
1128544584a44Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1128644584a44Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
11287b789ec8aSmrg
1128844584a44SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1128944584a44Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1129044584a44SmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
1129144584a44Smrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
1129244584a44Smrg#include <stdlib.h>
1129344584a44Smrg],[
1129444584a44Smrg    char *m0, *r0, *c0, *p;
1129544584a44Smrg    m0 = malloc(0);
1129644584a44Smrg    p = malloc(10);
1129744584a44Smrg    r0 = realloc(p,0);
1129844584a44Smrg    c0 = calloc(0,10);
1129944584a44Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
1130044584a44Smrg])],
1130144584a44Smrg		[xorg_cv_malloc0_returns_null=yes],
1130244584a44Smrg		[xorg_cv_malloc0_returns_null=no])])
1130344584a44SmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
1130406c34b88Smrgfi
1130544584a44SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
11306dc9477beSmrg
1130744584a44Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1130844584a44Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1130944584a44Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1131044584a44Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1131106c34b88Smrgelse
1131244584a44Smrg	MALLOC_ZERO_CFLAGS=""
1131344584a44Smrg	XMALLOC_ZERO_CFLAGS=""
1131444584a44Smrg	XTMALLOC_ZERO_CFLAGS=""
1131589069ce9Smrgfi
1131637eb1ca1Smrg
1131744584a44SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1131844584a44SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1131944584a44SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1132044584a44Smrg]) # XORG_CHECK_MALLOC_ZERO
1132106c34b88Smrg
1132244584a44Smrg# XORG_WITH_LINT()
1132344584a44Smrg# ----------------
1132444584a44Smrg# Minimum version: 1.1.0
1132506c34b88Smrg#
1132644584a44Smrg# This macro enables the use of a tool that flags some suspicious and
1132744584a44Smrg# non-portable constructs (likely to be bugs) in C language source code.
1132844584a44Smrg# It will attempt to locate the tool and use appropriate options.
1132944584a44Smrg# There are various lint type tools on different platforms.
1133044584a44Smrg#
1133144584a44Smrg# Interface to module:
1133244584a44Smrg# LINT:		returns the path to the tool found on the platform
1133344584a44Smrg#		or the value set to LINT on the configure cmd line
1133444584a44Smrg#		also an Automake conditional
1133544584a44Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
11336dc9477beSmrg#
1133744584a44Smrg# --with-lint:	'yes' user instructs the module to use lint
1133844584a44Smrg#		'no' user instructs the module not to use lint (default)
1133944584a44Smrg#
1134044584a44Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1134144584a44Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
1134244584a44Smrg#
1134344584a44SmrgAC_DEFUN([XORG_WITH_LINT],[
1134406c34b88Smrg
1134544584a44SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
1134644584a44SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1134744584a44SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1134844584a44Smrg		[Use a lint-style source code checker (default: disabled)])],
1134944584a44Smrg		[use_lint=$withval], [use_lint=no])
11350b789ec8aSmrg
1135144584a44Smrg# Obtain platform specific info like program name and options
1135244584a44Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
1135344584a44Smrgcase $host_os in
1135444584a44Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
1135544584a44Smrg	lint_name=splint
1135644584a44Smrg	lint_options="-badflag"
1135744584a44Smrg	;;
1135844584a44Smrg  *freebsd* | *netbsd*)
1135944584a44Smrg	lint_name=lint
1136044584a44Smrg	lint_options="-u -b"
1136144584a44Smrg	;;
1136244584a44Smrg  *solaris*)
1136344584a44Smrg	lint_name=lint
1136444584a44Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1136544584a44Smrg	;;
1136644584a44Smrgesac
1136744584a44Smrg
1136844584a44Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
1136944584a44Smrgif test "x$use_lint" = x"yes" ; then
1137044584a44Smrg   AC_PATH_PROG([LINT], [$lint_name])
1137144584a44Smrg   if test "x$LINT" = "x"; then
1137244584a44Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
1137344584a44Smrg   fi
1137444584a44Smrgelif test "x$use_lint" = x"no" ; then
1137544584a44Smrg   if test "x$LINT" != "x"; then
1137644584a44Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
1137744584a44Smrg   fi
11378dc9477beSmrgelse
1137944584a44Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
11380dc9477beSmrgfi
11381dc9477beSmrg
1138244584a44Smrg# User supplied flags override default flags
1138344584a44Smrgif test "x$LINT_FLAGS" != "x"; then
1138444584a44Smrg   lint_options=$LINT_FLAGS
1138544584a44Smrgfi
11386dc9477beSmrg
1138744584a44SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
1138844584a44SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
11389b789ec8aSmrg
1139044584a44Smrg]) # XORG_WITH_LINT
11391b789ec8aSmrg
1139244584a44Smrg# XORG_LINT_LIBRARY(LIBNAME)
1139344584a44Smrg# --------------------------
1139444584a44Smrg# Minimum version: 1.1.0
1139544584a44Smrg#
1139644584a44Smrg# Sets up flags for building lint libraries for checking programs that call
1139744584a44Smrg# functions in the library.
1139844584a44Smrg#
1139944584a44Smrg# Interface to module:
1140044584a44Smrg# LINTLIB		- Automake variable with the name of lint library file to make
1140144584a44Smrg# MAKE_LINT_LIB		- Automake conditional
1140244584a44Smrg#
1140344584a44Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
1140444584a44Smrg#			  - 'no' user instructs the module not to create a lint library (default)
1140537eb1ca1Smrg
1140644584a44SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
1140744584a44SmrgAC_REQUIRE([XORG_WITH_LINT])
1140844584a44SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1140944584a44Smrg	[Create lint library (default: disabled)])],
1141044584a44Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
1141106c34b88Smrg
1141244584a44Smrgif test "x$make_lint_lib" = x"yes" ; then
1141344584a44Smrg   LINTLIB=llib-l$1.ln
1141444584a44Smrg   if test "x$LINT" = "x"; then
1141544584a44Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
1141644584a44Smrg   fi
1141744584a44Smrgelif test "x$make_lint_lib" != x"no" ; then
1141844584a44Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
1141944584a44Smrgfi
11420b789ec8aSmrg
1142144584a44SmrgAC_SUBST(LINTLIB)
1142244584a44SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1142344584a44Smrg
1142444584a44Smrg]) # XORG_LINT_LIBRARY
1142506c34b88Smrg
1142644584a44Smrg# XORG_COMPILER_BRAND
1142744584a44Smrg# -------------------
1142844584a44Smrg# Minimum version: 1.14.0
1142906c34b88Smrg#
1143044584a44Smrg# Checks for various brands of compilers and sets flags as appropriate:
1143144584a44Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
1143244584a44Smrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
1143344584a44Smrg#   clang compiler - sets CLANGCC to "yes"
1143444584a44Smrg#   Intel compiler - sets INTELCC to "yes"
1143544584a44Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
1143644584a44Smrg#
1143744584a44SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
1143844584a44SmrgAC_LANG_CASE(
1143944584a44Smrg	[C], [
1144044584a44Smrg		AC_REQUIRE([AC_PROG_CC_C99])
1144144584a44Smrg	],
1144244584a44Smrg	[C++], [
1144344584a44Smrg		AC_REQUIRE([AC_PROG_CXX])
1144444584a44Smrg	]
1144544584a44Smrg)
1144644584a44SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
1144744584a44SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1144844584a44SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1144944584a44Smrg]) # XORG_COMPILER_BRAND
11450b789ec8aSmrg
1145144584a44Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
11452dc9477beSmrg# ---------------
1145344584a44Smrg# Minimum version: 1.16.0
1145444584a44Smrg#
1145544584a44Smrg# Test if the compiler works when passed the given flag as a command line argument.
1145644584a44Smrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
1145744584a44Smrg# next flag in the list until there are no more options.
1145844584a44Smrg#
1145944584a44Smrg# Note that this does not guarantee that the compiler supports the flag as some
1146044584a44Smrg# compilers will simply ignore arguments that they do not understand, but we do
1146144584a44Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
1146244584a44Smrg# -Werror=unused-command-line-argument
1146344584a44Smrg#
1146444584a44SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
1146544584a44Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
1146644584a44Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11467b789ec8aSmrg
1146844584a44SmrgAC_LANG_COMPILER_REQUIRE
11469b789ec8aSmrg
1147044584a44SmrgAC_LANG_CASE(
1147144584a44Smrg	[C], [
1147244584a44Smrg		AC_REQUIRE([AC_PROG_CC_C99])
1147344584a44Smrg		define([PREFIX], [C])
1147444584a44Smrg		define([CACHE_PREFIX], [cc])
1147544584a44Smrg		define([COMPILER], [$CC])
1147644584a44Smrg	],
1147744584a44Smrg	[C++], [
1147844584a44Smrg		define([PREFIX], [CXX])
1147944584a44Smrg		define([CACHE_PREFIX], [cxx])
1148044584a44Smrg		define([COMPILER], [$CXX])
1148144584a44Smrg	]
1148244584a44Smrg)
1148344584a44Smrg
1148444584a44Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
1148544584a44Smrg
1148644584a44Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
1148744584a44Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1148844584a44Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
1148944584a44Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
1149044584a44Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1149144584a44Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
1149244584a44Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
1149344584a44Smrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
1149444584a44Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1149589069ce9Smrgfi
1149644584a44Smrg
1149744584a44Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
1149844584a44Smrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
1149944584a44Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1150044584a44Smrg	fi
1150144584a44Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1150244584a44Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
1150344584a44Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
1150444584a44Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1150544584a44Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
1150644584a44Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
1150744584a44Smrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
1150844584a44Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1150944584a44Smrgfi
1151044584a44Smrg
1151144584a44Smrgfound="no"
1151244584a44Smrgm4_foreach([flag], m4_cdr($@), [
1151344584a44Smrg	if test $found = "no" ; then
1151444584a44Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
1151544584a44Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1151644584a44Smrg		fi
1151744584a44Smrg
1151844584a44Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
1151944584a44Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1152044584a44Smrg		fi
1152144584a44Smrg
1152244584a44Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
1152344584a44Smrg
1152444584a44Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
1152544584a44Smrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
1152644584a44Smrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
1152744584a44Smrg		AC_CACHE_VAL($cacheid,
1152844584a44Smrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
1152944584a44Smrg					     [eval $cacheid=yes],
1153044584a44Smrg					     [eval $cacheid=no])])
1153144584a44Smrg
1153244584a44Smrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1153344584a44Smrg
1153444584a44Smrg		eval supported=\$$cacheid
1153544584a44Smrg		AC_MSG_RESULT([$supported])
1153644584a44Smrg		if test "$supported" = "yes" ; then
1153744584a44Smrg			$1="$$1 ]flag["
1153844584a44Smrg			found="yes"
1153944584a44Smrg		fi
1154044584a44Smrg	fi
1154106c34b88Smrg])
1154244584a44Smrg]) # XORG_TESTSET_CFLAG
115433e256790Smrg
1154444584a44Smrg# XORG_COMPILER_FLAGS
1154544584a44Smrg# ---------------
1154644584a44Smrg# Minimum version: 1.16.0
1154706c34b88Smrg#
1154844584a44Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
1154944584a44Smrg# arguments supported by the selected compiler which do NOT alter the generated
1155044584a44Smrg# code.  These arguments will cause the compiler to print various warnings
1155144584a44Smrg# during compilation AND turn a conservative set of warnings into errors.
1155244584a44Smrg#
1155344584a44Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
1155444584a44Smrg# future versions of util-macros as options are added to new compilers.
1155544584a44Smrg#
1155644584a44SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
1155744584a44SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
11558f1ee322dSmrg
1155944584a44SmrgAC_ARG_ENABLE(selective-werror,
1156044584a44Smrg              AS_HELP_STRING([--disable-selective-werror],
1156144584a44Smrg                             [Turn off selective compiler errors. (default: enabled)]),
1156244584a44Smrg              [SELECTIVE_WERROR=$enableval],
1156344584a44Smrg              [SELECTIVE_WERROR=yes])
1156444584a44Smrg
1156544584a44SmrgAC_LANG_CASE(
1156644584a44Smrg        [C], [
1156744584a44Smrg                define([PREFIX], [C])
1156844584a44Smrg        ],
1156944584a44Smrg        [C++], [
1157044584a44Smrg                define([PREFIX], [CXX])
1157144584a44Smrg        ]
1157244584a44Smrg)
1157344584a44Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
1157444584a44Smrgif test "x$SUNCC" = "xyes"; then
1157544584a44Smrg    [BASE_]PREFIX[FLAGS]="-v"
11576dc9477beSmrgelse
1157744584a44Smrg    [BASE_]PREFIX[FLAGS]=""
11578f1ee322dSmrgfi
11579c43cc173Smrg
1158044584a44Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
1158144584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
1158244584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
1158344584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
1158444584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
1158506c34b88Smrg
1158644584a44SmrgAC_LANG_CASE(
1158744584a44Smrg	[C], [
1158844584a44Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
1158944584a44Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
1159044584a44Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
1159144584a44Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
1159244584a44Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
1159344584a44Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
1159444584a44Smrg	]
1159544584a44Smrg)
11596c43cc173Smrg
1159744584a44Smrg# This chunk adds additional warnings that could catch undesired effects.
1159844584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
1159944584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
1160044584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
1160144584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
1160244584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
1160344584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
1160444584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
11605dc9477beSmrg
1160644584a44Smrg# These are currently disabled because they are noisy.  They will be enabled
1160744584a44Smrg# in the future once the codebase is sufficiently modernized to silence
1160844584a44Smrg# them.  For now, I don't want them to drown out the other warnings.
1160944584a44Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
1161044584a44Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
1161144584a44Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
11612dc9477beSmrg
1161344584a44Smrg# Turn some warnings into errors, so we don't accidently get successful builds
1161444584a44Smrg# when there are problems that should be fixed.
1161537eb1ca1Smrg
1161644584a44Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
1161744584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
1161844584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
1161944584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
1162044584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
1162144584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
1162244584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
1162344584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
1162444584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
1162544584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
1162644584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
1162744584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
1162844584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
1162944584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
1163044584a44Smrgelse
1163144584a44SmrgAC_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])
1163244584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
1163344584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
1163444584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
1163544584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
1163644584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
1163744584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
1163844584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
1163944584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
1164044584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
1164144584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
1164244584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
1164344584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
1164444584a44SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
1164544584a44Smrgfi
11646dc9477beSmrg
1164744584a44SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
1164844584a44Smrg]) # XORG_COMPILER_FLAGS
11649dc9477beSmrg
1165044584a44Smrg# XORG_CWARNFLAGS
1165144584a44Smrg# ---------------
1165244584a44Smrg# Minimum version: 1.2.0
1165344584a44Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
11654dc9477beSmrg#
1165544584a44Smrg# Defines CWARNFLAGS to enable C compiler warnings.
11656dc9477beSmrg#
1165744584a44Smrg# This function is deprecated because it defines -fno-strict-aliasing
1165844584a44Smrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
1165944584a44Smrg# is needed, then it should be added explicitly in the module when
1166044584a44Smrg# it is updated to use BASE_CFLAGS.
1166144584a44Smrg#
1166244584a44SmrgAC_DEFUN([XORG_CWARNFLAGS], [
1166344584a44SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
1166444584a44SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
1166544584a44SmrgAC_LANG_CASE(
1166644584a44Smrg	[C], [
1166744584a44Smrg		CWARNFLAGS="$BASE_CFLAGS"
1166844584a44Smrg		if  test "x$GCC" = xyes ; then
1166944584a44Smrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
1167044584a44Smrg		fi
1167144584a44Smrg		AC_SUBST(CWARNFLAGS)
1167244584a44Smrg	]
1167344584a44Smrg)
1167444584a44Smrg]) # XORG_CWARNFLAGS
11675c27c18e8Smrg
1167644584a44Smrg# XORG_STRICT_OPTION
1167744584a44Smrg# -----------------------
1167844584a44Smrg# Minimum version: 1.3.0
1167944584a44Smrg#
1168044584a44Smrg# Add configure option to enable strict compilation flags, such as treating
1168144584a44Smrg# warnings as fatal errors.
1168244584a44Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
1168344584a44Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
1168444584a44Smrg#
1168544584a44Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
1168644584a44Smrg# when strict compilation is unconditionally desired.
1168744584a44SmrgAC_DEFUN([XORG_STRICT_OPTION], [
1168844584a44SmrgAC_REQUIRE([XORG_CWARNFLAGS])
1168944584a44SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
11690b789ec8aSmrg
1169144584a44SmrgAC_ARG_ENABLE(strict-compilation,
1169244584a44Smrg			  AS_HELP_STRING([--enable-strict-compilation],
1169344584a44Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
1169444584a44Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
11695b789ec8aSmrg
1169644584a44SmrgAC_LANG_CASE(
1169744584a44Smrg        [C], [
1169844584a44Smrg                define([PREFIX], [C])
1169944584a44Smrg        ],
1170044584a44Smrg        [C++], [
1170144584a44Smrg                define([PREFIX], [CXX])
1170244584a44Smrg        ]
1170344584a44Smrg)
11704c27c18e8Smrg
1170544584a44Smrg[STRICT_]PREFIX[FLAGS]=""
1170644584a44SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
1170744584a44SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
1170889069ce9Smrg
1170944584a44Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
1171044584a44Smrg# activate it with -Werror, so we add it here explicitly.
1171144584a44SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
117123e256790Smrg
1171344584a44Smrgif test "x$STRICT_COMPILE" = "xyes"; then
1171444584a44Smrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
1171544584a44Smrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
1171644584a44Smrgfi
1171744584a44SmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
1171844584a44SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
1171944584a44SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
1172044584a44Smrg]) # XORG_STRICT_OPTION
11721c43cc173Smrg
1172244584a44Smrg# XORG_DEFAULT_OPTIONS
1172344584a44Smrg# --------------------
1172444584a44Smrg# Minimum version: 1.3.0
1172544584a44Smrg#
1172644584a44Smrg# Defines default options for X.Org modules.
1172744584a44Smrg#
1172844584a44SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
1172944584a44SmrgAC_REQUIRE([AC_PROG_INSTALL])
1173044584a44SmrgXORG_COMPILER_FLAGS
1173144584a44SmrgXORG_CWARNFLAGS
1173244584a44SmrgXORG_STRICT_OPTION
1173344584a44SmrgXORG_RELEASE_VERSION
1173444584a44SmrgXORG_CHANGELOG
1173544584a44SmrgXORG_INSTALL
1173644584a44SmrgXORG_MANPAGE_SECTIONS
1173744584a44Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
1173844584a44Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
1173944584a44Smrg]) # XORG_DEFAULT_OPTIONS
1174021e67964Smrg
1174144584a44Smrg# XORG_INSTALL()
1174244584a44Smrg# ----------------
1174344584a44Smrg# Minimum version: 1.4.0
1174444584a44Smrg#
1174544584a44Smrg# Defines the variable INSTALL_CMD as the command to copy
1174644584a44Smrg# INSTALL from $prefix/share/util-macros.
1174744584a44Smrg#
1174844584a44SmrgAC_DEFUN([XORG_INSTALL], [
1174944584a44SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
1175044584a44Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
1175144584a44SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
1175244584a44Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
1175344584a44Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
1175444584a44Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
1175544584a44SmrgAC_SUBST([INSTALL_CMD])
1175644584a44Smrg]) # XORG_INSTALL
1175744584a44Smrgdnl Copyright 2005 Red Hat, Inc
1175844584a44Smrgdnl
1175944584a44Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1176044584a44Smrgdnl documentation for any purpose is hereby granted without fee, provided that
1176144584a44Smrgdnl the above copyright notice appear in all copies and that both that
1176244584a44Smrgdnl copyright notice and this permission notice appear in supporting
1176344584a44Smrgdnl documentation.
1176444584a44Smrgdnl
1176544584a44Smrgdnl The above copyright notice and this permission notice shall be included
1176644584a44Smrgdnl in all copies or substantial portions of the Software.
1176744584a44Smrgdnl
1176844584a44Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1176944584a44Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1177044584a44Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1177144584a44Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1177244584a44Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1177344584a44Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1177444584a44Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
1177544584a44Smrgdnl
1177644584a44Smrgdnl Except as contained in this notice, the name of the copyright holders shall
1177744584a44Smrgdnl not be used in advertising or otherwise to promote the sale, use or
1177844584a44Smrgdnl other dealings in this Software without prior written authorization
1177944584a44Smrgdnl from the copyright holders.
1178044584a44Smrgdnl
11781dc9477beSmrg
1178244584a44Smrg# XORG_RELEASE_VERSION
1178344584a44Smrg# --------------------
1178444584a44Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
11785dc9477beSmrg
1178644584a44SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1178744584a44Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1178844584a44Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1178944584a44Smrg		[Major version of this package])
1179044584a44Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1179144584a44Smrg	if test "x$PVM" = "x"; then
1179244584a44Smrg		PVM="0"
1179344584a44Smrg	fi
1179444584a44Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1179544584a44Smrg		[$PVM],
1179644584a44Smrg		[Minor version of this package])
1179744584a44Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1179844584a44Smrg	if test "x$PVP" = "x"; then
1179944584a44Smrg		PVP="0"
1180044584a44Smrg	fi
1180144584a44Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1180244584a44Smrg		[$PVP],
1180344584a44Smrg		[Patch version of this package])
1180444584a44Smrg])
11805dc9477beSmrg
1180644584a44Smrg# XORG_CHANGELOG()
1180744584a44Smrg# ----------------
1180844584a44Smrg# Minimum version: 1.2.0
1180944584a44Smrg#
1181044584a44Smrg# Defines the variable CHANGELOG_CMD as the command to generate
1181144584a44Smrg# ChangeLog from git.
1181244584a44Smrg#
1181344584a44Smrg#
1181444584a44SmrgAC_DEFUN([XORG_CHANGELOG], [
1181544584a44SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
1181644584a44Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
1181744584a44Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
1181844584a44Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
1181944584a44SmrgAC_SUBST([CHANGELOG_CMD])
1182044584a44Smrg]) # XORG_CHANGELOG
11821c43cc173Smrg
11822