aclocal.m4 revision dc407927
1dc407927Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
23eed67faSmbalmer
33eed67faSmbalmer# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4dc407927Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
53eed67faSmbalmer# This file is free software; the Free Software Foundation
63eed67faSmbalmer# gives unlimited permission to copy and/or distribute it,
73eed67faSmbalmer# with or without modifications, as long as this notice is preserved.
83eed67faSmbalmer
93eed67faSmbalmer# This program is distributed in the hope that it will be useful,
103eed67faSmbalmer# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
113eed67faSmbalmer# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
123eed67faSmbalmer# PARTICULAR PURPOSE.
133eed67faSmbalmer
14dc407927Smrgm4_ifndef([AC_AUTOCONF_VERSION],
15dc407927Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16dc407927Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,
17dc407927Smrg[m4_warning([this file was generated for autoconf 2.65.
18dc407927SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19dc407927SmrgIf you have problems, you may need to regenerate the build system entirely.
20dc407927SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21dc407927Smrg
223eed67faSmbalmer# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
23dc407927Smrg#
24dc407927Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
25dc407927Smrg#                 2006, 2007, 2008 Free Software Foundation, Inc.
26dc407927Smrg#   Written by Gordon Matzigkeit, 1996
27dc407927Smrg#
28dc407927Smrg# This file is free software; the Free Software Foundation gives
29dc407927Smrg# unlimited permission to copy and/or distribute it, with or without
30dc407927Smrg# modifications, as long as this notice is preserved.
31dc407927Smrg
32dc407927Smrgm4_define([_LT_COPYING], [dnl
33dc407927Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
34dc407927Smrg#                 2006, 2007, 2008 Free Software Foundation, Inc.
35dc407927Smrg#   Written by Gordon Matzigkeit, 1996
36dc407927Smrg#
37dc407927Smrg#   This file is part of GNU Libtool.
38dc407927Smrg#
39dc407927Smrg# GNU Libtool is free software; you can redistribute it and/or
40dc407927Smrg# modify it under the terms of the GNU General Public License as
41dc407927Smrg# published by the Free Software Foundation; either version 2 of
42dc407927Smrg# the License, or (at your option) any later version.
43dc407927Smrg#
44dc407927Smrg# As a special exception to the GNU General Public License,
45dc407927Smrg# if you distribute this file as part of a program or library that
46dc407927Smrg# is built using GNU Libtool, you may include this file under the
47dc407927Smrg# same distribution terms that you use for the rest of that program.
48dc407927Smrg#
49dc407927Smrg# GNU Libtool is distributed in the hope that it will be useful,
50dc407927Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
51dc407927Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
52dc407927Smrg# GNU General Public License for more details.
53dc407927Smrg#
54dc407927Smrg# You should have received a copy of the GNU General Public License
55dc407927Smrg# along with GNU Libtool; see the file COPYING.  If not, a copy
56dc407927Smrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
57dc407927Smrg# obtained by writing to the Free Software Foundation, Inc.,
58dc407927Smrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
59dc407927Smrg])
603eed67faSmbalmer
61dc407927Smrg# serial 56 LT_INIT
623eed67faSmbalmer
633eed67faSmbalmer
64dc407927Smrg# LT_PREREQ(VERSION)
65dc407927Smrg# ------------------
66dc407927Smrg# Complain and exit if this libtool version is less that VERSION.
67dc407927Smrgm4_defun([LT_PREREQ],
68dc407927Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
69dc407927Smrg       [m4_default([$3],
70dc407927Smrg		   [m4_fatal([Libtool version $1 or higher is required],
71dc407927Smrg		             63)])],
72dc407927Smrg       [$2])])
733eed67faSmbalmer
743eed67faSmbalmer
75dc407927Smrg# _LT_CHECK_BUILDDIR
76dc407927Smrg# ------------------
77dc407927Smrg# Complain if the absolute build directory name contains unusual characters
78dc407927Smrgm4_defun([_LT_CHECK_BUILDDIR],
79dc407927Smrg[case `pwd` in
80dc407927Smrg  *\ * | *\	*)
81dc407927Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
82dc407927Smrgesac
83dc407927Smrg])
84dc407927Smrg
85dc407927Smrg
86dc407927Smrg# LT_INIT([OPTIONS])
87dc407927Smrg# ------------------
88dc407927SmrgAC_DEFUN([LT_INIT],
89dc407927Smrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
90dc407927SmrgAC_BEFORE([$0], [LT_LANG])dnl
91dc407927SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
92dc407927SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
93dc407927Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
94dc407927Smrg
95dc407927Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
96dc407927Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
97dc407927Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
98dc407927Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
99dc407927Smrgdnl unless we require an AC_DEFUNed macro:
100dc407927SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
101dc407927SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
102dc407927SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
103dc407927SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
104dc407927Smrgm4_require([_LT_PROG_LTMAIN])dnl
105dc407927Smrg
106dc407927Smrgdnl Parse OPTIONS
107dc407927Smrg_LT_SET_OPTIONS([$0], [$1])
1083eed67faSmbalmer
1093eed67faSmbalmer# This can be used to rebuild libtool when needed
110dc407927SmrgLIBTOOL_DEPS="$ltmain"
1113eed67faSmbalmer
1123eed67faSmbalmer# Always use our own libtool.
1133eed67faSmbalmerLIBTOOL='$(SHELL) $(top_builddir)/libtool'
1143eed67faSmbalmerAC_SUBST(LIBTOOL)dnl
1153eed67faSmbalmer
116dc407927Smrg_LT_SETUP
1173eed67faSmbalmer
118dc407927Smrg# Only expand once:
119dc407927Smrgm4_define([LT_INIT])
120dc407927Smrg])# LT_INIT
1213eed67faSmbalmer
122dc407927Smrg# Old names:
123dc407927SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
124dc407927SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
125dc407927Smrgdnl aclocal-1.4 backwards compatibility:
126dc407927Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
127dc407927Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
128dc407927Smrg
129dc407927Smrg
130dc407927Smrg# _LT_CC_BASENAME(CC)
131dc407927Smrg# -------------------
132dc407927Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
133dc407927Smrgm4_defun([_LT_CC_BASENAME],
134dc407927Smrg[for cc_temp in $1""; do
135dc407927Smrg  case $cc_temp in
136dc407927Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
137dc407927Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
138dc407927Smrg    \-*) ;;
139dc407927Smrg    *) break;;
140dc407927Smrg  esac
141dc407927Smrgdone
142dc407927Smrgcc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
143dc407927Smrg])
144dc407927Smrg
145dc407927Smrg
146dc407927Smrg# _LT_FILEUTILS_DEFAULTS
147dc407927Smrg# ----------------------
148dc407927Smrg# It is okay to use these file commands and assume they have been set
149dc407927Smrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
150dc407927Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
151dc407927Smrg[: ${CP="cp -f"}
152dc407927Smrg: ${MV="mv -f"}
153dc407927Smrg: ${RM="rm -f"}
154dc407927Smrg])# _LT_FILEUTILS_DEFAULTS
155dc407927Smrg
156dc407927Smrg
157dc407927Smrg# _LT_SETUP
158dc407927Smrg# ---------
159dc407927Smrgm4_defun([_LT_SETUP],
160dc407927Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1613eed67faSmbalmerAC_REQUIRE([AC_CANONICAL_BUILD])dnl
162dc407927Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
163dc407927Smrg_LT_DECL([], [host], [0])dnl
164dc407927Smrg_LT_DECL([], [host_os], [0])dnl
165dc407927Smrgdnl
166dc407927Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
167dc407927Smrg_LT_DECL([], [build], [0])dnl
168dc407927Smrg_LT_DECL([], [build_os], [0])dnl
169dc407927Smrgdnl
1703eed67faSmbalmerAC_REQUIRE([AC_PROG_CC])dnl
171dc407927SmrgAC_REQUIRE([LT_PATH_LD])dnl
172dc407927SmrgAC_REQUIRE([LT_PATH_NM])dnl
173dc407927Smrgdnl
1743eed67faSmbalmerAC_REQUIRE([AC_PROG_LN_S])dnl
175dc407927Smrgtest -z "$LN_S" && LN_S="ln -s"
176dc407927Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
1773eed67faSmbalmerdnl
178dc407927SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
179dc407927Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
180dc407927Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
181dc407927Smrgdnl
182dc407927Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
183dc407927Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
184dc407927Smrgm4_require([_LT_CMD_RELOAD])dnl
185dc407927Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
186dc407927Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
187dc407927Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
188dc407927Smrg
189dc407927Smrg_LT_CONFIG_LIBTOOL_INIT([
190dc407927Smrg# See if we are running on zsh, and set the options which allow our
191dc407927Smrg# commands through without removal of \ escapes INIT.
192dc407927Smrgif test -n "\${ZSH_VERSION+set}" ; then
193dc407927Smrg   setopt NO_GLOB_SUBST
194dc407927Smrgfi
195dc407927Smrg])
196dc407927Smrgif test -n "${ZSH_VERSION+set}" ; then
197dc407927Smrg   setopt NO_GLOB_SUBST
198dc407927Smrgfi
1993eed67faSmbalmer
200dc407927Smrg_LT_CHECK_OBJDIR
201dc407927Smrg
202dc407927Smrgm4_require([_LT_TAG_COMPILER])dnl
203dc407927Smrg_LT_PROG_ECHO_BACKSLASH
2043eed67faSmbalmer
2053eed67faSmbalmercase $host_os in
2063eed67faSmbalmeraix3*)
2073eed67faSmbalmer  # AIX sometimes has problems with the GCC collect2 program.  For some
2083eed67faSmbalmer  # reason, if we set the COLLECT_NAMES environment variable, the problems
2093eed67faSmbalmer  # vanish in a puff of smoke.
2103eed67faSmbalmer  if test "X${COLLECT_NAMES+set}" != Xset; then
2113eed67faSmbalmer    COLLECT_NAMES=
2123eed67faSmbalmer    export COLLECT_NAMES
2133eed67faSmbalmer  fi
2143eed67faSmbalmer  ;;
2153eed67faSmbalmeresac
2163eed67faSmbalmer
2173eed67faSmbalmer# Sed substitution that helps us do robust quoting.  It backslashifies
2183eed67faSmbalmer# metacharacters that are still active within double-quoted strings.
219dc407927Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
2203eed67faSmbalmer
2213eed67faSmbalmer# Same as above, but do not quote variable references.
222dc407927Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
2233eed67faSmbalmer
2243eed67faSmbalmer# Sed substitution to delay expansion of an escaped shell variable in a
2253eed67faSmbalmer# double_quote_subst'ed string.
2263eed67faSmbalmerdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
2273eed67faSmbalmer
228dc407927Smrg# Sed substitution to delay expansion of an escaped single quote.
229dc407927Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
230dc407927Smrg
2313eed67faSmbalmer# Sed substitution to avoid accidental globbing in evaled expressions
2323eed67faSmbalmerno_glob_subst='s/\*/\\\*/g'
2333eed67faSmbalmer
2343eed67faSmbalmer# Global variables:
235dc407927Smrgofile=libtool
2363eed67faSmbalmercan_build_shared=yes
2373eed67faSmbalmer
2383eed67faSmbalmer# All known linkers require a `.a' archive for static linking (except MSVC,
2393eed67faSmbalmer# which needs '.lib').
2403eed67faSmbalmerlibext=a
2413eed67faSmbalmer
242dc407927Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
2433eed67faSmbalmer
2443eed67faSmbalmerold_CC="$CC"
2453eed67faSmbalmerold_CFLAGS="$CFLAGS"
2463eed67faSmbalmer
2473eed67faSmbalmer# Set sane defaults for various variables
2483eed67faSmbalmertest -z "$CC" && CC=cc
2493eed67faSmbalmertest -z "$LTCC" && LTCC=$CC
2503eed67faSmbalmertest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
2513eed67faSmbalmertest -z "$LD" && LD=ld
2523eed67faSmbalmertest -z "$ac_objext" && ac_objext=o
2533eed67faSmbalmer
2543eed67faSmbalmer_LT_CC_BASENAME([$compiler])
2553eed67faSmbalmer
2563eed67faSmbalmer# Only perform the check for file, if the check method requires it
257dc407927Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
2583eed67faSmbalmercase $deplibs_check_method in
2593eed67faSmbalmerfile_magic*)
2603eed67faSmbalmer  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
261dc407927Smrg    _LT_PATH_MAGIC
2623eed67faSmbalmer  fi
2633eed67faSmbalmer  ;;
2643eed67faSmbalmeresac
2653eed67faSmbalmer
266dc407927Smrg# Use C for the default configuration in the libtool script
267dc407927SmrgLT_SUPPORTED_TAG([CC])
268dc407927Smrg_LT_LANG_C_CONFIG
269dc407927Smrg_LT_LANG_DEFAULT_CONFIG
270dc407927Smrg_LT_CONFIG_COMMANDS
271dc407927Smrg])# _LT_SETUP
2723eed67faSmbalmer
2733eed67faSmbalmer
274dc407927Smrg# _LT_PROG_LTMAIN
275dc407927Smrg# ---------------
276dc407927Smrg# Note that this code is called both from `configure', and `config.status'
277dc407927Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
278dc407927Smrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
279dc407927Smrg# so we pass a copy along to make sure it has a sensible value anyway.
280dc407927Smrgm4_defun([_LT_PROG_LTMAIN],
281dc407927Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
282dc407927Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
283dc407927Smrgltmain="$ac_aux_dir/ltmain.sh"
284dc407927Smrg])# _LT_PROG_LTMAIN
2853eed67faSmbalmer
2863eed67faSmbalmer
287dc407927Smrg
288dc407927Smrg# So that we can recreate a full libtool script including additional
289dc407927Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
290dc407927Smrg# in macros and then make a single call at the end using the `libtool'
291dc407927Smrg# label.
292dc407927Smrg
293dc407927Smrg
294dc407927Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
295dc407927Smrg# ----------------------------------------
296dc407927Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
297dc407927Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
298dc407927Smrg[m4_ifval([$1],
299dc407927Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
300dc407927Smrg                     [$1
301dc407927Smrg])])])
302dc407927Smrg
303dc407927Smrg# Initialize.
304dc407927Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
305dc407927Smrg
306dc407927Smrg
307dc407927Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
308dc407927Smrg# ------------------------------
309dc407927Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
310dc407927Smrgm4_define([_LT_CONFIG_LIBTOOL],
311dc407927Smrg[m4_ifval([$1],
312dc407927Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
313dc407927Smrg                     [$1
314dc407927Smrg])])])
315dc407927Smrg
316dc407927Smrg# Initialize.
317dc407927Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
318dc407927Smrg
319dc407927Smrg
320dc407927Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
321dc407927Smrg# -----------------------------------------------------
322dc407927Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
323dc407927Smrg[_LT_CONFIG_LIBTOOL([$1])
324dc407927Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
325dc407927Smrg])
326dc407927Smrg
327dc407927Smrg
328dc407927Smrg# _LT_FORMAT_COMMENT([COMMENT])
329dc407927Smrg# -----------------------------
330dc407927Smrg# Add leading comment marks to the start of each line, and a trailing
331dc407927Smrg# full-stop to the whole comment if one is not present already.
332dc407927Smrgm4_define([_LT_FORMAT_COMMENT],
333dc407927Smrg[m4_ifval([$1], [
334dc407927Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
335dc407927Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
336dc407927Smrg)])
337dc407927Smrg
338dc407927Smrg
339dc407927Smrg
340dc407927Smrg
341dc407927Smrg
342dc407927Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
343dc407927Smrg# -------------------------------------------------------------------
344dc407927Smrg# CONFIGNAME is the name given to the value in the libtool script.
345dc407927Smrg# VARNAME is the (base) name used in the configure script.
346dc407927Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
347dc407927Smrg# VARNAME.  Any other value will be used directly.
348dc407927Smrgm4_define([_LT_DECL],
349dc407927Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
350dc407927Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
351dc407927Smrg	[m4_ifval([$1], [$1], [$2])])
352dc407927Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
353dc407927Smrg    m4_ifval([$4],
354dc407927Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
355dc407927Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
356dc407927Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
357dc407927Smrg])
358dc407927Smrg
359dc407927Smrg
360dc407927Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
361dc407927Smrg# --------------------------------------------------------
362dc407927Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
363dc407927Smrg
364dc407927Smrg
365dc407927Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
366dc407927Smrg# ------------------------------------------------
367dc407927Smrgm4_define([lt_decl_tag_varnames],
368dc407927Smrg[_lt_decl_filter([tagged?], [yes], $@)])
369dc407927Smrg
370dc407927Smrg
371dc407927Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
372dc407927Smrg# ---------------------------------------------------------
373dc407927Smrgm4_define([_lt_decl_filter],
374dc407927Smrg[m4_case([$#],
375dc407927Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
376dc407927Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
377dc407927Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
378dc407927Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
379dc407927Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
380dc407927Smrg])
381dc407927Smrg
382dc407927Smrg
383dc407927Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
384dc407927Smrg# --------------------------------------------------
385dc407927Smrgm4_define([lt_decl_quote_varnames],
386dc407927Smrg[_lt_decl_filter([value], [1], $@)])
387dc407927Smrg
388dc407927Smrg
389dc407927Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
390dc407927Smrg# ---------------------------------------------------
391dc407927Smrgm4_define([lt_decl_dquote_varnames],
392dc407927Smrg[_lt_decl_filter([value], [2], $@)])
393dc407927Smrg
394dc407927Smrg
395dc407927Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
396dc407927Smrg# ---------------------------------------------------
397dc407927Smrgm4_define([lt_decl_varnames_tagged],
398dc407927Smrg[m4_assert([$# <= 2])dnl
399dc407927Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
400dc407927Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
401dc407927Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
402dc407927Smrgm4_define([_lt_decl_varnames_tagged],
403dc407927Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
404dc407927Smrg
405dc407927Smrg
406dc407927Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
407dc407927Smrg# ------------------------------------------------
408dc407927Smrgm4_define([lt_decl_all_varnames],
409dc407927Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
410dc407927Smrg     m4_if([$2], [],
411dc407927Smrg	   m4_quote(lt_decl_varnames),
412dc407927Smrg	m4_quote(m4_shift($@))))[]dnl
413dc407927Smrg])
414dc407927Smrgm4_define([_lt_decl_all_varnames],
415dc407927Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
416dc407927Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
417dc407927Smrg])
418dc407927Smrg
419dc407927Smrg
420dc407927Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
421dc407927Smrg# ------------------------------------
422dc407927Smrg# Quote a variable value, and forward it to `config.status' so that its
423dc407927Smrg# declaration there will have the same value as in `configure'.  VARNAME
424dc407927Smrg# must have a single quote delimited value for this to work.
425dc407927Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
426dc407927Smrg[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
427dc407927Smrg
428dc407927Smrg
429dc407927Smrg# _LT_CONFIG_STATUS_DECLARATIONS
430dc407927Smrg# ------------------------------
431dc407927Smrg# We delimit libtool config variables with single quotes, so when
432dc407927Smrg# we write them to config.status, we have to be sure to quote all
433dc407927Smrg# embedded single quotes properly.  In configure, this macro expands
434dc407927Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
435dc407927Smrg#
436dc407927Smrg#    <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
437dc407927Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
438dc407927Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
439dc407927Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
440dc407927Smrg
441dc407927Smrg
442dc407927Smrg# _LT_LIBTOOL_TAGS
443dc407927Smrg# ----------------
444dc407927Smrg# Output comment and list of tags supported by the script
445dc407927Smrgm4_defun([_LT_LIBTOOL_TAGS],
446dc407927Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
447dc407927Smrgavailable_tags="_LT_TAGS"dnl
448dc407927Smrg])
449dc407927Smrg
450dc407927Smrg
451dc407927Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
452dc407927Smrg# -----------------------------------
453dc407927Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
454dc407927Smrg# expand to a commented shell variable setting:
455dc407927Smrg#
456dc407927Smrg#    # Some comment about what VAR is for.
457dc407927Smrg#    visible_name=$lt_internal_name
458dc407927Smrgm4_define([_LT_LIBTOOL_DECLARE],
459dc407927Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
460dc407927Smrg					   [description])))[]dnl
461dc407927Smrgm4_pushdef([_libtool_name],
462dc407927Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
463dc407927Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
464dc407927Smrg    [0], [_libtool_name=[$]$1],
465dc407927Smrg    [1], [_libtool_name=$lt_[]$1],
466dc407927Smrg    [2], [_libtool_name=$lt_[]$1],
467dc407927Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
468dc407927Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
469dc407927Smrg])
470dc407927Smrg
471dc407927Smrg
472dc407927Smrg# _LT_LIBTOOL_CONFIG_VARS
473dc407927Smrg# -----------------------
474dc407927Smrg# Produce commented declarations of non-tagged libtool config variables
475dc407927Smrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
476dc407927Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
477dc407927Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
478dc407927Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
479dc407927Smrg[m4_foreach([_lt_var],
480dc407927Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
481dc407927Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
482dc407927Smrg
483dc407927Smrg
484dc407927Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
485dc407927Smrg# -------------------------
486dc407927Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
487dc407927Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
488dc407927Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
4893eed67faSmbalmer
4903eed67faSmbalmer
491dc407927Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
492dc407927Smrg# ------------------------------
493dc407927Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
494dc407927Smrg
495dc407927Smrg
496dc407927Smrg# _LT_CONFIG_COMMANDS
4973eed67faSmbalmer# -------------------
498dc407927Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
499dc407927Smrg# variables for single and double quote escaping we saved from calls
500dc407927Smrg# to _LT_DECL, we can put quote escaped variables declarations
501dc407927Smrg# into `config.status', and then the shell code to quote escape them in
502dc407927Smrg# for loops in `config.status'.  Finally, any additional code accumulated
503dc407927Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
504dc407927Smrgm4_defun([_LT_CONFIG_COMMANDS],
505dc407927Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
506dc407927Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
507dc407927Smrg	dnl instead of duplicating it all over again into config.status,
508dc407927Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
509dc407927Smrg	dnl needs to know what name is stored there:
510dc407927Smrg        [AC_CONFIG_COMMANDS([libtool],
511dc407927Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
512dc407927Smrg    dnl If the libtool generation code is destined for config.status,
513dc407927Smrg    dnl expand the accumulated commands and init code now:
514dc407927Smrg    [AC_CONFIG_COMMANDS([libtool],
515dc407927Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
516dc407927Smrg])#_LT_CONFIG_COMMANDS
517dc407927Smrg
518dc407927Smrg
519dc407927Smrg# Initialize.
520dc407927Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
521dc407927Smrg[
522dc407927Smrg
523dc407927Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
524dc407927Smrg# if CDPATH is set.
525dc407927Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
526dc407927Smrg
527dc407927Smrgsed_quote_subst='$sed_quote_subst'
528dc407927Smrgdouble_quote_subst='$double_quote_subst'
529dc407927Smrgdelay_variable_subst='$delay_variable_subst'
530dc407927Smrg_LT_CONFIG_STATUS_DECLARATIONS
531dc407927SmrgLTCC='$LTCC'
532dc407927SmrgLTCFLAGS='$LTCFLAGS'
533dc407927Smrgcompiler='$compiler_DEFAULT'
534dc407927Smrg
535dc407927Smrg# Quote evaled strings.
536dc407927Smrgfor var in lt_decl_all_varnames([[ \
537dc407927Smrg]], lt_decl_quote_varnames); do
538dc407927Smrg    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
539dc407927Smrg    *[[\\\\\\\`\\"\\\$]]*)
540dc407927Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
541dc407927Smrg      ;;
542dc407927Smrg    *)
543dc407927Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
544dc407927Smrg      ;;
545dc407927Smrg    esac
546dc407927Smrgdone
547dc407927Smrg
548dc407927Smrg# Double-quote double-evaled strings.
549dc407927Smrgfor var in lt_decl_all_varnames([[ \
550dc407927Smrg]], lt_decl_dquote_varnames); do
551dc407927Smrg    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
552dc407927Smrg    *[[\\\\\\\`\\"\\\$]]*)
553dc407927Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
554dc407927Smrg      ;;
555dc407927Smrg    *)
556dc407927Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
557dc407927Smrg      ;;
558dc407927Smrg    esac
559dc407927Smrgdone
560dc407927Smrg
561dc407927Smrg# Fix-up fallback echo if it was mangled by the above quoting rules.
562dc407927Smrgcase \$lt_ECHO in
563dc407927Smrg*'\\\[$]0 --fallback-echo"')dnl "
564dc407927Smrg  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
565dc407927Smrg  ;;
566dc407927Smrgesac
567dc407927Smrg
568dc407927Smrg_LT_OUTPUT_LIBTOOL_INIT
569dc407927Smrg])
570dc407927Smrg
571dc407927Smrg
572dc407927Smrg# LT_OUTPUT
573dc407927Smrg# ---------
574dc407927Smrg# This macro allows early generation of the libtool script (before
575dc407927Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
576dc407927Smrg# tests.
577dc407927SmrgAC_DEFUN([LT_OUTPUT],
578dc407927Smrg[: ${CONFIG_LT=./config.lt}
579dc407927SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
580dc407927Smrgcat >"$CONFIG_LT" <<_LTEOF
581dc407927Smrg#! $SHELL
582dc407927Smrg# Generated by $as_me.
583dc407927Smrg# Run this file to recreate a libtool stub with the current configuration.
584dc407927Smrg
585dc407927Smrglt_cl_silent=false
586dc407927SmrgSHELL=\${CONFIG_SHELL-$SHELL}
587dc407927Smrg_LTEOF
588dc407927Smrg
589dc407927Smrgcat >>"$CONFIG_LT" <<\_LTEOF
590dc407927SmrgAS_SHELL_SANITIZE
591dc407927Smrg_AS_PREPARE
592dc407927Smrg
593dc407927Smrgexec AS_MESSAGE_FD>&1
594dc407927Smrgexec AS_MESSAGE_LOG_FD>>config.log
595dc407927Smrg{
596dc407927Smrg  echo
597dc407927Smrg  AS_BOX([Running $as_me.])
598dc407927Smrg} >&AS_MESSAGE_LOG_FD
599dc407927Smrg
600dc407927Smrglt_cl_help="\
601dc407927Smrg\`$as_me' creates a local libtool stub from the current configuration,
602dc407927Smrgfor use in further configure time tests before the real libtool is
603dc407927Smrggenerated.
604dc407927Smrg
605dc407927SmrgUsage: $[0] [[OPTIONS]]
606dc407927Smrg
607dc407927Smrg  -h, --help      print this help, then exit
608dc407927Smrg  -V, --version   print version number, then exit
609dc407927Smrg  -q, --quiet     do not print progress messages
610dc407927Smrg  -d, --debug     don't remove temporary files
611dc407927Smrg
612dc407927SmrgReport bugs to <bug-libtool@gnu.org>."
613dc407927Smrg
614dc407927Smrglt_cl_version="\
615dc407927Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
616dc407927Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
617dc407927Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
618dc407927Smrg
619dc407927SmrgCopyright (C) 2008 Free Software Foundation, Inc.
620dc407927SmrgThis config.lt script is free software; the Free Software Foundation
621dc407927Smrggives unlimited permision to copy, distribute and modify it."
622dc407927Smrg
623dc407927Smrgwhile test $[#] != 0
624dc407927Smrgdo
625dc407927Smrg  case $[1] in
626dc407927Smrg    --version | --v* | -V )
627dc407927Smrg      echo "$lt_cl_version"; exit 0 ;;
628dc407927Smrg    --help | --h* | -h )
629dc407927Smrg      echo "$lt_cl_help"; exit 0 ;;
630dc407927Smrg    --debug | --d* | -d )
631dc407927Smrg      debug=: ;;
632dc407927Smrg    --quiet | --q* | --silent | --s* | -q )
633dc407927Smrg      lt_cl_silent=: ;;
634dc407927Smrg
635dc407927Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
636dc407927SmrgTry \`$[0] --help' for more information.]) ;;
637dc407927Smrg
638dc407927Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
639dc407927SmrgTry \`$[0] --help' for more information.]) ;;
640dc407927Smrg  esac
641dc407927Smrg  shift
642dc407927Smrgdone
643dc407927Smrg
644dc407927Smrgif $lt_cl_silent; then
645dc407927Smrg  exec AS_MESSAGE_FD>/dev/null
646dc407927Smrgfi
647dc407927Smrg_LTEOF
648dc407927Smrg
649dc407927Smrgcat >>"$CONFIG_LT" <<_LTEOF
650dc407927Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
651dc407927Smrg_LTEOF
652dc407927Smrg
653dc407927Smrgcat >>"$CONFIG_LT" <<\_LTEOF
654dc407927SmrgAC_MSG_NOTICE([creating $ofile])
655dc407927Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
656dc407927SmrgAS_EXIT(0)
657dc407927Smrg_LTEOF
658dc407927Smrgchmod +x "$CONFIG_LT"
659dc407927Smrg
660dc407927Smrg# configure is writing to config.log, but config.lt does its own redirection,
661dc407927Smrg# appending to config.log, which fails on DOS, as config.log is still kept
662dc407927Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
663dc407927Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
664dc407927Smrgif test "$no_create" != yes; then
665dc407927Smrg  lt_cl_success=:
666dc407927Smrg  test "$silent" = yes &&
667dc407927Smrg    lt_config_lt_args="$lt_config_lt_args --quiet"
668dc407927Smrg  exec AS_MESSAGE_LOG_FD>/dev/null
669dc407927Smrg  $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
670dc407927Smrg  exec AS_MESSAGE_LOG_FD>>config.log
671dc407927Smrg  $lt_cl_success || AS_EXIT(1)
672dc407927Smrgfi
673dc407927Smrg])# LT_OUTPUT
674dc407927Smrg
675dc407927Smrg
676dc407927Smrg# _LT_CONFIG(TAG)
677dc407927Smrg# ---------------
678dc407927Smrg# If TAG is the built-in tag, create an initial libtool script with a
679dc407927Smrg# default configuration from the untagged config vars.  Otherwise add code
680dc407927Smrg# to config.status for appending the configuration named by TAG from the
681dc407927Smrg# matching tagged config vars.
682dc407927Smrgm4_defun([_LT_CONFIG],
683dc407927Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
684dc407927Smrg_LT_CONFIG_SAVE_COMMANDS([
685dc407927Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
686dc407927Smrg  m4_if(_LT_TAG, [C], [
687dc407927Smrg    # See if we are running on zsh, and set the options which allow our
688dc407927Smrg    # commands through without removal of \ escapes.
689dc407927Smrg    if test -n "${ZSH_VERSION+set}" ; then
690dc407927Smrg      setopt NO_GLOB_SUBST
691dc407927Smrg    fi
692dc407927Smrg
693dc407927Smrg    cfgfile="${ofile}T"
694dc407927Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
695dc407927Smrg    $RM "$cfgfile"
696dc407927Smrg
697dc407927Smrg    cat <<_LT_EOF >> "$cfgfile"
698dc407927Smrg#! $SHELL
699dc407927Smrg
700dc407927Smrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
701dc407927Smrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
702dc407927Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
703dc407927Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
704dc407927Smrg#
705dc407927Smrg_LT_COPYING
706dc407927Smrg_LT_LIBTOOL_TAGS
707dc407927Smrg
708dc407927Smrg# ### BEGIN LIBTOOL CONFIG
709dc407927Smrg_LT_LIBTOOL_CONFIG_VARS
710dc407927Smrg_LT_LIBTOOL_TAG_VARS
711dc407927Smrg# ### END LIBTOOL CONFIG
712dc407927Smrg
713dc407927Smrg_LT_EOF
714dc407927Smrg
715dc407927Smrg  case $host_os in
716dc407927Smrg  aix3*)
717dc407927Smrg    cat <<\_LT_EOF >> "$cfgfile"
718dc407927Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
719dc407927Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
720dc407927Smrg# vanish in a puff of smoke.
721dc407927Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
722dc407927Smrg  COLLECT_NAMES=
723dc407927Smrg  export COLLECT_NAMES
724dc407927Smrgfi
725dc407927Smrg_LT_EOF
726dc407927Smrg    ;;
727dc407927Smrg  esac
728dc407927Smrg
729dc407927Smrg  _LT_PROG_LTMAIN
730dc407927Smrg
731dc407927Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
732dc407927Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
733dc407927Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
734dc407927Smrg  # is reportedly fixed, but why not run on old versions too?
735dc407927Smrg  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
736dc407927Smrg    || (rm -f "$cfgfile"; exit 1)
737dc407927Smrg
738dc407927Smrg  _LT_PROG_XSI_SHELLFNS
739dc407927Smrg
740dc407927Smrg  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
741dc407927Smrg    || (rm -f "$cfgfile"; exit 1)
742dc407927Smrg
743dc407927Smrg  mv -f "$cfgfile" "$ofile" ||
744dc407927Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
745dc407927Smrg  chmod +x "$ofile"
746dc407927Smrg],
747dc407927Smrg[cat <<_LT_EOF >> "$ofile"
748dc407927Smrg
749dc407927Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
750dc407927Smrgdnl in a comment (ie after a #).
751dc407927Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
752dc407927Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
753dc407927Smrg# ### END LIBTOOL TAG CONFIG: $1
754dc407927Smrg_LT_EOF
755dc407927Smrg])dnl /m4_if
756dc407927Smrg],
757dc407927Smrg[m4_if([$1], [], [
758dc407927Smrg    PACKAGE='$PACKAGE'
759dc407927Smrg    VERSION='$VERSION'
760dc407927Smrg    TIMESTAMP='$TIMESTAMP'
761dc407927Smrg    RM='$RM'
762dc407927Smrg    ofile='$ofile'], [])
763dc407927Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
764dc407927Smrg])# _LT_CONFIG
765dc407927Smrg
766dc407927Smrg
767dc407927Smrg# LT_SUPPORTED_TAG(TAG)
768dc407927Smrg# ---------------------
769dc407927Smrg# Trace this macro to discover what tags are supported by the libtool
770dc407927Smrg# --tag option, using:
771dc407927Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
772dc407927SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
773dc407927Smrg
774dc407927Smrg
775dc407927Smrg# C support is built-in for now
776dc407927Smrgm4_define([_LT_LANG_C_enabled], [])
777dc407927Smrgm4_define([_LT_TAGS], [])
778dc407927Smrg
779dc407927Smrg
780dc407927Smrg# LT_LANG(LANG)
781dc407927Smrg# -------------
782dc407927Smrg# Enable libtool support for the given language if not already enabled.
783dc407927SmrgAC_DEFUN([LT_LANG],
784dc407927Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
785dc407927Smrgm4_case([$1],
786dc407927Smrg  [C],			[_LT_LANG(C)],
787dc407927Smrg  [C++],		[_LT_LANG(CXX)],
788dc407927Smrg  [Java],		[_LT_LANG(GCJ)],
789dc407927Smrg  [Fortran 77],		[_LT_LANG(F77)],
790dc407927Smrg  [Fortran],		[_LT_LANG(FC)],
791dc407927Smrg  [Windows Resource],	[_LT_LANG(RC)],
792dc407927Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
793dc407927Smrg    [_LT_LANG($1)],
794dc407927Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
795dc407927Smrg])# LT_LANG
796dc407927Smrg
797dc407927Smrg
798dc407927Smrg# _LT_LANG(LANGNAME)
799dc407927Smrg# ------------------
800dc407927Smrgm4_defun([_LT_LANG],
801dc407927Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
802dc407927Smrg  [LT_SUPPORTED_TAG([$1])dnl
803dc407927Smrg  m4_append([_LT_TAGS], [$1 ])dnl
804dc407927Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
805dc407927Smrg  _LT_LANG_$1_CONFIG($1)])dnl
806dc407927Smrg])# _LT_LANG
807dc407927Smrg
808dc407927Smrg
809dc407927Smrg# _LT_LANG_DEFAULT_CONFIG
810dc407927Smrg# -----------------------
811dc407927Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
812dc407927Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
813dc407927Smrg  [LT_LANG(CXX)],
814dc407927Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
815dc407927Smrg
816dc407927SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
817dc407927Smrg  [LT_LANG(F77)],
818dc407927Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
819dc407927Smrg
820dc407927SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
821dc407927Smrg  [LT_LANG(FC)],
822dc407927Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
823dc407927Smrg
824dc407927Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
825dc407927Smrgdnl pulling things in needlessly.
826dc407927SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
827dc407927Smrg  [LT_LANG(GCJ)],
828dc407927Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
829dc407927Smrg    [LT_LANG(GCJ)],
830dc407927Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
831dc407927Smrg      [LT_LANG(GCJ)],
832dc407927Smrg      [m4_ifdef([AC_PROG_GCJ],
833dc407927Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
834dc407927Smrg       m4_ifdef([A][M_PROG_GCJ],
835dc407927Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
836dc407927Smrg       m4_ifdef([LT_PROG_GCJ],
837dc407927Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
838dc407927Smrg
839dc407927SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
840dc407927Smrg  [LT_LANG(RC)],
841dc407927Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
842dc407927Smrg])# _LT_LANG_DEFAULT_CONFIG
843dc407927Smrg
844dc407927Smrg# Obsolete macros:
845dc407927SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
846dc407927SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
847dc407927SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
848dc407927SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
849dc407927Smrgdnl aclocal-1.4 backwards compatibility:
850dc407927Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
851dc407927Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
852dc407927Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
853dc407927Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
854dc407927Smrg
855dc407927Smrg
856dc407927Smrg# _LT_TAG_COMPILER
857dc407927Smrg# ----------------
858dc407927Smrgm4_defun([_LT_TAG_COMPILER],
8593eed67faSmbalmer[AC_REQUIRE([AC_PROG_CC])dnl
8603eed67faSmbalmer
861dc407927Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
862dc407927Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
863dc407927Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
864dc407927Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
865dc407927Smrg
8663eed67faSmbalmer# If no C compiler was specified, use CC.
8673eed67faSmbalmerLTCC=${LTCC-"$CC"}
8683eed67faSmbalmer
8693eed67faSmbalmer# If no C compiler flags were specified, use CFLAGS.
8703eed67faSmbalmerLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
8713eed67faSmbalmer
8723eed67faSmbalmer# Allow CC to be a program name with arguments.
8733eed67faSmbalmercompiler=$CC
874dc407927Smrg])# _LT_TAG_COMPILER
8753eed67faSmbalmer
8763eed67faSmbalmer
8773eed67faSmbalmer# _LT_COMPILER_BOILERPLATE
8783eed67faSmbalmer# ------------------------
8793eed67faSmbalmer# Check for compiler boilerplate output or warnings with
8803eed67faSmbalmer# the simple compiler test code.
881dc407927Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
882dc407927Smrg[m4_require([_LT_DECL_SED])dnl
8833eed67faSmbalmerac_outfile=conftest.$ac_objext
8843eed67faSmbalmerecho "$lt_simple_compile_test_code" >conftest.$ac_ext
8853eed67faSmbalmereval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
8863eed67faSmbalmer_lt_compiler_boilerplate=`cat conftest.err`
887dc407927Smrg$RM conftest*
8883eed67faSmbalmer])# _LT_COMPILER_BOILERPLATE
8893eed67faSmbalmer
8903eed67faSmbalmer
8913eed67faSmbalmer# _LT_LINKER_BOILERPLATE
8923eed67faSmbalmer# ----------------------
8933eed67faSmbalmer# Check for linker boilerplate output or warnings with
8943eed67faSmbalmer# the simple link test code.
895dc407927Smrgm4_defun([_LT_LINKER_BOILERPLATE],
896dc407927Smrg[m4_require([_LT_DECL_SED])dnl
8973eed67faSmbalmerac_outfile=conftest.$ac_objext
8983eed67faSmbalmerecho "$lt_simple_link_test_code" >conftest.$ac_ext
8993eed67faSmbalmereval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
9003eed67faSmbalmer_lt_linker_boilerplate=`cat conftest.err`
901dc407927Smrg$RM -r conftest*
9023eed67faSmbalmer])# _LT_LINKER_BOILERPLATE
9033eed67faSmbalmer
9043eed67faSmbalmer# _LT_REQUIRED_DARWIN_CHECKS
905dc407927Smrg# -------------------------
906dc407927Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
9073eed67faSmbalmer  case $host_os in
9083eed67faSmbalmer    rhapsody* | darwin*)
9093eed67faSmbalmer    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
9103eed67faSmbalmer    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
911dc407927Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
912dc407927Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
913dc407927Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
914dc407927Smrg    _LT_DECL([], [DSYMUTIL], [1],
915dc407927Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
916dc407927Smrg    _LT_DECL([], [NMEDIT], [1],
917dc407927Smrg      [Tool to change global to local symbols on Mac OS X])
918dc407927Smrg    _LT_DECL([], [LIPO], [1],
919dc407927Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
920dc407927Smrg    _LT_DECL([], [OTOOL], [1],
921dc407927Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
922dc407927Smrg    _LT_DECL([], [OTOOL64], [1],
923dc407927Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
9243eed67faSmbalmer
9253eed67faSmbalmer    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
9263eed67faSmbalmer      [lt_cv_apple_cc_single_mod=no
9273eed67faSmbalmer      if test -z "${LT_MULTI_MODULE}"; then
928dc407927Smrg	# By default we will add the -single_module flag. You can override
929dc407927Smrg	# by either setting the environment variable LT_MULTI_MODULE
930dc407927Smrg	# non-empty at configure time, or by adding -multi_module to the
931dc407927Smrg	# link flags.
932dc407927Smrg	rm -rf libconftest.dylib*
933dc407927Smrg	echo "int foo(void){return 1;}" > conftest.c
934dc407927Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
935dc407927Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
936dc407927Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
937dc407927Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
938dc407927Smrg        _lt_result=$?
939dc407927Smrg	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
940dc407927Smrg	  lt_cv_apple_cc_single_mod=yes
941dc407927Smrg	else
942dc407927Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
943dc407927Smrg	fi
944dc407927Smrg	rm -rf libconftest.dylib*
945dc407927Smrg	rm -f conftest.*
9463eed67faSmbalmer      fi])
9473eed67faSmbalmer    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
9483eed67faSmbalmer      [lt_cv_ld_exported_symbols_list],
9493eed67faSmbalmer      [lt_cv_ld_exported_symbols_list=no
9503eed67faSmbalmer      save_LDFLAGS=$LDFLAGS
9513eed67faSmbalmer      echo "_main" > conftest.sym
9523eed67faSmbalmer      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
9533eed67faSmbalmer      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
954dc407927Smrg	[lt_cv_ld_exported_symbols_list=yes],
955dc407927Smrg	[lt_cv_ld_exported_symbols_list=no])
956dc407927Smrg	LDFLAGS="$save_LDFLAGS"
9573eed67faSmbalmer    ])
9583eed67faSmbalmer    case $host_os in
959dc407927Smrg    rhapsody* | darwin1.[[012]])
9603eed67faSmbalmer      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
9613eed67faSmbalmer    darwin1.*)
962dc407927Smrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
963dc407927Smrg    darwin*) # darwin 5.x on
9643eed67faSmbalmer      # if running on 10.5 or later, the deployment target defaults
9653eed67faSmbalmer      # to the OS version, if on x86, and 10.4, the deployment
9663eed67faSmbalmer      # target defaults to 10.4. Don't you love it?
9673eed67faSmbalmer      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
968dc407927Smrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
969dc407927Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
970dc407927Smrg	10.[[012]]*)
971dc407927Smrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
972dc407927Smrg	10.*)
973dc407927Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
9743eed67faSmbalmer      esac
9753eed67faSmbalmer    ;;
9763eed67faSmbalmer  esac
9773eed67faSmbalmer    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
9783eed67faSmbalmer      _lt_dar_single_mod='$single_module'
9793eed67faSmbalmer    fi
9803eed67faSmbalmer    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
9813eed67faSmbalmer      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
9823eed67faSmbalmer    else
983dc407927Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
9843eed67faSmbalmer    fi
9853eed67faSmbalmer    if test "$DSYMUTIL" != ":"; then
986dc407927Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
9873eed67faSmbalmer    else
9883eed67faSmbalmer      _lt_dsymutil=
9893eed67faSmbalmer    fi
9903eed67faSmbalmer    ;;
9913eed67faSmbalmer  esac
9923eed67faSmbalmer])
9933eed67faSmbalmer
994dc407927Smrg
995dc407927Smrg# _LT_DARWIN_LINKER_FEATURES
996dc407927Smrg# --------------------------
997dc407927Smrg# Checks for linker and compiler features on darwin
998dc407927Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
999dc407927Smrg[
1000dc407927Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1001dc407927Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1002dc407927Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
1003dc407927Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
1004dc407927Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1005dc407927Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1006dc407927Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
1007dc407927Smrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
1008dc407927Smrg  case $cc_basename in
1009dc407927Smrg     ifort*) _lt_dar_can_shared=yes ;;
1010dc407927Smrg     *) _lt_dar_can_shared=$GCC ;;
1011dc407927Smrg  esac
1012dc407927Smrg  if test "$_lt_dar_can_shared" = "yes"; then
1013dc407927Smrg    output_verbose_link_cmd=echo
1014dc407927Smrg    _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}"
1015dc407927Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
1016dc407927Smrg    _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}"
1017dc407927Smrg    _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}"
1018dc407927Smrg    m4_if([$1], [CXX],
1019dc407927Smrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
1020dc407927Smrg      _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}"
1021dc407927Smrg      _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}"
1022dc407927Smrg    fi
1023dc407927Smrg],[])
1024dc407927Smrg  else
1025dc407927Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
1026dc407927Smrg  fi
1027dc407927Smrg])
1028dc407927Smrg
1029dc407927Smrg# _LT_SYS_MODULE_PATH_AIX
1030dc407927Smrg# -----------------------
10313eed67faSmbalmer# Links a minimal program and checks the executable
10323eed67faSmbalmer# for the system default hardcoded library path. In most cases,
10333eed67faSmbalmer# this is /usr/lib:/lib, but when the MPI compilers are used
10343eed67faSmbalmer# the location of the communication and MPI libs are included too.
10353eed67faSmbalmer# If we don't find anything, use the default library path according
10363eed67faSmbalmer# to the aix ld manual.
1037dc407927Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
1038dc407927Smrg[m4_require([_LT_DECL_SED])dnl
10393eed67faSmbalmerAC_LINK_IFELSE(AC_LANG_PROGRAM,[
10403eed67faSmbalmerlt_aix_libpath_sed='
10413eed67faSmbalmer    /Import File Strings/,/^$/ {
10423eed67faSmbalmer	/^0/ {
10433eed67faSmbalmer	    s/^0  *\(.*\)$/\1/
10443eed67faSmbalmer	    p
10453eed67faSmbalmer	}
10463eed67faSmbalmer    }'
10473eed67faSmbalmeraix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
10483eed67faSmbalmer# Check for a 64-bit object if we didn't find anything.
10493eed67faSmbalmerif test -z "$aix_libpath"; then
10503eed67faSmbalmer  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
10513eed67faSmbalmerfi],[])
10523eed67faSmbalmerif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
1053dc407927Smrg])# _LT_SYS_MODULE_PATH_AIX
10543eed67faSmbalmer
10553eed67faSmbalmer
1056dc407927Smrg# _LT_SHELL_INIT(ARG)
1057dc407927Smrg# -------------------
1058dc407927Smrgm4_define([_LT_SHELL_INIT],
10593eed67faSmbalmer[ifdef([AC_DIVERSION_NOTICE],
10603eed67faSmbalmer	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
10613eed67faSmbalmer	 [AC_DIVERT_PUSH(NOTICE)])
10623eed67faSmbalmer$1
10633eed67faSmbalmerAC_DIVERT_POP
1064dc407927Smrg])# _LT_SHELL_INIT
10653eed67faSmbalmer
10663eed67faSmbalmer
1067dc407927Smrg# _LT_PROG_ECHO_BACKSLASH
1068dc407927Smrg# -----------------------
10693eed67faSmbalmer# Add some code to the start of the generated configure script which
10703eed67faSmbalmer# will find an echo command which doesn't interpret backslashes.
1071dc407927Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
1072dc407927Smrg[_LT_SHELL_INIT([
10733eed67faSmbalmer# Check that we are running under the correct shell.
10743eed67faSmbalmerSHELL=${CONFIG_SHELL-/bin/sh}
10753eed67faSmbalmer
1076dc407927Smrgcase X$lt_ECHO in
10773eed67faSmbalmerX*--fallback-echo)
10783eed67faSmbalmer  # Remove one level of quotation (which was required for Make).
1079dc407927Smrg  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
10803eed67faSmbalmer  ;;
10813eed67faSmbalmeresac
10823eed67faSmbalmer
1083dc407927SmrgECHO=${lt_ECHO-echo}
10843eed67faSmbalmerif test "X[$]1" = X--no-reexec; then
10853eed67faSmbalmer  # Discard the --no-reexec flag, and continue.
10863eed67faSmbalmer  shift
10873eed67faSmbalmerelif test "X[$]1" = X--fallback-echo; then
10883eed67faSmbalmer  # Avoid inline document here, it may be left over
10893eed67faSmbalmer  :
1090dc407927Smrgelif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
1091dc407927Smrg  # Yippee, $ECHO works!
10923eed67faSmbalmer  :
10933eed67faSmbalmerelse
10943eed67faSmbalmer  # Restart under the correct shell.
10953eed67faSmbalmer  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
10963eed67faSmbalmerfi
10973eed67faSmbalmer
10983eed67faSmbalmerif test "X[$]1" = X--fallback-echo; then
10993eed67faSmbalmer  # used as fallback echo
11003eed67faSmbalmer  shift
1101dc407927Smrg  cat <<_LT_EOF
11023eed67faSmbalmer[$]*
1103dc407927Smrg_LT_EOF
11043eed67faSmbalmer  exit 0
11053eed67faSmbalmerfi
11063eed67faSmbalmer
11073eed67faSmbalmer# The HP-UX ksh and POSIX shell print the target directory to stdout
11083eed67faSmbalmer# if CDPATH is set.
11093eed67faSmbalmer(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
11103eed67faSmbalmer
1111dc407927Smrgif test -z "$lt_ECHO"; then
1112dc407927Smrg  if test "X${echo_test_string+set}" != Xset; then
1113dc407927Smrg    # find a string as large as possible, as long as the shell can cope with it
1114dc407927Smrg    for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
1115dc407927Smrg      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
1116dc407927Smrg      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
1117dc407927Smrg	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
1118dc407927Smrg      then
1119dc407927Smrg        break
1120dc407927Smrg      fi
1121dc407927Smrg    done
1122dc407927Smrg  fi
11233eed67faSmbalmer
1124dc407927Smrg  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
1125dc407927Smrg     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
1126dc407927Smrg     test "X$echo_testing_string" = "X$echo_test_string"; then
1127dc407927Smrg    :
1128dc407927Smrg  else
1129dc407927Smrg    # The Solaris, AIX, and Digital Unix default echo programs unquote
1130dc407927Smrg    # backslashes.  This makes it impossible to quote backslashes using
1131dc407927Smrg    #   echo "$something" | sed 's/\\/\\\\/g'
1132dc407927Smrg    #
1133dc407927Smrg    # So, first we look for a working echo in the user's PATH.
11343eed67faSmbalmer
1135dc407927Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
1136dc407927Smrg    for dir in $PATH /usr/ucb; do
1137dc407927Smrg      IFS="$lt_save_ifs"
1138dc407927Smrg      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
1139dc407927Smrg         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
1140dc407927Smrg         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
1141dc407927Smrg         test "X$echo_testing_string" = "X$echo_test_string"; then
1142dc407927Smrg        ECHO="$dir/echo"
1143dc407927Smrg        break
1144dc407927Smrg      fi
1145dc407927Smrg    done
11463eed67faSmbalmer    IFS="$lt_save_ifs"
11473eed67faSmbalmer
1148dc407927Smrg    if test "X$ECHO" = Xecho; then
1149dc407927Smrg      # We didn't find a better echo, so look for alternatives.
1150dc407927Smrg      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
1151dc407927Smrg         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
1152dc407927Smrg         test "X$echo_testing_string" = "X$echo_test_string"; then
1153dc407927Smrg        # This shell has a builtin print -r that does the trick.
1154dc407927Smrg        ECHO='print -r'
1155dc407927Smrg      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
1156dc407927Smrg	   test "X$CONFIG_SHELL" != X/bin/ksh; then
1157dc407927Smrg        # If we have ksh, try running configure again with it.
1158dc407927Smrg        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
1159dc407927Smrg        export ORIGINAL_CONFIG_SHELL
1160dc407927Smrg        CONFIG_SHELL=/bin/ksh
1161dc407927Smrg        export CONFIG_SHELL
1162dc407927Smrg        exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
11633eed67faSmbalmer      else
1164dc407927Smrg        # Try using printf.
1165dc407927Smrg        ECHO='printf %s\n'
1166dc407927Smrg        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
1167dc407927Smrg	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
1168dc407927Smrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
1169dc407927Smrg	  # Cool, printf works
1170dc407927Smrg	  :
1171dc407927Smrg        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1172dc407927Smrg	     test "X$echo_testing_string" = 'X\t' &&
1173dc407927Smrg	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1174dc407927Smrg	     test "X$echo_testing_string" = "X$echo_test_string"; then
1175dc407927Smrg	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
1176dc407927Smrg	  export CONFIG_SHELL
1177dc407927Smrg	  SHELL="$CONFIG_SHELL"
1178dc407927Smrg	  export SHELL
1179dc407927Smrg	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
1180dc407927Smrg        elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1181dc407927Smrg	     test "X$echo_testing_string" = 'X\t' &&
1182dc407927Smrg	     echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1183dc407927Smrg	     test "X$echo_testing_string" = "X$echo_test_string"; then
1184dc407927Smrg	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
1185dc407927Smrg        else
1186dc407927Smrg	  # maybe with a smaller string...
1187dc407927Smrg	  prev=:
11883eed67faSmbalmer
1189dc407927Smrg	  for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
1190dc407927Smrg	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
1191dc407927Smrg	    then
1192dc407927Smrg	      break
1193dc407927Smrg	    fi
1194dc407927Smrg	    prev="$cmd"
1195dc407927Smrg	  done
11963eed67faSmbalmer
1197dc407927Smrg	  if test "$prev" != 'sed 50q "[$]0"'; then
1198dc407927Smrg	    echo_test_string=`eval $prev`
1199dc407927Smrg	    export echo_test_string
1200dc407927Smrg	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
1201dc407927Smrg	  else
1202dc407927Smrg	    # Oops.  We lost completely, so just stick with echo.
1203dc407927Smrg	    ECHO=echo
1204dc407927Smrg	  fi
1205dc407927Smrg        fi
12063eed67faSmbalmer      fi
12073eed67faSmbalmer    fi
12083eed67faSmbalmer  fi
12093eed67faSmbalmerfi
12103eed67faSmbalmer
12113eed67faSmbalmer# Copy echo and quote the copy suitably for passing to libtool from
12123eed67faSmbalmer# the Makefile, instead of quoting the original, which is used later.
1213dc407927Smrglt_ECHO=$ECHO
1214dc407927Smrgif test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
1215dc407927Smrg   lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
12163eed67faSmbalmerfi
12173eed67faSmbalmer
1218dc407927SmrgAC_SUBST(lt_ECHO)
1219dc407927Smrg])
1220dc407927Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1221dc407927Smrg_LT_DECL([], [ECHO], [1],
1222dc407927Smrg    [An echo program that does not interpret backslashes])
1223dc407927Smrg])# _LT_PROG_ECHO_BACKSLASH
12243eed67faSmbalmer
12253eed67faSmbalmer
1226dc407927Smrg# _LT_ENABLE_LOCK
1227dc407927Smrg# ---------------
1228dc407927Smrgm4_defun([_LT_ENABLE_LOCK],
12293eed67faSmbalmer[AC_ARG_ENABLE([libtool-lock],
1230dc407927Smrg  [AS_HELP_STRING([--disable-libtool-lock],
1231dc407927Smrg    [avoid locking (might break parallel builds)])])
12323eed67faSmbalmertest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
12333eed67faSmbalmer
12343eed67faSmbalmer# Some flags need to be propagated to the compiler or linker for good
12353eed67faSmbalmer# libtool support.
12363eed67faSmbalmercase $host in
12373eed67faSmbalmeria64-*-hpux*)
12383eed67faSmbalmer  # Find out which ABI we are using.
12393eed67faSmbalmer  echo 'int i;' > conftest.$ac_ext
12403eed67faSmbalmer  if AC_TRY_EVAL(ac_compile); then
12413eed67faSmbalmer    case `/usr/bin/file conftest.$ac_objext` in
1242dc407927Smrg      *ELF-32*)
1243dc407927Smrg	HPUX_IA64_MODE="32"
1244dc407927Smrg	;;
1245dc407927Smrg      *ELF-64*)
1246dc407927Smrg	HPUX_IA64_MODE="64"
1247dc407927Smrg	;;
12483eed67faSmbalmer    esac
12493eed67faSmbalmer  fi
12503eed67faSmbalmer  rm -rf conftest*
12513eed67faSmbalmer  ;;
12523eed67faSmbalmer*-*-irix6*)
12533eed67faSmbalmer  # Find out which ABI we are using.
12543eed67faSmbalmer  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
12553eed67faSmbalmer  if AC_TRY_EVAL(ac_compile); then
1256dc407927Smrg    if test "$lt_cv_prog_gnu_ld" = yes; then
1257dc407927Smrg      case `/usr/bin/file conftest.$ac_objext` in
1258dc407927Smrg	*32-bit*)
1259dc407927Smrg	  LD="${LD-ld} -melf32bsmip"
1260dc407927Smrg	  ;;
1261dc407927Smrg	*N32*)
1262dc407927Smrg	  LD="${LD-ld} -melf32bmipn32"
1263dc407927Smrg	  ;;
1264dc407927Smrg	*64-bit*)
1265dc407927Smrg	  LD="${LD-ld} -melf64bmip"
1266dc407927Smrg	;;
1267dc407927Smrg      esac
1268dc407927Smrg    else
1269dc407927Smrg      case `/usr/bin/file conftest.$ac_objext` in
1270dc407927Smrg	*32-bit*)
1271dc407927Smrg	  LD="${LD-ld} -32"
1272dc407927Smrg	  ;;
1273dc407927Smrg	*N32*)
1274dc407927Smrg	  LD="${LD-ld} -n32"
1275dc407927Smrg	  ;;
1276dc407927Smrg	*64-bit*)
1277dc407927Smrg	  LD="${LD-ld} -64"
1278dc407927Smrg	  ;;
1279dc407927Smrg      esac
1280dc407927Smrg    fi
12813eed67faSmbalmer  fi
12823eed67faSmbalmer  rm -rf conftest*
12833eed67faSmbalmer  ;;
12843eed67faSmbalmer
12853eed67faSmbalmerx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
1286dc407927Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
12873eed67faSmbalmer  # Find out which ABI we are using.
12883eed67faSmbalmer  echo 'int i;' > conftest.$ac_ext
12893eed67faSmbalmer  if AC_TRY_EVAL(ac_compile); then
12903eed67faSmbalmer    case `/usr/bin/file conftest.o` in
1291dc407927Smrg      *32-bit*)
1292dc407927Smrg	case $host in
1293dc407927Smrg	  x86_64-*kfreebsd*-gnu)
1294dc407927Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
1295dc407927Smrg	    ;;
1296dc407927Smrg	  x86_64-*linux*)
1297dc407927Smrg	    LD="${LD-ld} -m elf_i386"
1298dc407927Smrg	    ;;
1299dc407927Smrg	  ppc64-*linux*|powerpc64-*linux*)
1300dc407927Smrg	    LD="${LD-ld} -m elf32ppclinux"
1301dc407927Smrg	    ;;
1302dc407927Smrg	  s390x-*linux*)
1303dc407927Smrg	    LD="${LD-ld} -m elf_s390"
1304dc407927Smrg	    ;;
1305dc407927Smrg	  sparc64-*linux*)
1306dc407927Smrg	    LD="${LD-ld} -m elf32_sparc"
1307dc407927Smrg	    ;;
1308dc407927Smrg	esac
1309dc407927Smrg	;;
1310dc407927Smrg      *64-bit*)
1311dc407927Smrg	case $host in
1312dc407927Smrg	  x86_64-*kfreebsd*-gnu)
1313dc407927Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
1314dc407927Smrg	    ;;
1315dc407927Smrg	  x86_64-*linux*)
1316dc407927Smrg	    LD="${LD-ld} -m elf_x86_64"
1317dc407927Smrg	    ;;
1318dc407927Smrg	  ppc*-*linux*|powerpc*-*linux*)
1319dc407927Smrg	    LD="${LD-ld} -m elf64ppc"
1320dc407927Smrg	    ;;
1321dc407927Smrg	  s390*-*linux*|s390*-*tpf*)
1322dc407927Smrg	    LD="${LD-ld} -m elf64_s390"
1323dc407927Smrg	    ;;
1324dc407927Smrg	  sparc*-*linux*)
1325dc407927Smrg	    LD="${LD-ld} -m elf64_sparc"
1326dc407927Smrg	    ;;
1327dc407927Smrg	esac
1328dc407927Smrg	;;
13293eed67faSmbalmer    esac
13303eed67faSmbalmer  fi
13313eed67faSmbalmer  rm -rf conftest*
13323eed67faSmbalmer  ;;
13333eed67faSmbalmer
13343eed67faSmbalmer*-*-sco3.2v5*)
13353eed67faSmbalmer  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
13363eed67faSmbalmer  SAVE_CFLAGS="$CFLAGS"
13373eed67faSmbalmer  CFLAGS="$CFLAGS -belf"
13383eed67faSmbalmer  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
13393eed67faSmbalmer    [AC_LANG_PUSH(C)
1340dc407927Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
13413eed67faSmbalmer     AC_LANG_POP])
13423eed67faSmbalmer  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
13433eed67faSmbalmer    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
13443eed67faSmbalmer    CFLAGS="$SAVE_CFLAGS"
13453eed67faSmbalmer  fi
13463eed67faSmbalmer  ;;
13473eed67faSmbalmersparc*-*solaris*)
13483eed67faSmbalmer  # Find out which ABI we are using.
13493eed67faSmbalmer  echo 'int i;' > conftest.$ac_ext
13503eed67faSmbalmer  if AC_TRY_EVAL(ac_compile); then
13513eed67faSmbalmer    case `/usr/bin/file conftest.o` in
13523eed67faSmbalmer    *64-bit*)
13533eed67faSmbalmer      case $lt_cv_prog_gnu_ld in
13543eed67faSmbalmer      yes*) LD="${LD-ld} -m elf64_sparc" ;;
13553eed67faSmbalmer      *)
1356dc407927Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
13573eed67faSmbalmer	  LD="${LD-ld} -64"
13583eed67faSmbalmer	fi
13593eed67faSmbalmer	;;
13603eed67faSmbalmer      esac
13613eed67faSmbalmer      ;;
13623eed67faSmbalmer    esac
13633eed67faSmbalmer  fi
13643eed67faSmbalmer  rm -rf conftest*
13653eed67faSmbalmer  ;;
13663eed67faSmbalmeresac
13673eed67faSmbalmer
13683eed67faSmbalmerneed_locks="$enable_libtool_lock"
1369dc407927Smrg])# _LT_ENABLE_LOCK
1370dc407927Smrg
1371dc407927Smrg
1372dc407927Smrg# _LT_CMD_OLD_ARCHIVE
1373dc407927Smrg# -------------------
1374dc407927Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
1375dc407927Smrg[AC_CHECK_TOOL(AR, ar, false)
1376dc407927Smrgtest -z "$AR" && AR=ar
1377dc407927Smrgtest -z "$AR_FLAGS" && AR_FLAGS=cru
1378dc407927Smrg_LT_DECL([], [AR], [1], [The archiver])
1379dc407927Smrg_LT_DECL([], [AR_FLAGS], [1])
1380dc407927Smrg
1381dc407927SmrgAC_CHECK_TOOL(STRIP, strip, :)
1382dc407927Smrgtest -z "$STRIP" && STRIP=:
1383dc407927Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1384dc407927Smrg
1385dc407927SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
1386dc407927Smrgtest -z "$RANLIB" && RANLIB=:
1387dc407927Smrg_LT_DECL([], [RANLIB], [1],
1388dc407927Smrg    [Commands used to install an old-style archive])
1389dc407927Smrg
1390dc407927Smrg# Determine commands to create old-style static archives.
1391dc407927Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1392dc407927Smrgold_postinstall_cmds='chmod 644 $oldlib'
1393dc407927Smrgold_postuninstall_cmds=
13943eed67faSmbalmer
1395dc407927Smrgif test -n "$RANLIB"; then
1396dc407927Smrg  case $host_os in
1397dc407927Smrg  openbsd*)
1398dc407927Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
1399dc407927Smrg    ;;
1400dc407927Smrg  *)
1401dc407927Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
1402dc407927Smrg    ;;
1403dc407927Smrg  esac
1404dc407927Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
1405dc407927Smrgfi
1406dc407927Smrg_LT_DECL([], [old_postinstall_cmds], [2])
1407dc407927Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
1408dc407927Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
1409dc407927Smrg    [Commands used to build an old-style archive])
1410dc407927Smrg])# _LT_CMD_OLD_ARCHIVE
14113eed67faSmbalmer
14123eed67faSmbalmer
1413dc407927Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
14143eed67faSmbalmer#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
14153eed67faSmbalmer# ----------------------------------------------------------------
14163eed67faSmbalmer# Check whether the given compiler option works
1417dc407927SmrgAC_DEFUN([_LT_COMPILER_OPTION],
1418dc407927Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1419dc407927Smrgm4_require([_LT_DECL_SED])dnl
14203eed67faSmbalmerAC_CACHE_CHECK([$1], [$2],
14213eed67faSmbalmer  [$2=no
1422dc407927Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
14233eed67faSmbalmer   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
14243eed67faSmbalmer   lt_compiler_flag="$3"
14253eed67faSmbalmer   # Insert the option either (1) after the last *FLAGS variable, or
14263eed67faSmbalmer   # (2) before a word containing "conftest.", or (3) at the end.
14273eed67faSmbalmer   # Note that $ac_compile itself does not contain backslashes and begins
14283eed67faSmbalmer   # with a dollar sign (not a hyphen), so the echo should work correctly.
14293eed67faSmbalmer   # The option is referenced via a variable to avoid confusing sed.
14303eed67faSmbalmer   lt_compile=`echo "$ac_compile" | $SED \
14313eed67faSmbalmer   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
14323eed67faSmbalmer   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
14333eed67faSmbalmer   -e 's:$: $lt_compiler_flag:'`
14343eed67faSmbalmer   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
14353eed67faSmbalmer   (eval "$lt_compile" 2>conftest.err)
14363eed67faSmbalmer   ac_status=$?
14373eed67faSmbalmer   cat conftest.err >&AS_MESSAGE_LOG_FD
14383eed67faSmbalmer   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
14393eed67faSmbalmer   if (exit $ac_status) && test -s "$ac_outfile"; then
14403eed67faSmbalmer     # The compiler can only warn and ignore the option if not recognized
14413eed67faSmbalmer     # So say no if there are warnings other than the usual output.
1442dc407927Smrg     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
14433eed67faSmbalmer     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
14443eed67faSmbalmer     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
14453eed67faSmbalmer       $2=yes
14463eed67faSmbalmer     fi
14473eed67faSmbalmer   fi
1448dc407927Smrg   $RM conftest*
14493eed67faSmbalmer])
14503eed67faSmbalmer
14513eed67faSmbalmerif test x"[$]$2" = xyes; then
1452dc407927Smrg    m4_if([$5], , :, [$5])
14533eed67faSmbalmerelse
1454dc407927Smrg    m4_if([$6], , :, [$6])
14553eed67faSmbalmerfi
1456dc407927Smrg])# _LT_COMPILER_OPTION
14573eed67faSmbalmer
1458dc407927Smrg# Old name:
1459dc407927SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1460dc407927Smrgdnl aclocal-1.4 backwards compatibility:
1461dc407927Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
14623eed67faSmbalmer
1463dc407927Smrg
1464dc407927Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1465dc407927Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
1466dc407927Smrg# ----------------------------------------------------
1467dc407927Smrg# Check whether the given linker option works
1468dc407927SmrgAC_DEFUN([_LT_LINKER_OPTION],
1469dc407927Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1470dc407927Smrgm4_require([_LT_DECL_SED])dnl
14713eed67faSmbalmerAC_CACHE_CHECK([$1], [$2],
14723eed67faSmbalmer  [$2=no
14733eed67faSmbalmer   save_LDFLAGS="$LDFLAGS"
14743eed67faSmbalmer   LDFLAGS="$LDFLAGS $3"
14753eed67faSmbalmer   echo "$lt_simple_link_test_code" > conftest.$ac_ext
14763eed67faSmbalmer   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
14773eed67faSmbalmer     # The linker can only warn and ignore the option if not recognized
14783eed67faSmbalmer     # So say no if there are warnings
14793eed67faSmbalmer     if test -s conftest.err; then
14803eed67faSmbalmer       # Append any errors to the config.log.
14813eed67faSmbalmer       cat conftest.err 1>&AS_MESSAGE_LOG_FD
1482dc407927Smrg       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
14833eed67faSmbalmer       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
14843eed67faSmbalmer       if diff conftest.exp conftest.er2 >/dev/null; then
14853eed67faSmbalmer         $2=yes
14863eed67faSmbalmer       fi
14873eed67faSmbalmer     else
14883eed67faSmbalmer       $2=yes
14893eed67faSmbalmer     fi
14903eed67faSmbalmer   fi
1491dc407927Smrg   $RM -r conftest*
14923eed67faSmbalmer   LDFLAGS="$save_LDFLAGS"
14933eed67faSmbalmer])
14943eed67faSmbalmer
14953eed67faSmbalmerif test x"[$]$2" = xyes; then
1496dc407927Smrg    m4_if([$4], , :, [$4])
14973eed67faSmbalmerelse
1498dc407927Smrg    m4_if([$5], , :, [$5])
14993eed67faSmbalmerfi
1500dc407927Smrg])# _LT_LINKER_OPTION
15013eed67faSmbalmer
1502dc407927Smrg# Old name:
1503dc407927SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1504dc407927Smrgdnl aclocal-1.4 backwards compatibility:
1505dc407927Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
15063eed67faSmbalmer
1507dc407927Smrg
1508dc407927Smrg# LT_CMD_MAX_LEN
1509dc407927Smrg#---------------
1510dc407927SmrgAC_DEFUN([LT_CMD_MAX_LEN],
1511dc407927Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1512dc407927Smrg# find the maximum length of command line arguments
15133eed67faSmbalmerAC_MSG_CHECKING([the maximum length of command line arguments])
15143eed67faSmbalmerAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
15153eed67faSmbalmer  i=0
15163eed67faSmbalmer  teststring="ABCD"
15173eed67faSmbalmer
15183eed67faSmbalmer  case $build_os in
15193eed67faSmbalmer  msdosdjgpp*)
15203eed67faSmbalmer    # On DJGPP, this test can blow up pretty badly due to problems in libc
15213eed67faSmbalmer    # (any single argument exceeding 2000 bytes causes a buffer overrun
15223eed67faSmbalmer    # during glob expansion).  Even if it were fixed, the result of this
15233eed67faSmbalmer    # check would be larger than it should be.
15243eed67faSmbalmer    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
15253eed67faSmbalmer    ;;
15263eed67faSmbalmer
15273eed67faSmbalmer  gnu*)
15283eed67faSmbalmer    # Under GNU Hurd, this test is not required because there is
15293eed67faSmbalmer    # no limit to the length of command line arguments.
15303eed67faSmbalmer    # Libtool will interpret -1 as no limit whatsoever
15313eed67faSmbalmer    lt_cv_sys_max_cmd_len=-1;
15323eed67faSmbalmer    ;;
15333eed67faSmbalmer
1534dc407927Smrg  cygwin* | mingw* | cegcc*)
15353eed67faSmbalmer    # On Win9x/ME, this test blows up -- it succeeds, but takes
15363eed67faSmbalmer    # about 5 minutes as the teststring grows exponentially.
15373eed67faSmbalmer    # Worse, since 9x/ME are not pre-emptively multitasking,
15383eed67faSmbalmer    # you end up with a "frozen" computer, even though with patience
15393eed67faSmbalmer    # the test eventually succeeds (with a max line length of 256k).
15403eed67faSmbalmer    # Instead, let's just punt: use the minimum linelength reported by
15413eed67faSmbalmer    # all of the supported platforms: 8192 (on NT/2K/XP).
15423eed67faSmbalmer    lt_cv_sys_max_cmd_len=8192;
15433eed67faSmbalmer    ;;
15443eed67faSmbalmer
15453eed67faSmbalmer  amigaos*)
15463eed67faSmbalmer    # On AmigaOS with pdksh, this test takes hours, literally.
15473eed67faSmbalmer    # So we just punt and use a minimum line length of 8192.
15483eed67faSmbalmer    lt_cv_sys_max_cmd_len=8192;
15493eed67faSmbalmer    ;;
15503eed67faSmbalmer
15513eed67faSmbalmer  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
15523eed67faSmbalmer    # This has been around since 386BSD, at least.  Likely further.
15533eed67faSmbalmer    if test -x /sbin/sysctl; then
15543eed67faSmbalmer      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
15553eed67faSmbalmer    elif test -x /usr/sbin/sysctl; then
15563eed67faSmbalmer      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
15573eed67faSmbalmer    else
15583eed67faSmbalmer      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
15593eed67faSmbalmer    fi
15603eed67faSmbalmer    # And add a safety zone
15613eed67faSmbalmer    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
15623eed67faSmbalmer    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
15633eed67faSmbalmer    ;;
15643eed67faSmbalmer
15653eed67faSmbalmer  interix*)
15663eed67faSmbalmer    # We know the value 262144 and hardcode it with a safety zone (like BSD)
15673eed67faSmbalmer    lt_cv_sys_max_cmd_len=196608
15683eed67faSmbalmer    ;;
15693eed67faSmbalmer
15703eed67faSmbalmer  osf*)
15713eed67faSmbalmer    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
15723eed67faSmbalmer    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
15733eed67faSmbalmer    # nice to cause kernel panics so lets avoid the loop below.
15743eed67faSmbalmer    # First set a reasonable default.
15753eed67faSmbalmer    lt_cv_sys_max_cmd_len=16384
15763eed67faSmbalmer    #
15773eed67faSmbalmer    if test -x /sbin/sysconfig; then
15783eed67faSmbalmer      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
15793eed67faSmbalmer        *1*) lt_cv_sys_max_cmd_len=-1 ;;
15803eed67faSmbalmer      esac
15813eed67faSmbalmer    fi
15823eed67faSmbalmer    ;;
15833eed67faSmbalmer  sco3.2v5*)
15843eed67faSmbalmer    lt_cv_sys_max_cmd_len=102400
15853eed67faSmbalmer    ;;
15863eed67faSmbalmer  sysv5* | sco5v6* | sysv4.2uw2*)
15873eed67faSmbalmer    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
15883eed67faSmbalmer    if test -n "$kargmax"; then
1589dc407927Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
15903eed67faSmbalmer    else
15913eed67faSmbalmer      lt_cv_sys_max_cmd_len=32768
15923eed67faSmbalmer    fi
15933eed67faSmbalmer    ;;
15943eed67faSmbalmer  *)
15953eed67faSmbalmer    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
15963eed67faSmbalmer    if test -n "$lt_cv_sys_max_cmd_len"; then
15973eed67faSmbalmer      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
15983eed67faSmbalmer      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
15993eed67faSmbalmer    else
1600dc407927Smrg      # Make teststring a little bigger before we do anything with it.
1601dc407927Smrg      # a 1K string should be a reasonable start.
1602dc407927Smrg      for i in 1 2 3 4 5 6 7 8 ; do
1603dc407927Smrg        teststring=$teststring$teststring
1604dc407927Smrg      done
16053eed67faSmbalmer      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1606dc407927Smrg      # If test is not a shell built-in, we'll probably end up computing a
1607dc407927Smrg      # maximum length that is only half of the actual maximum length, but
1608dc407927Smrg      # we can't tell.
1609dc407927Smrg      while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
1610dc407927Smrg	         = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
16113eed67faSmbalmer	      test $i != 17 # 1/2 MB should be enough
16123eed67faSmbalmer      do
16133eed67faSmbalmer        i=`expr $i + 1`
16143eed67faSmbalmer        teststring=$teststring$teststring
16153eed67faSmbalmer      done
1616dc407927Smrg      # Only check the string length outside the loop.
1617dc407927Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
16183eed67faSmbalmer      teststring=
1619dc407927Smrg      # Add a significant safety factor because C++ compilers can tack on
1620dc407927Smrg      # massive amounts of additional arguments before passing them to the
1621dc407927Smrg      # linker.  It appears as though 1/2 is a usable value.
16223eed67faSmbalmer      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
16233eed67faSmbalmer    fi
16243eed67faSmbalmer    ;;
16253eed67faSmbalmer  esac
16263eed67faSmbalmer])
16273eed67faSmbalmerif test -n $lt_cv_sys_max_cmd_len ; then
16283eed67faSmbalmer  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
16293eed67faSmbalmerelse
16303eed67faSmbalmer  AC_MSG_RESULT(none)
16313eed67faSmbalmerfi
1632dc407927Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
1633dc407927Smrg_LT_DECL([], [max_cmd_len], [0],
1634dc407927Smrg    [What is the maximum length of a command?])
1635dc407927Smrg])# LT_CMD_MAX_LEN
16363eed67faSmbalmer
1637dc407927Smrg# Old name:
1638dc407927SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1639dc407927Smrgdnl aclocal-1.4 backwards compatibility:
1640dc407927Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
16413eed67faSmbalmer
1642dc407927Smrg
1643dc407927Smrg# _LT_HEADER_DLFCN
1644dc407927Smrg# ----------------
1645dc407927Smrgm4_defun([_LT_HEADER_DLFCN],
1646dc407927Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1647dc407927Smrg])# _LT_HEADER_DLFCN
16483eed67faSmbalmer
16493eed67faSmbalmer
1650dc407927Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1651dc407927Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1652dc407927Smrg# ----------------------------------------------------------------
1653dc407927Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
1654dc407927Smrg[m4_require([_LT_HEADER_DLFCN])dnl
16553eed67faSmbalmerif test "$cross_compiling" = yes; then :
16563eed67faSmbalmer  [$4]
16573eed67faSmbalmerelse
16583eed67faSmbalmer  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
16593eed67faSmbalmer  lt_status=$lt_dlunknown
1660dc407927Smrg  cat > conftest.$ac_ext <<_LT_EOF
16613eed67faSmbalmer[#line __oline__ "configure"
16623eed67faSmbalmer#include "confdefs.h"
16633eed67faSmbalmer
16643eed67faSmbalmer#if HAVE_DLFCN_H
16653eed67faSmbalmer#include <dlfcn.h>
16663eed67faSmbalmer#endif
16673eed67faSmbalmer
16683eed67faSmbalmer#include <stdio.h>
16693eed67faSmbalmer
16703eed67faSmbalmer#ifdef RTLD_GLOBAL
16713eed67faSmbalmer#  define LT_DLGLOBAL		RTLD_GLOBAL
16723eed67faSmbalmer#else
16733eed67faSmbalmer#  ifdef DL_GLOBAL
16743eed67faSmbalmer#    define LT_DLGLOBAL		DL_GLOBAL
16753eed67faSmbalmer#  else
16763eed67faSmbalmer#    define LT_DLGLOBAL		0
16773eed67faSmbalmer#  endif
16783eed67faSmbalmer#endif
16793eed67faSmbalmer
16803eed67faSmbalmer/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
16813eed67faSmbalmer   find out it does not work in some platform. */
16823eed67faSmbalmer#ifndef LT_DLLAZY_OR_NOW
16833eed67faSmbalmer#  ifdef RTLD_LAZY
16843eed67faSmbalmer#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
16853eed67faSmbalmer#  else
16863eed67faSmbalmer#    ifdef DL_LAZY
16873eed67faSmbalmer#      define LT_DLLAZY_OR_NOW		DL_LAZY
16883eed67faSmbalmer#    else
16893eed67faSmbalmer#      ifdef RTLD_NOW
16903eed67faSmbalmer#        define LT_DLLAZY_OR_NOW	RTLD_NOW
16913eed67faSmbalmer#      else
16923eed67faSmbalmer#        ifdef DL_NOW
16933eed67faSmbalmer#          define LT_DLLAZY_OR_NOW	DL_NOW
16943eed67faSmbalmer#        else
16953eed67faSmbalmer#          define LT_DLLAZY_OR_NOW	0
16963eed67faSmbalmer#        endif
16973eed67faSmbalmer#      endif
16983eed67faSmbalmer#    endif
16993eed67faSmbalmer#  endif
17003eed67faSmbalmer#endif
17013eed67faSmbalmer
17023eed67faSmbalmervoid fnord() { int i=42;}
17033eed67faSmbalmerint main ()
17043eed67faSmbalmer{
17053eed67faSmbalmer  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
17063eed67faSmbalmer  int status = $lt_dlunknown;
17073eed67faSmbalmer
17083eed67faSmbalmer  if (self)
17093eed67faSmbalmer    {
17103eed67faSmbalmer      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
17113eed67faSmbalmer      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
17123eed67faSmbalmer      /* dlclose (self); */
17133eed67faSmbalmer    }
17143eed67faSmbalmer  else
17153eed67faSmbalmer    puts (dlerror ());
17163eed67faSmbalmer
1717dc407927Smrg  return status;
17183eed67faSmbalmer}]
1719dc407927Smrg_LT_EOF
17203eed67faSmbalmer  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
17213eed67faSmbalmer    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
17223eed67faSmbalmer    lt_status=$?
17233eed67faSmbalmer    case x$lt_status in
17243eed67faSmbalmer      x$lt_dlno_uscore) $1 ;;
17253eed67faSmbalmer      x$lt_dlneed_uscore) $2 ;;
17263eed67faSmbalmer      x$lt_dlunknown|x*) $3 ;;
17273eed67faSmbalmer    esac
17283eed67faSmbalmer  else :
17293eed67faSmbalmer    # compilation failed
17303eed67faSmbalmer    $3
17313eed67faSmbalmer  fi
17323eed67faSmbalmerfi
17333eed67faSmbalmerrm -fr conftest*
1734dc407927Smrg])# _LT_TRY_DLOPEN_SELF
17353eed67faSmbalmer
17363eed67faSmbalmer
1737dc407927Smrg# LT_SYS_DLOPEN_SELF
1738dc407927Smrg# ------------------
1739dc407927SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
1740dc407927Smrg[m4_require([_LT_HEADER_DLFCN])dnl
17413eed67faSmbalmerif test "x$enable_dlopen" != xyes; then
17423eed67faSmbalmer  enable_dlopen=unknown
17433eed67faSmbalmer  enable_dlopen_self=unknown
17443eed67faSmbalmer  enable_dlopen_self_static=unknown
17453eed67faSmbalmerelse
17463eed67faSmbalmer  lt_cv_dlopen=no
17473eed67faSmbalmer  lt_cv_dlopen_libs=
17483eed67faSmbalmer
17493eed67faSmbalmer  case $host_os in
17503eed67faSmbalmer  beos*)
17513eed67faSmbalmer    lt_cv_dlopen="load_add_on"
17523eed67faSmbalmer    lt_cv_dlopen_libs=
17533eed67faSmbalmer    lt_cv_dlopen_self=yes
17543eed67faSmbalmer    ;;
17553eed67faSmbalmer
1756dc407927Smrg  mingw* | pw32* | cegcc*)
17573eed67faSmbalmer    lt_cv_dlopen="LoadLibrary"
17583eed67faSmbalmer    lt_cv_dlopen_libs=
1759dc407927Smrg    ;;
17603eed67faSmbalmer
17613eed67faSmbalmer  cygwin*)
17623eed67faSmbalmer    lt_cv_dlopen="dlopen"
17633eed67faSmbalmer    lt_cv_dlopen_libs=
1764dc407927Smrg    ;;
17653eed67faSmbalmer
17663eed67faSmbalmer  darwin*)
17673eed67faSmbalmer  # if libdl is installed we need to link against it
17683eed67faSmbalmer    AC_CHECK_LIB([dl], [dlopen],
17693eed67faSmbalmer		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
17703eed67faSmbalmer    lt_cv_dlopen="dyld"
17713eed67faSmbalmer    lt_cv_dlopen_libs=
17723eed67faSmbalmer    lt_cv_dlopen_self=yes
17733eed67faSmbalmer    ])
1774dc407927Smrg    ;;
17753eed67faSmbalmer
17763eed67faSmbalmer  *)
17773eed67faSmbalmer    AC_CHECK_FUNC([shl_load],
17783eed67faSmbalmer	  [lt_cv_dlopen="shl_load"],
17793eed67faSmbalmer      [AC_CHECK_LIB([dld], [shl_load],
17803eed67faSmbalmer	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
17813eed67faSmbalmer	[AC_CHECK_FUNC([dlopen],
17823eed67faSmbalmer	      [lt_cv_dlopen="dlopen"],
17833eed67faSmbalmer	  [AC_CHECK_LIB([dl], [dlopen],
17843eed67faSmbalmer		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
17853eed67faSmbalmer	    [AC_CHECK_LIB([svld], [dlopen],
17863eed67faSmbalmer		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
17873eed67faSmbalmer	      [AC_CHECK_LIB([dld], [dld_link],
17883eed67faSmbalmer		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
17893eed67faSmbalmer	      ])
17903eed67faSmbalmer	    ])
17913eed67faSmbalmer	  ])
17923eed67faSmbalmer	])
17933eed67faSmbalmer      ])
17943eed67faSmbalmer    ;;
17953eed67faSmbalmer  esac
17963eed67faSmbalmer
17973eed67faSmbalmer  if test "x$lt_cv_dlopen" != xno; then
17983eed67faSmbalmer    enable_dlopen=yes
17993eed67faSmbalmer  else
18003eed67faSmbalmer    enable_dlopen=no
18013eed67faSmbalmer  fi
18023eed67faSmbalmer
18033eed67faSmbalmer  case $lt_cv_dlopen in
18043eed67faSmbalmer  dlopen)
18053eed67faSmbalmer    save_CPPFLAGS="$CPPFLAGS"
18063eed67faSmbalmer    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
18073eed67faSmbalmer
18083eed67faSmbalmer    save_LDFLAGS="$LDFLAGS"
18093eed67faSmbalmer    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
18103eed67faSmbalmer
18113eed67faSmbalmer    save_LIBS="$LIBS"
18123eed67faSmbalmer    LIBS="$lt_cv_dlopen_libs $LIBS"
18133eed67faSmbalmer
18143eed67faSmbalmer    AC_CACHE_CHECK([whether a program can dlopen itself],
18153eed67faSmbalmer	  lt_cv_dlopen_self, [dnl
1816dc407927Smrg	  _LT_TRY_DLOPEN_SELF(
18173eed67faSmbalmer	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
18183eed67faSmbalmer	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
18193eed67faSmbalmer    ])
18203eed67faSmbalmer
18213eed67faSmbalmer    if test "x$lt_cv_dlopen_self" = xyes; then
18223eed67faSmbalmer      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
18233eed67faSmbalmer      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1824dc407927Smrg	  lt_cv_dlopen_self_static, [dnl
1825dc407927Smrg	  _LT_TRY_DLOPEN_SELF(
18263eed67faSmbalmer	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
18273eed67faSmbalmer	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
18283eed67faSmbalmer      ])
18293eed67faSmbalmer    fi
18303eed67faSmbalmer
18313eed67faSmbalmer    CPPFLAGS="$save_CPPFLAGS"
18323eed67faSmbalmer    LDFLAGS="$save_LDFLAGS"
18333eed67faSmbalmer    LIBS="$save_LIBS"
18343eed67faSmbalmer    ;;
18353eed67faSmbalmer  esac
18363eed67faSmbalmer
18373eed67faSmbalmer  case $lt_cv_dlopen_self in
18383eed67faSmbalmer  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
18393eed67faSmbalmer  *) enable_dlopen_self=unknown ;;
18403eed67faSmbalmer  esac
18413eed67faSmbalmer
18423eed67faSmbalmer  case $lt_cv_dlopen_self_static in
18433eed67faSmbalmer  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
18443eed67faSmbalmer  *) enable_dlopen_self_static=unknown ;;
18453eed67faSmbalmer  esac
18463eed67faSmbalmerfi
1847dc407927Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
1848dc407927Smrg	 [Whether dlopen is supported])
1849dc407927Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
1850dc407927Smrg	 [Whether dlopen of programs is supported])
1851dc407927Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
1852dc407927Smrg	 [Whether dlopen of statically linked programs is supported])
1853dc407927Smrg])# LT_SYS_DLOPEN_SELF
18543eed67faSmbalmer
1855dc407927Smrg# Old name:
1856dc407927SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
1857dc407927Smrgdnl aclocal-1.4 backwards compatibility:
1858dc407927Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
18593eed67faSmbalmer
1860dc407927Smrg
1861dc407927Smrg# _LT_COMPILER_C_O([TAGNAME])
1862dc407927Smrg# ---------------------------
1863dc407927Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
1864dc407927Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
1865dc407927Smrgm4_defun([_LT_COMPILER_C_O],
1866dc407927Smrg[m4_require([_LT_DECL_SED])dnl
1867dc407927Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
1868dc407927Smrgm4_require([_LT_TAG_COMPILER])dnl
18693eed67faSmbalmerAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1870dc407927Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
1871dc407927Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
1872dc407927Smrg   $RM -r conftest 2>/dev/null
18733eed67faSmbalmer   mkdir conftest
18743eed67faSmbalmer   cd conftest
18753eed67faSmbalmer   mkdir out
18763eed67faSmbalmer   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
18773eed67faSmbalmer
18783eed67faSmbalmer   lt_compiler_flag="-o out/conftest2.$ac_objext"
18793eed67faSmbalmer   # Insert the option either (1) after the last *FLAGS variable, or
18803eed67faSmbalmer   # (2) before a word containing "conftest.", or (3) at the end.
18813eed67faSmbalmer   # Note that $ac_compile itself does not contain backslashes and begins
18823eed67faSmbalmer   # with a dollar sign (not a hyphen), so the echo should work correctly.
18833eed67faSmbalmer   lt_compile=`echo "$ac_compile" | $SED \
18843eed67faSmbalmer   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
18853eed67faSmbalmer   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
18863eed67faSmbalmer   -e 's:$: $lt_compiler_flag:'`
18873eed67faSmbalmer   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
18883eed67faSmbalmer   (eval "$lt_compile" 2>out/conftest.err)
18893eed67faSmbalmer   ac_status=$?
18903eed67faSmbalmer   cat out/conftest.err >&AS_MESSAGE_LOG_FD
18913eed67faSmbalmer   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
18923eed67faSmbalmer   if (exit $ac_status) && test -s out/conftest2.$ac_objext
18933eed67faSmbalmer   then
18943eed67faSmbalmer     # The compiler can only warn and ignore the option if not recognized
18953eed67faSmbalmer     # So say no if there are warnings
1896dc407927Smrg     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
18973eed67faSmbalmer     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
18983eed67faSmbalmer     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
1899dc407927Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
19003eed67faSmbalmer     fi
19013eed67faSmbalmer   fi
19023eed67faSmbalmer   chmod u+w . 2>&AS_MESSAGE_LOG_FD
1903dc407927Smrg   $RM conftest*
19043eed67faSmbalmer   # SGI C++ compiler will create directory out/ii_files/ for
19053eed67faSmbalmer   # template instantiation
1906dc407927Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
1907dc407927Smrg   $RM out/* && rmdir out
19083eed67faSmbalmer   cd ..
1909dc407927Smrg   $RM -r conftest
1910dc407927Smrg   $RM conftest*
19113eed67faSmbalmer])
1912dc407927Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
1913dc407927Smrg	[Does compiler simultaneously support -c and -o options?])
1914dc407927Smrg])# _LT_COMPILER_C_O
19153eed67faSmbalmer
19163eed67faSmbalmer
1917dc407927Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
1918dc407927Smrg# ----------------------------------
19193eed67faSmbalmer# Check to see if we can do hard links to lock some files if needed
1920dc407927Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
1921dc407927Smrg[m4_require([_LT_ENABLE_LOCK])dnl
1922dc407927Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
1923dc407927Smrg_LT_COMPILER_C_O([$1])
19243eed67faSmbalmer
19253eed67faSmbalmerhard_links="nottested"
1926dc407927Smrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
19273eed67faSmbalmer  # do not overwrite the value of need_locks provided by the user
19283eed67faSmbalmer  AC_MSG_CHECKING([if we can lock with hard links])
19293eed67faSmbalmer  hard_links=yes
1930dc407927Smrg  $RM conftest*
19313eed67faSmbalmer  ln conftest.a conftest.b 2>/dev/null && hard_links=no
19323eed67faSmbalmer  touch conftest.a
19333eed67faSmbalmer  ln conftest.a conftest.b 2>&5 || hard_links=no
19343eed67faSmbalmer  ln conftest.a conftest.b 2>/dev/null && hard_links=no
19353eed67faSmbalmer  AC_MSG_RESULT([$hard_links])
19363eed67faSmbalmer  if test "$hard_links" = no; then
19373eed67faSmbalmer    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
19383eed67faSmbalmer    need_locks=warn
19393eed67faSmbalmer  fi
19403eed67faSmbalmerelse
19413eed67faSmbalmer  need_locks=no
19423eed67faSmbalmerfi
1943dc407927Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
1944dc407927Smrg])# _LT_COMPILER_FILE_LOCKS
19453eed67faSmbalmer
19463eed67faSmbalmer
1947dc407927Smrg# _LT_CHECK_OBJDIR
1948dc407927Smrg# ----------------
1949dc407927Smrgm4_defun([_LT_CHECK_OBJDIR],
19503eed67faSmbalmer[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
19513eed67faSmbalmer[rm -f .libs 2>/dev/null
19523eed67faSmbalmermkdir .libs 2>/dev/null
19533eed67faSmbalmerif test -d .libs; then
19543eed67faSmbalmer  lt_cv_objdir=.libs
19553eed67faSmbalmerelse
19563eed67faSmbalmer  # MS-DOS does not allow filenames that begin with a dot.
19573eed67faSmbalmer  lt_cv_objdir=_libs
19583eed67faSmbalmerfi
19593eed67faSmbalmerrmdir .libs 2>/dev/null])
19603eed67faSmbalmerobjdir=$lt_cv_objdir
1961dc407927Smrg_LT_DECL([], [objdir], [0],
1962dc407927Smrg         [The name of the directory that contains temporary libtool files])dnl
1963dc407927Smrgm4_pattern_allow([LT_OBJDIR])dnl
1964dc407927SmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
1965dc407927Smrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
1966dc407927Smrg])# _LT_CHECK_OBJDIR
19673eed67faSmbalmer
19683eed67faSmbalmer
1969dc407927Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
1970dc407927Smrg# --------------------------------------
19713eed67faSmbalmer# Check hardcoding attributes.
1972dc407927Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
19733eed67faSmbalmer[AC_MSG_CHECKING([how to hardcode library paths into programs])
1974dc407927Smrg_LT_TAGVAR(hardcode_action, $1)=
1975dc407927Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
1976dc407927Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
1977dc407927Smrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
19783eed67faSmbalmer
1979dc407927Smrg  # We can hardcode non-existent directories.
1980dc407927Smrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
19813eed67faSmbalmer     # If the only mechanism to avoid hardcoding is shlibpath_var, we
19823eed67faSmbalmer     # have to relink, otherwise we might link with an installed library
19833eed67faSmbalmer     # when we should be linking with a yet-to-be-installed one
1984dc407927Smrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
1985dc407927Smrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
19863eed67faSmbalmer    # Linking always hardcodes the temporary library directory.
1987dc407927Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
19883eed67faSmbalmer  else
19893eed67faSmbalmer    # We can link without hardcoding, and we can hardcode nonexisting dirs.
1990dc407927Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
19913eed67faSmbalmer  fi
19923eed67faSmbalmerelse
19933eed67faSmbalmer  # We cannot hardcode anything, or else we can only hardcode existing
19943eed67faSmbalmer  # directories.
1995dc407927Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
19963eed67faSmbalmerfi
1997dc407927SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
19983eed67faSmbalmer
1999dc407927Smrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
2000dc407927Smrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
20013eed67faSmbalmer  # Fast installation is not supported
20023eed67faSmbalmer  enable_fast_install=no
20033eed67faSmbalmerelif test "$shlibpath_overrides_runpath" = yes ||
20043eed67faSmbalmer     test "$enable_shared" = no; then
20053eed67faSmbalmer  # Fast installation is not necessary
20063eed67faSmbalmer  enable_fast_install=needless
20073eed67faSmbalmerfi
2008dc407927Smrg_LT_TAGDECL([], [hardcode_action], [0],
2009dc407927Smrg    [How to hardcode a shared library path into an executable])
2010dc407927Smrg])# _LT_LINKER_HARDCODE_LIBPATH
20113eed67faSmbalmer
20123eed67faSmbalmer
2013dc407927Smrg# _LT_CMD_STRIPLIB
2014dc407927Smrg# ----------------
2015dc407927Smrgm4_defun([_LT_CMD_STRIPLIB],
2016dc407927Smrg[m4_require([_LT_DECL_EGREP])
2017dc407927Smrgstriplib=
20183eed67faSmbalmerold_striplib=
20193eed67faSmbalmerAC_MSG_CHECKING([whether stripping libraries is possible])
2020dc407927Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
20213eed67faSmbalmer  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
20223eed67faSmbalmer  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
20233eed67faSmbalmer  AC_MSG_RESULT([yes])
20243eed67faSmbalmerelse
20253eed67faSmbalmer# FIXME - insert some real tests, host_os isn't really good enough
20263eed67faSmbalmer  case $host_os in
2027dc407927Smrg  darwin*)
2028dc407927Smrg    if test -n "$STRIP" ; then
2029dc407927Smrg      striplib="$STRIP -x"
2030dc407927Smrg      old_striplib="$STRIP -S"
2031dc407927Smrg      AC_MSG_RESULT([yes])
2032dc407927Smrg    else
2033dc407927Smrg      AC_MSG_RESULT([no])
2034dc407927Smrg    fi
2035dc407927Smrg    ;;
2036dc407927Smrg  *)
2037dc407927Smrg    AC_MSG_RESULT([no])
20383eed67faSmbalmer    ;;
20393eed67faSmbalmer  esac
20403eed67faSmbalmerfi
2041dc407927Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2042dc407927Smrg_LT_DECL([], [striplib], [1])
2043dc407927Smrg])# _LT_CMD_STRIPLIB
20443eed67faSmbalmer
20453eed67faSmbalmer
2046dc407927Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
20473eed67faSmbalmer# -----------------------------
20483eed67faSmbalmer# PORTME Fill in your ld.so characteristics
2049dc407927Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
2050dc407927Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2051dc407927Smrgm4_require([_LT_DECL_EGREP])dnl
2052dc407927Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2053dc407927Smrgm4_require([_LT_DECL_OBJDUMP])dnl
2054dc407927Smrgm4_require([_LT_DECL_SED])dnl
20553eed67faSmbalmerAC_MSG_CHECKING([dynamic linker characteristics])
2056dc407927Smrgm4_if([$1],
2057dc407927Smrg	[], [
20583eed67faSmbalmerif test "$GCC" = yes; then
20593eed67faSmbalmer  case $host_os in
20603eed67faSmbalmer    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
20613eed67faSmbalmer    *) lt_awk_arg="/^libraries:/" ;;
20623eed67faSmbalmer  esac
20633eed67faSmbalmer  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
2064dc407927Smrg  if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
20653eed67faSmbalmer    # if the path contains ";" then we assume it to be the separator
20663eed67faSmbalmer    # otherwise default to the standard path separator (i.e. ":") - it is
20673eed67faSmbalmer    # assumed that no part of a normal pathname contains ";" but that should
20683eed67faSmbalmer    # okay in the real world where ";" in dirpaths is itself problematic.
2069dc407927Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
20703eed67faSmbalmer  else
2071dc407927Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
20723eed67faSmbalmer  fi
20733eed67faSmbalmer  # Ok, now we have the path, separated by spaces, we can step through it
20743eed67faSmbalmer  # and add multilib dir if necessary.
20753eed67faSmbalmer  lt_tmp_lt_search_path_spec=
20763eed67faSmbalmer  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
20773eed67faSmbalmer  for lt_sys_path in $lt_search_path_spec; do
20783eed67faSmbalmer    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
20793eed67faSmbalmer      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
20803eed67faSmbalmer    else
20813eed67faSmbalmer      test -d "$lt_sys_path" && \
20823eed67faSmbalmer	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
20833eed67faSmbalmer    fi
20843eed67faSmbalmer  done
2085dc407927Smrg  lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
20863eed67faSmbalmerBEGIN {RS=" "; FS="/|\n";} {
20873eed67faSmbalmer  lt_foo="";
20883eed67faSmbalmer  lt_count=0;
20893eed67faSmbalmer  for (lt_i = NF; lt_i > 0; lt_i--) {
20903eed67faSmbalmer    if ($lt_i != "" && $lt_i != ".") {
20913eed67faSmbalmer      if ($lt_i == "..") {
20923eed67faSmbalmer        lt_count++;
20933eed67faSmbalmer      } else {
20943eed67faSmbalmer        if (lt_count == 0) {
20953eed67faSmbalmer          lt_foo="/" $lt_i lt_foo;
20963eed67faSmbalmer        } else {
20973eed67faSmbalmer          lt_count--;
20983eed67faSmbalmer        }
20993eed67faSmbalmer      }
21003eed67faSmbalmer    }
21013eed67faSmbalmer  }
21023eed67faSmbalmer  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
21033eed67faSmbalmer  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
21043eed67faSmbalmer}'`
2105dc407927Smrg  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
21063eed67faSmbalmerelse
21073eed67faSmbalmer  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
21083eed67faSmbalmerfi])
2109dc407927Smrglibrary_names_spec=
2110dc407927Smrglibname_spec='lib$name'
2111dc407927Smrgsoname_spec=
2112dc407927Smrgshrext_cmds=".so"
2113dc407927Smrgpostinstall_cmds=
2114dc407927Smrgpostuninstall_cmds=
2115dc407927Smrgfinish_cmds=
2116dc407927Smrgfinish_eval=
2117dc407927Smrgshlibpath_var=
2118dc407927Smrgshlibpath_overrides_runpath=unknown
2119dc407927Smrgversion_type=none
2120dc407927Smrgdynamic_linker="$host_os ld.so"
2121dc407927Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
21223eed67faSmbalmerneed_lib_prefix=unknown
21233eed67faSmbalmerhardcode_into_libs=no
21243eed67faSmbalmer
21253eed67faSmbalmer# when you set need_version to no, make sure it does not cause -set_version
21263eed67faSmbalmer# flags to be left without arguments
21273eed67faSmbalmerneed_version=unknown
21283eed67faSmbalmer
21293eed67faSmbalmercase $host_os in
21303eed67faSmbalmeraix3*)
21313eed67faSmbalmer  version_type=linux
21323eed67faSmbalmer  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
21333eed67faSmbalmer  shlibpath_var=LIBPATH
21343eed67faSmbalmer
21353eed67faSmbalmer  # AIX 3 has no versioning support, so we append a major version to the name.
21363eed67faSmbalmer  soname_spec='${libname}${release}${shared_ext}$major'
21373eed67faSmbalmer  ;;
21383eed67faSmbalmer
21393eed67faSmbalmeraix[[4-9]]*)
21403eed67faSmbalmer  version_type=linux
21413eed67faSmbalmer  need_lib_prefix=no
21423eed67faSmbalmer  need_version=no
21433eed67faSmbalmer  hardcode_into_libs=yes
21443eed67faSmbalmer  if test "$host_cpu" = ia64; then
21453eed67faSmbalmer    # AIX 5 supports IA64
21463eed67faSmbalmer    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
21473eed67faSmbalmer    shlibpath_var=LD_LIBRARY_PATH
21483eed67faSmbalmer  else
21493eed67faSmbalmer    # With GCC up to 2.95.x, collect2 would create an import file
21503eed67faSmbalmer    # for dependence libraries.  The import file would start with
21513eed67faSmbalmer    # the line `#! .'.  This would cause the generated library to
21523eed67faSmbalmer    # depend on `.', always an invalid library.  This was fixed in
21533eed67faSmbalmer    # development snapshots of GCC prior to 3.0.
21543eed67faSmbalmer    case $host_os in
21553eed67faSmbalmer      aix4 | aix4.[[01]] | aix4.[[01]].*)
21563eed67faSmbalmer      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
21573eed67faSmbalmer	   echo ' yes '
2158dc407927Smrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
21593eed67faSmbalmer	:
21603eed67faSmbalmer      else
21613eed67faSmbalmer	can_build_shared=no
21623eed67faSmbalmer      fi
21633eed67faSmbalmer      ;;
21643eed67faSmbalmer    esac
21653eed67faSmbalmer    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
21663eed67faSmbalmer    # soname into executable. Probably we can add versioning support to
21673eed67faSmbalmer    # collect2, so additional links can be useful in future.
21683eed67faSmbalmer    if test "$aix_use_runtimelinking" = yes; then
21693eed67faSmbalmer      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
21703eed67faSmbalmer      # instead of lib<name>.a to let people know that these are not
21713eed67faSmbalmer      # typical AIX shared libraries.
21723eed67faSmbalmer      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
21733eed67faSmbalmer    else
21743eed67faSmbalmer      # We preserve .a as extension for shared libraries through AIX4.2
21753eed67faSmbalmer      # and later when we are not doing run time linking.
21763eed67faSmbalmer      library_names_spec='${libname}${release}.a $libname.a'
21773eed67faSmbalmer      soname_spec='${libname}${release}${shared_ext}$major'
21783eed67faSmbalmer    fi
21793eed67faSmbalmer    shlibpath_var=LIBPATH
21803eed67faSmbalmer  fi
21813eed67faSmbalmer  ;;
21823eed67faSmbalmer
21833eed67faSmbalmeramigaos*)
2184dc407927Smrg  case $host_cpu in
2185dc407927Smrg  powerpc)
2186dc407927Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
2187dc407927Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2188dc407927Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2189dc407927Smrg    ;;
2190dc407927Smrg  m68k)
2191dc407927Smrg    library_names_spec='$libname.ixlibrary $libname.a'
2192dc407927Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
2193dc407927Smrg    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''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'
2194dc407927Smrg    ;;
2195dc407927Smrg  esac
21963eed67faSmbalmer  ;;
21973eed67faSmbalmer
21983eed67faSmbalmerbeos*)
21993eed67faSmbalmer  library_names_spec='${libname}${shared_ext}'
22003eed67faSmbalmer  dynamic_linker="$host_os ld.so"
22013eed67faSmbalmer  shlibpath_var=LIBRARY_PATH
22023eed67faSmbalmer  ;;
22033eed67faSmbalmer
22043eed67faSmbalmerbsdi[[45]]*)
22053eed67faSmbalmer  version_type=linux
22063eed67faSmbalmer  need_version=no
22073eed67faSmbalmer  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
22083eed67faSmbalmer  soname_spec='${libname}${release}${shared_ext}$major'
22093eed67faSmbalmer  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
22103eed67faSmbalmer  shlibpath_var=LD_LIBRARY_PATH
22113eed67faSmbalmer  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
22123eed67faSmbalmer  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
22133eed67faSmbalmer  # the default ld.so.conf also contains /usr/contrib/lib and
22143eed67faSmbalmer  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
22153eed67faSmbalmer  # libtool to hard-code these into programs
22163eed67faSmbalmer  ;;
22173eed67faSmbalmer
2218dc407927Smrgcygwin* | mingw* | pw32* | cegcc*)
22193eed67faSmbalmer  version_type=windows
22203eed67faSmbalmer  shrext_cmds=".dll"
22213eed67faSmbalmer  need_version=no
22223eed67faSmbalmer  need_lib_prefix=no
22233eed67faSmbalmer
22243eed67faSmbalmer  case $GCC,$host_os in
2225dc407927Smrg  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
22263eed67faSmbalmer    library_names_spec='$libname.dll.a'
22273eed67faSmbalmer    # DLL is installed to $(libdir)/../bin by postinstall_cmds
22283eed67faSmbalmer    postinstall_cmds='base_file=`basename \${file}`~
2229dc407927Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
22303eed67faSmbalmer      dldir=$destdir/`dirname \$dlpath`~
22313eed67faSmbalmer      test -d \$dldir || mkdir -p \$dldir~
22323eed67faSmbalmer      $install_prog $dir/$dlname \$dldir/$dlname~
2233dc407927Smrg      chmod a+x \$dldir/$dlname~
2234dc407927Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2235dc407927Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2236dc407927Smrg      fi'
22373eed67faSmbalmer    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
22383eed67faSmbalmer      dlpath=$dir/\$dldll~
2239dc407927Smrg       $RM \$dlpath'
22403eed67faSmbalmer    shlibpath_overrides_runpath=yes
22413eed67faSmbalmer
22423eed67faSmbalmer    case $host_os in
22433eed67faSmbalmer    cygwin*)
22443eed67faSmbalmer      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
22453eed67faSmbalmer      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
22463eed67faSmbalmer      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
22473eed67faSmbalmer      ;;
2248dc407927Smrg    mingw* | cegcc*)
22493eed67faSmbalmer      # MinGW DLLs use traditional 'lib' prefix
22503eed67faSmbalmer      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2251dc407927Smrg      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
2252dc407927Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
22533eed67faSmbalmer        # It is most probably a Windows format PATH printed by
22543eed67faSmbalmer        # mingw gcc, but we are running on Cygwin. Gcc prints its search
22553eed67faSmbalmer        # path with ; separators, and with drive letters. We can handle the
22563eed67faSmbalmer        # drive letters (cygwin fileutils understands them), so leave them,
22573eed67faSmbalmer        # especially as we might pass files found there to a mingw objdump,
22583eed67faSmbalmer        # which wouldn't understand a cygwinified path. Ahh.
2259dc407927Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
22603eed67faSmbalmer      else
2261dc407927Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
22623eed67faSmbalmer      fi
22633eed67faSmbalmer      ;;
22643eed67faSmbalmer    pw32*)
22653eed67faSmbalmer      # pw32 DLLs use 'pw' prefix rather than 'lib'
22663eed67faSmbalmer      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
22673eed67faSmbalmer      ;;
22683eed67faSmbalmer    esac
22693eed67faSmbalmer    ;;
22703eed67faSmbalmer
22713eed67faSmbalmer  *)
22723eed67faSmbalmer    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
22733eed67faSmbalmer    ;;
22743eed67faSmbalmer  esac
22753eed67faSmbalmer  dynamic_linker='Win32 ld.exe'
22763eed67faSmbalmer  # FIXME: first we should search . and the directory the executable is in
22773eed67faSmbalmer  shlibpath_var=PATH
22783eed67faSmbalmer  ;;
22793eed67faSmbalmer
22803eed67faSmbalmerdarwin* | rhapsody*)
22813eed67faSmbalmer  dynamic_linker="$host_os dyld"
22823eed67faSmbalmer  version_type=darwin
22833eed67faSmbalmer  need_lib_prefix=no
22843eed67faSmbalmer  need_version=no
2285dc407927Smrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
22863eed67faSmbalmer  soname_spec='${libname}${release}${major}$shared_ext'
22873eed67faSmbalmer  shlibpath_overrides_runpath=yes
22883eed67faSmbalmer  shlibpath_var=DYLD_LIBRARY_PATH
22893eed67faSmbalmer  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2290dc407927Smrgm4_if([$1], [],[
2291dc407927Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
22923eed67faSmbalmer  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
22933eed67faSmbalmer  ;;
22943eed67faSmbalmer
22953eed67faSmbalmerdgux*)
22963eed67faSmbalmer  version_type=linux
22973eed67faSmbalmer  need_lib_prefix=no
22983eed67faSmbalmer  need_version=no
22993eed67faSmbalmer  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
23003eed67faSmbalmer  soname_spec='${libname}${release}${shared_ext}$major'
23013eed67faSmbalmer  shlibpath_var=LD_LIBRARY_PATH
23023eed67faSmbalmer  ;;
23033eed67faSmbalmer
23043eed67faSmbalmerfreebsd1*)
23053eed67faSmbalmer  dynamic_linker=no
23063eed67faSmbalmer  ;;
23073eed67faSmbalmer
23083eed67faSmbalmerfreebsd* | dragonfly*)
23093eed67faSmbalmer  # DragonFly does not have aout.  When/if they implement a new
23103eed67faSmbalmer  # versioning mechanism, adjust this.
23113eed67faSmbalmer  if test -x /usr/bin/objformat; then
23123eed67faSmbalmer    objformat=`/usr/bin/objformat`
23133eed67faSmbalmer  else
23143eed67faSmbalmer    case $host_os in
23153eed67faSmbalmer    freebsd[[123]]*) objformat=aout ;;
23163eed67faSmbalmer    *) objformat=elf ;;
23173eed67faSmbalmer    esac
23183eed67faSmbalmer  fi
23193eed67faSmbalmer  version_type=freebsd-$objformat
23203eed67faSmbalmer  case $version_type in
23213eed67faSmbalmer    freebsd-elf*)
23223eed67faSmbalmer      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
23233eed67faSmbalmer      need_version=no
23243eed67faSmbalmer      need_lib_prefix=no
23253eed67faSmbalmer      ;;
23263eed67faSmbalmer    freebsd-*)
23273eed67faSmbalmer      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
23283eed67faSmbalmer      need_version=yes
23293eed67faSmbalmer      ;;
23303eed67faSmbalmer  esac
23313eed67faSmbalmer  shlibpath_var=LD_LIBRARY_PATH
23323eed67faSmbalmer  case $host_os in
23333eed67faSmbalmer  freebsd2*)
23343eed67faSmbalmer    shlibpath_overrides_runpath=yes
23353eed67faSmbalmer    ;;
23363eed67faSmbalmer  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
23373eed67faSmbalmer    shlibpath_overrides_runpath=yes
23383eed67faSmbalmer    hardcode_into_libs=yes
23393eed67faSmbalmer    ;;
23403eed67faSmbalmer  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
23413eed67faSmbalmer  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
23423eed67faSmbalmer    shlibpath_overrides_runpath=no
23433eed67faSmbalmer    hardcode_into_libs=yes
23443eed67faSmbalmer    ;;
23453eed67faSmbalmer  *) # from 4.6 on, and DragonFly
23463eed67faSmbalmer    shlibpath_overrides_runpath=yes
23473eed67faSmbalmer    hardcode_into_libs=yes
23483eed67faSmbalmer    ;;
23493eed67faSmbalmer  esac
23503eed67faSmbalmer  ;;
23513eed67faSmbalmer
23523eed67faSmbalmergnu*)
23533eed67faSmbalmer  version_type=linux
23543eed67faSmbalmer  need_lib_prefix=no
23553eed67faSmbalmer  need_version=no
23563eed67faSmbalmer  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
23573eed67faSmbalmer  soname_spec='${libname}${release}${shared_ext}$major'
23583eed67faSmbalmer  shlibpath_var=LD_LIBRARY_PATH
23593eed67faSmbalmer  hardcode_into_libs=yes
23603eed67faSmbalmer  ;;
23613eed67faSmbalmer
23623eed67faSmbalmerhpux9* | hpux10* | hpux11*)
23633eed67faSmbalmer  # Give a soname corresponding to the major version so that dld.sl refuses to
23643eed67faSmbalmer  # link against other versions.
23653eed67faSmbalmer  version_type=sunos
23663eed67faSmbalmer  need_lib_prefix=no
23673eed67faSmbalmer  need_version=no
23683eed67faSmbalmer  case $host_cpu in
23693eed67faSmbalmer  ia64*)
23703eed67faSmbalmer    shrext_cmds='.so'
23713eed67faSmbalmer    hardcode_into_libs=yes
23723eed67faSmbalmer    dynamic_linker="$host_os dld.so"
23733eed67faSmbalmer    shlibpath_var=LD_LIBRARY_PATH
23743eed67faSmbalmer    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
23753eed67faSmbalmer    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
23763eed67faSmbalmer    soname_spec='${libname}${release}${shared_ext}$major'
23773eed67faSmbalmer    if test "X$HPUX_IA64_MODE" = X32; then
23783eed67faSmbalmer      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
23793eed67faSmbalmer    else
23803eed67faSmbalmer      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
23813eed67faSmbalmer    fi
23823eed67faSmbalmer    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
23833eed67faSmbalmer    ;;
2384dc407927Smrg  hppa*64*)
2385dc407927Smrg    shrext_cmds='.sl'
2386dc407927Smrg    hardcode_into_libs=yes
2387dc407927Smrg    dynamic_linker="$host_os dld.sl"
2388dc407927Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2389dc407927Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2390dc407927Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2391dc407927Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2392dc407927Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2393dc407927Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2394dc407927Smrg    ;;
2395dc407927Smrg  *)
23963eed67faSmbalmer    shrext_cmds='.sl'
23973eed67faSmbalmer    dynamic_linker="$host_os dld.sl"
23983eed67faSmbalmer    shlibpath_var=SHLIB_PATH
23993eed67faSmbalmer    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
24003eed67faSmbalmer    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
24013eed67faSmbalmer    soname_spec='${libname}${release}${shared_ext}$major'
24023eed67faSmbalmer    ;;
24033eed67faSmbalmer  esac
24043eed67faSmbalmer  # HP-UX runs *really* slowly unless shared libraries are mode 555.
24053eed67faSmbalmer  postinstall_cmds='chmod 555 $lib'
24063eed67faSmbalmer  ;;
24073eed67faSmbalmer
24083eed67faSmbalmerinterix[[3-9]]*)
24093eed67faSmbalmer  version_type=linux
24103eed67faSmbalmer  need_lib_prefix=no
24113eed67faSmbalmer  need_version=no
24123eed67faSmbalmer  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
24133eed67faSmbalmer  soname_spec='${libname}${release}${shared_ext}$major'
24143eed67faSmbalmer  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
24153eed67faSmbalmer  shlibpath_var=LD_LIBRARY_PATH
24163eed67faSmbalmer  shlibpath_overrides_runpath=no
24173eed67faSmbalmer  hardcode_into_libs=yes
24183eed67faSmbalmer  ;;
24193eed67faSmbalmer
24203eed67faSmbalmeririx5* | irix6* | nonstopux*)
24213eed67faSmbalmer  case $host_os in
24223eed67faSmbalmer    nonstopux*) version_type=nonstopux ;;
24233eed67faSmbalmer    *)
24243eed67faSmbalmer	if test "$lt_cv_prog_gnu_ld" = yes; then
24253eed67faSmbalmer		version_type=linux
24263eed67faSmbalmer	else
24273eed67faSmbalmer		version_type=irix
24283eed67faSmbalmer	fi ;;
24293eed67faSmbalmer  esac
24303eed67faSmbalmer  need_lib_prefix=no
24313eed67faSmbalmer  need_version=no
24323eed67faSmbalmer  soname_spec='${libname}${release}${shared_ext}$major'
24333eed67faSmbalmer  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
24343eed67faSmbalmer  case $host_os in
24353eed67faSmbalmer  irix5* | nonstopux*)
24363eed67faSmbalmer    libsuff= shlibsuff=
24373eed67faSmbalmer    ;;
24383eed67faSmbalmer  *)
24393eed67faSmbalmer    case $LD in # libtool.m4 will add one of these switches to LD
24403eed67faSmbalmer    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
24413eed67faSmbalmer      libsuff= shlibsuff= libmagic=32-bit;;
24423eed67faSmbalmer    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
24433eed67faSmbalmer      libsuff=32 shlibsuff=N32 libmagic=N32;;
24443eed67faSmbalmer    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
24453eed67faSmbalmer      libsuff=64 shlibsuff=64 libmagic=64-bit;;
24463eed67faSmbalmer    *) libsuff= shlibsuff= libmagic=never-match;;
24473eed67faSmbalmer    esac
24483eed67faSmbalmer    ;;
24493eed67faSmbalmer  esac
24503eed67faSmbalmer  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
24513eed67faSmbalmer  shlibpath_overrides_runpath=no
24523eed67faSmbalmer  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
24533eed67faSmbalmer  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
24543eed67faSmbalmer  hardcode_into_libs=yes
24553eed67faSmbalmer  ;;
24563eed67faSmbalmer
24573eed67faSmbalmer# No shared lib support for Linux oldld, aout, or coff.
24583eed67faSmbalmerlinux*oldld* | linux*aout* | linux*coff*)
24593eed67faSmbalmer  dynamic_linker=no
24603eed67faSmbalmer  ;;
24613eed67faSmbalmer
24623eed67faSmbalmer# This must be Linux ELF.
24633eed67faSmbalmerlinux* | k*bsd*-gnu)
24643eed67faSmbalmer  version_type=linux
24653eed67faSmbalmer  need_lib_prefix=no
24663eed67faSmbalmer  need_version=no
24673eed67faSmbalmer  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
24683eed67faSmbalmer  soname_spec='${libname}${release}${shared_ext}$major'
24693eed67faSmbalmer  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
24703eed67faSmbalmer  shlibpath_var=LD_LIBRARY_PATH
24713eed67faSmbalmer  shlibpath_overrides_runpath=no
2472dc407927Smrg  # Some binutils ld are patched to set DT_RUNPATH
2473dc407927Smrg  save_LDFLAGS=$LDFLAGS
2474dc407927Smrg  save_libdir=$libdir
2475dc407927Smrg  eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2476dc407927Smrg       LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2477dc407927Smrg  AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2478dc407927Smrg    [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2479dc407927Smrg       [shlibpath_overrides_runpath=yes])])
2480dc407927Smrg  LDFLAGS=$save_LDFLAGS
2481dc407927Smrg  libdir=$save_libdir
2482dc407927Smrg
24833eed67faSmbalmer  # This implies no fast_install, which is unacceptable.
24843eed67faSmbalmer  # Some rework will be needed to allow for fast_install
24853eed67faSmbalmer  # before this can be enabled.
24863eed67faSmbalmer  hardcode_into_libs=yes
24873eed67faSmbalmer
2488dc407927Smrg  # Add ABI-specific directories to the system library path.
2489dc407927Smrg  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
2490dc407927Smrg
24913eed67faSmbalmer  # Append ld.so.conf contents to the search path
24923eed67faSmbalmer  if test -f /etc/ld.so.conf; then
2493dc407927Smrg    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;/^$/d' | tr '\n' ' '`
2494dc407927Smrg    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
24953eed67faSmbalmer  fi
24963eed67faSmbalmer
24973eed67faSmbalmer  # We used to test for /lib/ld.so.1 and disable shared libraries on
24983eed67faSmbalmer  # powerpc, because MkLinux only supported shared libraries with the
24993eed67faSmbalmer  # GNU dynamic linker.  Since this was broken with cross compilers,
25003eed67faSmbalmer  # most powerpc-linux boxes support dynamic linking these days and
25013eed67faSmbalmer  # people can always --disable-shared, the test was removed, and we
25023eed67faSmbalmer  # assume the GNU/Linux dynamic linker is in use.
25033eed67faSmbalmer  dynamic_linker='GNU/Linux ld.so'
25043eed67faSmbalmer  ;;
25053eed67faSmbalmer
25063eed67faSmbalmernetbsd*)
25073eed67faSmbalmer  version_type=sunos
25083eed67faSmbalmer  need_lib_prefix=no
25093eed67faSmbalmer  need_version=no
2510dc407927Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
25113eed67faSmbalmer    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
25123eed67faSmbalmer    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
25133eed67faSmbalmer    dynamic_linker='NetBSD (a.out) ld.so'
25143eed67faSmbalmer  else
25153eed67faSmbalmer    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
25163eed67faSmbalmer    soname_spec='${libname}${release}${shared_ext}$major'
25173eed67faSmbalmer    dynamic_linker='NetBSD ld.elf_so'
25183eed67faSmbalmer  fi
25193eed67faSmbalmer  shlibpath_var=LD_LIBRARY_PATH
25203eed67faSmbalmer  shlibpath_overrides_runpath=yes
25213eed67faSmbalmer  hardcode_into_libs=yes
25223eed67faSmbalmer  ;;
25233eed67faSmbalmer
25243eed67faSmbalmernewsos6)
25253eed67faSmbalmer  version_type=linux
25263eed67faSmbalmer  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
25273eed67faSmbalmer  shlibpath_var=LD_LIBRARY_PATH
25283eed67faSmbalmer  shlibpath_overrides_runpath=yes
25293eed67faSmbalmer  ;;
25303eed67faSmbalmer
2531dc407927Smrg*nto* | *qnx*)
2532dc407927Smrg  version_type=qnx
25333eed67faSmbalmer  need_lib_prefix=no
25343eed67faSmbalmer  need_version=no
25353eed67faSmbalmer  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
25363eed67faSmbalmer  soname_spec='${libname}${release}${shared_ext}$major'
25373eed67faSmbalmer  shlibpath_var=LD_LIBRARY_PATH
2538dc407927Smrg  shlibpath_overrides_runpath=no
2539dc407927Smrg  hardcode_into_libs=yes
2540dc407927Smrg  dynamic_linker='ldqnx.so'
25413eed67faSmbalmer  ;;
25423eed67faSmbalmer
25433eed67faSmbalmeropenbsd*)
25443eed67faSmbalmer  version_type=sunos
25453eed67faSmbalmer  sys_lib_dlsearch_path_spec="/usr/lib"
25463eed67faSmbalmer  need_lib_prefix=no
25473eed67faSmbalmer  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
25483eed67faSmbalmer  case $host_os in
2549dc407927Smrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
2550dc407927Smrg    *)				need_version=no  ;;
25513eed67faSmbalmer  esac
25523eed67faSmbalmer  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
25533eed67faSmbalmer  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
25543eed67faSmbalmer  shlibpath_var=LD_LIBRARY_PATH
2555dc407927Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
25563eed67faSmbalmer    case $host_os in
25573eed67faSmbalmer      openbsd2.[[89]] | openbsd2.[[89]].*)
25583eed67faSmbalmer	shlibpath_overrides_runpath=no
25593eed67faSmbalmer	;;
25603eed67faSmbalmer      *)
25613eed67faSmbalmer	shlibpath_overrides_runpath=yes
25623eed67faSmbalmer	;;
25633eed67faSmbalmer      esac
25643eed67faSmbalmer  else
25653eed67faSmbalmer    shlibpath_overrides_runpath=yes
25663eed67faSmbalmer  fi
25673eed67faSmbalmer  ;;
25683eed67faSmbalmer
25693eed67faSmbalmeros2*)
25703eed67faSmbalmer  libname_spec='$name'
25713eed67faSmbalmer  shrext_cmds=".dll"
25723eed67faSmbalmer  need_lib_prefix=no
25733eed67faSmbalmer  library_names_spec='$libname${shared_ext} $libname.a'
25743eed67faSmbalmer  dynamic_linker='OS/2 ld.exe'
25753eed67faSmbalmer  shlibpath_var=LIBPATH
25763eed67faSmbalmer  ;;
25773eed67faSmbalmer
25783eed67faSmbalmerosf3* | osf4* | osf5*)
25793eed67faSmbalmer  version_type=osf
25803eed67faSmbalmer  need_lib_prefix=no
25813eed67faSmbalmer  need_version=no
25823eed67faSmbalmer  soname_spec='${libname}${release}${shared_ext}$major'
25833eed67faSmbalmer  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
25843eed67faSmbalmer  shlibpath_var=LD_LIBRARY_PATH
25853eed67faSmbalmer  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
25863eed67faSmbalmer  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
25873eed67faSmbalmer  ;;
25883eed67faSmbalmer
25893eed67faSmbalmerrdos*)
25903eed67faSmbalmer  dynamic_linker=no
25913eed67faSmbalmer  ;;
25923eed67faSmbalmer
25933eed67faSmbalmersolaris*)
25943eed67faSmbalmer  version_type=linux
25953eed67faSmbalmer  need_lib_prefix=no
25963eed67faSmbalmer  need_version=no
25973eed67faSmbalmer  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
25983eed67faSmbalmer  soname_spec='${libname}${release}${shared_ext}$major'
25993eed67faSmbalmer  shlibpath_var=LD_LIBRARY_PATH
26003eed67faSmbalmer  shlibpath_overrides_runpath=yes
26013eed67faSmbalmer  hardcode_into_libs=yes
26023eed67faSmbalmer  # ldd complains unless libraries are executable
26033eed67faSmbalmer  postinstall_cmds='chmod +x $lib'
26043eed67faSmbalmer  ;;
26053eed67faSmbalmer
26063eed67faSmbalmersunos4*)
26073eed67faSmbalmer  version_type=sunos
26083eed67faSmbalmer  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
26093eed67faSmbalmer  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
26103eed67faSmbalmer  shlibpath_var=LD_LIBRARY_PATH
26113eed67faSmbalmer  shlibpath_overrides_runpath=yes
26123eed67faSmbalmer  if test "$with_gnu_ld" = yes; then
26133eed67faSmbalmer    need_lib_prefix=no
26143eed67faSmbalmer  fi
26153eed67faSmbalmer  need_version=yes
26163eed67faSmbalmer  ;;
26173eed67faSmbalmer
26183eed67faSmbalmersysv4 | sysv4.3*)
26193eed67faSmbalmer  version_type=linux
26203eed67faSmbalmer  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
26213eed67faSmbalmer  soname_spec='${libname}${release}${shared_ext}$major'
26223eed67faSmbalmer  shlibpath_var=LD_LIBRARY_PATH
26233eed67faSmbalmer  case $host_vendor in
26243eed67faSmbalmer    sni)
26253eed67faSmbalmer      shlibpath_overrides_runpath=no
26263eed67faSmbalmer      need_lib_prefix=no
26273eed67faSmbalmer      runpath_var=LD_RUN_PATH
26283eed67faSmbalmer      ;;
26293eed67faSmbalmer    siemens)
26303eed67faSmbalmer      need_lib_prefix=no
26313eed67faSmbalmer      ;;
26323eed67faSmbalmer    motorola)
26333eed67faSmbalmer      need_lib_prefix=no
26343eed67faSmbalmer      need_version=no
26353eed67faSmbalmer      shlibpath_overrides_runpath=no
26363eed67faSmbalmer      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
26373eed67faSmbalmer      ;;
26383eed67faSmbalmer  esac
26393eed67faSmbalmer  ;;
26403eed67faSmbalmer
26413eed67faSmbalmersysv4*MP*)
26423eed67faSmbalmer  if test -d /usr/nec ;then
26433eed67faSmbalmer    version_type=linux
26443eed67faSmbalmer    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
26453eed67faSmbalmer    soname_spec='$libname${shared_ext}.$major'
26463eed67faSmbalmer    shlibpath_var=LD_LIBRARY_PATH
26473eed67faSmbalmer  fi
26483eed67faSmbalmer  ;;
26493eed67faSmbalmer
26503eed67faSmbalmersysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
26513eed67faSmbalmer  version_type=freebsd-elf
26523eed67faSmbalmer  need_lib_prefix=no
26533eed67faSmbalmer  need_version=no
26543eed67faSmbalmer  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
26553eed67faSmbalmer  soname_spec='${libname}${release}${shared_ext}$major'
26563eed67faSmbalmer  shlibpath_var=LD_LIBRARY_PATH
2657dc407927Smrg  shlibpath_overrides_runpath=yes
26583eed67faSmbalmer  hardcode_into_libs=yes
26593eed67faSmbalmer  if test "$with_gnu_ld" = yes; then
26603eed67faSmbalmer    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
26613eed67faSmbalmer  else
26623eed67faSmbalmer    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
26633eed67faSmbalmer    case $host_os in
26643eed67faSmbalmer      sco3.2v5*)
26653eed67faSmbalmer        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
26663eed67faSmbalmer	;;
26673eed67faSmbalmer    esac
26683eed67faSmbalmer  fi
26693eed67faSmbalmer  sys_lib_dlsearch_path_spec='/usr/lib'
26703eed67faSmbalmer  ;;
26713eed67faSmbalmer
2672dc407927Smrgtpf*)
2673dc407927Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
2674dc407927Smrg  version_type=linux
2675dc407927Smrg  need_lib_prefix=no
2676dc407927Smrg  need_version=no
2677dc407927Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2678dc407927Smrg  shlibpath_var=LD_LIBRARY_PATH
2679dc407927Smrg  shlibpath_overrides_runpath=no
2680dc407927Smrg  hardcode_into_libs=yes
2681dc407927Smrg  ;;
2682dc407927Smrg
26833eed67faSmbalmeruts4*)
26843eed67faSmbalmer  version_type=linux
26853eed67faSmbalmer  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
26863eed67faSmbalmer  soname_spec='${libname}${release}${shared_ext}$major'
26873eed67faSmbalmer  shlibpath_var=LD_LIBRARY_PATH
26883eed67faSmbalmer  ;;
26893eed67faSmbalmer
26903eed67faSmbalmer*)
26913eed67faSmbalmer  dynamic_linker=no
26923eed67faSmbalmer  ;;
26933eed67faSmbalmeresac
26943eed67faSmbalmerAC_MSG_RESULT([$dynamic_linker])
26953eed67faSmbalmertest "$dynamic_linker" = no && can_build_shared=no
26963eed67faSmbalmer
26973eed67faSmbalmervariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
26983eed67faSmbalmerif test "$GCC" = yes; then
26993eed67faSmbalmer  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
27003eed67faSmbalmerfi
27013eed67faSmbalmer
2702dc407927Smrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
2703dc407927Smrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
2704dc407927Smrgfi
2705dc407927Smrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
2706dc407927Smrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
2707dc407927Smrgfi
27083eed67faSmbalmer
2709dc407927Smrg_LT_DECL([], [variables_saved_for_relink], [1],
2710dc407927Smrg    [Variables whose values should be saved in libtool wrapper scripts and
2711dc407927Smrg    restored at link time])
2712dc407927Smrg_LT_DECL([], [need_lib_prefix], [0],
2713dc407927Smrg    [Do we need the "lib" prefix for modules?])
2714dc407927Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
2715dc407927Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
2716dc407927Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
2717dc407927Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
2718dc407927Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
2719dc407927Smrg    [Is shlibpath searched before the hard-coded library search path?])
2720dc407927Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
2721dc407927Smrg_LT_DECL([], [library_names_spec], [1],
2722dc407927Smrg    [[List of archive names.  First name is the real one, the rest are links.
2723dc407927Smrg    The last name is the one that the linker finds with -lNAME]])
2724dc407927Smrg_LT_DECL([], [soname_spec], [1],
2725dc407927Smrg    [[The coded name of the library, if different from the real name]])
2726dc407927Smrg_LT_DECL([], [postinstall_cmds], [2],
2727dc407927Smrg    [Command to use after installation of a shared archive])
2728dc407927Smrg_LT_DECL([], [postuninstall_cmds], [2],
2729dc407927Smrg    [Command to use after uninstallation of a shared archive])
2730dc407927Smrg_LT_DECL([], [finish_cmds], [2],
2731dc407927Smrg    [Commands used to finish a libtool library installation in a directory])
2732dc407927Smrg_LT_DECL([], [finish_eval], [1],
2733dc407927Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
2734dc407927Smrg    not shown]])
2735dc407927Smrg_LT_DECL([], [hardcode_into_libs], [0],
2736dc407927Smrg    [Whether we should hardcode library paths into libraries])
2737dc407927Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
2738dc407927Smrg    [Compile-time system search path for libraries])
2739dc407927Smrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
2740dc407927Smrg    [Run-time system search path for libraries])
2741dc407927Smrg])# _LT_SYS_DYNAMIC_LINKER
2742dc407927Smrg
2743dc407927Smrg
2744dc407927Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
27453eed67faSmbalmer# --------------------------
27463eed67faSmbalmer# find a file program which can recognize shared library
2747dc407927SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
2748dc407927Smrg[m4_require([_LT_DECL_EGREP])dnl
27493eed67faSmbalmerAC_MSG_CHECKING([for $1])
27503eed67faSmbalmerAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
27513eed67faSmbalmer[case $MAGIC_CMD in
27523eed67faSmbalmer[[\\/*] |  ?:[\\/]*])
27533eed67faSmbalmer  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
27543eed67faSmbalmer  ;;
27553eed67faSmbalmer*)
27563eed67faSmbalmer  lt_save_MAGIC_CMD="$MAGIC_CMD"
27573eed67faSmbalmer  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
27583eed67faSmbalmerdnl $ac_dummy forces splitting on constant user-supplied paths.
27593eed67faSmbalmerdnl POSIX.2 word splitting is done only on the output of word expansions,
27603eed67faSmbalmerdnl not every word.  This closes a longstanding sh security hole.
2761dc407927Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
27623eed67faSmbalmer  for ac_dir in $ac_dummy; do
27633eed67faSmbalmer    IFS="$lt_save_ifs"
27643eed67faSmbalmer    test -z "$ac_dir" && ac_dir=.
27653eed67faSmbalmer    if test -f $ac_dir/$1; then
27663eed67faSmbalmer      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
27673eed67faSmbalmer      if test -n "$file_magic_test_file"; then
27683eed67faSmbalmer	case $deplibs_check_method in
27693eed67faSmbalmer	"file_magic "*)
27703eed67faSmbalmer	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
27713eed67faSmbalmer	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
27723eed67faSmbalmer	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
27733eed67faSmbalmer	    $EGREP "$file_magic_regex" > /dev/null; then
27743eed67faSmbalmer	    :
27753eed67faSmbalmer	  else
2776dc407927Smrg	    cat <<_LT_EOF 1>&2
27773eed67faSmbalmer
27783eed67faSmbalmer*** Warning: the command libtool uses to detect shared libraries,
27793eed67faSmbalmer*** $file_magic_cmd, produces output that libtool cannot recognize.
27803eed67faSmbalmer*** The result is that libtool may fail to recognize shared libraries
27813eed67faSmbalmer*** as such.  This will affect the creation of libtool libraries that
27823eed67faSmbalmer*** depend on shared libraries, but programs linked with such libtool
27833eed67faSmbalmer*** libraries will work regardless of this problem.  Nevertheless, you
27843eed67faSmbalmer*** may want to report the problem to your system manager and/or to
27853eed67faSmbalmer*** bug-libtool@gnu.org
27863eed67faSmbalmer
2787dc407927Smrg_LT_EOF
27883eed67faSmbalmer	  fi ;;
27893eed67faSmbalmer	esac
27903eed67faSmbalmer      fi
27913eed67faSmbalmer      break
27923eed67faSmbalmer    fi
27933eed67faSmbalmer  done
27943eed67faSmbalmer  IFS="$lt_save_ifs"
27953eed67faSmbalmer  MAGIC_CMD="$lt_save_MAGIC_CMD"
27963eed67faSmbalmer  ;;
27973eed67faSmbalmeresac])
27983eed67faSmbalmerMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
27993eed67faSmbalmerif test -n "$MAGIC_CMD"; then
28003eed67faSmbalmer  AC_MSG_RESULT($MAGIC_CMD)
28013eed67faSmbalmerelse
28023eed67faSmbalmer  AC_MSG_RESULT(no)
28033eed67faSmbalmerfi
2804dc407927Smrg_LT_DECL([], [MAGIC_CMD], [0],
2805dc407927Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
2806dc407927Smrg])# _LT_PATH_TOOL_PREFIX
28073eed67faSmbalmer
2808dc407927Smrg# Old name:
2809dc407927SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
2810dc407927Smrgdnl aclocal-1.4 backwards compatibility:
2811dc407927Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
28123eed67faSmbalmer
2813dc407927Smrg
2814dc407927Smrg# _LT_PATH_MAGIC
2815dc407927Smrg# --------------
28163eed67faSmbalmer# find a file program which can recognize a shared library
2817dc407927Smrgm4_defun([_LT_PATH_MAGIC],
2818dc407927Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
28193eed67faSmbalmerif test -z "$lt_cv_path_MAGIC_CMD"; then
28203eed67faSmbalmer  if test -n "$ac_tool_prefix"; then
2821dc407927Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
28223eed67faSmbalmer  else
28233eed67faSmbalmer    MAGIC_CMD=:
28243eed67faSmbalmer  fi
28253eed67faSmbalmerfi
2826dc407927Smrg])# _LT_PATH_MAGIC
28273eed67faSmbalmer
28283eed67faSmbalmer
2829dc407927Smrg# LT_PATH_LD
28303eed67faSmbalmer# ----------
28313eed67faSmbalmer# find the pathname to the GNU or non-GNU linker
2832dc407927SmrgAC_DEFUN([LT_PATH_LD],
2833dc407927Smrg[AC_REQUIRE([AC_PROG_CC])dnl
28343eed67faSmbalmerAC_REQUIRE([AC_CANONICAL_HOST])dnl
28353eed67faSmbalmerAC_REQUIRE([AC_CANONICAL_BUILD])dnl
2836dc407927Smrgm4_require([_LT_DECL_SED])dnl
2837dc407927Smrgm4_require([_LT_DECL_EGREP])dnl
2838dc407927Smrg
2839dc407927SmrgAC_ARG_WITH([gnu-ld],
2840dc407927Smrg    [AS_HELP_STRING([--with-gnu-ld],
2841dc407927Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
2842dc407927Smrg    [test "$withval" = no || with_gnu_ld=yes],
2843dc407927Smrg    [with_gnu_ld=no])dnl
2844dc407927Smrg
28453eed67faSmbalmerac_prog=ld
28463eed67faSmbalmerif test "$GCC" = yes; then
28473eed67faSmbalmer  # Check if gcc -print-prog-name=ld gives a path.
28483eed67faSmbalmer  AC_MSG_CHECKING([for ld used by $CC])
28493eed67faSmbalmer  case $host in
28503eed67faSmbalmer  *-*-mingw*)
28513eed67faSmbalmer    # gcc leaves a trailing carriage return which upsets mingw
28523eed67faSmbalmer    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
28533eed67faSmbalmer  *)
28543eed67faSmbalmer    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
28553eed67faSmbalmer  esac
28563eed67faSmbalmer  case $ac_prog in
28573eed67faSmbalmer    # Accept absolute paths.
28583eed67faSmbalmer    [[\\/]]* | ?:[[\\/]]*)
28593eed67faSmbalmer      re_direlt='/[[^/]][[^/]]*/\.\./'
28603eed67faSmbalmer      # Canonicalize the pathname of ld
2861dc407927Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
2862dc407927Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
2863dc407927Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
28643eed67faSmbalmer      done
28653eed67faSmbalmer      test -z "$LD" && LD="$ac_prog"
28663eed67faSmbalmer      ;;
28673eed67faSmbalmer  "")
28683eed67faSmbalmer    # If it fails, then pretend we aren't using GCC.
28693eed67faSmbalmer    ac_prog=ld
28703eed67faSmbalmer    ;;
28713eed67faSmbalmer  *)
28723eed67faSmbalmer    # If it is relative, then search for the first ld in PATH.
28733eed67faSmbalmer    with_gnu_ld=unknown
28743eed67faSmbalmer    ;;
28753eed67faSmbalmer  esac
28763eed67faSmbalmerelif test "$with_gnu_ld" = yes; then
28773eed67faSmbalmer  AC_MSG_CHECKING([for GNU ld])
28783eed67faSmbalmerelse
28793eed67faSmbalmer  AC_MSG_CHECKING([for non-GNU ld])
28803eed67faSmbalmerfi
28813eed67faSmbalmerAC_CACHE_VAL(lt_cv_path_LD,
28823eed67faSmbalmer[if test -z "$LD"; then
28833eed67faSmbalmer  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
28843eed67faSmbalmer  for ac_dir in $PATH; do
28853eed67faSmbalmer    IFS="$lt_save_ifs"
28863eed67faSmbalmer    test -z "$ac_dir" && ac_dir=.
28873eed67faSmbalmer    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
28883eed67faSmbalmer      lt_cv_path_LD="$ac_dir/$ac_prog"
28893eed67faSmbalmer      # Check to see if the program is GNU ld.  I'd rather use --version,
28903eed67faSmbalmer      # but apparently some variants of GNU ld only accept -v.
28913eed67faSmbalmer      # Break only if it was the GNU/non-GNU ld that we prefer.
28923eed67faSmbalmer      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
28933eed67faSmbalmer      *GNU* | *'with BFD'*)
28943eed67faSmbalmer	test "$with_gnu_ld" != no && break
28953eed67faSmbalmer	;;
28963eed67faSmbalmer      *)
28973eed67faSmbalmer	test "$with_gnu_ld" != yes && break
28983eed67faSmbalmer	;;
28993eed67faSmbalmer      esac
29003eed67faSmbalmer    fi
29013eed67faSmbalmer  done
29023eed67faSmbalmer  IFS="$lt_save_ifs"
29033eed67faSmbalmerelse
29043eed67faSmbalmer  lt_cv_path_LD="$LD" # Let the user override the test with a path.
29053eed67faSmbalmerfi])
29063eed67faSmbalmerLD="$lt_cv_path_LD"
29073eed67faSmbalmerif test -n "$LD"; then
29083eed67faSmbalmer  AC_MSG_RESULT($LD)
29093eed67faSmbalmerelse
29103eed67faSmbalmer  AC_MSG_RESULT(no)
29113eed67faSmbalmerfi
29123eed67faSmbalmertest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2913dc407927Smrg_LT_PATH_LD_GNU
2914dc407927SmrgAC_SUBST([LD])
29153eed67faSmbalmer
2916dc407927Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
2917dc407927Smrg])# LT_PATH_LD
29183eed67faSmbalmer
2919dc407927Smrg# Old names:
2920dc407927SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
2921dc407927SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
2922dc407927Smrgdnl aclocal-1.4 backwards compatibility:
2923dc407927Smrgdnl AC_DEFUN([AM_PROG_LD], [])
2924dc407927Smrgdnl AC_DEFUN([AC_PROG_LD], [])
2925dc407927Smrg
2926dc407927Smrg
2927dc407927Smrg# _LT_PATH_LD_GNU
2928dc407927Smrg#- --------------
2929dc407927Smrgm4_defun([_LT_PATH_LD_GNU],
2930dc407927Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
29313eed67faSmbalmer[# I'd rather use --version here, but apparently some GNU lds only accept -v.
29323eed67faSmbalmercase `$LD -v 2>&1 </dev/null` in
29333eed67faSmbalmer*GNU* | *'with BFD'*)
29343eed67faSmbalmer  lt_cv_prog_gnu_ld=yes
29353eed67faSmbalmer  ;;
29363eed67faSmbalmer*)
29373eed67faSmbalmer  lt_cv_prog_gnu_ld=no
29383eed67faSmbalmer  ;;
29393eed67faSmbalmeresac])
29403eed67faSmbalmerwith_gnu_ld=$lt_cv_prog_gnu_ld
2941dc407927Smrg])# _LT_PATH_LD_GNU
29423eed67faSmbalmer
29433eed67faSmbalmer
2944dc407927Smrg# _LT_CMD_RELOAD
2945dc407927Smrg# --------------
29463eed67faSmbalmer# find reload flag for linker
29473eed67faSmbalmer#   -- PORTME Some linkers may need a different reload flag.
2948dc407927Smrgm4_defun([_LT_CMD_RELOAD],
29493eed67faSmbalmer[AC_CACHE_CHECK([for $LD option to reload object files],
29503eed67faSmbalmer  lt_cv_ld_reload_flag,
29513eed67faSmbalmer  [lt_cv_ld_reload_flag='-r'])
29523eed67faSmbalmerreload_flag=$lt_cv_ld_reload_flag
29533eed67faSmbalmercase $reload_flag in
29543eed67faSmbalmer"" | " "*) ;;
29553eed67faSmbalmer*) reload_flag=" $reload_flag" ;;
29563eed67faSmbalmeresac
29573eed67faSmbalmerreload_cmds='$LD$reload_flag -o $output$reload_objs'
29583eed67faSmbalmercase $host_os in
29593eed67faSmbalmer  darwin*)
29603eed67faSmbalmer    if test "$GCC" = yes; then
29613eed67faSmbalmer      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
29623eed67faSmbalmer    else
29633eed67faSmbalmer      reload_cmds='$LD$reload_flag -o $output$reload_objs'
29643eed67faSmbalmer    fi
29653eed67faSmbalmer    ;;
29663eed67faSmbalmeresac
2967dc407927Smrg_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
2968dc407927Smrg_LT_DECL([], [reload_cmds], [2])dnl
2969dc407927Smrg])# _LT_CMD_RELOAD
29703eed67faSmbalmer
29713eed67faSmbalmer
2972dc407927Smrg# _LT_CHECK_MAGIC_METHOD
2973dc407927Smrg# ----------------------
29743eed67faSmbalmer# how to check for library dependencies
29753eed67faSmbalmer#  -- PORTME fill in with the dynamic library characteristics
2976dc407927Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
2977dc407927Smrg[m4_require([_LT_DECL_EGREP])
2978dc407927Smrgm4_require([_LT_DECL_OBJDUMP])
2979dc407927SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
29803eed67faSmbalmerlt_cv_deplibs_check_method,
29813eed67faSmbalmer[lt_cv_file_magic_cmd='$MAGIC_CMD'
29823eed67faSmbalmerlt_cv_file_magic_test_file=
29833eed67faSmbalmerlt_cv_deplibs_check_method='unknown'
29843eed67faSmbalmer# Need to set the preceding variable on all platforms that support
29853eed67faSmbalmer# interlibrary dependencies.
29863eed67faSmbalmer# 'none' -- dependencies not supported.
29873eed67faSmbalmer# `unknown' -- same as none, but documents that we really don't know.
29883eed67faSmbalmer# 'pass_all' -- all dependencies passed with no checks.
29893eed67faSmbalmer# 'test_compile' -- check by making test program.
29903eed67faSmbalmer# 'file_magic [[regex]]' -- check by looking for files in library path
29913eed67faSmbalmer# which responds to the $file_magic_cmd with a given extended regex.
29923eed67faSmbalmer# If you have `file' or equivalent on your system and you're not sure
29933eed67faSmbalmer# whether `pass_all' will *always* work, you probably want this one.
29943eed67faSmbalmer
29953eed67faSmbalmercase $host_os in
29963eed67faSmbalmeraix[[4-9]]*)
29973eed67faSmbalmer  lt_cv_deplibs_check_method=pass_all
29983eed67faSmbalmer  ;;
29993eed67faSmbalmer
30003eed67faSmbalmerbeos*)
30013eed67faSmbalmer  lt_cv_deplibs_check_method=pass_all
30023eed67faSmbalmer  ;;
30033eed67faSmbalmer
30043eed67faSmbalmerbsdi[[45]]*)
30053eed67faSmbalmer  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
30063eed67faSmbalmer  lt_cv_file_magic_cmd='/usr/bin/file -L'
30073eed67faSmbalmer  lt_cv_file_magic_test_file=/shlib/libc.so
30083eed67faSmbalmer  ;;
30093eed67faSmbalmer
30103eed67faSmbalmercygwin*)
30113eed67faSmbalmer  # func_win32_libid is a shell function defined in ltmain.sh
30123eed67faSmbalmer  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
30133eed67faSmbalmer  lt_cv_file_magic_cmd='func_win32_libid'
30143eed67faSmbalmer  ;;
30153eed67faSmbalmer
30163eed67faSmbalmermingw* | pw32*)
30173eed67faSmbalmer  # Base MSYS/MinGW do not provide the 'file' command needed by
30183eed67faSmbalmer  # func_win32_libid shell function, so use a weaker test based on 'objdump',
30193eed67faSmbalmer  # unless we find 'file', for example because we are cross-compiling.
30203eed67faSmbalmer  if ( file / ) >/dev/null 2>&1; then
30213eed67faSmbalmer    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
30223eed67faSmbalmer    lt_cv_file_magic_cmd='func_win32_libid'
30233eed67faSmbalmer  else
30243eed67faSmbalmer    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
30253eed67faSmbalmer    lt_cv_file_magic_cmd='$OBJDUMP -f'
30263eed67faSmbalmer  fi
30273eed67faSmbalmer  ;;
30283eed67faSmbalmer
3029dc407927Smrgcegcc)
3030dc407927Smrg  # use the weaker test based on 'objdump'. See mingw*.
3031dc407927Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3032dc407927Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
3033dc407927Smrg  ;;
3034dc407927Smrg
30353eed67faSmbalmerdarwin* | rhapsody*)
30363eed67faSmbalmer  lt_cv_deplibs_check_method=pass_all
30373eed67faSmbalmer  ;;
30383eed67faSmbalmer
30393eed67faSmbalmerfreebsd* | dragonfly*)
3040dc407927Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
30413eed67faSmbalmer    case $host_cpu in
30423eed67faSmbalmer    i*86 )
30433eed67faSmbalmer      # Not sure whether the presence of OpenBSD here was a mistake.
30443eed67faSmbalmer      # Let's accept both of them until this is cleared up.
30453eed67faSmbalmer      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
30463eed67faSmbalmer      lt_cv_file_magic_cmd=/usr/bin/file
30473eed67faSmbalmer      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
30483eed67faSmbalmer      ;;
30493eed67faSmbalmer    esac
30503eed67faSmbalmer  else
30513eed67faSmbalmer    lt_cv_deplibs_check_method=pass_all
30523eed67faSmbalmer  fi
30533eed67faSmbalmer  ;;
30543eed67faSmbalmer
30553eed67faSmbalmergnu*)
30563eed67faSmbalmer  lt_cv_deplibs_check_method=pass_all
30573eed67faSmbalmer  ;;
30583eed67faSmbalmer
30593eed67faSmbalmerhpux10.20* | hpux11*)
30603eed67faSmbalmer  lt_cv_file_magic_cmd=/usr/bin/file
30613eed67faSmbalmer  case $host_cpu in
30623eed67faSmbalmer  ia64*)
30633eed67faSmbalmer    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
30643eed67faSmbalmer    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
30653eed67faSmbalmer    ;;
30663eed67faSmbalmer  hppa*64*)
30673eed67faSmbalmer    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
30683eed67faSmbalmer    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
30693eed67faSmbalmer    ;;
30703eed67faSmbalmer  *)
30713eed67faSmbalmer    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
30723eed67faSmbalmer    lt_cv_file_magic_test_file=/usr/lib/libc.sl
30733eed67faSmbalmer    ;;
30743eed67faSmbalmer  esac
30753eed67faSmbalmer  ;;
30763eed67faSmbalmer
30773eed67faSmbalmerinterix[[3-9]]*)
30783eed67faSmbalmer  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
30793eed67faSmbalmer  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
30803eed67faSmbalmer  ;;
30813eed67faSmbalmer
30823eed67faSmbalmeririx5* | irix6* | nonstopux*)
30833eed67faSmbalmer  case $LD in
30843eed67faSmbalmer  *-32|*"-32 ") libmagic=32-bit;;
30853eed67faSmbalmer  *-n32|*"-n32 ") libmagic=N32;;
30863eed67faSmbalmer  *-64|*"-64 ") libmagic=64-bit;;
30873eed67faSmbalmer  *) libmagic=never-match;;
30883eed67faSmbalmer  esac
30893eed67faSmbalmer  lt_cv_deplibs_check_method=pass_all
30903eed67faSmbalmer  ;;
30913eed67faSmbalmer
30923eed67faSmbalmer# This must be Linux ELF.
30933eed67faSmbalmerlinux* | k*bsd*-gnu)
30943eed67faSmbalmer  lt_cv_deplibs_check_method=pass_all
30953eed67faSmbalmer  ;;
30963eed67faSmbalmer
30973eed67faSmbalmernetbsd*)
3098dc407927Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
30993eed67faSmbalmer    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
31003eed67faSmbalmer  else
31013eed67faSmbalmer    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
31023eed67faSmbalmer  fi
31033eed67faSmbalmer  ;;
31043eed67faSmbalmer
31053eed67faSmbalmernewos6*)
31063eed67faSmbalmer  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
31073eed67faSmbalmer  lt_cv_file_magic_cmd=/usr/bin/file
31083eed67faSmbalmer  lt_cv_file_magic_test_file=/usr/lib/libnls.so
31093eed67faSmbalmer  ;;
31103eed67faSmbalmer
3111dc407927Smrg*nto* | *qnx*)
3112dc407927Smrg  lt_cv_deplibs_check_method=pass_all
31133eed67faSmbalmer  ;;
31143eed67faSmbalmer
31153eed67faSmbalmeropenbsd*)
3116dc407927Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
31173eed67faSmbalmer    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
31183eed67faSmbalmer  else
31193eed67faSmbalmer    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
31203eed67faSmbalmer  fi
31213eed67faSmbalmer  ;;
31223eed67faSmbalmer
31233eed67faSmbalmerosf3* | osf4* | osf5*)
31243eed67faSmbalmer  lt_cv_deplibs_check_method=pass_all
31253eed67faSmbalmer  ;;
31263eed67faSmbalmer
31273eed67faSmbalmerrdos*)
31283eed67faSmbalmer  lt_cv_deplibs_check_method=pass_all
31293eed67faSmbalmer  ;;
31303eed67faSmbalmer
31313eed67faSmbalmersolaris*)
31323eed67faSmbalmer  lt_cv_deplibs_check_method=pass_all
31333eed67faSmbalmer  ;;
31343eed67faSmbalmer
3135dc407927Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3136dc407927Smrg  lt_cv_deplibs_check_method=pass_all
3137dc407927Smrg  ;;
3138dc407927Smrg
31393eed67faSmbalmersysv4 | sysv4.3*)
31403eed67faSmbalmer  case $host_vendor in
31413eed67faSmbalmer  motorola)
31423eed67faSmbalmer    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]]'
31433eed67faSmbalmer    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
31443eed67faSmbalmer    ;;
31453eed67faSmbalmer  ncr)
31463eed67faSmbalmer    lt_cv_deplibs_check_method=pass_all
31473eed67faSmbalmer    ;;
31483eed67faSmbalmer  sequent)
31493eed67faSmbalmer    lt_cv_file_magic_cmd='/bin/file'
31503eed67faSmbalmer    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
31513eed67faSmbalmer    ;;
31523eed67faSmbalmer  sni)
31533eed67faSmbalmer    lt_cv_file_magic_cmd='/bin/file'
31543eed67faSmbalmer    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
31553eed67faSmbalmer    lt_cv_file_magic_test_file=/lib/libc.so
31563eed67faSmbalmer    ;;
31573eed67faSmbalmer  siemens)
31583eed67faSmbalmer    lt_cv_deplibs_check_method=pass_all
31593eed67faSmbalmer    ;;
31603eed67faSmbalmer  pc)
31613eed67faSmbalmer    lt_cv_deplibs_check_method=pass_all
31623eed67faSmbalmer    ;;
31633eed67faSmbalmer  esac
31643eed67faSmbalmer  ;;
31653eed67faSmbalmer
3166dc407927Smrgtpf*)
31673eed67faSmbalmer  lt_cv_deplibs_check_method=pass_all
31683eed67faSmbalmer  ;;
31693eed67faSmbalmeresac
31703eed67faSmbalmer])
31713eed67faSmbalmerfile_magic_cmd=$lt_cv_file_magic_cmd
31723eed67faSmbalmerdeplibs_check_method=$lt_cv_deplibs_check_method
31733eed67faSmbalmertest -z "$deplibs_check_method" && deplibs_check_method=unknown
31743eed67faSmbalmer
3175dc407927Smrg_LT_DECL([], [deplibs_check_method], [1],
3176dc407927Smrg    [Method to check whether dependent libraries are shared objects])
3177dc407927Smrg_LT_DECL([], [file_magic_cmd], [1],
3178dc407927Smrg    [Command to use when deplibs_check_method == "file_magic"])
3179dc407927Smrg])# _LT_CHECK_MAGIC_METHOD
31803eed67faSmbalmer
3181dc407927Smrg
3182dc407927Smrg# LT_PATH_NM
31833eed67faSmbalmer# ----------
3184dc407927Smrg# find the pathname to a BSD- or MS-compatible name lister
3185dc407927SmrgAC_DEFUN([LT_PATH_NM],
3186dc407927Smrg[AC_REQUIRE([AC_PROG_CC])dnl
3187dc407927SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
31883eed67faSmbalmer[if test -n "$NM"; then
31893eed67faSmbalmer  # Let the user override the test.
31903eed67faSmbalmer  lt_cv_path_NM="$NM"
31913eed67faSmbalmerelse
31923eed67faSmbalmer  lt_nm_to_check="${ac_tool_prefix}nm"
31933eed67faSmbalmer  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
31943eed67faSmbalmer    lt_nm_to_check="$lt_nm_to_check nm"
31953eed67faSmbalmer  fi
31963eed67faSmbalmer  for lt_tmp_nm in $lt_nm_to_check; do
31973eed67faSmbalmer    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
31983eed67faSmbalmer    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
31993eed67faSmbalmer      IFS="$lt_save_ifs"
32003eed67faSmbalmer      test -z "$ac_dir" && ac_dir=.
32013eed67faSmbalmer      tmp_nm="$ac_dir/$lt_tmp_nm"
32023eed67faSmbalmer      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
32033eed67faSmbalmer	# Check to see if the nm accepts a BSD-compat flag.
32043eed67faSmbalmer	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
32053eed67faSmbalmer	#   nm: unknown option "B" ignored
32063eed67faSmbalmer	# Tru64's nm complains that /dev/null is an invalid object file
32073eed67faSmbalmer	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
32083eed67faSmbalmer	*/dev/null* | *'Invalid file or object type'*)
32093eed67faSmbalmer	  lt_cv_path_NM="$tmp_nm -B"
32103eed67faSmbalmer	  break
32113eed67faSmbalmer	  ;;
32123eed67faSmbalmer	*)
32133eed67faSmbalmer	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
32143eed67faSmbalmer	  */dev/null*)
32153eed67faSmbalmer	    lt_cv_path_NM="$tmp_nm -p"
32163eed67faSmbalmer	    break
32173eed67faSmbalmer	    ;;
32183eed67faSmbalmer	  *)
32193eed67faSmbalmer	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
32203eed67faSmbalmer	    continue # so that we can try to find one that supports BSD flags
32213eed67faSmbalmer	    ;;
32223eed67faSmbalmer	  esac
32233eed67faSmbalmer	  ;;
32243eed67faSmbalmer	esac
32253eed67faSmbalmer      fi
32263eed67faSmbalmer    done
32273eed67faSmbalmer    IFS="$lt_save_ifs"
32283eed67faSmbalmer  done
3229dc407927Smrg  : ${lt_cv_path_NM=no}
32303eed67faSmbalmerfi])
3231dc407927Smrgif test "$lt_cv_path_NM" != "no"; then
3232dc407927Smrg  NM="$lt_cv_path_NM"
3233dc407927Smrgelse
3234dc407927Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
3235dc407927Smrg  AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
3236dc407927Smrg  AC_SUBST([DUMPBIN])
3237dc407927Smrg  if test "$DUMPBIN" != ":"; then
3238dc407927Smrg    NM="$DUMPBIN"
3239dc407927Smrg  fi
3240dc407927Smrgfi
3241dc407927Smrgtest -z "$NM" && NM=nm
3242dc407927SmrgAC_SUBST([NM])
3243dc407927Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3244dc407927Smrg
3245dc407927SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3246dc407927Smrg  [lt_cv_nm_interface="BSD nm"
3247dc407927Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
3248dc407927Smrg  (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3249dc407927Smrg  (eval "$ac_compile" 2>conftest.err)
3250dc407927Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3251dc407927Smrg  (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3252dc407927Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3253dc407927Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3254dc407927Smrg  (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
3255dc407927Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
3256dc407927Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3257dc407927Smrg    lt_cv_nm_interface="MS dumpbin"
3258dc407927Smrg  fi
3259dc407927Smrg  rm -f conftest*])
3260dc407927Smrg])# LT_PATH_NM
32613eed67faSmbalmer
3262dc407927Smrg# Old names:
3263dc407927SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3264dc407927SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3265dc407927Smrgdnl aclocal-1.4 backwards compatibility:
3266dc407927Smrgdnl AC_DEFUN([AM_PROG_NM], [])
3267dc407927Smrgdnl AC_DEFUN([AC_PROG_NM], [])
32683eed67faSmbalmer
3269dc407927Smrg
3270dc407927Smrg# LT_LIB_M
3271dc407927Smrg# --------
32723eed67faSmbalmer# check for math library
3273dc407927SmrgAC_DEFUN([LT_LIB_M],
32743eed67faSmbalmer[AC_REQUIRE([AC_CANONICAL_HOST])dnl
32753eed67faSmbalmerLIBM=
32763eed67faSmbalmercase $host in
32773eed67faSmbalmer*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
32783eed67faSmbalmer  # These system don't have libm, or don't need it
32793eed67faSmbalmer  ;;
32803eed67faSmbalmer*-ncr-sysv4.3*)
32813eed67faSmbalmer  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
32823eed67faSmbalmer  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
32833eed67faSmbalmer  ;;
32843eed67faSmbalmer*)
32853eed67faSmbalmer  AC_CHECK_LIB(m, cos, LIBM="-lm")
32863eed67faSmbalmer  ;;
32873eed67faSmbalmeresac
3288dc407927SmrgAC_SUBST([LIBM])
3289dc407927Smrg])# LT_LIB_M
32903eed67faSmbalmer
3291dc407927Smrg# Old name:
3292dc407927SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3293dc407927Smrgdnl aclocal-1.4 backwards compatibility:
3294dc407927Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
32953eed67faSmbalmer
32963eed67faSmbalmer
3297dc407927Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
3298dc407927Smrg# -------------------------------
3299dc407927Smrgm4_defun([_LT_COMPILER_NO_RTTI],
3300dc407927Smrg[m4_require([_LT_TAG_COMPILER])dnl
33013eed67faSmbalmer
3302dc407927Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
33033eed67faSmbalmer
3304dc407927Smrgif test "$GCC" = yes; then
3305dc407927Smrg  _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
33063eed67faSmbalmer
3307dc407927Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3308dc407927Smrg    lt_cv_prog_compiler_rtti_exceptions,
3309dc407927Smrg    [-fno-rtti -fno-exceptions], [],
3310dc407927Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3311dc407927Smrgfi
3312dc407927Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3313dc407927Smrg	[Compiler flag to turn off builtin functions])
3314dc407927Smrg])# _LT_COMPILER_NO_RTTI
33153eed67faSmbalmer
33163eed67faSmbalmer
3317dc407927Smrg# _LT_CMD_GLOBAL_SYMBOLS
3318dc407927Smrg# ----------------------
3319dc407927Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3320dc407927Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3321dc407927SmrgAC_REQUIRE([AC_PROG_CC])dnl
3322dc407927SmrgAC_REQUIRE([LT_PATH_NM])dnl
3323dc407927SmrgAC_REQUIRE([LT_PATH_LD])dnl
3324dc407927Smrgm4_require([_LT_DECL_SED])dnl
3325dc407927Smrgm4_require([_LT_DECL_EGREP])dnl
3326dc407927Smrgm4_require([_LT_TAG_COMPILER])dnl
33273eed67faSmbalmer
3328dc407927Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
3329dc407927SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
3330dc407927SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
33313eed67faSmbalmer[
3332dc407927Smrg# These are sane defaults that work on at least a few old systems.
3333dc407927Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
33343eed67faSmbalmer
3335dc407927Smrg# Character class describing NM global symbol codes.
3336dc407927Smrgsymcode='[[BCDEGRST]]'
33373eed67faSmbalmer
3338dc407927Smrg# Regexp to match symbols that can be accessed directly from C.
3339dc407927Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
33403eed67faSmbalmer
3341dc407927Smrg# Define system-specific variables.
3342dc407927Smrgcase $host_os in
3343dc407927Smrgaix*)
3344dc407927Smrg  symcode='[[BCDT]]'
3345dc407927Smrg  ;;
3346dc407927Smrgcygwin* | mingw* | pw32* | cegcc*)
3347dc407927Smrg  symcode='[[ABCDGISTW]]'
3348dc407927Smrg  ;;
3349dc407927Smrghpux*)
3350dc407927Smrg  if test "$host_cpu" = ia64; then
3351dc407927Smrg    symcode='[[ABCDEGRST]]'
3352dc407927Smrg  fi
3353dc407927Smrg  ;;
3354dc407927Smrgirix* | nonstopux*)
3355dc407927Smrg  symcode='[[BCDEGRST]]'
3356dc407927Smrg  ;;
3357dc407927Smrgosf*)
3358dc407927Smrg  symcode='[[BCDEGQRST]]'
3359dc407927Smrg  ;;
3360dc407927Smrgsolaris*)
3361dc407927Smrg  symcode='[[BDRT]]'
3362dc407927Smrg  ;;
3363dc407927Smrgsco3.2v5*)
3364dc407927Smrg  symcode='[[DT]]'
3365dc407927Smrg  ;;
3366dc407927Smrgsysv4.2uw2*)
3367dc407927Smrg  symcode='[[DT]]'
3368dc407927Smrg  ;;
3369dc407927Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
3370dc407927Smrg  symcode='[[ABDT]]'
3371dc407927Smrg  ;;
3372dc407927Smrgsysv4)
3373dc407927Smrg  symcode='[[DFNSTU]]'
3374dc407927Smrg  ;;
3375dc407927Smrgesac
33763eed67faSmbalmer
3377dc407927Smrg# If we're using GNU nm, then use its standard symbol codes.
3378dc407927Smrgcase `$NM -V 2>&1` in
3379dc407927Smrg*GNU* | *'with BFD'*)
3380dc407927Smrg  symcode='[[ABCDGIRSTW]]' ;;
3381dc407927Smrgesac
33823eed67faSmbalmer
3383dc407927Smrg# Transform an extracted symbol line into a proper C declaration.
3384dc407927Smrg# Some systems (esp. on ia64) link data and code symbols differently,
3385dc407927Smrg# so use this general approach.
3386dc407927Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
33873eed67faSmbalmer
3388dc407927Smrg# Transform an extracted symbol line into symbol name and symbol address
3389dc407927Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
3390dc407927Smrglt_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'"
33913eed67faSmbalmer
3392dc407927Smrg# Handle CRLF in mingw tool chain
3393dc407927Smrgopt_cr=
3394dc407927Smrgcase $build_os in
3395dc407927Smrgmingw*)
3396dc407927Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
3397dc407927Smrg  ;;
3398dc407927Smrgesac
33993eed67faSmbalmer
3400dc407927Smrg# Try without a prefix underscore, then with it.
3401dc407927Smrgfor ac_symprfx in "" "_"; do
34023eed67faSmbalmer
3403dc407927Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
3404dc407927Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
34053eed67faSmbalmer
3406dc407927Smrg  # Write the raw and C identifiers.
3407dc407927Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3408dc407927Smrg    # Fake it for dumpbin and say T for any non-static function
3409dc407927Smrg    # and D for any global variable.
3410dc407927Smrg    # Also find C++ and __fastcall symbols from MSVC++,
3411dc407927Smrg    # which start with @ or ?.
3412dc407927Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
3413dc407927Smrg"     {last_section=section; section=\$ 3};"\
3414dc407927Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
3415dc407927Smrg"     \$ 0!~/External *\|/{next};"\
3416dc407927Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
3417dc407927Smrg"     {if(hide[section]) next};"\
3418dc407927Smrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
3419dc407927Smrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
3420dc407927Smrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
3421dc407927Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
3422dc407927Smrg"     ' prfx=^$ac_symprfx]"
3423dc407927Smrg  else
3424dc407927Smrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
34253eed67faSmbalmer  fi
34263eed67faSmbalmer
3427dc407927Smrg  # Check to see that the pipe works correctly.
3428dc407927Smrg  pipe_works=no
34293eed67faSmbalmer
3430dc407927Smrg  rm -f conftest*
3431dc407927Smrg  cat > conftest.$ac_ext <<_LT_EOF
3432dc407927Smrg#ifdef __cplusplus
3433dc407927Smrgextern "C" {
3434dc407927Smrg#endif
3435dc407927Smrgchar nm_test_var;
3436dc407927Smrgvoid nm_test_func(void);
3437dc407927Smrgvoid nm_test_func(void){}
3438dc407927Smrg#ifdef __cplusplus
3439dc407927Smrg}
3440dc407927Smrg#endif
3441dc407927Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
3442dc407927Smrg_LT_EOF
34433eed67faSmbalmer
3444dc407927Smrg  if AC_TRY_EVAL(ac_compile); then
3445dc407927Smrg    # Now try to grab the symbols.
3446dc407927Smrg    nlist=conftest.nm
3447dc407927Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
3448dc407927Smrg      # Try sorting and uniquifying the output.
3449dc407927Smrg      if sort "$nlist" | uniq > "$nlist"T; then
3450dc407927Smrg	mv -f "$nlist"T "$nlist"
3451dc407927Smrg      else
3452dc407927Smrg	rm -f "$nlist"T
3453dc407927Smrg      fi
34543eed67faSmbalmer
3455dc407927Smrg      # Make sure that we snagged all the symbols we need.
3456dc407927Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
3457dc407927Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
3458dc407927Smrg	  cat <<_LT_EOF > conftest.$ac_ext
3459dc407927Smrg#ifdef __cplusplus
3460dc407927Smrgextern "C" {
3461dc407927Smrg#endif
34623eed67faSmbalmer
3463dc407927Smrg_LT_EOF
3464dc407927Smrg	  # Now generate the symbol file.
3465dc407927Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
34663eed67faSmbalmer
3467dc407927Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
34683eed67faSmbalmer
3469dc407927Smrg/* The mapping between symbol names and symbols.  */
3470dc407927Smrgconst struct {
3471dc407927Smrg  const char *name;
3472dc407927Smrg  void       *address;
3473dc407927Smrg}
3474dc407927Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
3475dc407927Smrg{
3476dc407927Smrg  { "@PROGRAM@", (void *) 0 },
3477dc407927Smrg_LT_EOF
3478dc407927Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
3479dc407927Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
3480dc407927Smrg  {0, (void *) 0}
3481dc407927Smrg};
34823eed67faSmbalmer
3483dc407927Smrg/* This works around a problem in FreeBSD linker */
3484dc407927Smrg#ifdef FREEBSD_WORKAROUND
3485dc407927Smrgstatic const void *lt_preloaded_setup() {
3486dc407927Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
3487dc407927Smrg}
3488dc407927Smrg#endif
34893eed67faSmbalmer
3490dc407927Smrg#ifdef __cplusplus
3491dc407927Smrg}
3492dc407927Smrg#endif
3493dc407927Smrg_LT_EOF
3494dc407927Smrg	  # Now try linking the two files.
3495dc407927Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
3496dc407927Smrg	  lt_save_LIBS="$LIBS"
3497dc407927Smrg	  lt_save_CFLAGS="$CFLAGS"
3498dc407927Smrg	  LIBS="conftstm.$ac_objext"
3499dc407927Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
3500dc407927Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
3501dc407927Smrg	    pipe_works=yes
3502dc407927Smrg	  fi
3503dc407927Smrg	  LIBS="$lt_save_LIBS"
3504dc407927Smrg	  CFLAGS="$lt_save_CFLAGS"
3505dc407927Smrg	else
3506dc407927Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
3507dc407927Smrg	fi
3508dc407927Smrg      else
3509dc407927Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
3510dc407927Smrg      fi
35113eed67faSmbalmer    else
3512dc407927Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
35133eed67faSmbalmer    fi
35143eed67faSmbalmer  else
3515dc407927Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
3516dc407927Smrg    cat conftest.$ac_ext >&5
35173eed67faSmbalmer  fi
3518dc407927Smrg  rm -rf conftest* conftst*
35193eed67faSmbalmer
3520dc407927Smrg  # Do not use the global_symbol_pipe unless it works.
3521dc407927Smrg  if test "$pipe_works" = yes; then
3522dc407927Smrg    break
3523dc407927Smrg  else
3524dc407927Smrg    lt_cv_sys_global_symbol_pipe=
3525dc407927Smrg  fi
3526dc407927Smrgdone
3527dc407927Smrg])
3528dc407927Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
3529dc407927Smrg  lt_cv_sys_global_symbol_to_cdecl=
3530dc407927Smrgfi
3531dc407927Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
3532dc407927Smrg  AC_MSG_RESULT(failed)
35333eed67faSmbalmerelse
3534dc407927Smrg  AC_MSG_RESULT(ok)
35353eed67faSmbalmerfi
35363eed67faSmbalmer
3537dc407927Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
3538dc407927Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
3539dc407927Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
3540dc407927Smrg    [Transform the output of nm in a proper C declaration])
3541dc407927Smrg_LT_DECL([global_symbol_to_c_name_address],
3542dc407927Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
3543dc407927Smrg    [Transform the output of nm in a C name address pair])
3544dc407927Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
3545dc407927Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
3546dc407927Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
3547dc407927Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
35483eed67faSmbalmer
35493eed67faSmbalmer
3550dc407927Smrg# _LT_COMPILER_PIC([TAGNAME])
3551dc407927Smrg# ---------------------------
3552dc407927Smrgm4_defun([_LT_COMPILER_PIC],
3553dc407927Smrg[m4_require([_LT_TAG_COMPILER])dnl
3554dc407927Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
3555dc407927Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
3556dc407927Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
35573eed67faSmbalmer
3558dc407927SmrgAC_MSG_CHECKING([for $compiler option to produce PIC])
3559dc407927Smrgm4_if([$1], [CXX], [
3560dc407927Smrg  # C++ specific cases for pic, static, wl, etc.
3561dc407927Smrg  if test "$GXX" = yes; then
3562dc407927Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3563dc407927Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
35643eed67faSmbalmer
3565dc407927Smrg    case $host_os in
3566dc407927Smrg    aix*)
3567dc407927Smrg      # All AIX code is PIC.
35683eed67faSmbalmer      if test "$host_cpu" = ia64; then
3569dc407927Smrg	# AIX 5 now supports IA64 processor
3570dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
35713eed67faSmbalmer      fi
35723eed67faSmbalmer      ;;
35733eed67faSmbalmer
3574dc407927Smrg    amigaos*)
35753eed67faSmbalmer      case $host_cpu in
3576dc407927Smrg      powerpc)
3577dc407927Smrg            # see comment about AmigaOS4 .so support
3578dc407927Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3579dc407927Smrg        ;;
3580dc407927Smrg      m68k)
3581dc407927Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
3582dc407927Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
3583dc407927Smrg            # like `-m68040'.
3584dc407927Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
35853eed67faSmbalmer        ;;
35863eed67faSmbalmer      esac
35873eed67faSmbalmer      ;;
35883eed67faSmbalmer
3589dc407927Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3590dc407927Smrg      # PIC is the default for these OSes.
3591dc407927Smrg      ;;
3592dc407927Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
3593dc407927Smrg      # This hack is so that the source file can tell whether it is being
3594dc407927Smrg      # built for inclusion in a dll (and should export symbols for example).
3595dc407927Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
3596dc407927Smrg      # (--disable-auto-import) libraries
3597dc407927Smrg      m4_if([$1], [GCJ], [],
3598dc407927Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3599dc407927Smrg      ;;
3600dc407927Smrg    darwin* | rhapsody*)
3601dc407927Smrg      # PIC is the default on this platform
3602dc407927Smrg      # Common symbols not allowed in MH_DYLIB files
3603dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3604dc407927Smrg      ;;
3605dc407927Smrg    *djgpp*)
3606dc407927Smrg      # DJGPP does not support shared libraries at all
3607dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3608dc407927Smrg      ;;
3609dc407927Smrg    interix[[3-9]]*)
3610dc407927Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3611dc407927Smrg      # Instead, we relocate shared libraries at runtime.
3612dc407927Smrg      ;;
3613dc407927Smrg    sysv4*MP*)
3614dc407927Smrg      if test -d /usr/nec; then
3615dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3616dc407927Smrg      fi
3617dc407927Smrg      ;;
3618dc407927Smrg    hpux*)
3619dc407927Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3620dc407927Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
3621dc407927Smrg      # sets the default TLS model and affects inlining.
3622dc407927Smrg      case $host_cpu in
3623dc407927Smrg      hppa*64*)
36243eed67faSmbalmer	;;
36253eed67faSmbalmer      *)
3626dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
36273eed67faSmbalmer	;;
3628dc407927Smrg      esac
3629dc407927Smrg      ;;
3630dc407927Smrg    *qnx* | *nto*)
3631dc407927Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
3632dc407927Smrg      # it will coredump.
3633dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3634dc407927Smrg      ;;
3635dc407927Smrg    *)
3636dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3637dc407927Smrg      ;;
36383eed67faSmbalmer    esac
3639dc407927Smrg  else
3640dc407927Smrg    case $host_os in
3641dc407927Smrg      aix[[4-9]]*)
3642dc407927Smrg	# All AIX code is PIC.
3643dc407927Smrg	if test "$host_cpu" = ia64; then
3644dc407927Smrg	  # AIX 5 now supports IA64 processor
3645dc407927Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3646dc407927Smrg	else
3647dc407927Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
36483eed67faSmbalmer	fi
36493eed67faSmbalmer	;;
3650dc407927Smrg      chorus*)
3651dc407927Smrg	case $cc_basename in
3652dc407927Smrg	cxch68*)
3653dc407927Smrg	  # Green Hills C++ Compiler
3654dc407927Smrg	  # _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"
36553eed67faSmbalmer	  ;;
36563eed67faSmbalmer	esac
36573eed67faSmbalmer	;;
3658dc407927Smrg      dgux*)
3659dc407927Smrg	case $cc_basename in
3660dc407927Smrg	  ec++*)
3661dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3662dc407927Smrg	    ;;
3663dc407927Smrg	  ghcx*)
3664dc407927Smrg	    # Green Hills C++ Compiler
3665dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3666dc407927Smrg	    ;;
3667dc407927Smrg	  *)
3668dc407927Smrg	    ;;
36693eed67faSmbalmer	esac
36703eed67faSmbalmer	;;
3671dc407927Smrg      freebsd* | dragonfly*)
3672dc407927Smrg	# FreeBSD uses GNU C++
36733eed67faSmbalmer	;;
3674dc407927Smrg      hpux9* | hpux10* | hpux11*)
3675dc407927Smrg	case $cc_basename in
3676dc407927Smrg	  CC*)
3677dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3678dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3679dc407927Smrg	    if test "$host_cpu" != ia64; then
3680dc407927Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3681dc407927Smrg	    fi
3682dc407927Smrg	    ;;
3683dc407927Smrg	  aCC*)
3684dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3685dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3686dc407927Smrg	    case $host_cpu in
3687dc407927Smrg	    hppa*64*|ia64*)
3688dc407927Smrg	      # +Z the default
3689dc407927Smrg	      ;;
3690dc407927Smrg	    *)
3691dc407927Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3692dc407927Smrg	      ;;
3693dc407927Smrg	    esac
3694dc407927Smrg	    ;;
3695dc407927Smrg	  *)
3696dc407927Smrg	    ;;
3697dc407927Smrg	esac
36983eed67faSmbalmer	;;
3699dc407927Smrg      interix*)
3700dc407927Smrg	# This is c89, which is MS Visual C++ (no shared libs)
3701dc407927Smrg	# Anyone wants to do a port?
37023eed67faSmbalmer	;;
3703dc407927Smrg      irix5* | irix6* | nonstopux*)
3704dc407927Smrg	case $cc_basename in
3705dc407927Smrg	  CC*)
3706dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3707dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3708dc407927Smrg	    # CC pic flag -KPIC is the default.
3709dc407927Smrg	    ;;
3710dc407927Smrg	  *)
3711dc407927Smrg	    ;;
3712dc407927Smrg	esac
37133eed67faSmbalmer	;;
3714dc407927Smrg      linux* | k*bsd*-gnu)
3715dc407927Smrg	case $cc_basename in
3716dc407927Smrg	  KCC*)
3717dc407927Smrg	    # KAI C++ Compiler
3718dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
3719dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3720dc407927Smrg	    ;;
3721dc407927Smrg	  ecpc* )
3722dc407927Smrg	    # old Intel C++ for x86_64 which still supported -KPIC.
3723dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3724dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3725dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3726dc407927Smrg	    ;;
3727dc407927Smrg	  icpc* )
3728dc407927Smrg	    # Intel C++, used to be incompatible with GCC.
3729dc407927Smrg	    # ICC 10 doesn't accept -KPIC any more.
3730dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3731dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3732dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3733dc407927Smrg	    ;;
3734dc407927Smrg	  pgCC* | pgcpp*)
3735dc407927Smrg	    # Portland Group C++ compiler
3736dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3737dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
3738dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3739dc407927Smrg	    ;;
3740dc407927Smrg	  cxx*)
3741dc407927Smrg	    # Compaq C++
3742dc407927Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
3743dc407927Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
3744dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3745dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3746dc407927Smrg	    ;;
3747dc407927Smrg	  xlc* | xlC*)
3748dc407927Smrg	    # IBM XL 8.0 on PPC
3749dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3750dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
3751dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
3752dc407927Smrg	    ;;
3753dc407927Smrg	  *)
3754dc407927Smrg	    case `$CC -V 2>&1 | sed 5q` in
3755dc407927Smrg	    *Sun\ C*)
3756dc407927Smrg	      # Sun C++ 5.9
3757dc407927Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3758dc407927Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3759dc407927Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
3760dc407927Smrg	      ;;
3761dc407927Smrg	    esac
3762dc407927Smrg	    ;;
3763dc407927Smrg	esac
37643eed67faSmbalmer	;;
3765dc407927Smrg      lynxos*)
37663eed67faSmbalmer	;;
3767dc407927Smrg      m88k*)
37683eed67faSmbalmer	;;
3769dc407927Smrg      mvs*)
3770dc407927Smrg	case $cc_basename in
3771dc407927Smrg	  cxx*)
3772dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
3773dc407927Smrg	    ;;
3774dc407927Smrg	  *)
3775dc407927Smrg	    ;;
3776dc407927Smrg	esac
37773eed67faSmbalmer	;;
3778dc407927Smrg      netbsd*)
37793eed67faSmbalmer	;;
3780dc407927Smrg      *qnx* | *nto*)
3781dc407927Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
3782dc407927Smrg        # it will coredump.
3783dc407927Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3784dc407927Smrg        ;;
3785dc407927Smrg      osf3* | osf4* | osf5*)
3786dc407927Smrg	case $cc_basename in
3787dc407927Smrg	  KCC*)
3788dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
3789dc407927Smrg	    ;;
3790dc407927Smrg	  RCC*)
3791dc407927Smrg	    # Rational C++ 2.4.1
3792dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3793dc407927Smrg	    ;;
3794dc407927Smrg	  cxx*)
3795dc407927Smrg	    # Digital/Compaq C++
3796dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3797dc407927Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
3798dc407927Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
3799dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3800dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3801dc407927Smrg	    ;;
3802dc407927Smrg	  *)
3803dc407927Smrg	    ;;
3804dc407927Smrg	esac
38053eed67faSmbalmer	;;
3806dc407927Smrg      psos*)
38073eed67faSmbalmer	;;
3808dc407927Smrg      solaris*)
3809dc407927Smrg	case $cc_basename in
3810dc407927Smrg	  CC*)
3811dc407927Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
3812dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3813dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3814dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
3815dc407927Smrg	    ;;
3816dc407927Smrg	  gcx*)
3817dc407927Smrg	    # Green Hills C++ Compiler
3818dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
3819dc407927Smrg	    ;;
3820dc407927Smrg	  *)
3821dc407927Smrg	    ;;
3822dc407927Smrg	esac
38233eed67faSmbalmer	;;
3824dc407927Smrg      sunos4*)
3825dc407927Smrg	case $cc_basename in
3826dc407927Smrg	  CC*)
3827dc407927Smrg	    # Sun C++ 4.x
3828dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3829dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3830dc407927Smrg	    ;;
3831dc407927Smrg	  lcc*)
3832dc407927Smrg	    # Lucid
3833dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3834dc407927Smrg	    ;;
38353eed67faSmbalmer	  *)
38363eed67faSmbalmer	    ;;
38373eed67faSmbalmer	esac
38383eed67faSmbalmer	;;
3839dc407927Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
3840dc407927Smrg	case $cc_basename in
3841dc407927Smrg	  CC*)
3842dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3843dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3844dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3845dc407927Smrg	    ;;
3846dc407927Smrg	esac
38473eed67faSmbalmer	;;
3848dc407927Smrg      tandem*)
3849dc407927Smrg	case $cc_basename in
3850dc407927Smrg	  NCC*)
3851dc407927Smrg	    # NonStop-UX NCC 3.20
3852dc407927Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3853dc407927Smrg	    ;;
38543eed67faSmbalmer	  *)
38553eed67faSmbalmer	    ;;
3856dc407927Smrg	esac
38573eed67faSmbalmer	;;
3858dc407927Smrg      vxworks*)
38593eed67faSmbalmer	;;
38603eed67faSmbalmer      *)
3861dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
38623eed67faSmbalmer	;;
38633eed67faSmbalmer    esac
3864dc407927Smrg  fi
3865dc407927Smrg],
3866dc407927Smrg[
3867dc407927Smrg  if test "$GCC" = yes; then
3868dc407927Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3869dc407927Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3870dc407927Smrg
3871dc407927Smrg    case $host_os in
3872dc407927Smrg      aix*)
3873dc407927Smrg      # All AIX code is PIC.
3874dc407927Smrg      if test "$host_cpu" = ia64; then
3875dc407927Smrg	# AIX 5 now supports IA64 processor
3876dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3877dc407927Smrg      fi
3878dc407927Smrg      ;;
3879dc407927Smrg
3880dc407927Smrg    amigaos*)
3881dc407927Smrg      case $host_cpu in
3882dc407927Smrg      powerpc)
3883dc407927Smrg            # see comment about AmigaOS4 .so support
3884dc407927Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3885dc407927Smrg        ;;
3886dc407927Smrg      m68k)
3887dc407927Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
3888dc407927Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
3889dc407927Smrg            # like `-m68040'.
3890dc407927Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3891dc407927Smrg        ;;
3892dc407927Smrg      esac
3893dc407927Smrg      ;;
3894dc407927Smrg
3895dc407927Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3896dc407927Smrg      # PIC is the default for these OSes.
3897dc407927Smrg      ;;
3898dc407927Smrg
3899dc407927Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
3900dc407927Smrg      # This hack is so that the source file can tell whether it is being
3901dc407927Smrg      # built for inclusion in a dll (and should export symbols for example).
3902dc407927Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
3903dc407927Smrg      # (--disable-auto-import) libraries
3904dc407927Smrg      m4_if([$1], [GCJ], [],
3905dc407927Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3906dc407927Smrg      ;;
3907dc407927Smrg
3908dc407927Smrg    darwin* | rhapsody*)
3909dc407927Smrg      # PIC is the default on this platform
3910dc407927Smrg      # Common symbols not allowed in MH_DYLIB files
3911dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3912dc407927Smrg      ;;
3913dc407927Smrg
3914dc407927Smrg    hpux*)
3915dc407927Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3916dc407927Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
3917dc407927Smrg      # sets the default TLS model and affects inlining.
3918dc407927Smrg      case $host_cpu in
3919dc407927Smrg      hppa*64*)
3920dc407927Smrg	# +Z the default
39213eed67faSmbalmer	;;
39223eed67faSmbalmer      *)
3923dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
39243eed67faSmbalmer	;;
3925dc407927Smrg      esac
3926dc407927Smrg      ;;
3927dc407927Smrg
3928dc407927Smrg    interix[[3-9]]*)
3929dc407927Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3930dc407927Smrg      # Instead, we relocate shared libraries at runtime.
3931dc407927Smrg      ;;
3932dc407927Smrg
3933dc407927Smrg    msdosdjgpp*)
3934dc407927Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
3935dc407927Smrg      # on systems that don't support them.
3936dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
3937dc407927Smrg      enable_shared=no
3938dc407927Smrg      ;;
3939dc407927Smrg
3940dc407927Smrg    *nto* | *qnx*)
3941dc407927Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
3942dc407927Smrg      # it will coredump.
3943dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3944dc407927Smrg      ;;
3945dc407927Smrg
3946dc407927Smrg    sysv4*MP*)
3947dc407927Smrg      if test -d /usr/nec; then
3948dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3949dc407927Smrg      fi
3950dc407927Smrg      ;;
3951dc407927Smrg
3952dc407927Smrg    *)
3953dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3954dc407927Smrg      ;;
39553eed67faSmbalmer    esac
3956dc407927Smrg  else
3957dc407927Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
3958dc407927Smrg    case $host_os in
3959dc407927Smrg    aix*)
3960dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3961dc407927Smrg      if test "$host_cpu" = ia64; then
3962dc407927Smrg	# AIX 5 now supports IA64 processor
3963dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3964dc407927Smrg      else
3965dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3966dc407927Smrg      fi
3967dc407927Smrg      ;;
3968dc407927Smrg
3969dc407927Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
3970dc407927Smrg      # This hack is so that the source file can tell whether it is being
3971dc407927Smrg      # built for inclusion in a dll (and should export symbols for example).
3972dc407927Smrg      m4_if([$1], [GCJ], [],
3973dc407927Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3974dc407927Smrg      ;;
3975dc407927Smrg
3976dc407927Smrg    hpux9* | hpux10* | hpux11*)
3977dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3978dc407927Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
3979dc407927Smrg      # not for PA HP-UX.
3980dc407927Smrg      case $host_cpu in
3981dc407927Smrg      hppa*64*|ia64*)
3982dc407927Smrg	# +Z the default
39833eed67faSmbalmer	;;
39843eed67faSmbalmer      *)
3985dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
39863eed67faSmbalmer	;;
3987dc407927Smrg      esac
3988dc407927Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
3989dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3990dc407927Smrg      ;;
39913eed67faSmbalmer
3992dc407927Smrg    irix5* | irix6* | nonstopux*)
3993dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3994dc407927Smrg      # PIC (with -KPIC) is the default.
3995dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3996dc407927Smrg      ;;
39973eed67faSmbalmer
3998dc407927Smrg    linux* | k*bsd*-gnu)
3999dc407927Smrg      case $cc_basename in
4000dc407927Smrg      # old Intel for x86_64 which still supported -KPIC.
4001dc407927Smrg      ecc*)
4002dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4003dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4004dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4005dc407927Smrg        ;;
4006dc407927Smrg      # icc used to be incompatible with GCC.
4007dc407927Smrg      # ICC 10 doesn't accept -KPIC any more.
4008dc407927Smrg      icc* | ifort*)
4009dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4010dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4011dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4012dc407927Smrg        ;;
4013dc407927Smrg      # Lahey Fortran 8.1.
4014dc407927Smrg      lf95*)
4015dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4016dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4017dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4018dc407927Smrg	;;
4019dc407927Smrg      pgcc* | pgf77* | pgf90* | pgf95*)
4020dc407927Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
4021dc407927Smrg	# which looks to be a dead project)
4022dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4023dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4024dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4025dc407927Smrg        ;;
4026dc407927Smrg      ccc*)
4027dc407927Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4028dc407927Smrg        # All Alpha code is PIC.
4029dc407927Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4030dc407927Smrg        ;;
4031dc407927Smrg      xl*)
4032dc407927Smrg	# IBM XL C 8.0/Fortran 10.1 on PPC
4033dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4034dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4035dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4036dc407927Smrg	;;
4037dc407927Smrg      *)
4038dc407927Smrg	case `$CC -V 2>&1 | sed 5q` in
4039dc407927Smrg	*Sun\ C*)
4040dc407927Smrg	  # Sun C 5.9
4041dc407927Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4042dc407927Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4043dc407927Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4044dc407927Smrg	  ;;
4045dc407927Smrg	*Sun\ F*)
4046dc407927Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
4047dc407927Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4048dc407927Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4049dc407927Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4050dc407927Smrg	  ;;
4051dc407927Smrg	esac
4052dc407927Smrg	;;
4053dc407927Smrg      esac
4054dc407927Smrg      ;;
40553eed67faSmbalmer
4056dc407927Smrg    newsos6)
4057dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4058dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4059dc407927Smrg      ;;
40603eed67faSmbalmer
4061dc407927Smrg    *nto* | *qnx*)
4062dc407927Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4063dc407927Smrg      # it will coredump.
4064dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4065dc407927Smrg      ;;
40663eed67faSmbalmer
4067dc407927Smrg    osf3* | osf4* | osf5*)
4068dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4069dc407927Smrg      # All OSF/1 code is PIC.
4070dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4071dc407927Smrg      ;;
40723eed67faSmbalmer
4073dc407927Smrg    rdos*)
4074dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4075dc407927Smrg      ;;
40763eed67faSmbalmer
4077dc407927Smrg    solaris*)
4078dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4079dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4080dc407927Smrg      case $cc_basename in
4081dc407927Smrg      f77* | f90* | f95*)
4082dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4083dc407927Smrg      *)
4084dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4085dc407927Smrg      esac
4086dc407927Smrg      ;;
40873eed67faSmbalmer
4088dc407927Smrg    sunos4*)
4089dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4090dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4091dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4092dc407927Smrg      ;;
40933eed67faSmbalmer
4094dc407927Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
4095dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4096dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4097dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4098dc407927Smrg      ;;
40993eed67faSmbalmer
4100dc407927Smrg    sysv4*MP*)
4101dc407927Smrg      if test -d /usr/nec ;then
4102dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4103dc407927Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4104dc407927Smrg      fi
4105dc407927Smrg      ;;
41063eed67faSmbalmer
4107dc407927Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4108dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4109dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4110dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4111dc407927Smrg      ;;
41123eed67faSmbalmer
4113dc407927Smrg    unicos*)
4114dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4115dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4116dc407927Smrg      ;;
41173eed67faSmbalmer
4118dc407927Smrg    uts4*)
4119dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4120dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4121dc407927Smrg      ;;
4122dc407927Smrg
4123dc407927Smrg    *)
4124dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4125dc407927Smrg      ;;
41263eed67faSmbalmer    esac
4127dc407927Smrg  fi
4128dc407927Smrg])
4129dc407927Smrgcase $host_os in
4130dc407927Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
4131dc407927Smrg  *djgpp*)
4132dc407927Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4133dc407927Smrg    ;;
4134dc407927Smrg  *)
4135dc407927Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4136dc407927Smrg    ;;
4137dc407927Smrgesac
4138dc407927SmrgAC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4139dc407927Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4140dc407927Smrg	[How to pass a linker flag through the compiler])
41413eed67faSmbalmer
4142dc407927Smrg#
4143dc407927Smrg# Check to make sure the PIC flag actually works.
4144dc407927Smrg#
4145dc407927Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4146dc407927Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4147dc407927Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4148dc407927Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4149dc407927Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4150dc407927Smrg     "" | " "*) ;;
4151dc407927Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4152dc407927Smrg     esac],
4153dc407927Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4154dc407927Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
41553eed67faSmbalmerfi
4156dc407927Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4157dc407927Smrg	[Additional compiler flags for building library objects])
41583eed67faSmbalmer
4159dc407927Smrg#
4160dc407927Smrg# Check to make sure the static flag actually works.
4161dc407927Smrg#
4162dc407927Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4163dc407927Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4164dc407927Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4165dc407927Smrg  $lt_tmp_static_flag,
4166dc407927Smrg  [],
4167dc407927Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4168dc407927Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4169dc407927Smrg	[Compiler flag to prevent dynamic linking])
4170dc407927Smrg])# _LT_COMPILER_PIC
41713eed67faSmbalmer
41723eed67faSmbalmer
4173dc407927Smrg# _LT_LINKER_SHLIBS([TAGNAME])
4174dc407927Smrg# ----------------------------
4175dc407927Smrg# See if the linker supports building shared libraries.
4176dc407927Smrgm4_defun([_LT_LINKER_SHLIBS],
4177dc407927Smrg[AC_REQUIRE([LT_PATH_LD])dnl
4178dc407927SmrgAC_REQUIRE([LT_PATH_NM])dnl
4179dc407927Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
4180dc407927Smrgm4_require([_LT_DECL_EGREP])dnl
4181dc407927Smrgm4_require([_LT_DECL_SED])dnl
4182dc407927Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4183dc407927Smrgm4_require([_LT_TAG_COMPILER])dnl
4184dc407927SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4185dc407927Smrgm4_if([$1], [CXX], [
4186dc407927Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4187dc407927Smrg  case $host_os in
4188dc407927Smrg  aix[[4-9]]*)
4189dc407927Smrg    # If we're using GNU nm, then we don't want the "-C" option.
4190dc407927Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
4191dc407927Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4192dc407927Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4193dc407927Smrg    else
4194dc407927Smrg      _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'
41953eed67faSmbalmer    fi
41963eed67faSmbalmer    ;;
4197dc407927Smrg  pw32*)
4198dc407927Smrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
41993eed67faSmbalmer  ;;
4200dc407927Smrg  cygwin* | mingw* | cegcc*)
4201dc407927Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
4202dc407927Smrg  ;;
4203dc407927Smrg  *)
4204dc407927Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4205dc407927Smrg  ;;
4206dc407927Smrg  esac
4207dc407927Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4208dc407927Smrg], [
4209dc407927Smrg  runpath_var=
4210dc407927Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
4211dc407927Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
4212dc407927Smrg  _LT_TAGVAR(archive_cmds, $1)=
4213dc407927Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
4214dc407927Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
4215dc407927Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4216dc407927Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4217dc407927Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4218dc407927Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
4219dc407927Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
4220dc407927Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4221dc407927Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4222dc407927Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
4223dc407927Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4224dc407927Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
4225dc407927Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4226dc407927Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
4227dc407927Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
4228dc407927Smrg  _LT_TAGVAR(module_cmds, $1)=
4229dc407927Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
4230dc407927Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4231dc407927Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4232dc407927Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
4233dc407927Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4234dc407927Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
4235dc407927Smrg  # included in the symbol list
4236dc407927Smrg  _LT_TAGVAR(include_expsyms, $1)=
4237dc407927Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
4238dc407927Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
4239dc407927Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
4240dc407927Smrg  # as well as any symbol that contains `d'.
4241dc407927Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4242dc407927Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
4243dc407927Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
4244dc407927Smrg  # the symbol is explicitly referenced.  Since portable code cannot
4245dc407927Smrg  # rely on this symbol name, it's probably fine to never include it in
4246dc407927Smrg  # preloaded symbol tables.
4247dc407927Smrg  # Exclude shared library initialization/finalization symbols.
4248dc407927Smrgdnl Note also adjust exclude_expsyms for C++ above.
4249dc407927Smrg  extract_expsyms_cmds=
42503eed67faSmbalmer
4251dc407927Smrg  case $host_os in
4252dc407927Smrg  cygwin* | mingw* | pw32* | cegcc*)
4253dc407927Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
4254dc407927Smrg    # When not using gcc, we currently assume that we are using
4255dc407927Smrg    # Microsoft Visual C++.
4256dc407927Smrg    if test "$GCC" != yes; then
4257dc407927Smrg      with_gnu_ld=no
42583eed67faSmbalmer    fi
42593eed67faSmbalmer    ;;
4260dc407927Smrg  interix*)
4261dc407927Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
4262dc407927Smrg    with_gnu_ld=yes
4263dc407927Smrg    ;;
4264dc407927Smrg  openbsd*)
4265dc407927Smrg    with_gnu_ld=no
4266dc407927Smrg    ;;
42673eed67faSmbalmer  esac
42683eed67faSmbalmer
4269dc407927Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
4270dc407927Smrg  if test "$with_gnu_ld" = yes; then
4271dc407927Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
4272dc407927Smrg    wlarc='${wl}'
42733eed67faSmbalmer
4274dc407927Smrg    # Set some defaults for GNU ld with shared library support. These
4275dc407927Smrg    # are reset later if shared libraries are not supported. Putting them
4276dc407927Smrg    # here allows them to be overridden if necessary.
4277dc407927Smrg    runpath_var=LD_RUN_PATH
4278dc407927Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4279dc407927Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
4280dc407927Smrg    # ancient GNU ld didn't support --whole-archive et. al.
4281dc407927Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
4282dc407927Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
4283dc407927Smrg    else
4284dc407927Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
4285dc407927Smrg    fi
4286dc407927Smrg    supports_anon_versioning=no
4287dc407927Smrg    case `$LD -v 2>&1` in
4288dc407927Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
4289dc407927Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
4290dc407927Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
4291dc407927Smrg      *\ 2.11.*) ;; # other 2.11 versions
4292dc407927Smrg      *) supports_anon_versioning=yes ;;
4293dc407927Smrg    esac
42943eed67faSmbalmer
4295dc407927Smrg    # See if GNU ld supports shared libraries.
4296dc407927Smrg    case $host_os in
4297dc407927Smrg    aix[[3-9]]*)
4298dc407927Smrg      # On AIX/PPC, the GNU linker is very broken
4299dc407927Smrg      if test "$host_cpu" != ia64; then
4300dc407927Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4301dc407927Smrg	cat <<_LT_EOF 1>&2
43023eed67faSmbalmer
4303dc407927Smrg*** Warning: the GNU linker, at least up to release 2.9.1, is reported
4304dc407927Smrg*** to be unable to reliably create shared libraries on AIX.
4305dc407927Smrg*** Therefore, libtool is disabling shared libraries support.  If you
4306dc407927Smrg*** really care for shared libraries, you may want to modify your PATH
4307dc407927Smrg*** so that a non-GNU linker is found, and then restart.
43083eed67faSmbalmer
4309dc407927Smrg_LT_EOF
4310dc407927Smrg      fi
4311dc407927Smrg      ;;
43123eed67faSmbalmer
4313dc407927Smrg    amigaos*)
4314dc407927Smrg      case $host_cpu in
4315dc407927Smrg      powerpc)
4316dc407927Smrg            # see comment about AmigaOS4 .so support
4317dc407927Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4318dc407927Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
4319dc407927Smrg        ;;
4320dc407927Smrg      m68k)
4321dc407927Smrg            _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)'
4322dc407927Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4323dc407927Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
4324dc407927Smrg        ;;
4325dc407927Smrg      esac
4326dc407927Smrg      ;;
43273eed67faSmbalmer
4328dc407927Smrg    beos*)
4329dc407927Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4330dc407927Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4331dc407927Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
4332dc407927Smrg	# support --undefined.  This deserves some investigation.  FIXME
4333dc407927Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4334dc407927Smrg      else
4335dc407927Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4336dc407927Smrg      fi
4337dc407927Smrg      ;;
43383eed67faSmbalmer
4339dc407927Smrg    cygwin* | mingw* | pw32* | cegcc*)
4340dc407927Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
4341dc407927Smrg      # as there is no search path for DLLs.
4342dc407927Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4343dc407927Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4344dc407927Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
4345dc407927Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4346dc407927Smrg      _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'
4347dc407927Smrg
4348dc407927Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
4349dc407927Smrg        _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'
4350dc407927Smrg	# If the export-symbols file already is a .def file (1st line
4351dc407927Smrg	# is EXPORTS), use it as is; otherwise, prepend...
4352dc407927Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
4353dc407927Smrg	  cp $export_symbols $output_objdir/$soname.def;
4354dc407927Smrg	else
4355dc407927Smrg	  echo EXPORTS > $output_objdir/$soname.def;
4356dc407927Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
4357dc407927Smrg	fi~
4358dc407927Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
4359dc407927Smrg      else
4360dc407927Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4361dc407927Smrg      fi
4362dc407927Smrg      ;;
43633eed67faSmbalmer
4364dc407927Smrg    interix[[3-9]]*)
4365dc407927Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
4366dc407927Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4367dc407927Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4368dc407927Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4369dc407927Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
4370dc407927Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
4371dc407927Smrg      # default) and relocated if they conflict, which is a slow very memory
4372dc407927Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
4373dc407927Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
4374dc407927Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
4375dc407927Smrg      _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'
4376dc407927Smrg      _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'
4377dc407927Smrg      ;;
43783eed67faSmbalmer
4379dc407927Smrg    gnu* | linux* | tpf* | k*bsd*-gnu)
4380dc407927Smrg      tmp_diet=no
4381dc407927Smrg      if test "$host_os" = linux-dietlibc; then
4382dc407927Smrg	case $cc_basename in
4383dc407927Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
4384dc407927Smrg	esac
4385dc407927Smrg      fi
4386dc407927Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
4387dc407927Smrg	 && test "$tmp_diet" = no
4388dc407927Smrg      then
4389dc407927Smrg	tmp_addflag=
4390dc407927Smrg	tmp_sharedflag='-shared'
4391dc407927Smrg	case $cc_basename,$host_cpu in
4392dc407927Smrg        pgcc*)				# Portland Group C compiler
4393dc407927Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
4394dc407927Smrg	  tmp_addflag=' $pic_flag'
4395dc407927Smrg	  ;;
4396dc407927Smrg	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
4397dc407927Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
4398dc407927Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
4399dc407927Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
4400dc407927Smrg	  tmp_addflag=' -i_dynamic' ;;
4401dc407927Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
4402dc407927Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
4403dc407927Smrg	ifc* | ifort*)			# Intel Fortran compiler
4404dc407927Smrg	  tmp_addflag=' -nofor_main' ;;
4405dc407927Smrg	lf95*)				# Lahey Fortran 8.1
4406dc407927Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4407dc407927Smrg	  tmp_sharedflag='--shared' ;;
4408dc407927Smrg	xl[[cC]]*)			# IBM XL C 8.0 on PPC (deal with xlf below)
4409dc407927Smrg	  tmp_sharedflag='-qmkshrobj'
4410dc407927Smrg	  tmp_addflag= ;;
4411dc407927Smrg	esac
4412dc407927Smrg	case `$CC -V 2>&1 | sed 5q` in
4413dc407927Smrg	*Sun\ C*)			# Sun C 5.9
4414dc407927Smrg	  _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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
4415dc407927Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
4416dc407927Smrg	  tmp_sharedflag='-G' ;;
4417dc407927Smrg	*Sun\ F*)			# Sun Fortran 8.3
4418dc407927Smrg	  tmp_sharedflag='-G' ;;
4419dc407927Smrg	esac
4420dc407927Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
44213eed67faSmbalmer
4422dc407927Smrg        if test "x$supports_anon_versioning" = xyes; then
4423dc407927Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4424dc407927Smrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4425dc407927Smrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
4426dc407927Smrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
4427dc407927Smrg        fi
44283eed67faSmbalmer
4429dc407927Smrg	case $cc_basename in
4430dc407927Smrg	xlf*)
4431dc407927Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
4432dc407927Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
4433dc407927Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4434dc407927Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
4435dc407927Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
4436dc407927Smrg	  if test "x$supports_anon_versioning" = xyes; then
4437dc407927Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4438dc407927Smrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4439dc407927Smrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
4440dc407927Smrg	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
4441dc407927Smrg	  fi
4442dc407927Smrg	  ;;
4443dc407927Smrg	esac
4444dc407927Smrg      else
4445dc407927Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
4446dc407927Smrg      fi
4447dc407927Smrg      ;;
44483eed67faSmbalmer
4449dc407927Smrg    netbsd*)
4450dc407927Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4451dc407927Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
4452dc407927Smrg	wlarc=
4453dc407927Smrg      else
4454dc407927Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4455dc407927Smrg	_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'
4456dc407927Smrg      fi
4457dc407927Smrg      ;;
44583eed67faSmbalmer
4459dc407927Smrg    solaris*)
4460dc407927Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
4461dc407927Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4462dc407927Smrg	cat <<_LT_EOF 1>&2
44633eed67faSmbalmer
4464dc407927Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
4465dc407927Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
4466dc407927Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
4467dc407927Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
4468dc407927Smrg*** your PATH or compiler configuration so that the native linker is
4469dc407927Smrg*** used, and then restart.
44703eed67faSmbalmer
4471dc407927Smrg_LT_EOF
4472dc407927Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4473dc407927Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4474dc407927Smrg	_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'
4475dc407927Smrg      else
4476dc407927Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4477dc407927Smrg      fi
4478dc407927Smrg      ;;
44793eed67faSmbalmer
4480dc407927Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
4481dc407927Smrg      case `$LD -v 2>&1` in
4482dc407927Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
4483dc407927Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4484dc407927Smrg	cat <<_LT_EOF 1>&2
44853eed67faSmbalmer
4486dc407927Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
4487dc407927Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
4488dc407927Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
4489dc407927Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
4490dc407927Smrg*** your PATH or compiler configuration so that the native linker is
4491dc407927Smrg*** used, and then restart.
44923eed67faSmbalmer
4493dc407927Smrg_LT_EOF
4494dc407927Smrg	;;
4495dc407927Smrg	*)
4496dc407927Smrg	  # For security reasons, it is highly recommended that you always
4497dc407927Smrg	  # use absolute paths for naming shared libraries, and exclude the
4498dc407927Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
4499dc407927Smrg	  # requires that you compile everything twice, which is a pain.
4500dc407927Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4501dc407927Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4502dc407927Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4503dc407927Smrg	    _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'
4504dc407927Smrg	  else
4505dc407927Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
4506dc407927Smrg	  fi
4507dc407927Smrg	;;
4508dc407927Smrg      esac
4509dc407927Smrg      ;;
45103eed67faSmbalmer
4511dc407927Smrg    sunos4*)
4512dc407927Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4513dc407927Smrg      wlarc=
4514dc407927Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4515dc407927Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4516dc407927Smrg      ;;
45173eed67faSmbalmer
4518dc407927Smrg    *)
4519dc407927Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4520dc407927Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4521dc407927Smrg	_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'
4522dc407927Smrg      else
4523dc407927Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4524dc407927Smrg      fi
4525dc407927Smrg      ;;
4526dc407927Smrg    esac
45273eed67faSmbalmer
4528dc407927Smrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
4529dc407927Smrg      runpath_var=
4530dc407927Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4531dc407927Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4532dc407927Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
4533dc407927Smrg    fi
4534dc407927Smrg  else
4535dc407927Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
4536dc407927Smrg    case $host_os in
4537dc407927Smrg    aix3*)
4538dc407927Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4539dc407927Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
4540dc407927Smrg      _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'
4541dc407927Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
4542dc407927Smrg      # are no directories specified by -L.
4543dc407927Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4544dc407927Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
4545dc407927Smrg	# Neither direct hardcoding nor static linking is supported with a
4546dc407927Smrg	# broken collect2.
4547dc407927Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
4548dc407927Smrg      fi
4549dc407927Smrg      ;;
45503eed67faSmbalmer
4551dc407927Smrg    aix[[4-9]]*)
4552dc407927Smrg      if test "$host_cpu" = ia64; then
4553dc407927Smrg	# On IA64, the linker does run time linking by default, so we don't
4554dc407927Smrg	# have to do anything special.
4555dc407927Smrg	aix_use_runtimelinking=no
4556dc407927Smrg	exp_sym_flag='-Bexport'
4557dc407927Smrg	no_entry_flag=""
4558dc407927Smrg      else
4559dc407927Smrg	# If we're using GNU nm, then we don't want the "-C" option.
4560dc407927Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
4561dc407927Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4562dc407927Smrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4563dc407927Smrg	else
4564dc407927Smrg	  _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'
4565dc407927Smrg	fi
4566dc407927Smrg	aix_use_runtimelinking=no
45673eed67faSmbalmer
4568dc407927Smrg	# Test if we are trying to use run time linking or normal
4569dc407927Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
4570dc407927Smrg	# need to do runtime linking.
4571dc407927Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
4572dc407927Smrg	  for ld_flag in $LDFLAGS; do
4573dc407927Smrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
4574dc407927Smrg	    aix_use_runtimelinking=yes
4575dc407927Smrg	    break
4576dc407927Smrg	  fi
4577dc407927Smrg	  done
4578dc407927Smrg	  ;;
4579dc407927Smrg	esac
45803eed67faSmbalmer
4581dc407927Smrg	exp_sym_flag='-bexport'
4582dc407927Smrg	no_entry_flag='-bnoentry'
4583dc407927Smrg      fi
45843eed67faSmbalmer
4585dc407927Smrg      # When large executables or shared objects are built, AIX ld can
4586dc407927Smrg      # have problems creating the table of contents.  If linking a library
4587dc407927Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
4588dc407927Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
4589dc407927Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
4590dc407927Smrg
4591dc407927Smrg      _LT_TAGVAR(archive_cmds, $1)=''
4592dc407927Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4593dc407927Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4594dc407927Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
4595dc407927Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
4596dc407927Smrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
45973eed67faSmbalmer
4598dc407927Smrg      if test "$GCC" = yes; then
4599dc407927Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
4600dc407927Smrg	# We only want to do this on AIX 4.2 and lower, the check
4601dc407927Smrg	# below for broken collect2 doesn't work under 4.3+
4602dc407927Smrg	  collect2name=`${CC} -print-prog-name=collect2`
4603dc407927Smrg	  if test -f "$collect2name" &&
4604dc407927Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
4605dc407927Smrg	  then
4606dc407927Smrg	  # We have reworked collect2
4607dc407927Smrg	  :
4608dc407927Smrg	  else
4609dc407927Smrg	  # We have old collect2
4610dc407927Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
4611dc407927Smrg	  # It fails to find uninstalled libraries when the uninstalled
4612dc407927Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
4613dc407927Smrg	  # to unsupported forces relinking
4614dc407927Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
4615dc407927Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4616dc407927Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4617dc407927Smrg	  fi
4618dc407927Smrg	  ;;
4619dc407927Smrg	esac
4620dc407927Smrg	shared_flag='-shared'
4621dc407927Smrg	if test "$aix_use_runtimelinking" = yes; then
4622dc407927Smrg	  shared_flag="$shared_flag "'${wl}-G'
4623dc407927Smrg	fi
4624dc407927Smrg      else
4625dc407927Smrg	# not using gcc
4626dc407927Smrg	if test "$host_cpu" = ia64; then
4627dc407927Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
4628dc407927Smrg	# chokes on -Wl,-G. The following line is correct:
4629dc407927Smrg	  shared_flag='-G'
4630dc407927Smrg	else
4631dc407927Smrg	  if test "$aix_use_runtimelinking" = yes; then
4632dc407927Smrg	    shared_flag='${wl}-G'
4633dc407927Smrg	  else
4634dc407927Smrg	    shared_flag='${wl}-bM:SRE'
4635dc407927Smrg	  fi
4636dc407927Smrg	fi
4637dc407927Smrg      fi
46383eed67faSmbalmer
4639dc407927Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
4640dc407927Smrg      # It seems that -bexpall does not export symbols beginning with
4641dc407927Smrg      # underscore (_), so it is better to generate a list of symbols to export.
4642dc407927Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
4643dc407927Smrg      if test "$aix_use_runtimelinking" = yes; then
4644dc407927Smrg	# Warning - without using the other runtime loading flags (-brtl),
4645dc407927Smrg	# -berok will link without error, but may produce a broken library.
4646dc407927Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
4647dc407927Smrg        # Determine the default libpath from the value encoded in an
4648dc407927Smrg        # empty executable.
4649dc407927Smrg        _LT_SYS_MODULE_PATH_AIX
4650dc407927Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
4651dc407927Smrg        _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 $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
4652dc407927Smrg      else
4653dc407927Smrg	if test "$host_cpu" = ia64; then
4654dc407927Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
4655dc407927Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
4656dc407927Smrg	  _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"
4657dc407927Smrg	else
4658dc407927Smrg	 # Determine the default libpath from the value encoded in an
4659dc407927Smrg	 # empty executable.
4660dc407927Smrg	 _LT_SYS_MODULE_PATH_AIX
4661dc407927Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
4662dc407927Smrg	  # Warning - without using the other run time loading flags,
4663dc407927Smrg	  # -berok will link without error, but may produce a broken library.
4664dc407927Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
4665dc407927Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
4666dc407927Smrg	  # Exported symbols can be pulled into shared objects from archives
4667dc407927Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
4668dc407927Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
4669dc407927Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
4670dc407927Smrg	  _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'
4671dc407927Smrg	fi
4672dc407927Smrg      fi
4673dc407927Smrg      ;;
46743eed67faSmbalmer
4675dc407927Smrg    amigaos*)
4676dc407927Smrg      case $host_cpu in
4677dc407927Smrg      powerpc)
4678dc407927Smrg            # see comment about AmigaOS4 .so support
4679dc407927Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4680dc407927Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
4681dc407927Smrg        ;;
4682dc407927Smrg      m68k)
4683dc407927Smrg            _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)'
4684dc407927Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4685dc407927Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
4686dc407927Smrg        ;;
4687dc407927Smrg      esac
4688dc407927Smrg      ;;
46893eed67faSmbalmer
4690dc407927Smrg    bsdi[[45]]*)
4691dc407927Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
4692dc407927Smrg      ;;
46933eed67faSmbalmer
4694dc407927Smrg    cygwin* | mingw* | pw32* | cegcc*)
4695dc407927Smrg      # When not using gcc, we currently assume that we are using
4696dc407927Smrg      # Microsoft Visual C++.
4697dc407927Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
4698dc407927Smrg      # no search path for DLLs.
4699dc407927Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
4700dc407927Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4701dc407927Smrg      # Tell ltmain to make .lib files, not .a files.
4702dc407927Smrg      libext=lib
4703dc407927Smrg      # Tell ltmain to make .dll files, not .so files.
4704dc407927Smrg      shrext_cmds=".dll"
4705dc407927Smrg      # FIXME: Setting linknames here is a bad hack.
4706dc407927Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
4707dc407927Smrg      # The linker will automatically build a .lib file if we build a DLL.
4708dc407927Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
4709dc407927Smrg      # FIXME: Should let the user specify the lib program.
4710dc407927Smrg      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
4711dc407927Smrg      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
4712dc407927Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4713dc407927Smrg      ;;
47143eed67faSmbalmer
4715dc407927Smrg    darwin* | rhapsody*)
4716dc407927Smrg      _LT_DARWIN_LINKER_FEATURES($1)
4717dc407927Smrg      ;;
47183eed67faSmbalmer
4719dc407927Smrg    dgux*)
4720dc407927Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
4721dc407927Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4722dc407927Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4723dc407927Smrg      ;;
47243eed67faSmbalmer
4725dc407927Smrg    freebsd1*)
4726dc407927Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
4727dc407927Smrg      ;;
47283eed67faSmbalmer
4729dc407927Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
4730dc407927Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
4731dc407927Smrg    # does not break anything, and helps significantly (at the cost of a little
4732dc407927Smrg    # extra space).
4733dc407927Smrg    freebsd2.2*)
4734dc407927Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
4735dc407927Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4736dc407927Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4737dc407927Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4738dc407927Smrg      ;;
47393eed67faSmbalmer
4740dc407927Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
4741dc407927Smrg    freebsd2*)
4742dc407927Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4743dc407927Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4744dc407927Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4745dc407927Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4746dc407927Smrg      ;;
47473eed67faSmbalmer
4748dc407927Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
4749dc407927Smrg    freebsd* | dragonfly*)
4750dc407927Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
4751dc407927Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4752dc407927Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4753dc407927Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4754dc407927Smrg      ;;
47553eed67faSmbalmer
4756dc407927Smrg    hpux9*)
4757dc407927Smrg      if test "$GCC" = yes; then
4758dc407927Smrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
4759dc407927Smrg      else
4760dc407927Smrg	_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'
4761dc407927Smrg      fi
4762dc407927Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4763dc407927Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4764dc407927Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
47653eed67faSmbalmer
4766dc407927Smrg      # hardcode_minus_L: Not really in the search PATH,
4767dc407927Smrg      # but as the default location of the library.
4768dc407927Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4769dc407927Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4770dc407927Smrg      ;;
47713eed67faSmbalmer
4772dc407927Smrg    hpux10*)
4773dc407927Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
4774dc407927Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4775dc407927Smrg      else
4776dc407927Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
4777dc407927Smrg      fi
4778dc407927Smrg      if test "$with_gnu_ld" = no; then
4779dc407927Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4780dc407927Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
4781dc407927Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
4782dc407927Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
4783dc407927Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4784dc407927Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4785dc407927Smrg	# hardcode_minus_L: Not really in the search PATH,
4786dc407927Smrg	# but as the default location of the library.
4787dc407927Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
4788dc407927Smrg      fi
4789dc407927Smrg      ;;
47903eed67faSmbalmer
4791dc407927Smrg    hpux11*)
4792dc407927Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
4793dc407927Smrg	case $host_cpu in
4794dc407927Smrg	hppa*64*)
4795dc407927Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4796dc407927Smrg	  ;;
4797dc407927Smrg	ia64*)
4798dc407927Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
4799dc407927Smrg	  ;;
4800dc407927Smrg	*)
4801dc407927Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4802dc407927Smrg	  ;;
4803dc407927Smrg	esac
4804dc407927Smrg      else
4805dc407927Smrg	case $host_cpu in
4806dc407927Smrg	hppa*64*)
4807dc407927Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4808dc407927Smrg	  ;;
4809dc407927Smrg	ia64*)
4810dc407927Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
4811dc407927Smrg	  ;;
4812dc407927Smrg	*)
4813dc407927Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4814dc407927Smrg	  ;;
4815dc407927Smrg	esac
4816dc407927Smrg      fi
4817dc407927Smrg      if test "$with_gnu_ld" = no; then
4818dc407927Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4819dc407927Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
48203eed67faSmbalmer
4821dc407927Smrg	case $host_cpu in
4822dc407927Smrg	hppa*64*|ia64*)
4823dc407927Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
4824dc407927Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4825dc407927Smrg	  ;;
4826dc407927Smrg	*)
4827dc407927Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
4828dc407927Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4829dc407927Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
48303eed67faSmbalmer
4831dc407927Smrg	  # hardcode_minus_L: Not really in the search PATH,
4832dc407927Smrg	  # but as the default location of the library.
4833dc407927Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
4834dc407927Smrg	  ;;
4835dc407927Smrg	esac
4836dc407927Smrg      fi
48373eed67faSmbalmer      ;;
4838dc407927Smrg
4839dc407927Smrg    irix5* | irix6* | nonstopux*)
4840dc407927Smrg      if test "$GCC" = yes; then
4841dc407927Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
4842dc407927Smrg	# Try to use the -exported_symbol ld option, if it does not
4843dc407927Smrg	# work, assume that -exports_file does not work either and
4844dc407927Smrg	# implicitly export all symbols.
4845dc407927Smrg        save_LDFLAGS="$LDFLAGS"
4846dc407927Smrg        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
4847dc407927Smrg        AC_LINK_IFELSE(int foo(void) {},
4848dc407927Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
4849dc407927Smrg        )
4850dc407927Smrg        LDFLAGS="$save_LDFLAGS"
4851dc407927Smrg      else
4852dc407927Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
4853dc407927Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
4854dc407927Smrg      fi
4855dc407927Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4856dc407927Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4857dc407927Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4858dc407927Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
4859dc407927Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
48603eed67faSmbalmer      ;;
48613eed67faSmbalmer
4862dc407927Smrg    netbsd*)
4863dc407927Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4864dc407927Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
4865dc407927Smrg      else
4866dc407927Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
4867dc407927Smrg      fi
4868dc407927Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4869dc407927Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4870dc407927Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4871dc407927Smrg      ;;
48723eed67faSmbalmer
4873dc407927Smrg    newsos6)
4874dc407927Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
4875dc407927Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4876dc407927Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4877dc407927Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4878dc407927Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4879dc407927Smrg      ;;
48803eed67faSmbalmer
4881dc407927Smrg    *nto* | *qnx*)
4882dc407927Smrg      ;;
48833eed67faSmbalmer
4884dc407927Smrg    openbsd*)
4885dc407927Smrg      if test -f /usr/libexec/ld.so; then
4886dc407927Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
4887dc407927Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4888dc407927Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4889dc407927Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4890dc407927Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
4891dc407927Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
4892dc407927Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4893dc407927Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4894dc407927Smrg	else
4895dc407927Smrg	  case $host_os in
4896dc407927Smrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
4897dc407927Smrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4898dc407927Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4899dc407927Smrg	     ;;
4900dc407927Smrg	   *)
4901dc407927Smrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
4902dc407927Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4903dc407927Smrg	     ;;
4904dc407927Smrg	  esac
4905dc407927Smrg	fi
4906dc407927Smrg      else
4907dc407927Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4908dc407927Smrg      fi
4909dc407927Smrg      ;;
49103eed67faSmbalmer
4911dc407927Smrg    os2*)
4912dc407927Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4913dc407927Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4914dc407927Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4915dc407927Smrg      _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'
4916dc407927Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
4917dc407927Smrg      ;;
49183eed67faSmbalmer
4919dc407927Smrg    osf3*)
4920dc407927Smrg      if test "$GCC" = yes; then
4921dc407927Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
4922dc407927Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
4923dc407927Smrg      else
4924dc407927Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
4925dc407927Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
4926dc407927Smrg      fi
4927dc407927Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4928dc407927Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4929dc407927Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4930dc407927Smrg      ;;
49313eed67faSmbalmer
4932dc407927Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
4933dc407927Smrg      if test "$GCC" = yes; then
4934dc407927Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
4935dc407927Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
4936dc407927Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4937dc407927Smrg      else
4938dc407927Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
4939dc407927Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
4940dc407927Smrg	_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~
4941dc407927Smrg	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
49423eed67faSmbalmer
4943dc407927Smrg	# Both c and cxx compiler support -rpath directly
4944dc407927Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
4945dc407927Smrg      fi
4946dc407927Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4947dc407927Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4948dc407927Smrg      ;;
49493eed67faSmbalmer
4950dc407927Smrg    solaris*)
4951dc407927Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
4952dc407927Smrg      if test "$GCC" = yes; then
4953dc407927Smrg	wlarc='${wl}'
4954dc407927Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4955dc407927Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4956dc407927Smrg	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
4957dc407927Smrg      else
4958dc407927Smrg	case `$CC -V 2>&1` in
4959dc407927Smrg	*"Compilers 5.0"*)
4960dc407927Smrg	  wlarc=''
4961dc407927Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
4962dc407927Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4963dc407927Smrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
4964dc407927Smrg	  ;;
4965dc407927Smrg	*)
4966dc407927Smrg	  wlarc='${wl}'
4967dc407927Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
4968dc407927Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4969dc407927Smrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
4970dc407927Smrg	  ;;
4971dc407927Smrg	esac
4972dc407927Smrg      fi
4973dc407927Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4974dc407927Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4975dc407927Smrg      case $host_os in
4976dc407927Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
4977dc407927Smrg      *)
4978dc407927Smrg	# The compiler driver will combine and reorder linker options,
4979dc407927Smrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
4980dc407927Smrg	# but is careful enough not to reorder.
4981dc407927Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
4982dc407927Smrg	if test "$GCC" = yes; then
4983dc407927Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
4984dc407927Smrg	else
4985dc407927Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
4986dc407927Smrg	fi
4987dc407927Smrg	;;
4988dc407927Smrg      esac
4989dc407927Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
4990dc407927Smrg      ;;
49913eed67faSmbalmer
4992dc407927Smrg    sunos4*)
4993dc407927Smrg      if test "x$host_vendor" = xsequent; then
4994dc407927Smrg	# Use $CC to link under sequent, because it throws in some extra .o
4995dc407927Smrg	# files that make .init and .fini sections work.
4996dc407927Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
4997dc407927Smrg      else
4998dc407927Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
4999dc407927Smrg      fi
5000dc407927Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5001dc407927Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5002dc407927Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5003dc407927Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5004dc407927Smrg      ;;
50053eed67faSmbalmer
5006dc407927Smrg    sysv4)
5007dc407927Smrg      case $host_vendor in
5008dc407927Smrg	sni)
5009dc407927Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5010dc407927Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5011dc407927Smrg	;;
5012dc407927Smrg	siemens)
5013dc407927Smrg	  ## LD is ld it makes a PLAMLIB
5014dc407927Smrg	  ## CC just makes a GrossModule.
5015dc407927Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5016dc407927Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5017dc407927Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
5018dc407927Smrg        ;;
5019dc407927Smrg	motorola)
5020dc407927Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5021dc407927Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
5022dc407927Smrg	;;
5023dc407927Smrg      esac
5024dc407927Smrg      runpath_var='LD_RUN_PATH'
5025dc407927Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5026dc407927Smrg      ;;
50273eed67faSmbalmer
5028dc407927Smrg    sysv4.3*)
5029dc407927Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5030dc407927Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5031dc407927Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
5032dc407927Smrg      ;;
50333eed67faSmbalmer
5034dc407927Smrg    sysv4*MP*)
5035dc407927Smrg      if test -d /usr/nec; then
5036dc407927Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5037dc407927Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5038dc407927Smrg	runpath_var=LD_RUN_PATH
5039dc407927Smrg	hardcode_runpath_var=yes
5040dc407927Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
5041dc407927Smrg      fi
5042dc407927Smrg      ;;
50433eed67faSmbalmer
5044dc407927Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
5045dc407927Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5046dc407927Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5047dc407927Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5048dc407927Smrg      runpath_var='LD_RUN_PATH'
50493eed67faSmbalmer
5050dc407927Smrg      if test "$GCC" = yes; then
5051dc407927Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5052dc407927Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5053dc407927Smrg      else
5054dc407927Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5055dc407927Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5056dc407927Smrg      fi
5057dc407927Smrg      ;;
50583eed67faSmbalmer
5059dc407927Smrg    sysv5* | sco3.2v5* | sco5v6*)
5060dc407927Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
5061dc407927Smrg      # link with -lc, and that would cause any symbols used from libc to
5062dc407927Smrg      # always be unresolved, which means just about no library would
5063dc407927Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
5064dc407927Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
5065dc407927Smrg      # as -z defs.
5066dc407927Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5067dc407927Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
5068dc407927Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5069dc407927Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5070dc407927Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
5071dc407927Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5072dc407927Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5073dc407927Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
5074dc407927Smrg      runpath_var='LD_RUN_PATH'
50753eed67faSmbalmer
5076dc407927Smrg      if test "$GCC" = yes; then
5077dc407927Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5078dc407927Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5079dc407927Smrg      else
5080dc407927Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5081dc407927Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5082dc407927Smrg      fi
5083dc407927Smrg      ;;
50843eed67faSmbalmer
5085dc407927Smrg    uts4*)
5086dc407927Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5087dc407927Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5088dc407927Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5089dc407927Smrg      ;;
50903eed67faSmbalmer
5091dc407927Smrg    *)
5092dc407927Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
5093dc407927Smrg      ;;
5094dc407927Smrg    esac
50953eed67faSmbalmer
5096dc407927Smrg    if test x$host_vendor = xsni; then
5097dc407927Smrg      case $host in
5098dc407927Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5099dc407927Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
5100dc407927Smrg	;;
5101dc407927Smrg      esac
5102dc407927Smrg    fi
5103dc407927Smrg  fi
5104dc407927Smrg])
5105dc407927SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
5106dc407927Smrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
51073eed67faSmbalmer
5108dc407927Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
51093eed67faSmbalmer
5110dc407927Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
5111dc407927Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
5112dc407927Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
5113dc407927Smrg    [The commands to extract the exported symbol list from a shared archive])
51143eed67faSmbalmer
5115dc407927Smrg#
5116dc407927Smrg# Do we need to explicitly link libc?
5117dc407927Smrg#
5118dc407927Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
5119dc407927Smrgx|xyes)
5120dc407927Smrg  # Assume -lc should be added
5121dc407927Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
51223eed67faSmbalmer
5123dc407927Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
5124dc407927Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
5125dc407927Smrg    *'~'*)
5126dc407927Smrg      # FIXME: we may have to deal with multi-command sequences.
5127dc407927Smrg      ;;
5128dc407927Smrg    '$CC '*)
5129dc407927Smrg      # Test whether the compiler implicitly links with -lc since on some
5130dc407927Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
5131dc407927Smrg      # to ld, don't add -lc before -lgcc.
5132dc407927Smrg      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
5133dc407927Smrg      $RM conftest*
5134dc407927Smrg      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
51353eed67faSmbalmer
5136dc407927Smrg      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
5137dc407927Smrg        soname=conftest
5138dc407927Smrg        lib=conftest
5139dc407927Smrg        libobjs=conftest.$ac_objext
5140dc407927Smrg        deplibs=
5141dc407927Smrg        wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
5142dc407927Smrg	pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
5143dc407927Smrg        compiler_flags=-v
5144dc407927Smrg        linker_flags=-v
5145dc407927Smrg        verstring=
5146dc407927Smrg        output_objdir=.
5147dc407927Smrg        libname=conftest
5148dc407927Smrg        lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
5149dc407927Smrg        _LT_TAGVAR(allow_undefined_flag, $1)=
5150dc407927Smrg        if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
5151dc407927Smrg        then
5152dc407927Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5153dc407927Smrg        else
5154dc407927Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5155dc407927Smrg        fi
5156dc407927Smrg        _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
5157dc407927Smrg      else
5158dc407927Smrg        cat conftest.err 1>&5
5159dc407927Smrg      fi
5160dc407927Smrg      $RM conftest*
5161dc407927Smrg      AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
5162dc407927Smrg      ;;
5163dc407927Smrg    esac
5164dc407927Smrg  fi
5165dc407927Smrg  ;;
5166dc407927Smrgesac
51673eed67faSmbalmer
5168dc407927Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
5169dc407927Smrg    [Whether or not to add -lc for building shared libraries])
5170dc407927Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
5171dc407927Smrg    [enable_shared_with_static_runtimes], [0],
5172dc407927Smrg    [Whether or not to disallow shared libs when runtime libs are static])
5173dc407927Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
5174dc407927Smrg    [Compiler flag to allow reflexive dlopens])
5175dc407927Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
5176dc407927Smrg    [Compiler flag to generate shared objects directly from archives])
5177dc407927Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
5178dc407927Smrg    [Whether the compiler copes with passing no objects directly])
5179dc407927Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
5180dc407927Smrg    [Create an old-style archive from a shared archive])
5181dc407927Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
5182dc407927Smrg    [Create a temporary old-style archive to link instead of a shared archive])
5183dc407927Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
5184dc407927Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
5185dc407927Smrg_LT_TAGDECL([], [module_cmds], [2],
5186dc407927Smrg    [Commands used to build a loadable module if different from building
5187dc407927Smrg    a shared archive.])
5188dc407927Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
5189dc407927Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
5190dc407927Smrg    [Whether we are building with GNU ld or not])
5191dc407927Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
5192dc407927Smrg    [Flag that allows shared libraries with undefined symbols to be built])
5193dc407927Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
5194dc407927Smrg    [Flag that enforces no undefined symbols])
5195dc407927Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
5196dc407927Smrg    [Flag to hardcode $libdir into a binary during linking.
5197dc407927Smrg    This must work even if $libdir does not exist])
5198dc407927Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
5199dc407927Smrg    [[If ld is used when linking, flag to hardcode $libdir into a binary
5200dc407927Smrg    during linking.  This must work even if $libdir does not exist]])
5201dc407927Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
5202dc407927Smrg    [Whether we need a single "-rpath" flag with a separated argument])
5203dc407927Smrg_LT_TAGDECL([], [hardcode_direct], [0],
5204dc407927Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5205dc407927Smrg    DIR into the resulting binary])
5206dc407927Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
5207dc407927Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5208dc407927Smrg    DIR into the resulting binary and the resulting library dependency is
5209dc407927Smrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
5210dc407927Smrg    library is relocated])
5211dc407927Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
5212dc407927Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
5213dc407927Smrg    into the resulting binary])
5214dc407927Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
5215dc407927Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
5216dc407927Smrg    into the resulting binary])
5217dc407927Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
5218dc407927Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
5219dc407927Smrg    into the library and all subsequent libraries and executables linked
5220dc407927Smrg    against it])
5221dc407927Smrg_LT_TAGDECL([], [inherit_rpath], [0],
5222dc407927Smrg    [Set to yes if linker adds runtime paths of dependent libraries
5223dc407927Smrg    to runtime path list])
5224dc407927Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
5225dc407927Smrg    [Whether libtool must link a program against all its dependency libraries])
5226dc407927Smrg_LT_TAGDECL([], [fix_srcfile_path], [1],
5227dc407927Smrg    [Fix the shell variable $srcfile for the compiler])
5228dc407927Smrg_LT_TAGDECL([], [always_export_symbols], [0],
5229dc407927Smrg    [Set to "yes" if exported symbols are required])
5230dc407927Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
5231dc407927Smrg    [The commands to list exported symbols])
5232dc407927Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
5233dc407927Smrg    [Symbols that should not be listed in the preloaded symbols])
5234dc407927Smrg_LT_TAGDECL([], [include_expsyms], [1],
5235dc407927Smrg    [Symbols that must always be exported])
5236dc407927Smrg_LT_TAGDECL([], [prelink_cmds], [2],
5237dc407927Smrg    [Commands necessary for linking programs (against libraries) with templates])
5238dc407927Smrg_LT_TAGDECL([], [file_list_spec], [1],
5239dc407927Smrg    [Specify filename containing input files])
5240dc407927Smrgdnl FIXME: Not yet implemented
5241dc407927Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
5242dc407927Smrgdnl    [Compiler flag to generate thread safe objects])
5243dc407927Smrg])# _LT_LINKER_SHLIBS
5244dc407927Smrg
5245dc407927Smrg
5246dc407927Smrg# _LT_LANG_C_CONFIG([TAG])
5247dc407927Smrg# ------------------------
5248dc407927Smrg# Ensure that the configuration variables for a C compiler are suitably
5249dc407927Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
5250dc407927Smrg# the compiler configuration to `libtool'.
5251dc407927Smrgm4_defun([_LT_LANG_C_CONFIG],
5252dc407927Smrg[m4_require([_LT_DECL_EGREP])dnl
5253dc407927Smrglt_save_CC="$CC"
5254dc407927SmrgAC_LANG_PUSH(C)
52553eed67faSmbalmer
5256dc407927Smrg# Source file extension for C test sources.
5257dc407927Smrgac_ext=c
52583eed67faSmbalmer
5259dc407927Smrg# Object file extension for compiled C test sources.
5260dc407927Smrgobjext=o
5261dc407927Smrg_LT_TAGVAR(objext, $1)=$objext
52623eed67faSmbalmer
5263dc407927Smrg# Code to be used in simple compile tests
5264dc407927Smrglt_simple_compile_test_code="int some_variable = 0;"
52653eed67faSmbalmer
5266dc407927Smrg# Code to be used in simple link tests
5267dc407927Smrglt_simple_link_test_code='int main(){return(0);}'
52683eed67faSmbalmer
5269dc407927Smrg_LT_TAG_COMPILER
5270dc407927Smrg# Save the default compiler, since it gets overwritten when the other
5271dc407927Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
5272dc407927Smrgcompiler_DEFAULT=$CC
52733eed67faSmbalmer
5274dc407927Smrg# save warnings/boilerplate of simple test code
5275dc407927Smrg_LT_COMPILER_BOILERPLATE
5276dc407927Smrg_LT_LINKER_BOILERPLATE
52773eed67faSmbalmer
5278dc407927Smrgif test -n "$compiler"; then
5279dc407927Smrg  _LT_COMPILER_NO_RTTI($1)
5280dc407927Smrg  _LT_COMPILER_PIC($1)
5281dc407927Smrg  _LT_COMPILER_C_O($1)
5282dc407927Smrg  _LT_COMPILER_FILE_LOCKS($1)
5283dc407927Smrg  _LT_LINKER_SHLIBS($1)
5284dc407927Smrg  _LT_SYS_DYNAMIC_LINKER($1)
5285dc407927Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
5286dc407927Smrg  LT_SYS_DLOPEN_SELF
5287dc407927Smrg  _LT_CMD_STRIPLIB
5288dc407927Smrg
5289dc407927Smrg  # Report which library types will actually be built
5290dc407927Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
5291dc407927Smrg  AC_MSG_RESULT([$can_build_shared])
5292dc407927Smrg
5293dc407927Smrg  AC_MSG_CHECKING([whether to build shared libraries])
5294dc407927Smrg  test "$can_build_shared" = "no" && enable_shared=no
5295dc407927Smrg
5296dc407927Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
5297dc407927Smrg  # are all built from PIC.
5298dc407927Smrg  case $host_os in
5299dc407927Smrg  aix3*)
5300dc407927Smrg    test "$enable_shared" = yes && enable_static=no
5301dc407927Smrg    if test -n "$RANLIB"; then
5302dc407927Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
5303dc407927Smrg      postinstall_cmds='$RANLIB $lib'
5304dc407927Smrg    fi
5305dc407927Smrg    ;;
53063eed67faSmbalmer
5307dc407927Smrg  aix[[4-9]]*)
5308dc407927Smrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
5309dc407927Smrg      test "$enable_shared" = yes && enable_static=no
5310dc407927Smrg    fi
5311dc407927Smrg    ;;
5312dc407927Smrg  esac
5313dc407927Smrg  AC_MSG_RESULT([$enable_shared])
53143eed67faSmbalmer
5315dc407927Smrg  AC_MSG_CHECKING([whether to build static libraries])
5316dc407927Smrg  # Make sure either enable_shared or enable_static is yes.
5317dc407927Smrg  test "$enable_shared" = yes || enable_static=yes
5318dc407927Smrg  AC_MSG_RESULT([$enable_static])
53193eed67faSmbalmer
5320dc407927Smrg  _LT_CONFIG($1)
5321dc407927Smrgfi
5322dc407927SmrgAC_LANG_POP
5323dc407927SmrgCC="$lt_save_CC"
5324dc407927Smrg])# _LT_LANG_C_CONFIG
53253eed67faSmbalmer
53263eed67faSmbalmer
5327dc407927Smrg# _LT_PROG_CXX
5328dc407927Smrg# ------------
5329dc407927Smrg# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
5330dc407927Smrg# compiler, we have our own version here.
5331dc407927Smrgm4_defun([_LT_PROG_CXX],
5332dc407927Smrg[
5333dc407927Smrgpushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
5334dc407927SmrgAC_PROG_CXX
5335dc407927Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
5336dc407927Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
5337dc407927Smrg    (test "X$CXX" != "Xg++"))) ; then
5338dc407927Smrg  AC_PROG_CXXCPP
5339dc407927Smrgelse
5340dc407927Smrg  _lt_caught_CXX_error=yes
5341dc407927Smrgfi
5342dc407927Smrgpopdef([AC_MSG_ERROR])
5343dc407927Smrg])# _LT_PROG_CXX
53443eed67faSmbalmer
5345dc407927Smrgdnl aclocal-1.4 backwards compatibility:
5346dc407927Smrgdnl AC_DEFUN([_LT_PROG_CXX], [])
53473eed67faSmbalmer
53483eed67faSmbalmer
5349dc407927Smrg# _LT_LANG_CXX_CONFIG([TAG])
5350dc407927Smrg# --------------------------
5351dc407927Smrg# Ensure that the configuration variables for a C++ compiler are suitably
5352dc407927Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
5353dc407927Smrg# the compiler configuration to `libtool'.
5354dc407927Smrgm4_defun([_LT_LANG_CXX_CONFIG],
5355dc407927Smrg[AC_REQUIRE([_LT_PROG_CXX])dnl
5356dc407927Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
5357dc407927Smrgm4_require([_LT_DECL_EGREP])dnl
5358dc407927Smrg
5359dc407927SmrgAC_LANG_PUSH(C++)
5360dc407927Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
5361dc407927Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
5362dc407927Smrg_LT_TAGVAR(always_export_symbols, $1)=no
5363dc407927Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
5364dc407927Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
5365dc407927Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
5366dc407927Smrg_LT_TAGVAR(hardcode_direct, $1)=no
5367dc407927Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
5368dc407927Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5369dc407927Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
5370dc407927Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
5371dc407927Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
5372dc407927Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5373dc407927Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
5374dc407927Smrg_LT_TAGVAR(inherit_rpath, $1)=no
5375dc407927Smrg_LT_TAGVAR(module_cmds, $1)=
5376dc407927Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
5377dc407927Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
5378dc407927Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
5379dc407927Smrg_LT_TAGVAR(no_undefined_flag, $1)=
5380dc407927Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
5381dc407927Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
53823eed67faSmbalmer
5383dc407927Smrg# Source file extension for C++ test sources.
5384dc407927Smrgac_ext=cpp
53853eed67faSmbalmer
5386dc407927Smrg# Object file extension for compiled C++ test sources.
5387dc407927Smrgobjext=o
5388dc407927Smrg_LT_TAGVAR(objext, $1)=$objext
5389dc407927Smrg
5390dc407927Smrg# No sense in running all these tests if we already determined that
5391dc407927Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
5392dc407927Smrg# are currently assumed to apply to all compilers on this platform,
5393dc407927Smrg# and will be corrupted by setting them based on a non-working compiler.
5394dc407927Smrgif test "$_lt_caught_CXX_error" != yes; then
5395dc407927Smrg  # Code to be used in simple compile tests
5396dc407927Smrg  lt_simple_compile_test_code="int some_variable = 0;"
5397dc407927Smrg
5398dc407927Smrg  # Code to be used in simple link tests
5399dc407927Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
5400dc407927Smrg
5401dc407927Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
5402dc407927Smrg  _LT_TAG_COMPILER
5403dc407927Smrg
5404dc407927Smrg  # save warnings/boilerplate of simple test code
5405dc407927Smrg  _LT_COMPILER_BOILERPLATE
5406dc407927Smrg  _LT_LINKER_BOILERPLATE
5407dc407927Smrg
5408dc407927Smrg  # Allow CC to be a program name with arguments.
5409dc407927Smrg  lt_save_CC=$CC
5410dc407927Smrg  lt_save_LD=$LD
5411dc407927Smrg  lt_save_GCC=$GCC
5412dc407927Smrg  GCC=$GXX
5413dc407927Smrg  lt_save_with_gnu_ld=$with_gnu_ld
5414dc407927Smrg  lt_save_path_LD=$lt_cv_path_LD
5415dc407927Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
5416dc407927Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
5417dc407927Smrg  else
5418dc407927Smrg    $as_unset lt_cv_prog_gnu_ld
5419dc407927Smrg  fi
5420dc407927Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
5421dc407927Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
5422dc407927Smrg  else
5423dc407927Smrg    $as_unset lt_cv_path_LD
5424dc407927Smrg  fi
5425dc407927Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
5426dc407927Smrg  CC=${CXX-"c++"}
5427dc407927Smrg  compiler=$CC
5428dc407927Smrg  _LT_TAGVAR(compiler, $1)=$CC
5429dc407927Smrg  _LT_CC_BASENAME([$compiler])
54303eed67faSmbalmer
5431dc407927Smrg  if test -n "$compiler"; then
5432dc407927Smrg    # We don't want -fno-exception when compiling C++ code, so set the
5433dc407927Smrg    # no_builtin_flag separately
5434dc407927Smrg    if test "$GXX" = yes; then
5435dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
5436dc407927Smrg    else
5437dc407927Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
5438dc407927Smrg    fi
54393eed67faSmbalmer
5440dc407927Smrg    if test "$GXX" = yes; then
5441dc407927Smrg      # Set up default GNU C++ configuration
54423eed67faSmbalmer
5443dc407927Smrg      LT_PATH_LD
54443eed67faSmbalmer
5445dc407927Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
5446dc407927Smrg      # archiving commands below assume that GNU ld is being used.
5447dc407927Smrg      if test "$with_gnu_ld" = yes; then
5448dc407927Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5449dc407927Smrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
54503eed67faSmbalmer
5451dc407927Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5452dc407927Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
54533eed67faSmbalmer
5454dc407927Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
5455dc407927Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
5456dc407927Smrg        #     investigate it a little bit more. (MM)
5457dc407927Smrg        wlarc='${wl}'
54583eed67faSmbalmer
5459dc407927Smrg        # ancient GNU ld didn't support --whole-archive et. al.
5460dc407927Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
5461dc407927Smrg	  $GREP 'no-whole-archive' > /dev/null; then
5462dc407927Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5463dc407927Smrg        else
5464dc407927Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
5465dc407927Smrg        fi
5466dc407927Smrg      else
5467dc407927Smrg        with_gnu_ld=no
5468dc407927Smrg        wlarc=
5469dc407927Smrg
5470dc407927Smrg        # A generic and very simple default shared library creation
5471dc407927Smrg        # command for GNU C++ for the case where it uses the native
5472dc407927Smrg        # linker, instead of GNU ld.  If possible, this setting should
5473dc407927Smrg        # overridden to take advantage of the native linker features on
5474dc407927Smrg        # the platform it is being used on.
5475dc407927Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
5476dc407927Smrg      fi
54773eed67faSmbalmer
5478dc407927Smrg      # Commands to make compiler produce verbose output that lists
5479dc407927Smrg      # what "hidden" libraries, object files and flags are used when
5480dc407927Smrg      # linking a shared library.
5481dc407927Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
54823eed67faSmbalmer
5483dc407927Smrg    else
5484dc407927Smrg      GXX=no
5485dc407927Smrg      with_gnu_ld=no
5486dc407927Smrg      wlarc=
5487dc407927Smrg    fi
54883eed67faSmbalmer
5489dc407927Smrg    # PORTME: fill in a description of your system's C++ link characteristics
5490dc407927Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5491dc407927Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
5492dc407927Smrg    case $host_os in
5493dc407927Smrg      aix3*)
5494dc407927Smrg        # FIXME: insert proper C++ library support
5495dc407927Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
5496dc407927Smrg        ;;
5497dc407927Smrg      aix[[4-9]]*)
5498dc407927Smrg        if test "$host_cpu" = ia64; then
5499dc407927Smrg          # On IA64, the linker does run time linking by default, so we don't
5500dc407927Smrg          # have to do anything special.
5501dc407927Smrg          aix_use_runtimelinking=no
5502dc407927Smrg          exp_sym_flag='-Bexport'
5503dc407927Smrg          no_entry_flag=""
5504dc407927Smrg        else
5505dc407927Smrg          aix_use_runtimelinking=no
5506dc407927Smrg
5507dc407927Smrg          # Test if we are trying to use run time linking or normal
5508dc407927Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5509dc407927Smrg          # need to do runtime linking.
5510dc407927Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5511dc407927Smrg	    for ld_flag in $LDFLAGS; do
5512dc407927Smrg	      case $ld_flag in
5513dc407927Smrg	      *-brtl*)
5514dc407927Smrg	        aix_use_runtimelinking=yes
5515dc407927Smrg	        break
5516dc407927Smrg	        ;;
5517dc407927Smrg	      esac
5518dc407927Smrg	    done
5519dc407927Smrg	    ;;
5520dc407927Smrg          esac
55213eed67faSmbalmer
5522dc407927Smrg          exp_sym_flag='-bexport'
5523dc407927Smrg          no_entry_flag='-bnoentry'
5524dc407927Smrg        fi
55253eed67faSmbalmer
5526dc407927Smrg        # When large executables or shared objects are built, AIX ld can
5527dc407927Smrg        # have problems creating the table of contents.  If linking a library
5528dc407927Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
5529dc407927Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5530dc407927Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5531dc407927Smrg
5532dc407927Smrg        _LT_TAGVAR(archive_cmds, $1)=''
5533dc407927Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
5534dc407927Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5535dc407927Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5536dc407927Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
5537dc407927Smrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
5538dc407927Smrg
5539dc407927Smrg        if test "$GXX" = yes; then
5540dc407927Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
5541dc407927Smrg          # We only want to do this on AIX 4.2 and lower, the check
5542dc407927Smrg          # below for broken collect2 doesn't work under 4.3+
5543dc407927Smrg	  collect2name=`${CC} -print-prog-name=collect2`
5544dc407927Smrg	  if test -f "$collect2name" &&
5545dc407927Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5546dc407927Smrg	  then
5547dc407927Smrg	    # We have reworked collect2
5548dc407927Smrg	    :
5549dc407927Smrg	  else
5550dc407927Smrg	    # We have old collect2
5551dc407927Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
5552dc407927Smrg	    # It fails to find uninstalled libraries when the uninstalled
5553dc407927Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
5554dc407927Smrg	    # to unsupported forces relinking
5555dc407927Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
5556dc407927Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5557dc407927Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
5558dc407927Smrg	  fi
5559dc407927Smrg          esac
5560dc407927Smrg          shared_flag='-shared'
5561dc407927Smrg	  if test "$aix_use_runtimelinking" = yes; then
5562dc407927Smrg	    shared_flag="$shared_flag "'${wl}-G'
5563dc407927Smrg	  fi
5564dc407927Smrg        else
5565dc407927Smrg          # not using gcc
5566dc407927Smrg          if test "$host_cpu" = ia64; then
5567dc407927Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5568dc407927Smrg	  # chokes on -Wl,-G. The following line is correct:
5569dc407927Smrg	  shared_flag='-G'
5570dc407927Smrg          else
5571dc407927Smrg	    if test "$aix_use_runtimelinking" = yes; then
5572dc407927Smrg	      shared_flag='${wl}-G'
5573dc407927Smrg	    else
5574dc407927Smrg	      shared_flag='${wl}-bM:SRE'
5575dc407927Smrg	    fi
5576dc407927Smrg          fi
5577dc407927Smrg        fi
55783eed67faSmbalmer
5579dc407927Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
5580dc407927Smrg        # It seems that -bexpall does not export symbols beginning with
5581dc407927Smrg        # underscore (_), so it is better to generate a list of symbols to
5582dc407927Smrg	# export.
5583dc407927Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
5584dc407927Smrg        if test "$aix_use_runtimelinking" = yes; then
5585dc407927Smrg          # Warning - without using the other runtime loading flags (-brtl),
5586dc407927Smrg          # -berok will link without error, but may produce a broken library.
5587dc407927Smrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5588dc407927Smrg          # Determine the default libpath from the value encoded in an empty
5589dc407927Smrg          # executable.
5590dc407927Smrg          _LT_SYS_MODULE_PATH_AIX
5591dc407927Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5592dc407927Smrg
5593dc407927Smrg          _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 $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
5594dc407927Smrg        else
5595dc407927Smrg          if test "$host_cpu" = ia64; then
5596dc407927Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
5597dc407927Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5598dc407927Smrg	    _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"
5599dc407927Smrg          else
5600dc407927Smrg	    # Determine the default libpath from the value encoded in an
5601dc407927Smrg	    # empty executable.
5602dc407927Smrg	    _LT_SYS_MODULE_PATH_AIX
5603dc407927Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5604dc407927Smrg	    # Warning - without using the other run time loading flags,
5605dc407927Smrg	    # -berok will link without error, but may produce a broken library.
5606dc407927Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
5607dc407927Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
5608dc407927Smrg	    # Exported symbols can be pulled into shared objects from archives
5609dc407927Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5610dc407927Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5611dc407927Smrg	    # This is similar to how AIX traditionally builds its shared
5612dc407927Smrg	    # libraries.
5613dc407927Smrg	    _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'
5614dc407927Smrg          fi
5615dc407927Smrg        fi
5616dc407927Smrg        ;;
56173eed67faSmbalmer
5618dc407927Smrg      beos*)
5619dc407927Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5620dc407927Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5621dc407927Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5622dc407927Smrg	  # support --undefined.  This deserves some investigation.  FIXME
5623dc407927Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5624dc407927Smrg	else
5625dc407927Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
5626dc407927Smrg	fi
5627dc407927Smrg	;;
56283eed67faSmbalmer
5629dc407927Smrg      chorus*)
5630dc407927Smrg        case $cc_basename in
5631dc407927Smrg          *)
5632dc407927Smrg	  # FIXME: insert proper C++ library support
5633dc407927Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
5634dc407927Smrg	  ;;
5635dc407927Smrg        esac
5636dc407927Smrg        ;;
56373eed67faSmbalmer
5638dc407927Smrg      cygwin* | mingw* | pw32* | cegcc*)
5639dc407927Smrg        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5640dc407927Smrg        # as there is no search path for DLLs.
5641dc407927Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5642dc407927Smrg        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5643dc407927Smrg        _LT_TAGVAR(always_export_symbols, $1)=no
5644dc407927Smrg        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5645dc407927Smrg
5646dc407927Smrg        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5647dc407927Smrg          _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'
5648dc407927Smrg          # If the export-symbols file already is a .def file (1st line
5649dc407927Smrg          # is EXPORTS), use it as is; otherwise, prepend...
5650dc407927Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5651dc407927Smrg	    cp $export_symbols $output_objdir/$soname.def;
5652dc407927Smrg          else
5653dc407927Smrg	    echo EXPORTS > $output_objdir/$soname.def;
5654dc407927Smrg	    cat $export_symbols >> $output_objdir/$soname.def;
5655dc407927Smrg          fi~
5656dc407927Smrg          $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'
5657dc407927Smrg        else
5658dc407927Smrg          _LT_TAGVAR(ld_shlibs, $1)=no
5659dc407927Smrg        fi
5660dc407927Smrg        ;;
5661dc407927Smrg      darwin* | rhapsody*)
5662dc407927Smrg        _LT_DARWIN_LINKER_FEATURES($1)
5663dc407927Smrg	;;
56643eed67faSmbalmer
5665dc407927Smrg      dgux*)
5666dc407927Smrg        case $cc_basename in
5667dc407927Smrg          ec++*)
5668dc407927Smrg	    # FIXME: insert proper C++ library support
5669dc407927Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5670dc407927Smrg	    ;;
5671dc407927Smrg          ghcx*)
5672dc407927Smrg	    # Green Hills C++ Compiler
5673dc407927Smrg	    # FIXME: insert proper C++ library support
5674dc407927Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5675dc407927Smrg	    ;;
5676dc407927Smrg          *)
5677dc407927Smrg	    # FIXME: insert proper C++ library support
5678dc407927Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5679dc407927Smrg	    ;;
5680dc407927Smrg        esac
5681dc407927Smrg        ;;
56823eed67faSmbalmer
5683dc407927Smrg      freebsd[[12]]*)
5684dc407927Smrg        # C++ shared libraries reported to be fairly broken before
5685dc407927Smrg	# switch to ELF
5686dc407927Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
5687dc407927Smrg        ;;
56883eed67faSmbalmer
5689dc407927Smrg      freebsd-elf*)
5690dc407927Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5691dc407927Smrg        ;;
5692dc407927Smrg
5693dc407927Smrg      freebsd* | dragonfly*)
5694dc407927Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
5695dc407927Smrg        # conventions
5696dc407927Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
5697dc407927Smrg        ;;
56983eed67faSmbalmer
5699dc407927Smrg      gnu*)
5700dc407927Smrg        ;;
57013eed67faSmbalmer
5702dc407927Smrg      hpux9*)
5703dc407927Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5704dc407927Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5705dc407927Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5706dc407927Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
5707dc407927Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
5708dc407927Smrg				             # but as the default
5709dc407927Smrg				             # location of the library.
5710dc407927Smrg
5711dc407927Smrg        case $cc_basename in
5712dc407927Smrg          CC*)
5713dc407927Smrg            # FIXME: insert proper C++ library support
5714dc407927Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
5715dc407927Smrg            ;;
5716dc407927Smrg          aCC*)
5717dc407927Smrg            _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'
5718dc407927Smrg            # Commands to make compiler produce verbose output that lists
5719dc407927Smrg            # what "hidden" libraries, object files and flags are used when
5720dc407927Smrg            # linking a shared library.
5721dc407927Smrg            #
5722dc407927Smrg            # There doesn't appear to be a way to prevent this compiler from
5723dc407927Smrg            # explicitly linking system object files so we need to strip them
5724dc407927Smrg            # from the output so that they don't get included in the library
5725dc407927Smrg            # dependencies.
5726dc407927Smrg            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; $ECHO "X$list" | $Xsed'
5727dc407927Smrg            ;;
5728dc407927Smrg          *)
5729dc407927Smrg            if test "$GXX" = yes; then
5730dc407927Smrg              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${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'
5731dc407927Smrg            else
5732dc407927Smrg              # FIXME: insert proper C++ library support
5733dc407927Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
5734dc407927Smrg            fi
5735dc407927Smrg            ;;
5736dc407927Smrg        esac
5737dc407927Smrg        ;;
57383eed67faSmbalmer
5739dc407927Smrg      hpux10*|hpux11*)
5740dc407927Smrg        if test $with_gnu_ld = no; then
5741dc407927Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5742dc407927Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5743dc407927Smrg
5744dc407927Smrg          case $host_cpu in
5745dc407927Smrg            hppa*64*|ia64*)
5746dc407927Smrg              ;;
5747dc407927Smrg            *)
5748dc407927Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5749dc407927Smrg              ;;
5750dc407927Smrg          esac
5751dc407927Smrg        fi
5752dc407927Smrg        case $host_cpu in
5753dc407927Smrg          hppa*64*|ia64*)
5754dc407927Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
5755dc407927Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5756dc407927Smrg            ;;
5757dc407927Smrg          *)
5758dc407927Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
5759dc407927Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5760dc407927Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
5761dc407927Smrg					         # but as the default
5762dc407927Smrg					         # location of the library.
5763dc407927Smrg            ;;
5764dc407927Smrg        esac
5765dc407927Smrg
5766dc407927Smrg        case $cc_basename in
5767dc407927Smrg          CC*)
5768dc407927Smrg	    # FIXME: insert proper C++ library support
5769dc407927Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5770dc407927Smrg	    ;;
5771dc407927Smrg          aCC*)
5772dc407927Smrg	    case $host_cpu in
5773dc407927Smrg	      hppa*64*)
5774dc407927Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5775dc407927Smrg	        ;;
5776dc407927Smrg	      ia64*)
5777dc407927Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5778dc407927Smrg	        ;;
5779dc407927Smrg	      *)
5780dc407927Smrg	        _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'
5781dc407927Smrg	        ;;
5782dc407927Smrg	    esac
5783dc407927Smrg	    # Commands to make compiler produce verbose output that lists
5784dc407927Smrg	    # what "hidden" libraries, object files and flags are used when
5785dc407927Smrg	    # linking a shared library.
5786dc407927Smrg	    #
5787dc407927Smrg	    # There doesn't appear to be a way to prevent this compiler from
5788dc407927Smrg	    # explicitly linking system object files so we need to strip them
5789dc407927Smrg	    # from the output so that they don't get included in the library
5790dc407927Smrg	    # dependencies.
5791dc407927Smrg	    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; $ECHO "X$list" | $Xsed'
5792dc407927Smrg	    ;;
5793dc407927Smrg          *)
5794dc407927Smrg	    if test "$GXX" = yes; then
5795dc407927Smrg	      if test $with_gnu_ld = no; then
5796dc407927Smrg	        case $host_cpu in
5797dc407927Smrg	          hppa*64*)
5798dc407927Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5799dc407927Smrg	            ;;
5800dc407927Smrg	          ia64*)
5801dc407927Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5802dc407927Smrg	            ;;
5803dc407927Smrg	          *)
5804dc407927Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5805dc407927Smrg	            ;;
5806dc407927Smrg	        esac
5807dc407927Smrg	      fi
5808dc407927Smrg	    else
5809dc407927Smrg	      # FIXME: insert proper C++ library support
5810dc407927Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
5811dc407927Smrg	    fi
5812dc407927Smrg	    ;;
5813dc407927Smrg        esac
5814dc407927Smrg        ;;
58153eed67faSmbalmer
5816dc407927Smrg      interix[[3-9]]*)
5817dc407927Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
5818dc407927Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5819dc407927Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5820dc407927Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5821dc407927Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5822dc407927Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
5823dc407927Smrg	# default) and relocated if they conflict, which is a slow very memory
5824dc407927Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
5825dc407927Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5826dc407927Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5827dc407927Smrg	_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'
5828dc407927Smrg	_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'
5829dc407927Smrg	;;
5830dc407927Smrg      irix5* | irix6*)
5831dc407927Smrg        case $cc_basename in
5832dc407927Smrg          CC*)
5833dc407927Smrg	    # SGI C++
5834dc407927Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
5835dc407927Smrg
5836dc407927Smrg	    # Archives containing C++ object files must be created using
5837dc407927Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
5838dc407927Smrg	    # necessary to make sure instantiated templates are included
5839dc407927Smrg	    # in the archive.
5840dc407927Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
5841dc407927Smrg	    ;;
5842dc407927Smrg          *)
5843dc407927Smrg	    if test "$GXX" = yes; then
5844dc407927Smrg	      if test "$with_gnu_ld" = no; then
5845dc407927Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5846dc407927Smrg	      else
5847dc407927Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
5848dc407927Smrg	      fi
5849dc407927Smrg	    fi
5850dc407927Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
5851dc407927Smrg	    ;;
5852dc407927Smrg        esac
5853dc407927Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5854dc407927Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5855dc407927Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
5856dc407927Smrg        ;;
58573eed67faSmbalmer
5858dc407927Smrg      linux* | k*bsd*-gnu)
5859dc407927Smrg        case $cc_basename in
5860dc407927Smrg          KCC*)
5861dc407927Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
5862dc407927Smrg
5863dc407927Smrg	    # KCC will only create a shared library if the output file
5864dc407927Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
5865dc407927Smrg	    # to its proper name (with version) after linking.
5866dc407927Smrg	    _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'
5867dc407927Smrg	    _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'
5868dc407927Smrg	    # Commands to make compiler produce verbose output that lists
5869dc407927Smrg	    # what "hidden" libraries, object files and flags are used when
5870dc407927Smrg	    # linking a shared library.
5871dc407927Smrg	    #
5872dc407927Smrg	    # There doesn't appear to be a way to prevent this compiler from
5873dc407927Smrg	    # explicitly linking system object files so we need to strip them
5874dc407927Smrg	    # from the output so that they don't get included in the library
5875dc407927Smrg	    # dependencies.
5876dc407927Smrg	    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; $ECHO "X$list" | $Xsed'
5877dc407927Smrg
5878dc407927Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5879dc407927Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5880dc407927Smrg
5881dc407927Smrg	    # Archives containing C++ object files must be created using
5882dc407927Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
5883dc407927Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
5884dc407927Smrg	    ;;
5885dc407927Smrg	  icpc* | ecpc* )
5886dc407927Smrg	    # Intel C++
5887dc407927Smrg	    with_gnu_ld=yes
5888dc407927Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
5889dc407927Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
5890dc407927Smrg	    # earlier do not add the objects themselves.
5891dc407927Smrg	    case `$CC -V 2>&1` in
5892dc407927Smrg	      *"Version 7."*)
5893dc407927Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5894dc407927Smrg		_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'
5895dc407927Smrg		;;
5896dc407927Smrg	      *)  # Version 8.0 or newer
5897dc407927Smrg	        tmp_idyn=
5898dc407927Smrg	        case $host_cpu in
5899dc407927Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
5900dc407927Smrg		esac
5901dc407927Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5902dc407927Smrg		_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'
5903dc407927Smrg		;;
5904dc407927Smrg	    esac
5905dc407927Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5906dc407927Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5907dc407927Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5908dc407927Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
5909dc407927Smrg	    ;;
5910dc407927Smrg          pgCC* | pgcpp*)
5911dc407927Smrg            # Portland Group C++ compiler
5912dc407927Smrg	    case `$CC -V` in
5913dc407927Smrg	    *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
5914dc407927Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
5915dc407927Smrg		rm -rf $tpldir~
5916dc407927Smrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
5917dc407927Smrg		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
5918dc407927Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
5919dc407927Smrg		rm -rf $tpldir~
5920dc407927Smrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
5921dc407927Smrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
5922dc407927Smrg		$RANLIB $oldlib'
5923dc407927Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
5924dc407927Smrg		rm -rf $tpldir~
5925dc407927Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
5926dc407927Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
5927dc407927Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
5928dc407927Smrg		rm -rf $tpldir~
5929dc407927Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
5930dc407927Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
5931dc407927Smrg	      ;;
5932dc407927Smrg	    *) # Version 6 will use weak symbols
5933dc407927Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
5934dc407927Smrg	      _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'
5935dc407927Smrg	      ;;
5936dc407927Smrg	    esac
59373eed67faSmbalmer
5938dc407927Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
5939dc407927Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5940dc407927Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
5941dc407927Smrg            ;;
5942dc407927Smrg	  cxx*)
5943dc407927Smrg	    # Compaq C++
5944dc407927Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5945dc407927Smrg	    _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'
59463eed67faSmbalmer
5947dc407927Smrg	    runpath_var=LD_RUN_PATH
5948dc407927Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5949dc407927Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
59503eed67faSmbalmer
5951dc407927Smrg	    # Commands to make compiler produce verbose output that lists
5952dc407927Smrg	    # what "hidden" libraries, object files and flags are used when
5953dc407927Smrg	    # linking a shared library.
5954dc407927Smrg	    #
5955dc407927Smrg	    # There doesn't appear to be a way to prevent this compiler from
5956dc407927Smrg	    # explicitly linking system object files so we need to strip them
5957dc407927Smrg	    # from the output so that they don't get included in the library
5958dc407927Smrg	    # dependencies.
5959dc407927Smrg	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
5960dc407927Smrg	    ;;
5961dc407927Smrg	  xl*)
5962dc407927Smrg	    # IBM XL 8.0 on PPC, with GNU ld
5963dc407927Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5964dc407927Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5965dc407927Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5966dc407927Smrg	    if test "x$supports_anon_versioning" = xyes; then
5967dc407927Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5968dc407927Smrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5969dc407927Smrg		echo "local: *; };" >> $output_objdir/$libname.ver~
5970dc407927Smrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5971dc407927Smrg	    fi
5972dc407927Smrg	    ;;
5973dc407927Smrg	  *)
5974dc407927Smrg	    case `$CC -V 2>&1 | sed 5q` in
5975dc407927Smrg	    *Sun\ C*)
5976dc407927Smrg	      # Sun C++ 5.9
5977dc407927Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
5978dc407927Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5979dc407927Smrg	      _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'
5980dc407927Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5981dc407927Smrg	      _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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
5982dc407927Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
5983dc407927Smrg
5984dc407927Smrg	      # Not sure whether something based on
5985dc407927Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
5986dc407927Smrg	      # would be better.
5987dc407927Smrg	      output_verbose_link_cmd='echo'
5988dc407927Smrg
5989dc407927Smrg	      # Archives containing C++ object files must be created using
5990dc407927Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
5991dc407927Smrg	      # necessary to make sure instantiated templates are included
5992dc407927Smrg	      # in the archive.
5993dc407927Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
5994dc407927Smrg	      ;;
5995dc407927Smrg	    esac
5996dc407927Smrg	    ;;
5997dc407927Smrg	esac
5998dc407927Smrg	;;
59993eed67faSmbalmer
6000dc407927Smrg      lynxos*)
6001dc407927Smrg        # FIXME: insert proper C++ library support
6002dc407927Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
6003dc407927Smrg	;;
60043eed67faSmbalmer
6005dc407927Smrg      m88k*)
6006dc407927Smrg        # FIXME: insert proper C++ library support
6007dc407927Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6008dc407927Smrg	;;
60093eed67faSmbalmer
6010dc407927Smrg      mvs*)
6011dc407927Smrg        case $cc_basename in
6012dc407927Smrg          cxx*)
6013dc407927Smrg	    # FIXME: insert proper C++ library support
6014dc407927Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6015dc407927Smrg	    ;;
6016dc407927Smrg	  *)
6017dc407927Smrg	    # FIXME: insert proper C++ library support
6018dc407927Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6019dc407927Smrg	    ;;
6020dc407927Smrg	esac
6021dc407927Smrg	;;
60223eed67faSmbalmer
6023dc407927Smrg      netbsd*)
6024dc407927Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6025dc407927Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
6026dc407927Smrg	  wlarc=
6027dc407927Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6028dc407927Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
6029dc407927Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6030dc407927Smrg	fi
6031dc407927Smrg	# Workaround some broken pre-1.5 toolchains
6032dc407927Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
6033dc407927Smrg	;;
60343eed67faSmbalmer
6035dc407927Smrg      *nto* | *qnx*)
6036dc407927Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
6037dc407927Smrg	;;
60383eed67faSmbalmer
6039dc407927Smrg      openbsd2*)
6040dc407927Smrg        # C++ shared libraries are fairly broken
6041dc407927Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
6042dc407927Smrg	;;
60433eed67faSmbalmer
6044dc407927Smrg      openbsd*)
6045dc407927Smrg	if test -f /usr/libexec/ld.so; then
6046dc407927Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
6047dc407927Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6048dc407927Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6049dc407927Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6050dc407927Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6051dc407927Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6052dc407927Smrg	    _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'
6053dc407927Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6054dc407927Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6055dc407927Smrg	  fi
6056dc407927Smrg	  output_verbose_link_cmd=echo
6057dc407927Smrg	else
6058dc407927Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6059dc407927Smrg	fi
6060dc407927Smrg	;;
60613eed67faSmbalmer
6062dc407927Smrg      osf3* | osf4* | osf5*)
6063dc407927Smrg        case $cc_basename in
6064dc407927Smrg          KCC*)
6065dc407927Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6066dc407927Smrg
6067dc407927Smrg	    # KCC will only create a shared library if the output file
6068dc407927Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6069dc407927Smrg	    # to its proper name (with version) after linking.
6070dc407927Smrg	    _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'
6071dc407927Smrg
6072dc407927Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6073dc407927Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6074dc407927Smrg
6075dc407927Smrg	    # Archives containing C++ object files must be created using
6076dc407927Smrg	    # the KAI C++ compiler.
6077dc407927Smrg	    case $host in
6078dc407927Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
6079dc407927Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
6080dc407927Smrg	    esac
6081dc407927Smrg	    ;;
6082dc407927Smrg          RCC*)
6083dc407927Smrg	    # Rational C++ 2.4.1
6084dc407927Smrg	    # FIXME: insert proper C++ library support
6085dc407927Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6086dc407927Smrg	    ;;
6087dc407927Smrg          cxx*)
6088dc407927Smrg	    case $host in
6089dc407927Smrg	      osf3*)
6090dc407927Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6091dc407927Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
6092dc407927Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6093dc407927Smrg		;;
6094dc407927Smrg	      *)
6095dc407927Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6096dc407927Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
6097dc407927Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
6098dc407927Smrg	          echo "-hidden">> $lib.exp~
6099dc407927Smrg	          $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 "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
6100dc407927Smrg	          $RM $lib.exp'
6101dc407927Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6102dc407927Smrg		;;
6103dc407927Smrg	    esac
61043eed67faSmbalmer
6105dc407927Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
61063eed67faSmbalmer
6107dc407927Smrg	    # Commands to make compiler produce verbose output that lists
6108dc407927Smrg	    # what "hidden" libraries, object files and flags are used when
6109dc407927Smrg	    # linking a shared library.
6110dc407927Smrg	    #
6111dc407927Smrg	    # There doesn't appear to be a way to prevent this compiler from
6112dc407927Smrg	    # explicitly linking system object files so we need to strip them
6113dc407927Smrg	    # from the output so that they don't get included in the library
6114dc407927Smrg	    # dependencies.
6115dc407927Smrg	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
6116dc407927Smrg	    ;;
6117dc407927Smrg	  *)
6118dc407927Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6119dc407927Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6120dc407927Smrg	      case $host in
6121dc407927Smrg	        osf3*)
6122dc407927Smrg	          _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" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6123dc407927Smrg		  ;;
6124dc407927Smrg	        *)
6125dc407927Smrg	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6126dc407927Smrg		  ;;
6127dc407927Smrg	      esac
6128dc407927Smrg
6129dc407927Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6130dc407927Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6131dc407927Smrg
6132dc407927Smrg	      # Commands to make compiler produce verbose output that lists
6133dc407927Smrg	      # what "hidden" libraries, object files and flags are used when
6134dc407927Smrg	      # linking a shared library.
6135dc407927Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6136dc407927Smrg
6137dc407927Smrg	    else
6138dc407927Smrg	      # FIXME: insert proper C++ library support
6139dc407927Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
6140dc407927Smrg	    fi
6141dc407927Smrg	    ;;
6142dc407927Smrg        esac
6143dc407927Smrg        ;;
61443eed67faSmbalmer
6145dc407927Smrg      psos*)
6146dc407927Smrg        # FIXME: insert proper C++ library support
6147dc407927Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6148dc407927Smrg        ;;
61493eed67faSmbalmer
6150dc407927Smrg      sunos4*)
6151dc407927Smrg        case $cc_basename in
6152dc407927Smrg          CC*)
6153dc407927Smrg	    # Sun C++ 4.x
6154dc407927Smrg	    # FIXME: insert proper C++ library support
6155dc407927Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6156dc407927Smrg	    ;;
6157dc407927Smrg          lcc*)
6158dc407927Smrg	    # Lucid
6159dc407927Smrg	    # FIXME: insert proper C++ library support
6160dc407927Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6161dc407927Smrg	    ;;
6162dc407927Smrg          *)
6163dc407927Smrg	    # FIXME: insert proper C++ library support
6164dc407927Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6165dc407927Smrg	    ;;
6166dc407927Smrg        esac
6167dc407927Smrg        ;;
61683eed67faSmbalmer
6169dc407927Smrg      solaris*)
6170dc407927Smrg        case $cc_basename in
6171dc407927Smrg          CC*)
6172dc407927Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
6173dc407927Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
6174dc407927Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6175dc407927Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6176dc407927Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6177dc407927Smrg	      $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'
6178dc407927Smrg
6179dc407927Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6180dc407927Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6181dc407927Smrg	    case $host_os in
6182dc407927Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6183dc407927Smrg	      *)
6184dc407927Smrg		# The compiler driver will combine and reorder linker options,
6185dc407927Smrg		# but understands `-z linker_flag'.
6186dc407927Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
6187dc407927Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6188dc407927Smrg	        ;;
6189dc407927Smrg	    esac
6190dc407927Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
61913eed67faSmbalmer
6192dc407927Smrg	    output_verbose_link_cmd='echo'
61933eed67faSmbalmer
6194dc407927Smrg	    # Archives containing C++ object files must be created using
6195dc407927Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
6196dc407927Smrg	    # necessary to make sure instantiated templates are included
6197dc407927Smrg	    # in the archive.
6198dc407927Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6199dc407927Smrg	    ;;
6200dc407927Smrg          gcx*)
6201dc407927Smrg	    # Green Hills C++ Compiler
6202dc407927Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
62033eed67faSmbalmer
6204dc407927Smrg	    # The C++ compiler must be used to create the archive.
6205dc407927Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
6206dc407927Smrg	    ;;
6207dc407927Smrg          *)
6208dc407927Smrg	    # GNU C++ compiler with Solaris linker
6209dc407927Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6210dc407927Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
6211dc407927Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
6212dc407927Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6213dc407927Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6214dc407927Smrg		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6215dc407927Smrg
6216dc407927Smrg	        # Commands to make compiler produce verbose output that lists
6217dc407927Smrg	        # what "hidden" libraries, object files and flags are used when
6218dc407927Smrg	        # linking a shared library.
6219dc407927Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6220dc407927Smrg	      else
6221dc407927Smrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
6222dc407927Smrg	        # platform.
6223dc407927Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6224dc407927Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6225dc407927Smrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6226dc407927Smrg
6227dc407927Smrg	        # Commands to make compiler produce verbose output that lists
6228dc407927Smrg	        # what "hidden" libraries, object files and flags are used when
6229dc407927Smrg	        # linking a shared library.
6230dc407927Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6231dc407927Smrg	      fi
6232dc407927Smrg
6233dc407927Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
6234dc407927Smrg	      case $host_os in
6235dc407927Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6236dc407927Smrg		*)
6237dc407927Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6238dc407927Smrg		  ;;
6239dc407927Smrg	      esac
6240dc407927Smrg	    fi
6241dc407927Smrg	    ;;
6242dc407927Smrg        esac
6243dc407927Smrg        ;;
62443eed67faSmbalmer
6245dc407927Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6246dc407927Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6247dc407927Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6248dc407927Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6249dc407927Smrg      runpath_var='LD_RUN_PATH'
62503eed67faSmbalmer
6251dc407927Smrg      case $cc_basename in
6252dc407927Smrg        CC*)
6253dc407927Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6254dc407927Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6255dc407927Smrg	  ;;
6256dc407927Smrg	*)
6257dc407927Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6258dc407927Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6259dc407927Smrg	  ;;
6260dc407927Smrg      esac
6261dc407927Smrg      ;;
62623eed67faSmbalmer
6263dc407927Smrg      sysv5* | sco3.2v5* | sco5v6*)
6264dc407927Smrg	# Note: We can NOT use -z defs as we might desire, because we do not
6265dc407927Smrg	# link with -lc, and that would cause any symbols used from libc to
6266dc407927Smrg	# always be unresolved, which means just about no library would
6267dc407927Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
6268dc407927Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
6269dc407927Smrg	# as -z defs.
6270dc407927Smrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6271dc407927Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6272dc407927Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6273dc407927Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6274dc407927Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6275dc407927Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6276dc407927Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
6277dc407927Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6278dc407927Smrg	runpath_var='LD_RUN_PATH'
62793eed67faSmbalmer
6280dc407927Smrg	case $cc_basename in
6281dc407927Smrg          CC*)
6282dc407927Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6283dc407927Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6284dc407927Smrg	    ;;
6285dc407927Smrg	  *)
6286dc407927Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6287dc407927Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6288dc407927Smrg	    ;;
6289dc407927Smrg	esac
6290dc407927Smrg      ;;
62913eed67faSmbalmer
6292dc407927Smrg      tandem*)
6293dc407927Smrg        case $cc_basename in
6294dc407927Smrg          NCC*)
6295dc407927Smrg	    # NonStop-UX NCC 3.20
6296dc407927Smrg	    # FIXME: insert proper C++ library support
6297dc407927Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6298dc407927Smrg	    ;;
6299dc407927Smrg          *)
6300dc407927Smrg	    # FIXME: insert proper C++ library support
6301dc407927Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6302dc407927Smrg	    ;;
6303dc407927Smrg        esac
6304dc407927Smrg        ;;
63053eed67faSmbalmer
6306dc407927Smrg      vxworks*)
6307dc407927Smrg        # FIXME: insert proper C++ library support
6308dc407927Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6309dc407927Smrg        ;;
63103eed67faSmbalmer
6311dc407927Smrg      *)
6312dc407927Smrg        # FIXME: insert proper C++ library support
6313dc407927Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6314dc407927Smrg        ;;
6315dc407927Smrg    esac
63163eed67faSmbalmer
6317dc407927Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6318dc407927Smrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6319dc407927Smrg
6320dc407927Smrg    _LT_TAGVAR(GCC, $1)="$GXX"
6321dc407927Smrg    _LT_TAGVAR(LD, $1)="$LD"
6322dc407927Smrg
6323dc407927Smrg    ## CAVEAT EMPTOR:
6324dc407927Smrg    ## There is no encapsulation within the following macros, do not change
6325dc407927Smrg    ## the running order or otherwise move them around unless you know exactly
6326dc407927Smrg    ## what you are doing...
6327dc407927Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
6328dc407927Smrg    _LT_COMPILER_PIC($1)
6329dc407927Smrg    _LT_COMPILER_C_O($1)
6330dc407927Smrg    _LT_COMPILER_FILE_LOCKS($1)
6331dc407927Smrg    _LT_LINKER_SHLIBS($1)
6332dc407927Smrg    _LT_SYS_DYNAMIC_LINKER($1)
6333dc407927Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
6334dc407927Smrg
6335dc407927Smrg    _LT_CONFIG($1)
6336dc407927Smrg  fi # test -n "$compiler"
6337dc407927Smrg
6338dc407927Smrg  CC=$lt_save_CC
6339dc407927Smrg  LDCXX=$LD
6340dc407927Smrg  LD=$lt_save_LD
6341dc407927Smrg  GCC=$lt_save_GCC
6342dc407927Smrg  with_gnu_ld=$lt_save_with_gnu_ld
6343dc407927Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
6344dc407927Smrg  lt_cv_path_LD=$lt_save_path_LD
6345dc407927Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
6346dc407927Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
6347dc407927Smrgfi # test "$_lt_caught_CXX_error" != yes
63483eed67faSmbalmer
6349dc407927SmrgAC_LANG_POP
6350dc407927Smrg])# _LT_LANG_CXX_CONFIG
63513eed67faSmbalmer
63523eed67faSmbalmer
6353dc407927Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
6354dc407927Smrg# ---------------------------------
6355dc407927Smrg# Figure out "hidden" library dependencies from verbose
6356dc407927Smrg# compiler output when linking a shared library.
6357dc407927Smrg# Parse the compiler output and extract the necessary
6358dc407927Smrg# objects, libraries and library flags.
6359dc407927Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
6360dc407927Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6361dc407927Smrg# Dependencies to place before and after the object being linked:
6362dc407927Smrg_LT_TAGVAR(predep_objects, $1)=
6363dc407927Smrg_LT_TAGVAR(postdep_objects, $1)=
6364dc407927Smrg_LT_TAGVAR(predeps, $1)=
6365dc407927Smrg_LT_TAGVAR(postdeps, $1)=
6366dc407927Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
63673eed67faSmbalmer
6368dc407927Smrgdnl we can't use the lt_simple_compile_test_code here,
6369dc407927Smrgdnl because it contains code intended for an executable,
6370dc407927Smrgdnl not a library.  It's possible we should let each
6371dc407927Smrgdnl tag define a new lt_????_link_test_code variable,
6372dc407927Smrgdnl but it's only used here...
6373dc407927Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
6374dc407927Smrgint a;
6375dc407927Smrgvoid foo (void) { a = 0; }
6376dc407927Smrg_LT_EOF
6377dc407927Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
6378dc407927Smrgclass Foo
6379dc407927Smrg{
6380dc407927Smrgpublic:
6381dc407927Smrg  Foo (void) { a = 0; }
6382dc407927Smrgprivate:
6383dc407927Smrg  int a;
6384dc407927Smrg};
6385dc407927Smrg_LT_EOF
6386dc407927Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
6387dc407927Smrg      subroutine foo
6388dc407927Smrg      implicit none
6389dc407927Smrg      integer*4 a
6390dc407927Smrg      a=0
6391dc407927Smrg      return
6392dc407927Smrg      end
6393dc407927Smrg_LT_EOF
6394dc407927Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
6395dc407927Smrg      subroutine foo
6396dc407927Smrg      implicit none
6397dc407927Smrg      integer a
6398dc407927Smrg      a=0
6399dc407927Smrg      return
6400dc407927Smrg      end
6401dc407927Smrg_LT_EOF
6402dc407927Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
6403dc407927Smrgpublic class foo {
6404dc407927Smrg  private int a;
6405dc407927Smrg  public void bar (void) {
6406dc407927Smrg    a = 0;
6407dc407927Smrg  }
6408dc407927Smrg};
6409dc407927Smrg_LT_EOF
6410dc407927Smrg])
6411dc407927Smrgdnl Parse the compiler output and extract the necessary
6412dc407927Smrgdnl objects, libraries and library flags.
6413dc407927Smrgif AC_TRY_EVAL(ac_compile); then
6414dc407927Smrg  # Parse the compiler output and extract the necessary
6415dc407927Smrg  # objects, libraries and library flags.
64163eed67faSmbalmer
6417dc407927Smrg  # Sentinel used to keep track of whether or not we are before
6418dc407927Smrg  # the conftest object file.
6419dc407927Smrg  pre_test_object_deps_done=no
64203eed67faSmbalmer
6421dc407927Smrg  for p in `eval "$output_verbose_link_cmd"`; do
6422dc407927Smrg    case $p in
64233eed67faSmbalmer
6424dc407927Smrg    -L* | -R* | -l*)
6425dc407927Smrg       # Some compilers place space between "-{L,R}" and the path.
6426dc407927Smrg       # Remove the space.
6427dc407927Smrg       if test $p = "-L" ||
6428dc407927Smrg          test $p = "-R"; then
6429dc407927Smrg	 prev=$p
6430dc407927Smrg	 continue
6431dc407927Smrg       else
6432dc407927Smrg	 prev=
6433dc407927Smrg       fi
64343eed67faSmbalmer
6435dc407927Smrg       if test "$pre_test_object_deps_done" = no; then
6436dc407927Smrg	 case $p in
6437dc407927Smrg	 -L* | -R*)
6438dc407927Smrg	   # Internal compiler library paths should come after those
6439dc407927Smrg	   # provided the user.  The postdeps already come after the
6440dc407927Smrg	   # user supplied libs so there is no need to process them.
6441dc407927Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
6442dc407927Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
6443dc407927Smrg	   else
6444dc407927Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
6445dc407927Smrg	   fi
6446dc407927Smrg	   ;;
6447dc407927Smrg	 # The "-l" case would never come before the object being
6448dc407927Smrg	 # linked, so don't bother handling this case.
6449dc407927Smrg	 esac
6450dc407927Smrg       else
6451dc407927Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
6452dc407927Smrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
6453dc407927Smrg	 else
6454dc407927Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
6455dc407927Smrg	 fi
6456dc407927Smrg       fi
6457dc407927Smrg       ;;
64583eed67faSmbalmer
6459dc407927Smrg    *.$objext)
6460dc407927Smrg       # This assumes that the test object file only shows up
6461dc407927Smrg       # once in the compiler output.
6462dc407927Smrg       if test "$p" = "conftest.$objext"; then
6463dc407927Smrg	 pre_test_object_deps_done=yes
6464dc407927Smrg	 continue
6465dc407927Smrg       fi
64663eed67faSmbalmer
6467dc407927Smrg       if test "$pre_test_object_deps_done" = no; then
6468dc407927Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
6469dc407927Smrg	   _LT_TAGVAR(predep_objects, $1)="$p"
6470dc407927Smrg	 else
6471dc407927Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
6472dc407927Smrg	 fi
6473dc407927Smrg       else
6474dc407927Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
6475dc407927Smrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
6476dc407927Smrg	 else
6477dc407927Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
6478dc407927Smrg	 fi
6479dc407927Smrg       fi
6480dc407927Smrg       ;;
64813eed67faSmbalmer
6482dc407927Smrg    *) ;; # Ignore the rest.
64833eed67faSmbalmer
6484dc407927Smrg    esac
6485dc407927Smrg  done
64863eed67faSmbalmer
6487dc407927Smrg  # Clean up.
6488dc407927Smrg  rm -f a.out a.exe
64893eed67faSmbalmerelse
6490dc407927Smrg  echo "libtool.m4: error: problem compiling $1 test program"
64913eed67faSmbalmerfi
64923eed67faSmbalmer
6493dc407927Smrg$RM -f confest.$objext
64943eed67faSmbalmer
6495dc407927Smrg# PORTME: override above test on systems where it is broken
6496dc407927Smrgm4_if([$1], [CXX],
6497dc407927Smrg[case $host_os in
6498dc407927Smrginterix[[3-9]]*)
6499dc407927Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
6500dc407927Smrg  # hack all around it, let's just trust "g++" to DTRT.
6501dc407927Smrg  _LT_TAGVAR(predep_objects,$1)=
6502dc407927Smrg  _LT_TAGVAR(postdep_objects,$1)=
6503dc407927Smrg  _LT_TAGVAR(postdeps,$1)=
6504dc407927Smrg  ;;
65053eed67faSmbalmer
6506dc407927Smrglinux*)
6507dc407927Smrg  case `$CC -V 2>&1 | sed 5q` in
6508dc407927Smrg  *Sun\ C*)
6509dc407927Smrg    # Sun C++ 5.9
65103eed67faSmbalmer
6511dc407927Smrg    # The more standards-conforming stlport4 library is
6512dc407927Smrg    # incompatible with the Cstd library. Avoid specifying
6513dc407927Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
6514dc407927Smrg    # -library=stlport4 depends on it.
6515dc407927Smrg    case " $CXX $CXXFLAGS " in
6516dc407927Smrg    *" -library=stlport4 "*)
6517dc407927Smrg      solaris_use_stlport4=yes
6518dc407927Smrg      ;;
6519dc407927Smrg    esac
65203eed67faSmbalmer
6521dc407927Smrg    if test "$solaris_use_stlport4" != yes; then
6522dc407927Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
6523dc407927Smrg    fi
6524dc407927Smrg    ;;
6525dc407927Smrg  esac
6526dc407927Smrg  ;;
6527dc407927Smrg
6528dc407927Smrgsolaris*)
6529dc407927Smrg  case $cc_basename in
6530dc407927Smrg  CC*)
6531dc407927Smrg    # The more standards-conforming stlport4 library is
6532dc407927Smrg    # incompatible with the Cstd library. Avoid specifying
6533dc407927Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
6534dc407927Smrg    # -library=stlport4 depends on it.
6535dc407927Smrg    case " $CXX $CXXFLAGS " in
6536dc407927Smrg    *" -library=stlport4 "*)
6537dc407927Smrg      solaris_use_stlport4=yes
6538dc407927Smrg      ;;
6539dc407927Smrg    esac
65403eed67faSmbalmer
6541dc407927Smrg    # Adding this requires a known-good setup of shared libraries for
6542dc407927Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
6543dc407927Smrg    # archive will be linked into the output, leading to subtle bugs.
6544dc407927Smrg    if test "$solaris_use_stlport4" != yes; then
6545dc407927Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
6546dc407927Smrg    fi
6547dc407927Smrg    ;;
6548dc407927Smrg  esac
6549dc407927Smrg  ;;
6550dc407927Smrgesac
6551dc407927Smrg])
65523eed67faSmbalmer
6553dc407927Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
6554dc407927Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
6555dc407927Smrgesac
6556dc407927Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
6557dc407927Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
6558dc407927Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
6559dc407927Smrgfi
6560dc407927Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
6561dc407927Smrg    [The directories searched by this compiler when creating a shared library])
6562dc407927Smrg_LT_TAGDECL([], [predep_objects], [1],
6563dc407927Smrg    [Dependencies to place before and after the objects being linked to
6564dc407927Smrg    create a shared library])
6565dc407927Smrg_LT_TAGDECL([], [postdep_objects], [1])
6566dc407927Smrg_LT_TAGDECL([], [predeps], [1])
6567dc407927Smrg_LT_TAGDECL([], [postdeps], [1])
6568dc407927Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
6569dc407927Smrg    [The library search path used internally by the compiler when linking
6570dc407927Smrg    a shared library])
6571dc407927Smrg])# _LT_SYS_HIDDEN_LIBDEPS
6572dc407927Smrg
6573dc407927Smrg
6574dc407927Smrg# _LT_PROG_F77
6575dc407927Smrg# ------------
6576dc407927Smrg# Since AC_PROG_F77 is broken, in that it returns the empty string
6577dc407927Smrg# if there is no fortran compiler, we have our own version here.
6578dc407927Smrgm4_defun([_LT_PROG_F77],
65793eed67faSmbalmer[
6580dc407927Smrgpushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
6581dc407927SmrgAC_PROG_F77
6582dc407927Smrgif test -z "$F77" || test "X$F77" = "Xno"; then
6583dc407927Smrg  _lt_disable_F77=yes
6584dc407927Smrgfi
6585dc407927Smrgpopdef([AC_MSG_ERROR])
6586dc407927Smrg])# _LT_PROG_F77
65873eed67faSmbalmer
6588dc407927Smrgdnl aclocal-1.4 backwards compatibility:
6589dc407927Smrgdnl AC_DEFUN([_LT_PROG_F77], [])
65903eed67faSmbalmer
65913eed67faSmbalmer
6592dc407927Smrg# _LT_LANG_F77_CONFIG([TAG])
6593dc407927Smrg# --------------------------
6594dc407927Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
6595dc407927Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
6596dc407927Smrg# to write the compiler configuration to `libtool'.
6597dc407927Smrgm4_defun([_LT_LANG_F77_CONFIG],
6598dc407927Smrg[AC_REQUIRE([_LT_PROG_F77])dnl
6599dc407927SmrgAC_LANG_PUSH(Fortran 77)
66003eed67faSmbalmer
6601dc407927Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6602dc407927Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
6603dc407927Smrg_LT_TAGVAR(always_export_symbols, $1)=no
6604dc407927Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
6605dc407927Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6606dc407927Smrg_LT_TAGVAR(hardcode_direct, $1)=no
6607dc407927Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6608dc407927Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6609dc407927Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6610dc407927Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
6611dc407927Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
6612dc407927Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
6613dc407927Smrg_LT_TAGVAR(inherit_rpath, $1)=no
6614dc407927Smrg_LT_TAGVAR(module_cmds, $1)=
6615dc407927Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
6616dc407927Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
6617dc407927Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6618dc407927Smrg_LT_TAGVAR(no_undefined_flag, $1)=
6619dc407927Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
6620dc407927Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
66213eed67faSmbalmer
6622dc407927Smrg# Source file extension for f77 test sources.
6623dc407927Smrgac_ext=f
66243eed67faSmbalmer
6625dc407927Smrg# Object file extension for compiled f77 test sources.
6626dc407927Smrgobjext=o
6627dc407927Smrg_LT_TAGVAR(objext, $1)=$objext
6628dc407927Smrg
6629dc407927Smrg# No sense in running all these tests if we already determined that
6630dc407927Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
6631dc407927Smrg# are currently assumed to apply to all compilers on this platform,
6632dc407927Smrg# and will be corrupted by setting them based on a non-working compiler.
6633dc407927Smrgif test "$_lt_disable_F77" != yes; then
6634dc407927Smrg  # Code to be used in simple compile tests
6635dc407927Smrg  lt_simple_compile_test_code="\
6636dc407927Smrg      subroutine t
6637dc407927Smrg      return
6638dc407927Smrg      end
6639dc407927Smrg"
66403eed67faSmbalmer
6641dc407927Smrg  # Code to be used in simple link tests
6642dc407927Smrg  lt_simple_link_test_code="\
6643dc407927Smrg      program t
6644dc407927Smrg      end
6645dc407927Smrg"
66463eed67faSmbalmer
6647dc407927Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6648dc407927Smrg  _LT_TAG_COMPILER
66493eed67faSmbalmer
6650dc407927Smrg  # save warnings/boilerplate of simple test code
6651dc407927Smrg  _LT_COMPILER_BOILERPLATE
6652dc407927Smrg  _LT_LINKER_BOILERPLATE
66533eed67faSmbalmer
6654dc407927Smrg  # Allow CC to be a program name with arguments.
6655dc407927Smrg  lt_save_CC="$CC"
6656dc407927Smrg  lt_save_GCC=$GCC
6657dc407927Smrg  CC=${F77-"f77"}
6658dc407927Smrg  compiler=$CC
6659dc407927Smrg  _LT_TAGVAR(compiler, $1)=$CC
6660dc407927Smrg  _LT_CC_BASENAME([$compiler])
6661dc407927Smrg  GCC=$G77
6662dc407927Smrg  if test -n "$compiler"; then
6663dc407927Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
6664dc407927Smrg    AC_MSG_RESULT([$can_build_shared])
66653eed67faSmbalmer
6666dc407927Smrg    AC_MSG_CHECKING([whether to build shared libraries])
6667dc407927Smrg    test "$can_build_shared" = "no" && enable_shared=no
66683eed67faSmbalmer
6669dc407927Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
6670dc407927Smrg    # are all built from PIC.
6671dc407927Smrg    case $host_os in
6672dc407927Smrg      aix3*)
6673dc407927Smrg        test "$enable_shared" = yes && enable_static=no
6674dc407927Smrg        if test -n "$RANLIB"; then
6675dc407927Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
6676dc407927Smrg          postinstall_cmds='$RANLIB $lib'
6677dc407927Smrg        fi
6678dc407927Smrg        ;;
6679dc407927Smrg      aix[[4-9]]*)
6680dc407927Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6681dc407927Smrg	  test "$enable_shared" = yes && enable_static=no
6682dc407927Smrg	fi
6683dc407927Smrg        ;;
6684dc407927Smrg    esac
6685dc407927Smrg    AC_MSG_RESULT([$enable_shared])
6686dc407927Smrg
6687dc407927Smrg    AC_MSG_CHECKING([whether to build static libraries])
6688dc407927Smrg    # Make sure either enable_shared or enable_static is yes.
6689dc407927Smrg    test "$enable_shared" = yes || enable_static=yes
6690dc407927Smrg    AC_MSG_RESULT([$enable_static])
6691dc407927Smrg
6692dc407927Smrg    _LT_TAGVAR(GCC, $1)="$G77"
6693dc407927Smrg    _LT_TAGVAR(LD, $1)="$LD"
6694dc407927Smrg
6695dc407927Smrg    ## CAVEAT EMPTOR:
6696dc407927Smrg    ## There is no encapsulation within the following macros, do not change
6697dc407927Smrg    ## the running order or otherwise move them around unless you know exactly
6698dc407927Smrg    ## what you are doing...
6699dc407927Smrg    _LT_COMPILER_PIC($1)
6700dc407927Smrg    _LT_COMPILER_C_O($1)
6701dc407927Smrg    _LT_COMPILER_FILE_LOCKS($1)
6702dc407927Smrg    _LT_LINKER_SHLIBS($1)
6703dc407927Smrg    _LT_SYS_DYNAMIC_LINKER($1)
6704dc407927Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
6705dc407927Smrg
6706dc407927Smrg    _LT_CONFIG($1)
6707dc407927Smrg  fi # test -n "$compiler"
6708dc407927Smrg
6709dc407927Smrg  GCC=$lt_save_GCC
6710dc407927Smrg  CC="$lt_save_CC"
6711dc407927Smrgfi # test "$_lt_disable_F77" != yes
67123eed67faSmbalmer
6713dc407927SmrgAC_LANG_POP
6714dc407927Smrg])# _LT_LANG_F77_CONFIG
67153eed67faSmbalmer
67163eed67faSmbalmer
6717dc407927Smrg# _LT_PROG_FC
6718dc407927Smrg# -----------
6719dc407927Smrg# Since AC_PROG_FC is broken, in that it returns the empty string
6720dc407927Smrg# if there is no fortran compiler, we have our own version here.
6721dc407927Smrgm4_defun([_LT_PROG_FC],
6722dc407927Smrg[
6723dc407927Smrgpushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
6724dc407927SmrgAC_PROG_FC
6725dc407927Smrgif test -z "$FC" || test "X$FC" = "Xno"; then
6726dc407927Smrg  _lt_disable_FC=yes
6727dc407927Smrgfi
6728dc407927Smrgpopdef([AC_MSG_ERROR])
6729dc407927Smrg])# _LT_PROG_FC
67303eed67faSmbalmer
6731dc407927Smrgdnl aclocal-1.4 backwards compatibility:
6732dc407927Smrgdnl AC_DEFUN([_LT_PROG_FC], [])
67333eed67faSmbalmer
67343eed67faSmbalmer
6735dc407927Smrg# _LT_LANG_FC_CONFIG([TAG])
6736dc407927Smrg# -------------------------
6737dc407927Smrg# Ensure that the configuration variables for a Fortran compiler are
6738dc407927Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
6739dc407927Smrg# to write the compiler configuration to `libtool'.
6740dc407927Smrgm4_defun([_LT_LANG_FC_CONFIG],
6741dc407927Smrg[AC_REQUIRE([_LT_PROG_FC])dnl
6742dc407927SmrgAC_LANG_PUSH(Fortran)
6743dc407927Smrg
6744dc407927Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6745dc407927Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
6746dc407927Smrg_LT_TAGVAR(always_export_symbols, $1)=no
6747dc407927Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
6748dc407927Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6749dc407927Smrg_LT_TAGVAR(hardcode_direct, $1)=no
6750dc407927Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6751dc407927Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6752dc407927Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6753dc407927Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
6754dc407927Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
6755dc407927Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
6756dc407927Smrg_LT_TAGVAR(inherit_rpath, $1)=no
6757dc407927Smrg_LT_TAGVAR(module_cmds, $1)=
6758dc407927Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
6759dc407927Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
6760dc407927Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6761dc407927Smrg_LT_TAGVAR(no_undefined_flag, $1)=
6762dc407927Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
6763dc407927Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6764dc407927Smrg
6765dc407927Smrg# Source file extension for fc test sources.
6766dc407927Smrgac_ext=${ac_fc_srcext-f}
6767dc407927Smrg
6768dc407927Smrg# Object file extension for compiled fc test sources.
6769dc407927Smrgobjext=o
6770dc407927Smrg_LT_TAGVAR(objext, $1)=$objext
6771dc407927Smrg
6772dc407927Smrg# No sense in running all these tests if we already determined that
6773dc407927Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
6774dc407927Smrg# are currently assumed to apply to all compilers on this platform,
6775dc407927Smrg# and will be corrupted by setting them based on a non-working compiler.
6776dc407927Smrgif test "$_lt_disable_FC" != yes; then
6777dc407927Smrg  # Code to be used in simple compile tests
6778dc407927Smrg  lt_simple_compile_test_code="\
6779dc407927Smrg      subroutine t
6780dc407927Smrg      return
6781dc407927Smrg      end
6782dc407927Smrg"
67833eed67faSmbalmer
6784dc407927Smrg  # Code to be used in simple link tests
6785dc407927Smrg  lt_simple_link_test_code="\
6786dc407927Smrg      program t
6787dc407927Smrg      end
6788dc407927Smrg"
67893eed67faSmbalmer
6790dc407927Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6791dc407927Smrg  _LT_TAG_COMPILER
67923eed67faSmbalmer
6793dc407927Smrg  # save warnings/boilerplate of simple test code
6794dc407927Smrg  _LT_COMPILER_BOILERPLATE
6795dc407927Smrg  _LT_LINKER_BOILERPLATE
67963eed67faSmbalmer
6797dc407927Smrg  # Allow CC to be a program name with arguments.
6798dc407927Smrg  lt_save_CC="$CC"
6799dc407927Smrg  lt_save_GCC=$GCC
6800dc407927Smrg  CC=${FC-"f95"}
6801dc407927Smrg  compiler=$CC
6802dc407927Smrg  GCC=$ac_cv_fc_compiler_gnu
6803dc407927Smrg
6804dc407927Smrg  _LT_TAGVAR(compiler, $1)=$CC
6805dc407927Smrg  _LT_CC_BASENAME([$compiler])
68063eed67faSmbalmer
6807dc407927Smrg  if test -n "$compiler"; then
6808dc407927Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
6809dc407927Smrg    AC_MSG_RESULT([$can_build_shared])
6810dc407927Smrg
6811dc407927Smrg    AC_MSG_CHECKING([whether to build shared libraries])
6812dc407927Smrg    test "$can_build_shared" = "no" && enable_shared=no
6813dc407927Smrg
6814dc407927Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
6815dc407927Smrg    # are all built from PIC.
68163eed67faSmbalmer    case $host_os in
6817dc407927Smrg      aix3*)
6818dc407927Smrg        test "$enable_shared" = yes && enable_static=no
6819dc407927Smrg        if test -n "$RANLIB"; then
6820dc407927Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
6821dc407927Smrg          postinstall_cmds='$RANLIB $lib'
6822dc407927Smrg        fi
6823dc407927Smrg        ;;
68243eed67faSmbalmer      aix[[4-9]]*)
6825dc407927Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6826dc407927Smrg	  test "$enable_shared" = yes && enable_static=no
68273eed67faSmbalmer	fi
6828dc407927Smrg        ;;
68293eed67faSmbalmer    esac
6830dc407927Smrg    AC_MSG_RESULT([$enable_shared])
6831dc407927Smrg
6832dc407927Smrg    AC_MSG_CHECKING([whether to build static libraries])
6833dc407927Smrg    # Make sure either enable_shared or enable_static is yes.
6834dc407927Smrg    test "$enable_shared" = yes || enable_static=yes
6835dc407927Smrg    AC_MSG_RESULT([$enable_static])
6836dc407927Smrg
6837dc407927Smrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
6838dc407927Smrg    _LT_TAGVAR(LD, $1)="$LD"
6839dc407927Smrg
6840dc407927Smrg    ## CAVEAT EMPTOR:
6841dc407927Smrg    ## There is no encapsulation within the following macros, do not change
6842dc407927Smrg    ## the running order or otherwise move them around unless you know exactly
6843dc407927Smrg    ## what you are doing...
6844dc407927Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
6845dc407927Smrg    _LT_COMPILER_PIC($1)
6846dc407927Smrg    _LT_COMPILER_C_O($1)
6847dc407927Smrg    _LT_COMPILER_FILE_LOCKS($1)
6848dc407927Smrg    _LT_LINKER_SHLIBS($1)
6849dc407927Smrg    _LT_SYS_DYNAMIC_LINKER($1)
6850dc407927Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
6851dc407927Smrg
6852dc407927Smrg    _LT_CONFIG($1)
6853dc407927Smrg  fi # test -n "$compiler"
6854dc407927Smrg
6855dc407927Smrg  GCC=$lt_save_GCC
6856dc407927Smrg  CC="$lt_save_CC"
6857dc407927Smrgfi # test "$_lt_disable_FC" != yes
68583eed67faSmbalmer
6859dc407927SmrgAC_LANG_POP
6860dc407927Smrg])# _LT_LANG_FC_CONFIG
68613eed67faSmbalmer
68623eed67faSmbalmer
6863dc407927Smrg# _LT_LANG_GCJ_CONFIG([TAG])
6864dc407927Smrg# --------------------------
6865dc407927Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
6866dc407927Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
6867dc407927Smrg# to write the compiler configuration to `libtool'.
6868dc407927Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
6869dc407927Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
6870dc407927SmrgAC_LANG_SAVE
68713eed67faSmbalmer
6872dc407927Smrg# Source file extension for Java test sources.
6873dc407927Smrgac_ext=java
68743eed67faSmbalmer
6875dc407927Smrg# Object file extension for compiled Java test sources.
6876dc407927Smrgobjext=o
6877dc407927Smrg_LT_TAGVAR(objext, $1)=$objext
68783eed67faSmbalmer
6879dc407927Smrg# Code to be used in simple compile tests
6880dc407927Smrglt_simple_compile_test_code="class foo {}"
68813eed67faSmbalmer
6882dc407927Smrg# Code to be used in simple link tests
6883dc407927Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
68843eed67faSmbalmer
6885dc407927Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
6886dc407927Smrg_LT_TAG_COMPILER
68873eed67faSmbalmer
6888dc407927Smrg# save warnings/boilerplate of simple test code
6889dc407927Smrg_LT_COMPILER_BOILERPLATE
6890dc407927Smrg_LT_LINKER_BOILERPLATE
6891dc407927Smrg
6892dc407927Smrg# Allow CC to be a program name with arguments.
6893dc407927Smrglt_save_CC="$CC"
6894dc407927Smrglt_save_GCC=$GCC
6895dc407927SmrgGCC=yes
6896dc407927SmrgCC=${GCJ-"gcj"}
6897dc407927Smrgcompiler=$CC
6898dc407927Smrg_LT_TAGVAR(compiler, $1)=$CC
6899dc407927Smrg_LT_TAGVAR(LD, $1)="$LD"
6900dc407927Smrg_LT_CC_BASENAME([$compiler])
6901dc407927Smrg
6902dc407927Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
6903dc407927Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6904dc407927Smrg
6905dc407927Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6906dc407927Smrg
6907dc407927Smrgif test -n "$compiler"; then
6908dc407927Smrg  _LT_COMPILER_NO_RTTI($1)
6909dc407927Smrg  _LT_COMPILER_PIC($1)
6910dc407927Smrg  _LT_COMPILER_C_O($1)
6911dc407927Smrg  _LT_COMPILER_FILE_LOCKS($1)
6912dc407927Smrg  _LT_LINKER_SHLIBS($1)
6913dc407927Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
6914dc407927Smrg
6915dc407927Smrg  _LT_CONFIG($1)
6916dc407927Smrgfi
6917dc407927Smrg
6918dc407927SmrgAC_LANG_RESTORE
69193eed67faSmbalmer
6920dc407927SmrgGCC=$lt_save_GCC
6921dc407927SmrgCC="$lt_save_CC"
6922dc407927Smrg])# _LT_LANG_GCJ_CONFIG
69233eed67faSmbalmer
69243eed67faSmbalmer
6925dc407927Smrg# _LT_LANG_RC_CONFIG([TAG])
6926dc407927Smrg# -------------------------
6927dc407927Smrg# Ensure that the configuration variables for the Windows resource compiler
6928dc407927Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
6929dc407927Smrg# to write the compiler configuration to `libtool'.
6930dc407927Smrgm4_defun([_LT_LANG_RC_CONFIG],
6931dc407927Smrg[AC_REQUIRE([LT_PROG_RC])dnl
6932dc407927SmrgAC_LANG_SAVE
69333eed67faSmbalmer
6934dc407927Smrg# Source file extension for RC test sources.
6935dc407927Smrgac_ext=rc
69363eed67faSmbalmer
6937dc407927Smrg# Object file extension for compiled RC test sources.
6938dc407927Smrgobjext=o
6939dc407927Smrg_LT_TAGVAR(objext, $1)=$objext
69403eed67faSmbalmer
6941dc407927Smrg# Code to be used in simple compile tests
6942dc407927Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
69433eed67faSmbalmer
6944dc407927Smrg# Code to be used in simple link tests
6945dc407927Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
69463eed67faSmbalmer
6947dc407927Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
6948dc407927Smrg_LT_TAG_COMPILER
69493eed67faSmbalmer
6950dc407927Smrg# save warnings/boilerplate of simple test code
6951dc407927Smrg_LT_COMPILER_BOILERPLATE
6952dc407927Smrg_LT_LINKER_BOILERPLATE
69533eed67faSmbalmer
6954dc407927Smrg# Allow CC to be a program name with arguments.
6955dc407927Smrglt_save_CC="$CC"
6956dc407927Smrglt_save_GCC=$GCC
6957dc407927SmrgGCC=
6958dc407927SmrgCC=${RC-"windres"}
6959dc407927Smrgcompiler=$CC
6960dc407927Smrg_LT_TAGVAR(compiler, $1)=$CC
6961dc407927Smrg_LT_CC_BASENAME([$compiler])
6962dc407927Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
69633eed67faSmbalmer
6964dc407927Smrgif test -n "$compiler"; then
6965dc407927Smrg  :
6966dc407927Smrg  _LT_CONFIG($1)
6967dc407927Smrgfi
69683eed67faSmbalmer
6969dc407927SmrgGCC=$lt_save_GCC
6970dc407927SmrgAC_LANG_RESTORE
6971dc407927SmrgCC="$lt_save_CC"
6972dc407927Smrg])# _LT_LANG_RC_CONFIG
69733eed67faSmbalmer
69743eed67faSmbalmer
6975dc407927Smrg# LT_PROG_GCJ
6976dc407927Smrg# -----------
6977dc407927SmrgAC_DEFUN([LT_PROG_GCJ],
6978dc407927Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
6979dc407927Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
6980dc407927Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
6981dc407927Smrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
6982dc407927Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
6983dc407927Smrg])
69843eed67faSmbalmer
6985dc407927Smrg# Old name:
6986dc407927SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
6987dc407927Smrgdnl aclocal-1.4 backwards compatibility:
6988dc407927Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
69893eed67faSmbalmer
6990dc407927Smrg
6991dc407927Smrg# LT_PROG_RC
6992dc407927Smrg# ----------
6993dc407927SmrgAC_DEFUN([LT_PROG_RC],
6994dc407927Smrg[AC_CHECK_TOOL(RC, windres,)
69953eed67faSmbalmer])
69963eed67faSmbalmer
6997dc407927Smrg# Old name:
6998dc407927SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
6999dc407927Smrgdnl aclocal-1.4 backwards compatibility:
7000dc407927Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
70013eed67faSmbalmer
7002dc407927Smrg
7003dc407927Smrg# _LT_DECL_EGREP
7004dc407927Smrg# --------------
7005dc407927Smrg# If we don't have a new enough Autoconf to choose the best grep
7006dc407927Smrg# available, choose the one first in the user's PATH.
7007dc407927Smrgm4_defun([_LT_DECL_EGREP],
7008dc407927Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
7009dc407927SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
7010dc407927Smrgtest -z "$GREP" && GREP=grep
7011dc407927Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
7012dc407927Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
7013dc407927Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
7014dc407927Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
7015dc407927SmrgAC_SUBST([GREP])
70163eed67faSmbalmer])
70173eed67faSmbalmer
70183eed67faSmbalmer
7019dc407927Smrg# _LT_DECL_OBJDUMP
7020dc407927Smrg# --------------
7021dc407927Smrg# If we don't have a new enough Autoconf to choose the best objdump
7022dc407927Smrg# available, choose the one first in the user's PATH.
7023dc407927Smrgm4_defun([_LT_DECL_OBJDUMP],
7024dc407927Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
7025dc407927Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
7026dc407927Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
7027dc407927SmrgAC_SUBST([OBJDUMP])
7028dc407927Smrg])
7029dc407927Smrg
7030dc407927Smrg
7031dc407927Smrg# _LT_DECL_SED
7032dc407927Smrg# ------------
7033dc407927Smrg# Check for a fully-functional sed program, that truncates
7034dc407927Smrg# as few characters as possible.  Prefer GNU sed if found.
7035dc407927Smrgm4_defun([_LT_DECL_SED],
7036dc407927Smrg[AC_PROG_SED
7037dc407927Smrgtest -z "$SED" && SED=sed
7038dc407927SmrgXsed="$SED -e 1s/^X//"
7039dc407927Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
7040dc407927Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
7041dc407927Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
7042dc407927Smrg])# _LT_DECL_SED
7043dc407927Smrg
7044dc407927Smrgm4_ifndef([AC_PROG_SED], [
7045dc407927Smrg# NOTE: This macro has been submitted for inclusion into   #
7046dc407927Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
7047dc407927Smrg#  a released version of Autoconf we should remove this    #
7048dc407927Smrg#  macro and use it instead.                               #
7049dc407927Smrg
7050dc407927Smrgm4_defun([AC_PROG_SED],
7051dc407927Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
7052dc407927SmrgAC_CACHE_VAL(lt_cv_path_SED,
7053dc407927Smrg[# Loop through the user's path and test for sed and gsed.
7054dc407927Smrg# Then use that list of sed's as ones to test for truncation.
7055dc407927Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7056dc407927Smrgfor as_dir in $PATH
7057dc407927Smrgdo
7058dc407927Smrg  IFS=$as_save_IFS
7059dc407927Smrg  test -z "$as_dir" && as_dir=.
7060dc407927Smrg  for lt_ac_prog in sed gsed; do
7061dc407927Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
7062dc407927Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
7063dc407927Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
7064dc407927Smrg      fi
7065dc407927Smrg    done
7066dc407927Smrg  done
7067dc407927Smrgdone
7068dc407927SmrgIFS=$as_save_IFS
7069dc407927Smrglt_ac_max=0
7070dc407927Smrglt_ac_count=0
7071dc407927Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
7072dc407927Smrg# along with /bin/sed that truncates output.
7073dc407927Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
7074dc407927Smrg  test ! -f $lt_ac_sed && continue
7075dc407927Smrg  cat /dev/null > conftest.in
7076dc407927Smrg  lt_ac_count=0
7077dc407927Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
7078dc407927Smrg  # Check for GNU sed and select it if it is found.
7079dc407927Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
7080dc407927Smrg    lt_cv_path_SED=$lt_ac_sed
7081dc407927Smrg    break
7082dc407927Smrg  fi
7083dc407927Smrg  while true; do
7084dc407927Smrg    cat conftest.in conftest.in >conftest.tmp
7085dc407927Smrg    mv conftest.tmp conftest.in
7086dc407927Smrg    cp conftest.in conftest.nl
7087dc407927Smrg    echo >>conftest.nl
7088dc407927Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
7089dc407927Smrg    cmp -s conftest.out conftest.nl || break
7090dc407927Smrg    # 10000 chars as input seems more than enough
7091dc407927Smrg    test $lt_ac_count -gt 10 && break
7092dc407927Smrg    lt_ac_count=`expr $lt_ac_count + 1`
7093dc407927Smrg    if test $lt_ac_count -gt $lt_ac_max; then
7094dc407927Smrg      lt_ac_max=$lt_ac_count
7095dc407927Smrg      lt_cv_path_SED=$lt_ac_sed
70963eed67faSmbalmer    fi
7097dc407927Smrg  done
7098dc407927Smrgdone
7099dc407927Smrg])
7100dc407927SmrgSED=$lt_cv_path_SED
7101dc407927SmrgAC_SUBST([SED])
7102dc407927SmrgAC_MSG_RESULT([$SED])
7103dc407927Smrg])#AC_PROG_SED
7104dc407927Smrg])#m4_ifndef
7105dc407927Smrg
7106dc407927Smrg# Old name:
7107dc407927SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
7108dc407927Smrgdnl aclocal-1.4 backwards compatibility:
7109dc407927Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
7110dc407927Smrg
7111dc407927Smrg
7112dc407927Smrg# _LT_CHECK_SHELL_FEATURES
7113dc407927Smrg# ------------------------
7114dc407927Smrg# Find out whether the shell is Bourne or XSI compatible,
7115dc407927Smrg# or has some other useful features.
7116dc407927Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
7117dc407927Smrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
7118dc407927Smrg# Try some XSI features
7119dc407927Smrgxsi_shell=no
7120dc407927Smrg( _lt_dummy="a/b/c"
7121dc407927Smrg  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
7122dc407927Smrg      = c,a/b,, \
7123dc407927Smrg    && eval 'test $(( 1 + 1 )) -eq 2 \
7124dc407927Smrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
7125dc407927Smrg  && xsi_shell=yes
7126dc407927SmrgAC_MSG_RESULT([$xsi_shell])
7127dc407927Smrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
7128dc407927Smrg
7129dc407927SmrgAC_MSG_CHECKING([whether the shell understands "+="])
7130dc407927Smrglt_shell_append=no
7131dc407927Smrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
7132dc407927Smrg    >/dev/null 2>&1 \
7133dc407927Smrg  && lt_shell_append=yes
7134dc407927SmrgAC_MSG_RESULT([$lt_shell_append])
7135dc407927Smrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
7136dc407927Smrg
7137dc407927Smrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
7138dc407927Smrg  lt_unset=unset
7139dc407927Smrgelse
7140dc407927Smrg  lt_unset=false
7141dc407927Smrgfi
7142dc407927Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
7143dc407927Smrg
7144dc407927Smrg# test EBCDIC or ASCII
7145dc407927Smrgcase `echo X|tr X '\101'` in
7146dc407927Smrg A) # ASCII based system
7147dc407927Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
7148dc407927Smrg  lt_SP2NL='tr \040 \012'
7149dc407927Smrg  lt_NL2SP='tr \015\012 \040\040'
71503eed67faSmbalmer  ;;
7151dc407927Smrg *) # EBCDIC based system
7152dc407927Smrg  lt_SP2NL='tr \100 \n'
7153dc407927Smrg  lt_NL2SP='tr \r\n \100\100'
71543eed67faSmbalmer  ;;
7155dc407927Smrgesac
7156dc407927Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
7157dc407927Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
7158dc407927Smrg])# _LT_CHECK_SHELL_FEATURES
7159dc407927Smrg
7160dc407927Smrg
7161dc407927Smrg# _LT_PROG_XSI_SHELLFNS
7162dc407927Smrg# ---------------------
7163dc407927Smrg# Bourne and XSI compatible variants of some useful shell functions.
7164dc407927Smrgm4_defun([_LT_PROG_XSI_SHELLFNS],
7165dc407927Smrg[case $xsi_shell in
7166dc407927Smrg  yes)
7167dc407927Smrg    cat << \_LT_EOF >> "$cfgfile"
7168dc407927Smrg
7169dc407927Smrg# func_dirname file append nondir_replacement
7170dc407927Smrg# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
7171dc407927Smrg# otherwise set result to NONDIR_REPLACEMENT.
7172dc407927Smrgfunc_dirname ()
7173dc407927Smrg{
7174dc407927Smrg  case ${1} in
7175dc407927Smrg    */*) func_dirname_result="${1%/*}${2}" ;;
7176dc407927Smrg    *  ) func_dirname_result="${3}" ;;
71773eed67faSmbalmer  esac
7178dc407927Smrg}
7179dc407927Smrg
7180dc407927Smrg# func_basename file
7181dc407927Smrgfunc_basename ()
7182dc407927Smrg{
7183dc407927Smrg  func_basename_result="${1##*/}"
7184dc407927Smrg}
7185dc407927Smrg
7186dc407927Smrg# func_dirname_and_basename file append nondir_replacement
7187dc407927Smrg# perform func_basename and func_dirname in a single function
7188dc407927Smrg# call:
7189dc407927Smrg#   dirname:  Compute the dirname of FILE.  If nonempty,
7190dc407927Smrg#             add APPEND to the result, otherwise set result
7191dc407927Smrg#             to NONDIR_REPLACEMENT.
7192dc407927Smrg#             value returned in "$func_dirname_result"
7193dc407927Smrg#   basename: Compute filename of FILE.
7194dc407927Smrg#             value retuned in "$func_basename_result"
7195dc407927Smrg# Implementation must be kept synchronized with func_dirname
7196dc407927Smrg# and func_basename. For efficiency, we do not delegate to
7197dc407927Smrg# those functions but instead duplicate the functionality here.
7198dc407927Smrgfunc_dirname_and_basename ()
7199dc407927Smrg{
7200dc407927Smrg  case ${1} in
7201dc407927Smrg    */*) func_dirname_result="${1%/*}${2}" ;;
7202dc407927Smrg    *  ) func_dirname_result="${3}" ;;
72033eed67faSmbalmer  esac
7204dc407927Smrg  func_basename_result="${1##*/}"
7205dc407927Smrg}
72063eed67faSmbalmer
7207dc407927Smrg# func_stripname prefix suffix name
7208dc407927Smrg# strip PREFIX and SUFFIX off of NAME.
7209dc407927Smrg# PREFIX and SUFFIX must not contain globbing or regex special
7210dc407927Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
7211dc407927Smrg# dot (in which case that matches only a dot).
7212dc407927Smrgfunc_stripname ()
7213dc407927Smrg{
7214dc407927Smrg  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
7215dc407927Smrg  # positional parameters, so assign one to ordinary parameter first.
7216dc407927Smrg  func_stripname_result=${3}
7217dc407927Smrg  func_stripname_result=${func_stripname_result#"${1}"}
7218dc407927Smrg  func_stripname_result=${func_stripname_result%"${2}"}
7219dc407927Smrg}
72203eed67faSmbalmer
7221dc407927Smrg# func_opt_split
7222dc407927Smrgfunc_opt_split ()
7223dc407927Smrg{
7224dc407927Smrg  func_opt_split_opt=${1%%=*}
7225dc407927Smrg  func_opt_split_arg=${1#*=}
7226dc407927Smrg}
72273eed67faSmbalmer
7228dc407927Smrg# func_lo2o object
7229dc407927Smrgfunc_lo2o ()
7230dc407927Smrg{
7231dc407927Smrg  case ${1} in
7232dc407927Smrg    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
7233dc407927Smrg    *)    func_lo2o_result=${1} ;;
7234dc407927Smrg  esac
7235dc407927Smrg}
72363eed67faSmbalmer
7237dc407927Smrg# func_xform libobj-or-source
7238dc407927Smrgfunc_xform ()
7239dc407927Smrg{
7240dc407927Smrg  func_xform_result=${1%.*}.lo
7241dc407927Smrg}
72423eed67faSmbalmer
7243dc407927Smrg# func_arith arithmetic-term...
7244dc407927Smrgfunc_arith ()
7245dc407927Smrg{
7246dc407927Smrg  func_arith_result=$(( $[*] ))
7247dc407927Smrg}
72483eed67faSmbalmer
7249dc407927Smrg# func_len string
7250dc407927Smrg# STRING may not start with a hyphen.
7251dc407927Smrgfunc_len ()
7252dc407927Smrg{
7253dc407927Smrg  func_len_result=${#1}
7254dc407927Smrg}
72553eed67faSmbalmer
7256dc407927Smrg_LT_EOF
7257dc407927Smrg    ;;
7258dc407927Smrg  *) # Bourne compatible functions.
7259dc407927Smrg    cat << \_LT_EOF >> "$cfgfile"
72603eed67faSmbalmer
7261dc407927Smrg# func_dirname file append nondir_replacement
7262dc407927Smrg# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
7263dc407927Smrg# otherwise set result to NONDIR_REPLACEMENT.
7264dc407927Smrgfunc_dirname ()
7265dc407927Smrg{
7266dc407927Smrg  # Extract subdirectory from the argument.
7267dc407927Smrg  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
7268dc407927Smrg  if test "X$func_dirname_result" = "X${1}"; then
7269dc407927Smrg    func_dirname_result="${3}"
7270dc407927Smrg  else
7271dc407927Smrg    func_dirname_result="$func_dirname_result${2}"
7272dc407927Smrg  fi
7273dc407927Smrg}
72743eed67faSmbalmer
7275dc407927Smrg# func_basename file
7276dc407927Smrgfunc_basename ()
7277dc407927Smrg{
7278dc407927Smrg  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
7279dc407927Smrg}
72803eed67faSmbalmer
7281dc407927Smrgdnl func_dirname_and_basename
7282dc407927Smrgdnl A portable version of this function is already defined in general.m4sh
7283dc407927Smrgdnl so there is no need for it here.
7284dc407927Smrg
7285dc407927Smrg# func_stripname prefix suffix name
7286dc407927Smrg# strip PREFIX and SUFFIX off of NAME.
7287dc407927Smrg# PREFIX and SUFFIX must not contain globbing or regex special
7288dc407927Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
7289dc407927Smrg# dot (in which case that matches only a dot).
7290dc407927Smrg# func_strip_suffix prefix name
7291dc407927Smrgfunc_stripname ()
7292dc407927Smrg{
7293dc407927Smrg  case ${2} in
7294dc407927Smrg    .*) func_stripname_result=`$ECHO "X${3}" \
7295dc407927Smrg           | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
7296dc407927Smrg    *)  func_stripname_result=`$ECHO "X${3}" \
7297dc407927Smrg           | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
7298dc407927Smrg  esac
7299dc407927Smrg}
73003eed67faSmbalmer
7301dc407927Smrg# sed scripts:
7302dc407927Smrgmy_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
7303dc407927Smrgmy_sed_long_arg='1s/^-[[^=]]*=//'
73043eed67faSmbalmer
7305dc407927Smrg# func_opt_split
7306dc407927Smrgfunc_opt_split ()
7307dc407927Smrg{
7308dc407927Smrg  func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
7309dc407927Smrg  func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
7310dc407927Smrg}
73113eed67faSmbalmer
7312dc407927Smrg# func_lo2o object
7313dc407927Smrgfunc_lo2o ()
7314dc407927Smrg{
7315dc407927Smrg  func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
7316dc407927Smrg}
73173eed67faSmbalmer
7318dc407927Smrg# func_xform libobj-or-source
7319dc407927Smrgfunc_xform ()
7320dc407927Smrg{
7321dc407927Smrg  func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
7322dc407927Smrg}
73233eed67faSmbalmer
7324dc407927Smrg# func_arith arithmetic-term...
7325dc407927Smrgfunc_arith ()
7326dc407927Smrg{
7327dc407927Smrg  func_arith_result=`expr "$[@]"`
7328dc407927Smrg}
73293eed67faSmbalmer
7330dc407927Smrg# func_len string
7331dc407927Smrg# STRING may not start with a hyphen.
7332dc407927Smrgfunc_len ()
7333dc407927Smrg{
7334dc407927Smrg  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
7335dc407927Smrg}
73363eed67faSmbalmer
7337dc407927Smrg_LT_EOF
7338dc407927Smrgesac
7339dc407927Smrg
7340dc407927Smrgcase $lt_shell_append in
7341dc407927Smrg  yes)
7342dc407927Smrg    cat << \_LT_EOF >> "$cfgfile"
73433eed67faSmbalmer
7344dc407927Smrg# func_append var value
7345dc407927Smrg# Append VALUE to the end of shell variable VAR.
7346dc407927Smrgfunc_append ()
7347dc407927Smrg{
7348dc407927Smrg  eval "$[1]+=\$[2]"
7349dc407927Smrg}
73503eed67faSmbalmer_LT_EOF
7351dc407927Smrg    ;;
7352dc407927Smrg  *)
7353dc407927Smrg    cat << \_LT_EOF >> "$cfgfile"
73543eed67faSmbalmer
7355dc407927Smrg# func_append var value
7356dc407927Smrg# Append VALUE to the end of shell variable VAR.
7357dc407927Smrgfunc_append ()
7358dc407927Smrg{
7359dc407927Smrg  eval "$[1]=\$$[1]\$[2]"
7360dc407927Smrg}
73613eed67faSmbalmer
7362dc407927Smrg_LT_EOF
7363dc407927Smrg    ;;
7364dc407927Smrg  esac
7365dc407927Smrg])
73663eed67faSmbalmer
7367dc407927Smrg# Helper functions for option handling.                    -*- Autoconf -*-
7368dc407927Smrg#
7369dc407927Smrg#   Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
7370dc407927Smrg#   Written by Gary V. Vaughan, 2004
7371dc407927Smrg#
7372dc407927Smrg# This file is free software; the Free Software Foundation gives
7373dc407927Smrg# unlimited permission to copy and/or distribute it, with or without
7374dc407927Smrg# modifications, as long as this notice is preserved.
73753eed67faSmbalmer
7376dc407927Smrg# serial 6 ltoptions.m4
73773eed67faSmbalmer
7378dc407927Smrg# This is to help aclocal find these macros, as it can't see m4_define.
7379dc407927SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
73803eed67faSmbalmer
73813eed67faSmbalmer
7382dc407927Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
7383dc407927Smrg# ------------------------------------------
7384dc407927Smrgm4_define([_LT_MANGLE_OPTION],
7385dc407927Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
73863eed67faSmbalmer
73873eed67faSmbalmer
7388dc407927Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
7389dc407927Smrg# ---------------------------------------
7390dc407927Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
7391dc407927Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
7392dc407927Smrg# saved as a flag.
7393dc407927Smrgm4_define([_LT_SET_OPTION],
7394dc407927Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
7395dc407927Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
7396dc407927Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
7397dc407927Smrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
7398dc407927Smrg])
7399dc407927Smrg
7400dc407927Smrg
7401dc407927Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
7402dc407927Smrg# ------------------------------------------------------------
7403dc407927Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7404dc407927Smrgm4_define([_LT_IF_OPTION],
7405dc407927Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
7406dc407927Smrg
7407dc407927Smrg
7408dc407927Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
7409dc407927Smrg# -------------------------------------------------------
7410dc407927Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
7411dc407927Smrg# are set.
7412dc407927Smrgm4_define([_LT_UNLESS_OPTIONS],
7413dc407927Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
7414dc407927Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
7415dc407927Smrg		      [m4_define([$0_found])])])[]dnl
7416dc407927Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
7417dc407927Smrg])[]dnl
7418dc407927Smrg])
7419dc407927Smrg
7420dc407927Smrg
7421dc407927Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
7422dc407927Smrg# ----------------------------------------
7423dc407927Smrg# OPTION-LIST is a space-separated list of Libtool options associated
7424dc407927Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
7425dc407927Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
7426dc407927Smrg# the unknown option and exit.
7427dc407927Smrgm4_defun([_LT_SET_OPTIONS],
7428dc407927Smrg[# Set options
7429dc407927Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
7430dc407927Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
7431dc407927Smrg
7432dc407927Smrgm4_if([$1],[LT_INIT],[
7433dc407927Smrg  dnl
7434dc407927Smrg  dnl Simply set some default values (i.e off) if boolean options were not
7435dc407927Smrg  dnl specified:
7436dc407927Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
7437dc407927Smrg  ])
7438dc407927Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
7439dc407927Smrg  ])
7440dc407927Smrg  dnl
7441dc407927Smrg  dnl If no reference was made to various pairs of opposing options, then
7442dc407927Smrg  dnl we run the default mode handler for the pair.  For example, if neither
7443dc407927Smrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
7444dc407927Smrg  dnl archives by default:
7445dc407927Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
7446dc407927Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
7447dc407927Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
7448dc407927Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
7449dc407927Smrg  		   [_LT_ENABLE_FAST_INSTALL])
7450dc407927Smrg  ])
7451dc407927Smrg])# _LT_SET_OPTIONS
7452dc407927Smrg
74533eed67faSmbalmer
74543eed67faSmbalmer
7455dc407927Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
7456dc407927Smrg# -----------------------------------------
7457dc407927Smrgm4_define([_LT_MANGLE_DEFUN],
7458dc407927Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
74593eed67faSmbalmer
74603eed67faSmbalmer
7461dc407927Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
7462dc407927Smrg# -----------------------------------------------
7463dc407927Smrgm4_define([LT_OPTION_DEFINE],
7464dc407927Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
7465dc407927Smrg])# LT_OPTION_DEFINE
74663eed67faSmbalmer
74673eed67faSmbalmer
7468dc407927Smrg# dlopen
7469dc407927Smrg# ------
7470dc407927SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
7471dc407927Smrg])
74723eed67faSmbalmer
7473dc407927SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
7474dc407927Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
7475dc407927SmrgAC_DIAGNOSE([obsolete],
7476dc407927Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
7477dc407927Smrgput the `dlopen' option into LT_INIT's first parameter.])
7478dc407927Smrg])
74793eed67faSmbalmer
7480dc407927Smrgdnl aclocal-1.4 backwards compatibility:
7481dc407927Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
74823eed67faSmbalmer
74833eed67faSmbalmer
7484dc407927Smrg# win32-dll
7485dc407927Smrg# ---------
7486dc407927Smrg# Declare package support for building win32 dll's.
7487dc407927SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
7488dc407927Smrg[enable_win32_dll=yes
74893eed67faSmbalmer
7490dc407927Smrgcase $host in
7491dc407927Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
7492dc407927Smrg  AC_CHECK_TOOL(AS, as, false)
7493dc407927Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
7494dc407927Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
7495dc407927Smrg  ;;
7496dc407927Smrgesac
74973eed67faSmbalmer
7498dc407927Smrgtest -z "$AS" && AS=as
7499dc407927Smrg_LT_DECL([], [AS],      [0], [Assembler program])dnl
75003eed67faSmbalmer
7501dc407927Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
7502dc407927Smrg_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
75033eed67faSmbalmer
7504dc407927Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
7505dc407927Smrg_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
7506dc407927Smrg])# win32-dll
75073eed67faSmbalmer
7508dc407927SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
7509dc407927Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7510dc407927Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
7511dc407927SmrgAC_DIAGNOSE([obsolete],
7512dc407927Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
7513dc407927Smrgput the `win32-dll' option into LT_INIT's first parameter.])
7514dc407927Smrg])
75153eed67faSmbalmer
7516dc407927Smrgdnl aclocal-1.4 backwards compatibility:
7517dc407927Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
75183eed67faSmbalmer
75193eed67faSmbalmer
7520dc407927Smrg# _LT_ENABLE_SHARED([DEFAULT])
7521dc407927Smrg# ----------------------------
7522dc407927Smrg# implement the --enable-shared flag, and supports the `shared' and
7523dc407927Smrg# `disable-shared' LT_INIT options.
7524dc407927Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7525dc407927Smrgm4_define([_LT_ENABLE_SHARED],
7526dc407927Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
7527dc407927SmrgAC_ARG_ENABLE([shared],
7528dc407927Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
7529dc407927Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
7530dc407927Smrg    [p=${PACKAGE-default}
7531dc407927Smrg    case $enableval in
7532dc407927Smrg    yes) enable_shared=yes ;;
7533dc407927Smrg    no) enable_shared=no ;;
7534dc407927Smrg    *)
7535dc407927Smrg      enable_shared=no
7536dc407927Smrg      # Look at the argument we got.  We use all the common list separators.
7537dc407927Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7538dc407927Smrg      for pkg in $enableval; do
7539dc407927Smrg	IFS="$lt_save_ifs"
7540dc407927Smrg	if test "X$pkg" = "X$p"; then
7541dc407927Smrg	  enable_shared=yes
7542dc407927Smrg	fi
7543dc407927Smrg      done
7544dc407927Smrg      IFS="$lt_save_ifs"
75453eed67faSmbalmer      ;;
7546dc407927Smrg    esac],
7547dc407927Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
75483eed67faSmbalmer
7549dc407927Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
7550dc407927Smrg	[Whether or not to build shared libraries])
7551dc407927Smrg])# _LT_ENABLE_SHARED
75523eed67faSmbalmer
7553dc407927SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
7554dc407927SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
75553eed67faSmbalmer
7556dc407927Smrg# Old names:
7557dc407927SmrgAC_DEFUN([AC_ENABLE_SHARED],
7558dc407927Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
7559dc407927Smrg])
75603eed67faSmbalmer
7561dc407927SmrgAC_DEFUN([AC_DISABLE_SHARED],
7562dc407927Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
7563dc407927Smrg])
75643eed67faSmbalmer
7565dc407927SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
7566dc407927SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
75673eed67faSmbalmer
7568dc407927Smrgdnl aclocal-1.4 backwards compatibility:
7569dc407927Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
7570dc407927Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
75713eed67faSmbalmer
75723eed67faSmbalmer
75733eed67faSmbalmer
7574dc407927Smrg# _LT_ENABLE_STATIC([DEFAULT])
7575dc407927Smrg# ----------------------------
7576dc407927Smrg# implement the --enable-static flag, and support the `static' and
7577dc407927Smrg# `disable-static' LT_INIT options.
7578dc407927Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7579dc407927Smrgm4_define([_LT_ENABLE_STATIC],
7580dc407927Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
7581dc407927SmrgAC_ARG_ENABLE([static],
7582dc407927Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
7583dc407927Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
7584dc407927Smrg    [p=${PACKAGE-default}
7585dc407927Smrg    case $enableval in
7586dc407927Smrg    yes) enable_static=yes ;;
7587dc407927Smrg    no) enable_static=no ;;
7588dc407927Smrg    *)
7589dc407927Smrg     enable_static=no
7590dc407927Smrg      # Look at the argument we got.  We use all the common list separators.
7591dc407927Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7592dc407927Smrg      for pkg in $enableval; do
7593dc407927Smrg	IFS="$lt_save_ifs"
7594dc407927Smrg	if test "X$pkg" = "X$p"; then
7595dc407927Smrg	  enable_static=yes
75963eed67faSmbalmer	fi
7597dc407927Smrg      done
7598dc407927Smrg      IFS="$lt_save_ifs"
75993eed67faSmbalmer      ;;
7600dc407927Smrg    esac],
7601dc407927Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
76023eed67faSmbalmer
7603dc407927Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
7604dc407927Smrg	[Whether or not to build static libraries])
7605dc407927Smrg])# _LT_ENABLE_STATIC
76063eed67faSmbalmer
7607dc407927SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
7608dc407927SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
7609dc407927Smrg
7610dc407927Smrg# Old names:
7611dc407927SmrgAC_DEFUN([AC_ENABLE_STATIC],
7612dc407927Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
7613dc407927Smrg])
7614dc407927Smrg
7615dc407927SmrgAC_DEFUN([AC_DISABLE_STATIC],
7616dc407927Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
7617dc407927Smrg])
7618dc407927Smrg
7619dc407927SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
7620dc407927SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
7621dc407927Smrg
7622dc407927Smrgdnl aclocal-1.4 backwards compatibility:
7623dc407927Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
7624dc407927Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
7625dc407927Smrg
7626dc407927Smrg
7627dc407927Smrg
7628dc407927Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
7629dc407927Smrg# ----------------------------------
7630dc407927Smrg# implement the --enable-fast-install flag, and support the `fast-install'
7631dc407927Smrg# and `disable-fast-install' LT_INIT options.
7632dc407927Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7633dc407927Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
7634dc407927Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
7635dc407927SmrgAC_ARG_ENABLE([fast-install],
7636dc407927Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
7637dc407927Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
7638dc407927Smrg    [p=${PACKAGE-default}
7639dc407927Smrg    case $enableval in
7640dc407927Smrg    yes) enable_fast_install=yes ;;
7641dc407927Smrg    no) enable_fast_install=no ;;
7642dc407927Smrg    *)
7643dc407927Smrg      enable_fast_install=no
7644dc407927Smrg      # Look at the argument we got.  We use all the common list separators.
7645dc407927Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7646dc407927Smrg      for pkg in $enableval; do
7647dc407927Smrg	IFS="$lt_save_ifs"
7648dc407927Smrg	if test "X$pkg" = "X$p"; then
7649dc407927Smrg	  enable_fast_install=yes
7650dc407927Smrg	fi
7651dc407927Smrg      done
7652dc407927Smrg      IFS="$lt_save_ifs"
76533eed67faSmbalmer      ;;
7654dc407927Smrg    esac],
7655dc407927Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
76563eed67faSmbalmer
7657dc407927Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
7658dc407927Smrg	 [Whether or not to optimize for fast installation])dnl
7659dc407927Smrg])# _LT_ENABLE_FAST_INSTALL
76603eed67faSmbalmer
7661dc407927SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
7662dc407927SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
76633eed67faSmbalmer
7664dc407927Smrg# Old names:
7665dc407927SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
7666dc407927Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
7667dc407927SmrgAC_DIAGNOSE([obsolete],
7668dc407927Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
7669dc407927Smrgthe `fast-install' option into LT_INIT's first parameter.])
7670dc407927Smrg])
76713eed67faSmbalmer
7672dc407927SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
7673dc407927Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
7674dc407927SmrgAC_DIAGNOSE([obsolete],
7675dc407927Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
7676dc407927Smrgthe `disable-fast-install' option into LT_INIT's first parameter.])
7677dc407927Smrg])
76783eed67faSmbalmer
7679dc407927Smrgdnl aclocal-1.4 backwards compatibility:
7680dc407927Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
7681dc407927Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
76823eed67faSmbalmer
76833eed67faSmbalmer
7684dc407927Smrg# _LT_WITH_PIC([MODE])
7685dc407927Smrg# --------------------
7686dc407927Smrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
7687dc407927Smrg# LT_INIT options.
7688dc407927Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
7689dc407927Smrgm4_define([_LT_WITH_PIC],
7690dc407927Smrg[AC_ARG_WITH([pic],
7691dc407927Smrg    [AS_HELP_STRING([--with-pic],
7692dc407927Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
7693dc407927Smrg    [pic_mode="$withval"],
7694dc407927Smrg    [pic_mode=default])
76953eed67faSmbalmer
7696dc407927Smrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
7697dc407927Smrg
7698dc407927Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
7699dc407927Smrg])# _LT_WITH_PIC
7700dc407927Smrg
7701dc407927SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
7702dc407927SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
7703dc407927Smrg
7704dc407927Smrg# Old name:
7705dc407927SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
7706dc407927Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
7707dc407927SmrgAC_DIAGNOSE([obsolete],
7708dc407927Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
7709dc407927Smrgput the `pic-only' option into LT_INIT's first parameter.])
77103eed67faSmbalmer])
77113eed67faSmbalmer
7712dc407927Smrgdnl aclocal-1.4 backwards compatibility:
7713dc407927Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
7714dc407927Smrg
7715dc407927Smrg
7716dc407927Smrgm4_define([_LTDL_MODE], [])
7717dc407927SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
7718dc407927Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
7719dc407927SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
7720dc407927Smrg		 [m4_define([_LTDL_MODE], [recursive])])
7721dc407927SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
7722dc407927Smrg		 [m4_define([_LTDL_MODE], [subproject])])
7723dc407927Smrg
7724dc407927Smrgm4_define([_LTDL_TYPE], [])
7725dc407927SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
7726dc407927Smrg		 [m4_define([_LTDL_TYPE], [installable])])
7727dc407927SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
7728dc407927Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
7729dc407927Smrg
7730dc407927Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
77313eed67faSmbalmer#
7732dc407927Smrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
7733dc407927Smrg# Written by Gary V. Vaughan, 2004
77343eed67faSmbalmer#
7735dc407927Smrg# This file is free software; the Free Software Foundation gives
7736dc407927Smrg# unlimited permission to copy and/or distribute it, with or without
7737dc407927Smrg# modifications, as long as this notice is preserved.
77383eed67faSmbalmer
7739dc407927Smrg# serial 6 ltsugar.m4
77403eed67faSmbalmer
7741dc407927Smrg# This is to help aclocal find these macros, as it can't see m4_define.
7742dc407927SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
77433eed67faSmbalmer
77443eed67faSmbalmer
7745dc407927Smrg# lt_join(SEP, ARG1, [ARG2...])
7746dc407927Smrg# -----------------------------
7747dc407927Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
7748dc407927Smrg# associated separator.
7749dc407927Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
7750dc407927Smrg# versions in m4sugar had bugs.
7751dc407927Smrgm4_define([lt_join],
7752dc407927Smrg[m4_if([$#], [1], [],
7753dc407927Smrg       [$#], [2], [[$2]],
7754dc407927Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
7755dc407927Smrgm4_define([_lt_join],
7756dc407927Smrg[m4_if([$#$2], [2], [],
7757dc407927Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
7758dc407927Smrg
7759dc407927Smrg
7760dc407927Smrg# lt_car(LIST)
7761dc407927Smrg# lt_cdr(LIST)
7762dc407927Smrg# ------------
7763dc407927Smrg# Manipulate m4 lists.
7764dc407927Smrg# These macros are necessary as long as will still need to support
7765dc407927Smrg# Autoconf-2.59 which quotes differently.
7766dc407927Smrgm4_define([lt_car], [[$1]])
7767dc407927Smrgm4_define([lt_cdr],
7768dc407927Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
7769dc407927Smrg       [$#], 1, [],
7770dc407927Smrg       [m4_dquote(m4_shift($@))])])
7771dc407927Smrgm4_define([lt_unquote], $1)
7772dc407927Smrg
7773dc407927Smrg
7774dc407927Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
7775dc407927Smrg# ------------------------------------------
7776dc407927Smrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
7777dc407927Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
7778dc407927Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
7779dc407927Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
7780dc407927Smrg# than defined and empty).
7781dc407927Smrg#
7782dc407927Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
7783dc407927Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
7784dc407927Smrgm4_define([lt_append],
7785dc407927Smrg[m4_define([$1],
7786dc407927Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
7787dc407927Smrg
7788dc407927Smrg
7789dc407927Smrg
7790dc407927Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
7791dc407927Smrg# ----------------------------------------------------------
7792dc407927Smrg# Produce a SEP delimited list of all paired combinations of elements of
7793dc407927Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
7794dc407927Smrg# has the form PREFIXmINFIXSUFFIXn.
7795dc407927Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
7796dc407927Smrgm4_define([lt_combine],
7797dc407927Smrg[m4_if(m4_eval([$# > 3]), [1],
7798dc407927Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
7799dc407927Smrg[[m4_foreach([_Lt_prefix], [$2],
7800dc407927Smrg	     [m4_foreach([_Lt_suffix],
7801dc407927Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
7802dc407927Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
7803dc407927Smrg
7804dc407927Smrg
7805dc407927Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
7806dc407927Smrg# -----------------------------------------------------------------------
7807dc407927Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
7808dc407927Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
7809dc407927Smrgm4_define([lt_if_append_uniq],
7810dc407927Smrg[m4_ifdef([$1],
7811dc407927Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
7812dc407927Smrg		 [lt_append([$1], [$2], [$3])$4],
7813dc407927Smrg		 [$5])],
7814dc407927Smrg	  [lt_append([$1], [$2], [$3])$4])])
7815dc407927Smrg
7816dc407927Smrg
7817dc407927Smrg# lt_dict_add(DICT, KEY, VALUE)
7818dc407927Smrg# -----------------------------
7819dc407927Smrgm4_define([lt_dict_add],
7820dc407927Smrg[m4_define([$1($2)], [$3])])
78213eed67faSmbalmer
78223eed67faSmbalmer
7823dc407927Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
7824dc407927Smrg# --------------------------------------------
7825dc407927Smrgm4_define([lt_dict_add_subkey],
7826dc407927Smrg[m4_define([$1($2:$3)], [$4])])
78273eed67faSmbalmer
78283eed67faSmbalmer
7829dc407927Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
7830dc407927Smrg# ----------------------------------
7831dc407927Smrgm4_define([lt_dict_fetch],
7832dc407927Smrg[m4_ifval([$3],
7833dc407927Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
7834dc407927Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
7835dc407927Smrg
7836dc407927Smrg
7837dc407927Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
7838dc407927Smrg# -----------------------------------------------------------------
7839dc407927Smrgm4_define([lt_if_dict_fetch],
7840dc407927Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
7841dc407927Smrg	[$5],
7842dc407927Smrg    [$6])])
78433eed67faSmbalmer
7844dc407927Smrg
7845dc407927Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
7846dc407927Smrg# --------------------------------------------------------------
7847dc407927Smrgm4_define([lt_dict_filter],
7848dc407927Smrg[m4_if([$5], [], [],
7849dc407927Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
7850dc407927Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
7851dc407927Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
78523eed67faSmbalmer])
78533eed67faSmbalmer
7854dc407927Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
7855dc407927Smrg#
7856dc407927Smrg#   Copyright (C) 2004 Free Software Foundation, Inc.
7857dc407927Smrg#   Written by Scott James Remnant, 2004
7858dc407927Smrg#
7859dc407927Smrg# This file is free software; the Free Software Foundation gives
7860dc407927Smrg# unlimited permission to copy and/or distribute it, with or without
7861dc407927Smrg# modifications, as long as this notice is preserved.
78623eed67faSmbalmer
7863dc407927Smrg# Generated from ltversion.in.
78643eed67faSmbalmer
7865dc407927Smrg# serial 3017 ltversion.m4
7866dc407927Smrg# This file is part of GNU Libtool
78673eed67faSmbalmer
7868dc407927Smrgm4_define([LT_PACKAGE_VERSION], [2.2.6b])
7869dc407927Smrgm4_define([LT_PACKAGE_REVISION], [1.3017])
78703eed67faSmbalmer
7871dc407927SmrgAC_DEFUN([LTVERSION_VERSION],
7872dc407927Smrg[macro_version='2.2.6b'
7873dc407927Smrgmacro_revision='1.3017'
7874dc407927Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
7875dc407927Smrg_LT_DECL(, macro_revision, 0)
78763eed67faSmbalmer])
78773eed67faSmbalmer
7878dc407927Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
7879dc407927Smrg#
7880dc407927Smrg#   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
7881dc407927Smrg#   Written by Scott James Remnant, 2004.
7882dc407927Smrg#
7883dc407927Smrg# This file is free software; the Free Software Foundation gives
7884dc407927Smrg# unlimited permission to copy and/or distribute it, with or without
7885dc407927Smrg# modifications, as long as this notice is preserved.
7886dc407927Smrg
7887dc407927Smrg# serial 4 lt~obsolete.m4
7888dc407927Smrg
7889dc407927Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
7890dc407927Smrg#
7891dc407927Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
7892dc407927Smrg# which have later been changed to m4_define as they aren't part of the
7893dc407927Smrg# exported API, or moved to Autoconf or Automake where they belong.
7894dc407927Smrg#
7895dc407927Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
7896dc407927Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
7897dc407927Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
7898dc407927Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
7899dc407927Smrg# and doesn't know about Autoconf macros at all.)
7900dc407927Smrg#
7901dc407927Smrg# So we provide this file, which has a silly filename so it's always
7902dc407927Smrg# included after everything else.  This provides aclocal with the
7903dc407927Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
7904dc407927Smrg# because those macros already exist, or will be overwritten later.
7905dc407927Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
7906dc407927Smrg#
7907dc407927Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
7908dc407927Smrg# Yes, that means every name once taken will need to remain here until
7909dc407927Smrg# we give up compatibility with versions before 1.7, at which point
7910dc407927Smrg# we need to keep only those names which we still refer to.
7911dc407927Smrg
7912dc407927Smrg# This is to help aclocal find these macros, as it can't see m4_define.
7913dc407927SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
7914dc407927Smrg
7915dc407927Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
7916dc407927Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
7917dc407927Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
7918dc407927Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
7919dc407927Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
7920dc407927Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
7921dc407927Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
7922dc407927Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
7923dc407927Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
7924dc407927Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
7925dc407927Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
7926dc407927Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
7927dc407927Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
7928dc407927Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
7929dc407927Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
7930dc407927Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
7931dc407927Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
7932dc407927Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
7933dc407927Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
7934dc407927Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
7935dc407927Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
7936dc407927Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
7937dc407927Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
7938dc407927Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
7939dc407927Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
7940dc407927Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
7941dc407927Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
7942dc407927Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
7943dc407927Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
7944dc407927Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
7945dc407927Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
7946dc407927Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
7947dc407927Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
7948dc407927Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
7949dc407927Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
7950dc407927Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
7951dc407927Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
7952dc407927Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
7953dc407927Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
7954dc407927Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
7955dc407927Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
7956dc407927Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
7957dc407927Smrgm4_ifndef([AC_LIBTOOL_RC],		[AC_DEFUN([AC_LIBTOOL_RC])])
7958dc407927Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
7959dc407927Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
7960dc407927Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
7961dc407927Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
7962dc407927Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
7963dc407927Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
7964dc407927Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
7965dc407927Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
7966dc407927Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
7967dc407927Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
7968dc407927Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
7969dc407927Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
7970dc407927Smrg
79713eed67faSmbalmer# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
79723eed67faSmbalmer# 
79733eed67faSmbalmer# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
79743eed67faSmbalmer#
79753eed67faSmbalmer# This program is free software; you can redistribute it and/or modify
79763eed67faSmbalmer# it under the terms of the GNU General Public License as published by
79773eed67faSmbalmer# the Free Software Foundation; either version 2 of the License, or
79783eed67faSmbalmer# (at your option) any later version.
79793eed67faSmbalmer#
79803eed67faSmbalmer# This program is distributed in the hope that it will be useful, but
79813eed67faSmbalmer# WITHOUT ANY WARRANTY; without even the implied warranty of
79823eed67faSmbalmer# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
79833eed67faSmbalmer# General Public License for more details.
79843eed67faSmbalmer#
79853eed67faSmbalmer# You should have received a copy of the GNU General Public License
79863eed67faSmbalmer# along with this program; if not, write to the Free Software
79873eed67faSmbalmer# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
79883eed67faSmbalmer#
79893eed67faSmbalmer# As a special exception to the GNU General Public License, if you
79903eed67faSmbalmer# distribute this file as part of a program that contains a
79913eed67faSmbalmer# configuration script generated by Autoconf, you may include it under
79923eed67faSmbalmer# the same distribution terms that you use for the rest of that program.
79933eed67faSmbalmer
79943eed67faSmbalmer# PKG_PROG_PKG_CONFIG([MIN-VERSION])
79953eed67faSmbalmer# ----------------------------------
79963eed67faSmbalmerAC_DEFUN([PKG_PROG_PKG_CONFIG],
79973eed67faSmbalmer[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
79983eed67faSmbalmerm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
79993eed67faSmbalmerAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
80003eed67faSmbalmerif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
80013eed67faSmbalmer	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
80023eed67faSmbalmerfi
80033eed67faSmbalmerif test -n "$PKG_CONFIG"; then
80043eed67faSmbalmer	_pkg_min_version=m4_default([$1], [0.9.0])
80053eed67faSmbalmer	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
80063eed67faSmbalmer	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
80073eed67faSmbalmer		AC_MSG_RESULT([yes])
80083eed67faSmbalmer	else
80093eed67faSmbalmer		AC_MSG_RESULT([no])
80103eed67faSmbalmer		PKG_CONFIG=""
80113eed67faSmbalmer	fi
80123eed67faSmbalmer		
80133eed67faSmbalmerfi[]dnl
80143eed67faSmbalmer])# PKG_PROG_PKG_CONFIG
80153eed67faSmbalmer
80163eed67faSmbalmer# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
80173eed67faSmbalmer#
80183eed67faSmbalmer# Check to see whether a particular set of modules exists.  Similar
80193eed67faSmbalmer# to PKG_CHECK_MODULES(), but does not set variables or print errors.
80203eed67faSmbalmer#
80213eed67faSmbalmer#
80223eed67faSmbalmer# Similar to PKG_CHECK_MODULES, make sure that the first instance of
80233eed67faSmbalmer# this or PKG_CHECK_MODULES is called, or make sure to call
80243eed67faSmbalmer# PKG_CHECK_EXISTS manually
80253eed67faSmbalmer# --------------------------------------------------------------
80263eed67faSmbalmerAC_DEFUN([PKG_CHECK_EXISTS],
80273eed67faSmbalmer[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
80283eed67faSmbalmerif test -n "$PKG_CONFIG" && \
80293eed67faSmbalmer    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
80303eed67faSmbalmer  m4_ifval([$2], [$2], [:])
80313eed67faSmbalmerm4_ifvaln([$3], [else
80323eed67faSmbalmer  $3])dnl
80333eed67faSmbalmerfi])
80343eed67faSmbalmer
80353eed67faSmbalmer
80363eed67faSmbalmer# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
80373eed67faSmbalmer# ---------------------------------------------
80383eed67faSmbalmerm4_define([_PKG_CONFIG],
8039dc407927Smrg[if test -n "$$1"; then
8040dc407927Smrg    pkg_cv_[]$1="$$1"
8041dc407927Smrg elif test -n "$PKG_CONFIG"; then
8042dc407927Smrg    PKG_CHECK_EXISTS([$3],
8043dc407927Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
8044dc407927Smrg		     [pkg_failed=yes])
8045dc407927Smrg else
8046dc407927Smrg    pkg_failed=untried
80473eed67faSmbalmerfi[]dnl
80483eed67faSmbalmer])# _PKG_CONFIG
80493eed67faSmbalmer
80503eed67faSmbalmer# _PKG_SHORT_ERRORS_SUPPORTED
80513eed67faSmbalmer# -----------------------------
80523eed67faSmbalmerAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
80533eed67faSmbalmer[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
80543eed67faSmbalmerif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
80553eed67faSmbalmer        _pkg_short_errors_supported=yes
80563eed67faSmbalmerelse
80573eed67faSmbalmer        _pkg_short_errors_supported=no
80583eed67faSmbalmerfi[]dnl
80593eed67faSmbalmer])# _PKG_SHORT_ERRORS_SUPPORTED
80603eed67faSmbalmer
80613eed67faSmbalmer
80623eed67faSmbalmer# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
80633eed67faSmbalmer# [ACTION-IF-NOT-FOUND])
80643eed67faSmbalmer#
80653eed67faSmbalmer#
80663eed67faSmbalmer# Note that if there is a possibility the first call to
80673eed67faSmbalmer# PKG_CHECK_MODULES might not happen, you should be sure to include an
80683eed67faSmbalmer# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
80693eed67faSmbalmer#
80703eed67faSmbalmer#
80713eed67faSmbalmer# --------------------------------------------------------------
80723eed67faSmbalmerAC_DEFUN([PKG_CHECK_MODULES],
80733eed67faSmbalmer[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
80743eed67faSmbalmerAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
80753eed67faSmbalmerAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
80763eed67faSmbalmer
80773eed67faSmbalmerpkg_failed=no
80783eed67faSmbalmerAC_MSG_CHECKING([for $1])
80793eed67faSmbalmer
80803eed67faSmbalmer_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
80813eed67faSmbalmer_PKG_CONFIG([$1][_LIBS], [libs], [$2])
80823eed67faSmbalmer
80833eed67faSmbalmerm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
80843eed67faSmbalmerand $1[]_LIBS to avoid the need to call pkg-config.
80853eed67faSmbalmerSee the pkg-config man page for more details.])
80863eed67faSmbalmer
80873eed67faSmbalmerif test $pkg_failed = yes; then
80883eed67faSmbalmer        _PKG_SHORT_ERRORS_SUPPORTED
80893eed67faSmbalmer        if test $_pkg_short_errors_supported = yes; then
8090dc407927Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
80913eed67faSmbalmer        else 
8092dc407927Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
80933eed67faSmbalmer        fi
80943eed67faSmbalmer	# Put the nasty error message in config.log where it belongs
80953eed67faSmbalmer	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
80963eed67faSmbalmer
80973eed67faSmbalmer	ifelse([$4], , [AC_MSG_ERROR(dnl
80983eed67faSmbalmer[Package requirements ($2) were not met:
80993eed67faSmbalmer
81003eed67faSmbalmer$$1_PKG_ERRORS
81013eed67faSmbalmer
81023eed67faSmbalmerConsider adjusting the PKG_CONFIG_PATH environment variable if you
81033eed67faSmbalmerinstalled software in a non-standard prefix.
81043eed67faSmbalmer
81053eed67faSmbalmer_PKG_TEXT
81063eed67faSmbalmer])],
81073eed67faSmbalmer		[AC_MSG_RESULT([no])
81083eed67faSmbalmer                $4])
81093eed67faSmbalmerelif test $pkg_failed = untried; then
81103eed67faSmbalmer	ifelse([$4], , [AC_MSG_FAILURE(dnl
81113eed67faSmbalmer[The pkg-config script could not be found or is too old.  Make sure it
81123eed67faSmbalmeris in your PATH or set the PKG_CONFIG environment variable to the full
81133eed67faSmbalmerpath to pkg-config.
81143eed67faSmbalmer
81153eed67faSmbalmer_PKG_TEXT
81163eed67faSmbalmer
8117dc407927SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
81183eed67faSmbalmer		[$4])
81193eed67faSmbalmerelse
81203eed67faSmbalmer	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
81213eed67faSmbalmer	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
81223eed67faSmbalmer        AC_MSG_RESULT([yes])
81233eed67faSmbalmer	ifelse([$3], , :, [$3])
81243eed67faSmbalmerfi[]dnl
81253eed67faSmbalmer])# PKG_CHECK_MODULES
81263eed67faSmbalmer
8127dc407927Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
81283eed67faSmbalmer#
81293eed67faSmbalmer# This file is free software; the Free Software Foundation
81303eed67faSmbalmer# gives unlimited permission to copy and/or distribute it,
81313eed67faSmbalmer# with or without modifications, as long as this notice is preserved.
81323eed67faSmbalmer
81333eed67faSmbalmer# AM_AUTOMAKE_VERSION(VERSION)
81343eed67faSmbalmer# ----------------------------
81353eed67faSmbalmer# Automake X.Y traces this macro to ensure aclocal.m4 has been
81363eed67faSmbalmer# generated from the m4 files accompanying Automake X.Y.
8137dc407927Smrg# (This private macro should not be called outside this file.)
8138dc407927SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
8139dc407927Smrg[am__api_version='1.11'
8140dc407927Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
8141dc407927Smrgdnl require some minimum version.  Point them to the right macro.
8142dc407927Smrgm4_if([$1], [1.11.1], [],
8143dc407927Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
8144dc407927Smrg])
8145dc407927Smrg
8146dc407927Smrg# _AM_AUTOCONF_VERSION(VERSION)
8147dc407927Smrg# -----------------------------
8148dc407927Smrg# aclocal traces this macro to find the Autoconf version.
8149dc407927Smrg# This is a private macro too.  Using m4_define simplifies
8150dc407927Smrg# the logic in aclocal, which can simply ignore this definition.
8151dc407927Smrgm4_define([_AM_AUTOCONF_VERSION], [])
81523eed67faSmbalmer
81533eed67faSmbalmer# AM_SET_CURRENT_AUTOMAKE_VERSION
81543eed67faSmbalmer# -------------------------------
8155dc407927Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
8156dc407927Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
81573eed67faSmbalmerAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
8158dc407927Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
8159dc407927Smrgm4_ifndef([AC_AUTOCONF_VERSION],
8160dc407927Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
8161dc407927Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
81623eed67faSmbalmer
81633eed67faSmbalmer# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
81643eed67faSmbalmer
81653eed67faSmbalmer# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
81663eed67faSmbalmer#
81673eed67faSmbalmer# This file is free software; the Free Software Foundation
81683eed67faSmbalmer# gives unlimited permission to copy and/or distribute it,
81693eed67faSmbalmer# with or without modifications, as long as this notice is preserved.
81703eed67faSmbalmer
81713eed67faSmbalmer# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
81723eed67faSmbalmer# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
81733eed67faSmbalmer# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
81743eed67faSmbalmer#
81753eed67faSmbalmer# Of course, Automake must honor this variable whenever it calls a
81763eed67faSmbalmer# tool from the auxiliary directory.  The problem is that $srcdir (and
81773eed67faSmbalmer# therefore $ac_aux_dir as well) can be either absolute or relative,
81783eed67faSmbalmer# depending on how configure is run.  This is pretty annoying, since
81793eed67faSmbalmer# it makes $ac_aux_dir quite unusable in subdirectories: in the top
81803eed67faSmbalmer# source directory, any form will work fine, but in subdirectories a
81813eed67faSmbalmer# relative path needs to be adjusted first.
81823eed67faSmbalmer#
81833eed67faSmbalmer# $ac_aux_dir/missing
81843eed67faSmbalmer#    fails when called from a subdirectory if $ac_aux_dir is relative
81853eed67faSmbalmer# $top_srcdir/$ac_aux_dir/missing
81863eed67faSmbalmer#    fails if $ac_aux_dir is absolute,
81873eed67faSmbalmer#    fails when called from a subdirectory in a VPATH build with
81883eed67faSmbalmer#          a relative $ac_aux_dir
81893eed67faSmbalmer#
81903eed67faSmbalmer# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
81913eed67faSmbalmer# are both prefixed by $srcdir.  In an in-source build this is usually
81923eed67faSmbalmer# harmless because $srcdir is `.', but things will broke when you
81933eed67faSmbalmer# start a VPATH build or use an absolute $srcdir.
81943eed67faSmbalmer#
81953eed67faSmbalmer# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
81963eed67faSmbalmer# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
81973eed67faSmbalmer#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
81983eed67faSmbalmer# and then we would define $MISSING as
81993eed67faSmbalmer#   MISSING="\${SHELL} $am_aux_dir/missing"
82003eed67faSmbalmer# This will work as long as MISSING is not called from configure, because
82013eed67faSmbalmer# unfortunately $(top_srcdir) has no meaning in configure.
82023eed67faSmbalmer# However there are other variables, like CC, which are often used in
82033eed67faSmbalmer# configure, and could therefore not use this "fixed" $ac_aux_dir.
82043eed67faSmbalmer#
82053eed67faSmbalmer# Another solution, used here, is to always expand $ac_aux_dir to an
82063eed67faSmbalmer# absolute PATH.  The drawback is that using absolute paths prevent a
82073eed67faSmbalmer# configured tree to be moved without reconfiguration.
82083eed67faSmbalmer
82093eed67faSmbalmerAC_DEFUN([AM_AUX_DIR_EXPAND],
82103eed67faSmbalmer[dnl Rely on autoconf to set up CDPATH properly.
82113eed67faSmbalmerAC_PREREQ([2.50])dnl
82123eed67faSmbalmer# expand $ac_aux_dir to an absolute path
82133eed67faSmbalmeram_aux_dir=`cd $ac_aux_dir && pwd`
82143eed67faSmbalmer])
82153eed67faSmbalmer
82163eed67faSmbalmer# AM_CONDITIONAL                                            -*- Autoconf -*-
82173eed67faSmbalmer
8218dc407927Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
82193eed67faSmbalmer# Free Software Foundation, Inc.
82203eed67faSmbalmer#
82213eed67faSmbalmer# This file is free software; the Free Software Foundation
82223eed67faSmbalmer# gives unlimited permission to copy and/or distribute it,
82233eed67faSmbalmer# with or without modifications, as long as this notice is preserved.
82243eed67faSmbalmer
8225dc407927Smrg# serial 9
82263eed67faSmbalmer
82273eed67faSmbalmer# AM_CONDITIONAL(NAME, SHELL-CONDITION)
82283eed67faSmbalmer# -------------------------------------
82293eed67faSmbalmer# Define a conditional.
82303eed67faSmbalmerAC_DEFUN([AM_CONDITIONAL],
82313eed67faSmbalmer[AC_PREREQ(2.52)dnl
82323eed67faSmbalmer ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
82333eed67faSmbalmer	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
8234dc407927SmrgAC_SUBST([$1_TRUE])dnl
8235dc407927SmrgAC_SUBST([$1_FALSE])dnl
8236dc407927Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
8237dc407927Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
8238dc407927Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
82393eed67faSmbalmerif $2; then
82403eed67faSmbalmer  $1_TRUE=
82413eed67faSmbalmer  $1_FALSE='#'
82423eed67faSmbalmerelse
82433eed67faSmbalmer  $1_TRUE='#'
82443eed67faSmbalmer  $1_FALSE=
82453eed67faSmbalmerfi
82463eed67faSmbalmerAC_CONFIG_COMMANDS_PRE(
82473eed67faSmbalmer[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
82483eed67faSmbalmer  AC_MSG_ERROR([[conditional "$1" was never defined.
82493eed67faSmbalmerUsually this means the macro was only invoked conditionally.]])
82503eed67faSmbalmerfi])])
82513eed67faSmbalmer
8252dc407927Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
82533eed67faSmbalmer# Free Software Foundation, Inc.
82543eed67faSmbalmer#
82553eed67faSmbalmer# This file is free software; the Free Software Foundation
82563eed67faSmbalmer# gives unlimited permission to copy and/or distribute it,
82573eed67faSmbalmer# with or without modifications, as long as this notice is preserved.
82583eed67faSmbalmer
8259dc407927Smrg# serial 10
82603eed67faSmbalmer
82613eed67faSmbalmer# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
82623eed67faSmbalmer# written in clear, in which case automake, when reading aclocal.m4,
82633eed67faSmbalmer# will think it sees a *use*, and therefore will trigger all it's
82643eed67faSmbalmer# C support machinery.  Also note that it means that autoscan, seeing
82653eed67faSmbalmer# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
82663eed67faSmbalmer
82673eed67faSmbalmer
82683eed67faSmbalmer# _AM_DEPENDENCIES(NAME)
82693eed67faSmbalmer# ----------------------
82703eed67faSmbalmer# See how the compiler implements dependency checking.
82713eed67faSmbalmer# NAME is "CC", "CXX", "GCJ", or "OBJC".
82723eed67faSmbalmer# We try a few techniques and use that to set a single cache variable.
82733eed67faSmbalmer#
82743eed67faSmbalmer# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
82753eed67faSmbalmer# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
82763eed67faSmbalmer# dependency, and given that the user is not expected to run this macro,
82773eed67faSmbalmer# just rely on AC_PROG_CC.
82783eed67faSmbalmerAC_DEFUN([_AM_DEPENDENCIES],
82793eed67faSmbalmer[AC_REQUIRE([AM_SET_DEPDIR])dnl
82803eed67faSmbalmerAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
82813eed67faSmbalmerAC_REQUIRE([AM_MAKE_INCLUDE])dnl
82823eed67faSmbalmerAC_REQUIRE([AM_DEP_TRACK])dnl
82833eed67faSmbalmer
82843eed67faSmbalmerifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
82853eed67faSmbalmer       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
82863eed67faSmbalmer       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
8287dc407927Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
82883eed67faSmbalmer       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
82893eed67faSmbalmer                   [depcc="$$1"   am_compiler_list=])
82903eed67faSmbalmer
82913eed67faSmbalmerAC_CACHE_CHECK([dependency style of $depcc],
82923eed67faSmbalmer               [am_cv_$1_dependencies_compiler_type],
82933eed67faSmbalmer[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
82943eed67faSmbalmer  # We make a subdir and do the tests there.  Otherwise we can end up
82953eed67faSmbalmer  # making bogus files that we don't know about and never remove.  For
82963eed67faSmbalmer  # instance it was reported that on HP-UX the gcc test will end up
82973eed67faSmbalmer  # making a dummy file named `D' -- because `-MD' means `put the output
82983eed67faSmbalmer  # in D'.
82993eed67faSmbalmer  mkdir conftest.dir
83003eed67faSmbalmer  # Copy depcomp to subdir because otherwise we won't find it if we're
83013eed67faSmbalmer  # using a relative directory.
83023eed67faSmbalmer  cp "$am_depcomp" conftest.dir
83033eed67faSmbalmer  cd conftest.dir
83043eed67faSmbalmer  # We will build objects and dependencies in a subdirectory because
83053eed67faSmbalmer  # it helps to detect inapplicable dependency modes.  For instance
83063eed67faSmbalmer  # both Tru64's cc and ICC support -MD to output dependencies as a
83073eed67faSmbalmer  # side effect of compilation, but ICC will put the dependencies in
83083eed67faSmbalmer  # the current directory while Tru64 will put them in the object
83093eed67faSmbalmer  # directory.
83103eed67faSmbalmer  mkdir sub
83113eed67faSmbalmer
83123eed67faSmbalmer  am_cv_$1_dependencies_compiler_type=none
83133eed67faSmbalmer  if test "$am_compiler_list" = ""; then
83143eed67faSmbalmer     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
83153eed67faSmbalmer  fi
8316dc407927Smrg  am__universal=false
8317dc407927Smrg  m4_case([$1], [CC],
8318dc407927Smrg    [case " $depcc " in #(
8319dc407927Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
8320dc407927Smrg     esac],
8321dc407927Smrg    [CXX],
8322dc407927Smrg    [case " $depcc " in #(
8323dc407927Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
8324dc407927Smrg     esac])
8325dc407927Smrg
83263eed67faSmbalmer  for depmode in $am_compiler_list; do
83273eed67faSmbalmer    # Setup a source with many dependencies, because some compilers
83283eed67faSmbalmer    # like to wrap large dependency lists on column 80 (with \), and
83293eed67faSmbalmer    # we should not choose a depcomp mode which is confused by this.
83303eed67faSmbalmer    #
83313eed67faSmbalmer    # We need to recreate these files for each test, as the compiler may
83323eed67faSmbalmer    # overwrite some of them when testing with obscure command lines.
83333eed67faSmbalmer    # This happens at least with the AIX C compiler.
83343eed67faSmbalmer    : > sub/conftest.c
83353eed67faSmbalmer    for i in 1 2 3 4 5 6; do
83363eed67faSmbalmer      echo '#include "conftst'$i'.h"' >> sub/conftest.c
83373eed67faSmbalmer      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
83383eed67faSmbalmer      # Solaris 8's {/usr,}/bin/sh.
83393eed67faSmbalmer      touch sub/conftst$i.h
83403eed67faSmbalmer    done
83413eed67faSmbalmer    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
83423eed67faSmbalmer
8343dc407927Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
8344dc407927Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
8345dc407927Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
8346dc407927Smrg    # versions had trouble with output in subdirs
8347dc407927Smrg    am__obj=sub/conftest.${OBJEXT-o}
8348dc407927Smrg    am__minus_obj="-o $am__obj"
83493eed67faSmbalmer    case $depmode in
8350dc407927Smrg    gcc)
8351dc407927Smrg      # This depmode causes a compiler race in universal mode.
8352dc407927Smrg      test "$am__universal" = false || continue
8353dc407927Smrg      ;;
83543eed67faSmbalmer    nosideeffect)
83553eed67faSmbalmer      # after this tag, mechanisms are not by side-effect, so they'll
83563eed67faSmbalmer      # only be used when explicitly requested
83573eed67faSmbalmer      if test "x$enable_dependency_tracking" = xyes; then
83583eed67faSmbalmer	continue
83593eed67faSmbalmer      else
83603eed67faSmbalmer	break
83613eed67faSmbalmer      fi
83623eed67faSmbalmer      ;;
8363dc407927Smrg    msvisualcpp | msvcmsys)
8364dc407927Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
8365dc407927Smrg      # not run yet.  These depmodes are late enough in the game, and
8366dc407927Smrg      # so weak that their functioning should not be impacted.
8367dc407927Smrg      am__obj=conftest.${OBJEXT-o}
8368dc407927Smrg      am__minus_obj=
8369dc407927Smrg      ;;
83703eed67faSmbalmer    none) break ;;
83713eed67faSmbalmer    esac
83723eed67faSmbalmer    if depmode=$depmode \
8373dc407927Smrg       source=sub/conftest.c object=$am__obj \
83743eed67faSmbalmer       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
8375dc407927Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
83763eed67faSmbalmer         >/dev/null 2>conftest.err &&
8377dc407927Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
83783eed67faSmbalmer       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
8379dc407927Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
83803eed67faSmbalmer       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
83813eed67faSmbalmer      # icc doesn't choke on unknown options, it will just issue warnings
83823eed67faSmbalmer      # or remarks (even with -Werror).  So we grep stderr for any message
83833eed67faSmbalmer      # that says an option was ignored or not supported.
83843eed67faSmbalmer      # When given -MP, icc 7.0 and 7.1 complain thusly:
83853eed67faSmbalmer      #   icc: Command line warning: ignoring option '-M'; no argument required
83863eed67faSmbalmer      # The diagnosis changed in icc 8.0:
83873eed67faSmbalmer      #   icc: Command line remark: option '-MP' not supported
83883eed67faSmbalmer      if (grep 'ignoring option' conftest.err ||
83893eed67faSmbalmer          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
83903eed67faSmbalmer        am_cv_$1_dependencies_compiler_type=$depmode
83913eed67faSmbalmer        break
83923eed67faSmbalmer      fi
83933eed67faSmbalmer    fi
83943eed67faSmbalmer  done
83953eed67faSmbalmer
83963eed67faSmbalmer  cd ..
83973eed67faSmbalmer  rm -rf conftest.dir
83983eed67faSmbalmerelse
83993eed67faSmbalmer  am_cv_$1_dependencies_compiler_type=none
84003eed67faSmbalmerfi
84013eed67faSmbalmer])
84023eed67faSmbalmerAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
84033eed67faSmbalmerAM_CONDITIONAL([am__fastdep$1], [
84043eed67faSmbalmer  test "x$enable_dependency_tracking" != xno \
84053eed67faSmbalmer  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
84063eed67faSmbalmer])
84073eed67faSmbalmer
84083eed67faSmbalmer
84093eed67faSmbalmer# AM_SET_DEPDIR
84103eed67faSmbalmer# -------------
84113eed67faSmbalmer# Choose a directory name for dependency files.
84123eed67faSmbalmer# This macro is AC_REQUIREd in _AM_DEPENDENCIES
84133eed67faSmbalmerAC_DEFUN([AM_SET_DEPDIR],
84143eed67faSmbalmer[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
84153eed67faSmbalmerAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
84163eed67faSmbalmer])
84173eed67faSmbalmer
84183eed67faSmbalmer
84193eed67faSmbalmer# AM_DEP_TRACK
84203eed67faSmbalmer# ------------
84213eed67faSmbalmerAC_DEFUN([AM_DEP_TRACK],
84223eed67faSmbalmer[AC_ARG_ENABLE(dependency-tracking,
84233eed67faSmbalmer[  --disable-dependency-tracking  speeds up one-time build
84243eed67faSmbalmer  --enable-dependency-tracking   do not reject slow dependency extractors])
84253eed67faSmbalmerif test "x$enable_dependency_tracking" != xno; then
84263eed67faSmbalmer  am_depcomp="$ac_aux_dir/depcomp"
84273eed67faSmbalmer  AMDEPBACKSLASH='\'
84283eed67faSmbalmerfi
84293eed67faSmbalmerAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
8430dc407927SmrgAC_SUBST([AMDEPBACKSLASH])dnl
8431dc407927Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
84323eed67faSmbalmer])
84333eed67faSmbalmer
84343eed67faSmbalmer# Generate code to set up dependency tracking.              -*- Autoconf -*-
84353eed67faSmbalmer
8436dc407927Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
84373eed67faSmbalmer# Free Software Foundation, Inc.
84383eed67faSmbalmer#
84393eed67faSmbalmer# This file is free software; the Free Software Foundation
84403eed67faSmbalmer# gives unlimited permission to copy and/or distribute it,
84413eed67faSmbalmer# with or without modifications, as long as this notice is preserved.
84423eed67faSmbalmer
8443dc407927Smrg#serial 5
84443eed67faSmbalmer
84453eed67faSmbalmer# _AM_OUTPUT_DEPENDENCY_COMMANDS
84463eed67faSmbalmer# ------------------------------
84473eed67faSmbalmerAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
8448dc407927Smrg[{
8449dc407927Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
8450dc407927Smrg  # are listed without --file.  Let's play safe and only enable the eval
8451dc407927Smrg  # if we detect the quoting.
8452dc407927Smrg  case $CONFIG_FILES in
8453dc407927Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
8454dc407927Smrg  *)   set x $CONFIG_FILES ;;
8455dc407927Smrg  esac
8456dc407927Smrg  shift
8457dc407927Smrg  for mf
8458dc407927Smrg  do
8459dc407927Smrg    # Strip MF so we end up with the name of the file.
8460dc407927Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
8461dc407927Smrg    # Check whether this is an Automake generated Makefile or not.
8462dc407927Smrg    # We used to match only the files named `Makefile.in', but
8463dc407927Smrg    # some people rename them; so instead we look at the file content.
8464dc407927Smrg    # Grep'ing the first line is not enough: some people post-process
8465dc407927Smrg    # each Makefile.in and add a new line on top of each file to say so.
8466dc407927Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
8467dc407927Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
8468dc407927Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
8469dc407927Smrg      dirpart=`AS_DIRNAME("$mf")`
8470dc407927Smrg    else
8471dc407927Smrg      continue
8472dc407927Smrg    fi
8473dc407927Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
8474dc407927Smrg    # from the Makefile without running `make'.
8475dc407927Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
8476dc407927Smrg    test -z "$DEPDIR" && continue
8477dc407927Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
8478dc407927Smrg    test -z "am__include" && continue
8479dc407927Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
8480dc407927Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
8481dc407927Smrg    U=`sed -n 's/^U = //p' < "$mf"`
8482dc407927Smrg    # Find all dependency output files, they are included files with
8483dc407927Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
8484dc407927Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
8485dc407927Smrg    # expansion.
8486dc407927Smrg    for file in `sed -n "
8487dc407927Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
8488dc407927Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
8489dc407927Smrg      # Make sure the directory exists.
8490dc407927Smrg      test -f "$dirpart/$file" && continue
8491dc407927Smrg      fdir=`AS_DIRNAME(["$file"])`
8492dc407927Smrg      AS_MKDIR_P([$dirpart/$fdir])
8493dc407927Smrg      # echo "creating $dirpart/$file"
8494dc407927Smrg      echo '# dummy' > "$dirpart/$file"
8495dc407927Smrg    done
84963eed67faSmbalmer  done
8497dc407927Smrg}
84983eed67faSmbalmer])# _AM_OUTPUT_DEPENDENCY_COMMANDS
84993eed67faSmbalmer
85003eed67faSmbalmer
85013eed67faSmbalmer# AM_OUTPUT_DEPENDENCY_COMMANDS
85023eed67faSmbalmer# -----------------------------
85033eed67faSmbalmer# This macro should only be invoked once -- use via AC_REQUIRE.
85043eed67faSmbalmer#
85053eed67faSmbalmer# This code is only required when automatic dependency tracking
85063eed67faSmbalmer# is enabled.  FIXME.  This creates each `.P' file that we will
85073eed67faSmbalmer# need in order to bootstrap the dependency handling code.
85083eed67faSmbalmerAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
85093eed67faSmbalmer[AC_CONFIG_COMMANDS([depfiles],
85103eed67faSmbalmer     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
85113eed67faSmbalmer     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
85123eed67faSmbalmer])
85133eed67faSmbalmer
85143eed67faSmbalmer# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
85153eed67faSmbalmer# Free Software Foundation, Inc.
85163eed67faSmbalmer#
85173eed67faSmbalmer# This file is free software; the Free Software Foundation
85183eed67faSmbalmer# gives unlimited permission to copy and/or distribute it,
85193eed67faSmbalmer# with or without modifications, as long as this notice is preserved.
85203eed67faSmbalmer
85213eed67faSmbalmer# serial 8
85223eed67faSmbalmer
85233eed67faSmbalmer# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
85243eed67faSmbalmerAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
85253eed67faSmbalmer
85263eed67faSmbalmer# Do all the work for Automake.                             -*- Autoconf -*-
85273eed67faSmbalmer
8528dc407927Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
8529dc407927Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
85303eed67faSmbalmer#
85313eed67faSmbalmer# This file is free software; the Free Software Foundation
85323eed67faSmbalmer# gives unlimited permission to copy and/or distribute it,
85333eed67faSmbalmer# with or without modifications, as long as this notice is preserved.
85343eed67faSmbalmer
8535dc407927Smrg# serial 16
85363eed67faSmbalmer
85373eed67faSmbalmer# This macro actually does too much.  Some checks are only needed if
85383eed67faSmbalmer# your package does certain things.  But this isn't really a big deal.
85393eed67faSmbalmer
85403eed67faSmbalmer# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
85413eed67faSmbalmer# AM_INIT_AUTOMAKE([OPTIONS])
85423eed67faSmbalmer# -----------------------------------------------
85433eed67faSmbalmer# The call with PACKAGE and VERSION arguments is the old style
85443eed67faSmbalmer# call (pre autoconf-2.50), which is being phased out.  PACKAGE
85453eed67faSmbalmer# and VERSION should now be passed to AC_INIT and removed from
85463eed67faSmbalmer# the call to AM_INIT_AUTOMAKE.
85473eed67faSmbalmer# We support both call styles for the transition.  After
85483eed67faSmbalmer# the next Automake release, Autoconf can make the AC_INIT
85493eed67faSmbalmer# arguments mandatory, and then we can depend on a new Autoconf
85503eed67faSmbalmer# release and drop the old call support.
85513eed67faSmbalmerAC_DEFUN([AM_INIT_AUTOMAKE],
8552dc407927Smrg[AC_PREREQ([2.62])dnl
85533eed67faSmbalmerdnl Autoconf wants to disallow AM_ names.  We explicitly allow
85543eed67faSmbalmerdnl the ones we care about.
85553eed67faSmbalmerm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
85563eed67faSmbalmerAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
85573eed67faSmbalmerAC_REQUIRE([AC_PROG_INSTALL])dnl
8558dc407927Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
8559dc407927Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
8560dc407927Smrg  # is not polluted with repeated "-I."
8561dc407927Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
8562dc407927Smrg  # test to see if srcdir already configured
8563dc407927Smrg  if test -f $srcdir/config.status; then
8564dc407927Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
8565dc407927Smrg  fi
85663eed67faSmbalmerfi
85673eed67faSmbalmer
85683eed67faSmbalmer# test whether we have cygpath
85693eed67faSmbalmerif test -z "$CYGPATH_W"; then
85703eed67faSmbalmer  if (cygpath --version) >/dev/null 2>/dev/null; then
85713eed67faSmbalmer    CYGPATH_W='cygpath -w'
85723eed67faSmbalmer  else
85733eed67faSmbalmer    CYGPATH_W=echo
85743eed67faSmbalmer  fi
85753eed67faSmbalmerfi
85763eed67faSmbalmerAC_SUBST([CYGPATH_W])
85773eed67faSmbalmer
85783eed67faSmbalmer# Define the identity of the package.
85793eed67faSmbalmerdnl Distinguish between old-style and new-style calls.
85803eed67faSmbalmerm4_ifval([$2],
85813eed67faSmbalmer[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
85823eed67faSmbalmer AC_SUBST([PACKAGE], [$1])dnl
85833eed67faSmbalmer AC_SUBST([VERSION], [$2])],
85843eed67faSmbalmer[_AM_SET_OPTIONS([$1])dnl
8585dc407927Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
8586dc407927Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
8587dc407927Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
85883eed67faSmbalmer AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
85893eed67faSmbalmer AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
85903eed67faSmbalmer
85913eed67faSmbalmer_AM_IF_OPTION([no-define],,
85923eed67faSmbalmer[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
85933eed67faSmbalmer AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
85943eed67faSmbalmer
85953eed67faSmbalmer# Some tools Automake needs.
85963eed67faSmbalmerAC_REQUIRE([AM_SANITY_CHECK])dnl
85973eed67faSmbalmerAC_REQUIRE([AC_ARG_PROGRAM])dnl
85983eed67faSmbalmerAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
85993eed67faSmbalmerAM_MISSING_PROG(AUTOCONF, autoconf)
86003eed67faSmbalmerAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
86013eed67faSmbalmerAM_MISSING_PROG(AUTOHEADER, autoheader)
86023eed67faSmbalmerAM_MISSING_PROG(MAKEINFO, makeinfo)
8603dc407927SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
8604dc407927SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
86053eed67faSmbalmerAC_REQUIRE([AM_PROG_MKDIR_P])dnl
86063eed67faSmbalmer# We need awk for the "check" target.  The system "awk" is bad on
86073eed67faSmbalmer# some platforms.
86083eed67faSmbalmerAC_REQUIRE([AC_PROG_AWK])dnl
86093eed67faSmbalmerAC_REQUIRE([AC_PROG_MAKE_SET])dnl
86103eed67faSmbalmerAC_REQUIRE([AM_SET_LEADING_DOT])dnl
86113eed67faSmbalmer_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
8612dc407927Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
8613dc407927Smrg			     [_AM_PROG_TAR([v7])])])
86143eed67faSmbalmer_AM_IF_OPTION([no-dependencies],,
86153eed67faSmbalmer[AC_PROVIDE_IFELSE([AC_PROG_CC],
8616dc407927Smrg		  [_AM_DEPENDENCIES(CC)],
8617dc407927Smrg		  [define([AC_PROG_CC],
8618dc407927Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
86193eed67faSmbalmerAC_PROVIDE_IFELSE([AC_PROG_CXX],
8620dc407927Smrg		  [_AM_DEPENDENCIES(CXX)],
8621dc407927Smrg		  [define([AC_PROG_CXX],
8622dc407927Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
8623dc407927SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
8624dc407927Smrg		  [_AM_DEPENDENCIES(OBJC)],
8625dc407927Smrg		  [define([AC_PROG_OBJC],
8626dc407927Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
86273eed67faSmbalmer])
8628dc407927Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
8629dc407927Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
8630dc407927Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
8631dc407927Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
8632dc407927SmrgAC_CONFIG_COMMANDS_PRE(dnl
8633dc407927Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
8634dc407927Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
86353eed67faSmbalmer])
86363eed67faSmbalmer
8637dc407927Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
8638dc407927Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
8639dc407927Smrgdnl mangled by Autoconf and run in a shell conditional statement.
8640dc407927Smrgm4_define([_AC_COMPILER_EXEEXT],
8641dc407927Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
8642dc407927Smrg
86433eed67faSmbalmer
86443eed67faSmbalmer# When config.status generates a header, we must update the stamp-h file.
86453eed67faSmbalmer# This file resides in the same directory as the config header
86463eed67faSmbalmer# that is generated.  The stamp files are numbered to have different names.
86473eed67faSmbalmer
86483eed67faSmbalmer# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
86493eed67faSmbalmer# loop where config.status creates the headers, so we can generate
86503eed67faSmbalmer# our stamp files there.
86513eed67faSmbalmerAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
86523eed67faSmbalmer[# Compute $1's index in $config_headers.
8653dc407927Smrg_am_arg=$1
86543eed67faSmbalmer_am_stamp_count=1
86553eed67faSmbalmerfor _am_header in $config_headers :; do
86563eed67faSmbalmer  case $_am_header in
8657dc407927Smrg    $_am_arg | $_am_arg:* )
86583eed67faSmbalmer      break ;;
86593eed67faSmbalmer    * )
86603eed67faSmbalmer      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
86613eed67faSmbalmer  esac
86623eed67faSmbalmerdone
8663dc407927Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
86643eed67faSmbalmer
8665dc407927Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
86663eed67faSmbalmer#
86673eed67faSmbalmer# This file is free software; the Free Software Foundation
86683eed67faSmbalmer# gives unlimited permission to copy and/or distribute it,
86693eed67faSmbalmer# with or without modifications, as long as this notice is preserved.
86703eed67faSmbalmer
86713eed67faSmbalmer# AM_PROG_INSTALL_SH
86723eed67faSmbalmer# ------------------
86733eed67faSmbalmer# Define $install_sh.
86743eed67faSmbalmerAC_DEFUN([AM_PROG_INSTALL_SH],
86753eed67faSmbalmer[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
8676dc407927Smrgif test x"${install_sh}" != xset; then
8677dc407927Smrg  case $am_aux_dir in
8678dc407927Smrg  *\ * | *\	*)
8679dc407927Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
8680dc407927Smrg  *)
8681dc407927Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
8682dc407927Smrg  esac
8683dc407927Smrgfi
86843eed67faSmbalmerAC_SUBST(install_sh)])
86853eed67faSmbalmer
86863eed67faSmbalmer# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
86873eed67faSmbalmer#
86883eed67faSmbalmer# This file is free software; the Free Software Foundation
86893eed67faSmbalmer# gives unlimited permission to copy and/or distribute it,
86903eed67faSmbalmer# with or without modifications, as long as this notice is preserved.
86913eed67faSmbalmer
86923eed67faSmbalmer# serial 2
86933eed67faSmbalmer
86943eed67faSmbalmer# Check whether the underlying file-system supports filenames
86953eed67faSmbalmer# with a leading dot.  For instance MS-DOS doesn't.
86963eed67faSmbalmerAC_DEFUN([AM_SET_LEADING_DOT],
86973eed67faSmbalmer[rm -rf .tst 2>/dev/null
86983eed67faSmbalmermkdir .tst 2>/dev/null
86993eed67faSmbalmerif test -d .tst; then
87003eed67faSmbalmer  am__leading_dot=.
87013eed67faSmbalmerelse
87023eed67faSmbalmer  am__leading_dot=_
87033eed67faSmbalmerfi
87043eed67faSmbalmerrmdir .tst 2>/dev/null
87053eed67faSmbalmerAC_SUBST([am__leading_dot])])
87063eed67faSmbalmer
87073eed67faSmbalmer# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
87083eed67faSmbalmer# From Jim Meyering
87093eed67faSmbalmer
8710dc407927Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
87113eed67faSmbalmer# Free Software Foundation, Inc.
87123eed67faSmbalmer#
87133eed67faSmbalmer# This file is free software; the Free Software Foundation
87143eed67faSmbalmer# gives unlimited permission to copy and/or distribute it,
87153eed67faSmbalmer# with or without modifications, as long as this notice is preserved.
87163eed67faSmbalmer
8717dc407927Smrg# serial 5
87183eed67faSmbalmer
8719dc407927Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
8720dc407927Smrg# ----------------------------------
8721dc407927Smrg# Control maintainer-specific portions of Makefiles.
8722dc407927Smrg# Default is to disable them, unless `enable' is passed literally.
8723dc407927Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
8724dc407927Smrg# can override the default with the --enable/--disable switch.
87253eed67faSmbalmerAC_DEFUN([AM_MAINTAINER_MODE],
8726dc407927Smrg[m4_case(m4_default([$1], [disable]),
8727dc407927Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
8728dc407927Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
8729dc407927Smrg       [m4_define([am_maintainer_other], [enable])
8730dc407927Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
8731dc407927SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
8732dc407927Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
8733dc407927Smrg  AC_ARG_ENABLE([maintainer-mode],
8734dc407927Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
87353eed67faSmbalmer			  (and sometimes confusing) to the casual installer],
8736dc407927Smrg      [USE_MAINTAINER_MODE=$enableval],
8737dc407927Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
87383eed67faSmbalmer  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
8739dc407927Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
87403eed67faSmbalmer  MAINT=$MAINTAINER_MODE_TRUE
8741dc407927Smrg  AC_SUBST([MAINT])dnl
87423eed67faSmbalmer]
87433eed67faSmbalmer)
87443eed67faSmbalmer
87453eed67faSmbalmerAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
87463eed67faSmbalmer
87473eed67faSmbalmer# Check to see how 'make' treats includes.	            -*- Autoconf -*-
87483eed67faSmbalmer
8749dc407927Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
87503eed67faSmbalmer#
87513eed67faSmbalmer# This file is free software; the Free Software Foundation
87523eed67faSmbalmer# gives unlimited permission to copy and/or distribute it,
87533eed67faSmbalmer# with or without modifications, as long as this notice is preserved.
87543eed67faSmbalmer
8755dc407927Smrg# serial 4
87563eed67faSmbalmer
87573eed67faSmbalmer# AM_MAKE_INCLUDE()
87583eed67faSmbalmer# -----------------
87593eed67faSmbalmer# Check to see how make treats includes.
87603eed67faSmbalmerAC_DEFUN([AM_MAKE_INCLUDE],
87613eed67faSmbalmer[am_make=${MAKE-make}
87623eed67faSmbalmercat > confinc << 'END'
87633eed67faSmbalmeram__doit:
8764dc407927Smrg	@echo this is the am__doit target
87653eed67faSmbalmer.PHONY: am__doit
87663eed67faSmbalmerEND
87673eed67faSmbalmer# If we don't find an include directive, just comment out the code.
87683eed67faSmbalmerAC_MSG_CHECKING([for style of include used by $am_make])
87693eed67faSmbalmeram__include="#"
87703eed67faSmbalmeram__quote=
87713eed67faSmbalmer_am_result=none
87723eed67faSmbalmer# First try GNU make style include.
87733eed67faSmbalmerecho "include confinc" > confmf
8774dc407927Smrg# Ignore all kinds of additional output from `make'.
8775dc407927Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
8776dc407927Smrg*the\ am__doit\ target*)
8777dc407927Smrg  am__include=include
8778dc407927Smrg  am__quote=
8779dc407927Smrg  _am_result=GNU
8780dc407927Smrg  ;;
8781dc407927Smrgesac
87823eed67faSmbalmer# Now try BSD make style include.
87833eed67faSmbalmerif test "$am__include" = "#"; then
87843eed67faSmbalmer   echo '.include "confinc"' > confmf
8785dc407927Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
8786dc407927Smrg   *the\ am__doit\ target*)
8787dc407927Smrg     am__include=.include
8788dc407927Smrg     am__quote="\""
8789dc407927Smrg     _am_result=BSD
8790dc407927Smrg     ;;
8791dc407927Smrg   esac
87923eed67faSmbalmerfi
87933eed67faSmbalmerAC_SUBST([am__include])
87943eed67faSmbalmerAC_SUBST([am__quote])
87953eed67faSmbalmerAC_MSG_RESULT([$_am_result])
87963eed67faSmbalmerrm -f confinc confmf
87973eed67faSmbalmer])
87983eed67faSmbalmer
87993eed67faSmbalmer# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
88003eed67faSmbalmer
8801dc407927Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
88023eed67faSmbalmer# Free Software Foundation, Inc.
88033eed67faSmbalmer#
88043eed67faSmbalmer# This file is free software; the Free Software Foundation
88053eed67faSmbalmer# gives unlimited permission to copy and/or distribute it,
88063eed67faSmbalmer# with or without modifications, as long as this notice is preserved.
88073eed67faSmbalmer
8808dc407927Smrg# serial 6
88093eed67faSmbalmer
88103eed67faSmbalmer# AM_MISSING_PROG(NAME, PROGRAM)
88113eed67faSmbalmer# ------------------------------
88123eed67faSmbalmerAC_DEFUN([AM_MISSING_PROG],
88133eed67faSmbalmer[AC_REQUIRE([AM_MISSING_HAS_RUN])
88143eed67faSmbalmer$1=${$1-"${am_missing_run}$2"}
88153eed67faSmbalmerAC_SUBST($1)])
88163eed67faSmbalmer
88173eed67faSmbalmer
88183eed67faSmbalmer# AM_MISSING_HAS_RUN
88193eed67faSmbalmer# ------------------
88203eed67faSmbalmer# Define MISSING if not defined so far and test if it supports --run.
88213eed67faSmbalmer# If it does, set am_missing_run to use it, otherwise, to nothing.
88223eed67faSmbalmerAC_DEFUN([AM_MISSING_HAS_RUN],
88233eed67faSmbalmer[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
8824dc407927SmrgAC_REQUIRE_AUX_FILE([missing])dnl
8825dc407927Smrgif test x"${MISSING+set}" != xset; then
8826dc407927Smrg  case $am_aux_dir in
8827dc407927Smrg  *\ * | *\	*)
8828dc407927Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
8829dc407927Smrg  *)
8830dc407927Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
8831dc407927Smrg  esac
8832dc407927Smrgfi
88333eed67faSmbalmer# Use eval to expand $SHELL
88343eed67faSmbalmerif eval "$MISSING --run true"; then
88353eed67faSmbalmer  am_missing_run="$MISSING --run "
88363eed67faSmbalmerelse
88373eed67faSmbalmer  am_missing_run=
88383eed67faSmbalmer  AC_MSG_WARN([`missing' script is too old or missing])
88393eed67faSmbalmerfi
88403eed67faSmbalmer])
88413eed67faSmbalmer
8842dc407927Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
88433eed67faSmbalmer#
88443eed67faSmbalmer# This file is free software; the Free Software Foundation
88453eed67faSmbalmer# gives unlimited permission to copy and/or distribute it,
88463eed67faSmbalmer# with or without modifications, as long as this notice is preserved.
88473eed67faSmbalmer
88483eed67faSmbalmer# AM_PROG_MKDIR_P
88493eed67faSmbalmer# ---------------
8850dc407927Smrg# Check for `mkdir -p'.
88513eed67faSmbalmerAC_DEFUN([AM_PROG_MKDIR_P],
8852dc407927Smrg[AC_PREREQ([2.60])dnl
8853dc407927SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
8854dc407927Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
8855dc407927Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
8856dc407927Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
8857dc407927Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
8858dc407927Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
8859dc407927Smrgdnl adjustment using top_builddir (which is defined more often than
8860dc407927Smrgdnl MKDIR_P).
8861dc407927SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
8862dc407927Smrgcase $mkdir_p in
8863dc407927Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
8864dc407927Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
8865dc407927Smrgesac
8866dc407927Smrg])
88673eed67faSmbalmer
88683eed67faSmbalmer# Helper functions for option handling.                     -*- Autoconf -*-
88693eed67faSmbalmer
8870dc407927Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
88713eed67faSmbalmer#
88723eed67faSmbalmer# This file is free software; the Free Software Foundation
88733eed67faSmbalmer# gives unlimited permission to copy and/or distribute it,
88743eed67faSmbalmer# with or without modifications, as long as this notice is preserved.
88753eed67faSmbalmer
8876dc407927Smrg# serial 4
88773eed67faSmbalmer
88783eed67faSmbalmer# _AM_MANGLE_OPTION(NAME)
88793eed67faSmbalmer# -----------------------
88803eed67faSmbalmerAC_DEFUN([_AM_MANGLE_OPTION],
88813eed67faSmbalmer[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
88823eed67faSmbalmer
88833eed67faSmbalmer# _AM_SET_OPTION(NAME)
88843eed67faSmbalmer# ------------------------------
88853eed67faSmbalmer# Set option NAME.  Presently that only means defining a flag for this option.
88863eed67faSmbalmerAC_DEFUN([_AM_SET_OPTION],
88873eed67faSmbalmer[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
88883eed67faSmbalmer
88893eed67faSmbalmer# _AM_SET_OPTIONS(OPTIONS)
88903eed67faSmbalmer# ----------------------------------
88913eed67faSmbalmer# OPTIONS is a space-separated list of Automake options.
88923eed67faSmbalmerAC_DEFUN([_AM_SET_OPTIONS],
8893dc407927Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
88943eed67faSmbalmer
88953eed67faSmbalmer# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
88963eed67faSmbalmer# -------------------------------------------
88973eed67faSmbalmer# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
88983eed67faSmbalmerAC_DEFUN([_AM_IF_OPTION],
88993eed67faSmbalmer[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
89003eed67faSmbalmer
8901dc407927Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
8902dc407927Smrg
8903dc407927Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
8904dc407927Smrg# Free Software Foundation, Inc.
8905dc407927Smrg#
8906dc407927Smrg# This file is free software; the Free Software Foundation
8907dc407927Smrg# gives unlimited permission to copy and/or distribute it,
8908dc407927Smrg# with or without modifications, as long as this notice is preserved.
8909dc407927Smrg
8910dc407927Smrg# serial 5
8911dc407927Smrg
8912dc407927Smrg# AM_SANITY_CHECK
8913dc407927Smrg# ---------------
8914dc407927SmrgAC_DEFUN([AM_SANITY_CHECK],
8915dc407927Smrg[AC_MSG_CHECKING([whether build environment is sane])
8916dc407927Smrg# Just in case
8917dc407927Smrgsleep 1
8918dc407927Smrgecho timestamp > conftest.file
8919dc407927Smrg# Reject unsafe characters in $srcdir or the absolute working directory
8920dc407927Smrg# name.  Accept space and tab only in the latter.
8921dc407927Smrgam_lf='
8922dc407927Smrg'
8923dc407927Smrgcase `pwd` in
8924dc407927Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
8925dc407927Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
8926dc407927Smrgesac
8927dc407927Smrgcase $srcdir in
8928dc407927Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
8929dc407927Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
8930dc407927Smrgesac
8931dc407927Smrg
8932dc407927Smrg# Do `set' in a subshell so we don't clobber the current shell's
8933dc407927Smrg# arguments.  Must try -L first in case configure is actually a
8934dc407927Smrg# symlink; some systems play weird games with the mod time of symlinks
8935dc407927Smrg# (eg FreeBSD returns the mod time of the symlink's containing
8936dc407927Smrg# directory).
8937dc407927Smrgif (
8938dc407927Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
8939dc407927Smrg   if test "$[*]" = "X"; then
8940dc407927Smrg      # -L didn't work.
8941dc407927Smrg      set X `ls -t "$srcdir/configure" conftest.file`
8942dc407927Smrg   fi
8943dc407927Smrg   rm -f conftest.file
8944dc407927Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
8945dc407927Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
8946dc407927Smrg
8947dc407927Smrg      # If neither matched, then we have a broken ls.  This can happen
8948dc407927Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
8949dc407927Smrg      # broken ls alias from the environment.  This has actually
8950dc407927Smrg      # happened.  Such a system could not be considered "sane".
8951dc407927Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
8952dc407927Smrgalias in your environment])
8953dc407927Smrg   fi
8954dc407927Smrg
8955dc407927Smrg   test "$[2]" = conftest.file
8956dc407927Smrg   )
8957dc407927Smrgthen
8958dc407927Smrg   # Ok.
8959dc407927Smrg   :
8960dc407927Smrgelse
8961dc407927Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
8962dc407927SmrgCheck your system clock])
8963dc407927Smrgfi
8964dc407927SmrgAC_MSG_RESULT(yes)])
8965dc407927Smrg
89663eed67faSmbalmer# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
89673eed67faSmbalmer#
89683eed67faSmbalmer# This file is free software; the Free Software Foundation
89693eed67faSmbalmer# gives unlimited permission to copy and/or distribute it,
89703eed67faSmbalmer# with or without modifications, as long as this notice is preserved.
89713eed67faSmbalmer
89723eed67faSmbalmer# AM_PROG_INSTALL_STRIP
89733eed67faSmbalmer# ---------------------
89743eed67faSmbalmer# One issue with vendor `install' (even GNU) is that you can't
89753eed67faSmbalmer# specify the program used to strip binaries.  This is especially
89763eed67faSmbalmer# annoying in cross-compiling environments, where the build's strip
89773eed67faSmbalmer# is unlikely to handle the host's binaries.
89783eed67faSmbalmer# Fortunately install-sh will honor a STRIPPROG variable, so we
89793eed67faSmbalmer# always use install-sh in `make install-strip', and initialize
89803eed67faSmbalmer# STRIPPROG with the value of the STRIP variable (set by the user).
89813eed67faSmbalmerAC_DEFUN([AM_PROG_INSTALL_STRIP],
89823eed67faSmbalmer[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
89833eed67faSmbalmer# Installed binaries are usually stripped using `strip' when the user
89843eed67faSmbalmer# run `make install-strip'.  However `strip' might not be the right
89853eed67faSmbalmer# tool to use in cross-compilation environments, therefore Automake
89863eed67faSmbalmer# will honor the `STRIP' environment variable to overrule this program.
89873eed67faSmbalmerdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
89883eed67faSmbalmerif test "$cross_compiling" != no; then
89893eed67faSmbalmer  AC_CHECK_TOOL([STRIP], [strip], :)
89903eed67faSmbalmerfi
8991dc407927SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
89923eed67faSmbalmerAC_SUBST([INSTALL_STRIP_PROGRAM])])
89933eed67faSmbalmer
8994dc407927Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
8995dc407927Smrg#
8996dc407927Smrg# This file is free software; the Free Software Foundation
8997dc407927Smrg# gives unlimited permission to copy and/or distribute it,
8998dc407927Smrg# with or without modifications, as long as this notice is preserved.
8999dc407927Smrg
9000dc407927Smrg# serial 2
9001dc407927Smrg
9002dc407927Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
9003dc407927Smrg# ---------------------------
9004dc407927Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
9005dc407927Smrg# This macro is traced by Automake.
9006dc407927SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
9007dc407927Smrg
9008dc407927Smrg# AM_SUBST_NOTMAKE(VARIABLE)
9009dc407927Smrg# ---------------------------
9010dc407927Smrg# Public sister of _AM_SUBST_NOTMAKE.
9011dc407927SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
9012dc407927Smrg
90133eed67faSmbalmer# Check how to create a tarball.                            -*- Autoconf -*-
90143eed67faSmbalmer
90153eed67faSmbalmer# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
90163eed67faSmbalmer#
90173eed67faSmbalmer# This file is free software; the Free Software Foundation
90183eed67faSmbalmer# gives unlimited permission to copy and/or distribute it,
90193eed67faSmbalmer# with or without modifications, as long as this notice is preserved.
90203eed67faSmbalmer
90213eed67faSmbalmer# serial 2
90223eed67faSmbalmer
90233eed67faSmbalmer# _AM_PROG_TAR(FORMAT)
90243eed67faSmbalmer# --------------------
90253eed67faSmbalmer# Check how to create a tarball in format FORMAT.
90263eed67faSmbalmer# FORMAT should be one of `v7', `ustar', or `pax'.
90273eed67faSmbalmer#
90283eed67faSmbalmer# Substitute a variable $(am__tar) that is a command
90293eed67faSmbalmer# writing to stdout a FORMAT-tarball containing the directory
90303eed67faSmbalmer# $tardir.
90313eed67faSmbalmer#     tardir=directory && $(am__tar) > result.tar
90323eed67faSmbalmer#
90333eed67faSmbalmer# Substitute a variable $(am__untar) that extract such
90343eed67faSmbalmer# a tarball read from stdin.
90353eed67faSmbalmer#     $(am__untar) < result.tar
90363eed67faSmbalmerAC_DEFUN([_AM_PROG_TAR],
90373eed67faSmbalmer[# Always define AMTAR for backward compatibility.
90383eed67faSmbalmerAM_MISSING_PROG([AMTAR], [tar])
90393eed67faSmbalmerm4_if([$1], [v7],
90403eed67faSmbalmer     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
90413eed67faSmbalmer     [m4_case([$1], [ustar],, [pax],,
90423eed67faSmbalmer              [m4_fatal([Unknown tar format])])
90433eed67faSmbalmerAC_MSG_CHECKING([how to create a $1 tar archive])
90443eed67faSmbalmer# Loop over all known methods to create a tar archive until one works.
90453eed67faSmbalmer_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
90463eed67faSmbalmer_am_tools=${am_cv_prog_tar_$1-$_am_tools}
90473eed67faSmbalmer# Do not fold the above two line into one, because Tru64 sh and
90483eed67faSmbalmer# Solaris sh will not grok spaces in the rhs of `-'.
90493eed67faSmbalmerfor _am_tool in $_am_tools
90503eed67faSmbalmerdo
90513eed67faSmbalmer  case $_am_tool in
90523eed67faSmbalmer  gnutar)
90533eed67faSmbalmer    for _am_tar in tar gnutar gtar;
90543eed67faSmbalmer    do
90553eed67faSmbalmer      AM_RUN_LOG([$_am_tar --version]) && break
90563eed67faSmbalmer    done
90573eed67faSmbalmer    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
90583eed67faSmbalmer    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
90593eed67faSmbalmer    am__untar="$_am_tar -xf -"
90603eed67faSmbalmer    ;;
90613eed67faSmbalmer  plaintar)
90623eed67faSmbalmer    # Must skip GNU tar: if it does not support --format= it doesn't create
90633eed67faSmbalmer    # ustar tarball either.
90643eed67faSmbalmer    (tar --version) >/dev/null 2>&1 && continue
90653eed67faSmbalmer    am__tar='tar chf - "$$tardir"'
90663eed67faSmbalmer    am__tar_='tar chf - "$tardir"'
90673eed67faSmbalmer    am__untar='tar xf -'
90683eed67faSmbalmer    ;;
90693eed67faSmbalmer  pax)
90703eed67faSmbalmer    am__tar='pax -L -x $1 -w "$$tardir"'
90713eed67faSmbalmer    am__tar_='pax -L -x $1 -w "$tardir"'
90723eed67faSmbalmer    am__untar='pax -r'
90733eed67faSmbalmer    ;;
90743eed67faSmbalmer  cpio)
90753eed67faSmbalmer    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
90763eed67faSmbalmer    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
90773eed67faSmbalmer    am__untar='cpio -i -H $1 -d'
90783eed67faSmbalmer    ;;
90793eed67faSmbalmer  none)
90803eed67faSmbalmer    am__tar=false
90813eed67faSmbalmer    am__tar_=false
90823eed67faSmbalmer    am__untar=false
90833eed67faSmbalmer    ;;
90843eed67faSmbalmer  esac
90853eed67faSmbalmer
90863eed67faSmbalmer  # If the value was cached, stop now.  We just wanted to have am__tar
90873eed67faSmbalmer  # and am__untar set.
90883eed67faSmbalmer  test -n "${am_cv_prog_tar_$1}" && break
90893eed67faSmbalmer
90903eed67faSmbalmer  # tar/untar a dummy directory, and stop if the command works
90913eed67faSmbalmer  rm -rf conftest.dir
90923eed67faSmbalmer  mkdir conftest.dir
90933eed67faSmbalmer  echo GrepMe > conftest.dir/file
90943eed67faSmbalmer  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
90953eed67faSmbalmer  rm -rf conftest.dir
90963eed67faSmbalmer  if test -s conftest.tar; then
90973eed67faSmbalmer    AM_RUN_LOG([$am__untar <conftest.tar])
90983eed67faSmbalmer    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
90993eed67faSmbalmer  fi
91003eed67faSmbalmerdone
91013eed67faSmbalmerrm -rf conftest.dir
91023eed67faSmbalmer
91033eed67faSmbalmerAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
91043eed67faSmbalmerAC_MSG_RESULT([$am_cv_prog_tar_$1])])
91053eed67faSmbalmerAC_SUBST([am__tar])
91063eed67faSmbalmerAC_SUBST([am__untar])
91073eed67faSmbalmer]) # _AM_PROG_TAR
91083eed67faSmbalmer
9109dc407927Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
91103eed67faSmbalmerdnl
91113eed67faSmbalmerdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
91123eed67faSmbalmerdnl 
91133eed67faSmbalmerdnl Permission is hereby granted, free of charge, to any person obtaining a
9114dc407927Smrgdnl copy of this software and associated documentation files (the "Software"),
9115dc407927Smrgdnl to deal in the Software without restriction, including without limitation
9116dc407927Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
9117dc407927Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
9118dc407927Smrgdnl Software is furnished to do so, subject to the following conditions:
91193eed67faSmbalmerdnl
9120dc407927Smrgdnl The above copyright notice and this permission notice (including the next
9121dc407927Smrgdnl paragraph) shall be included in all copies or substantial portions of the
9122dc407927Smrgdnl Software.
91233eed67faSmbalmerdnl
9124dc407927Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9125dc407927Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9126dc407927Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
9127dc407927Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9128dc407927Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9129dc407927Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
9130dc407927Smrgdnl DEALINGS IN THE SOFTWARE.
91313eed67faSmbalmer
91323eed67faSmbalmer# XORG_MACROS_VERSION(required-version)
91333eed67faSmbalmer# -------------------------------------
91343eed67faSmbalmer# Minimum version: 1.1.0
91353eed67faSmbalmer#
91363eed67faSmbalmer# If you're using a macro added in Version 1.1 or newer, include this in
91373eed67faSmbalmer# your configure.ac with the minimum required version, such as:
91383eed67faSmbalmer# XORG_MACROS_VERSION(1.1)
91393eed67faSmbalmer#
9140dc407927Smrg# To ensure that this macro is defined, also add:
9141dc407927Smrg# m4_ifndef([XORG_MACROS_VERSION],
9142dc407927Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
91433eed67faSmbalmer#
91443eed67faSmbalmer#
91453eed67faSmbalmer# See the "minimum version" comment for each macro you use to see what 
9146dc407927Smrg# version you require.
9147dc407927Smrgm4_defun([XORG_MACROS_VERSION],[
9148dc407927Smrgm4_define([vers_have], [1.8.0])
9149dc407927Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
9150dc407927Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
9151dc407927Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
9152dc407927Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
9153dc407927Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
9154dc407927Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
9155dc407927Smrgm4_undefine([vers_have])
9156dc407927Smrgm4_undefine([maj_have])
9157dc407927Smrgm4_undefine([maj_needed])
91583eed67faSmbalmer]) # XORG_MACROS_VERSION
91593eed67faSmbalmer
91603eed67faSmbalmer# XORG_PROG_RAWCPP()
91613eed67faSmbalmer# ------------------
91623eed67faSmbalmer# Minimum version: 1.0.0
91633eed67faSmbalmer#
91643eed67faSmbalmer# Find cpp program and necessary flags for use in pre-processing text files
91653eed67faSmbalmer# such as man pages and config files
91663eed67faSmbalmerAC_DEFUN([XORG_PROG_RAWCPP],[
91673eed67faSmbalmerAC_REQUIRE([AC_PROG_CPP])
91683eed67faSmbalmerAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
91693eed67faSmbalmer   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
91703eed67faSmbalmer
91713eed67faSmbalmer# Check for flag to avoid builtin definitions - assumes unix is predefined,
91723eed67faSmbalmer# which is not the best choice for supporting other OS'es, but covers most
91733eed67faSmbalmer# of the ones we need for now.
91743eed67faSmbalmerAC_MSG_CHECKING([if $RAWCPP requires -undef])
91753eed67faSmbalmerAC_LANG_CONFTEST([Does cpp redefine unix ?])
91763eed67faSmbalmerif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
91773eed67faSmbalmer	AC_MSG_RESULT([no])
91783eed67faSmbalmerelse
91793eed67faSmbalmer	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
91803eed67faSmbalmer		RAWCPPFLAGS=-undef
91813eed67faSmbalmer		AC_MSG_RESULT([yes])
9182dc407927Smrg	# under Cygwin unix is still defined even with -undef
9183dc407927Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9184dc407927Smrg		RAWCPPFLAGS="-undef -ansi"
9185dc407927Smrg		AC_MSG_RESULT([yes, with -ansi])
91863eed67faSmbalmer	else
91873eed67faSmbalmer		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
91883eed67faSmbalmer	fi
91893eed67faSmbalmerfi
91903eed67faSmbalmerrm -f conftest.$ac_ext
91913eed67faSmbalmer
91923eed67faSmbalmerAC_MSG_CHECKING([if $RAWCPP requires -traditional])
91933eed67faSmbalmerAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
91943eed67faSmbalmerif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
91953eed67faSmbalmer	AC_MSG_RESULT([no])
91963eed67faSmbalmerelse
91973eed67faSmbalmer	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
91983eed67faSmbalmer		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
91993eed67faSmbalmer		AC_MSG_RESULT([yes])
92003eed67faSmbalmer	else
92013eed67faSmbalmer		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
92023eed67faSmbalmer	fi
92033eed67faSmbalmerfi
92043eed67faSmbalmerrm -f conftest.$ac_ext
92053eed67faSmbalmerAC_SUBST(RAWCPPFLAGS)
92063eed67faSmbalmer]) # XORG_PROG_RAWCPP
92073eed67faSmbalmer
92083eed67faSmbalmer# XORG_MANPAGE_SECTIONS()
92093eed67faSmbalmer# -----------------------
92103eed67faSmbalmer# Minimum version: 1.0.0
92113eed67faSmbalmer#
92123eed67faSmbalmer# Determine which sections man pages go in for the different man page types
92133eed67faSmbalmer# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
92143eed67faSmbalmer# Not sure if there's any better way than just hardcoding by OS name.
92153eed67faSmbalmer# Override default settings by setting environment variables
9216dc407927Smrg# Added MAN_SUBSTS in version 1.8
9217dc407927Smrg# Added AC_PROG_SED in version 1.8
92183eed67faSmbalmer
92193eed67faSmbalmerAC_DEFUN([XORG_MANPAGE_SECTIONS],[
92203eed67faSmbalmerAC_REQUIRE([AC_CANONICAL_HOST])
9221dc407927SmrgAC_REQUIRE([AC_PROG_SED])
92223eed67faSmbalmer
92233eed67faSmbalmerif test x$APP_MAN_SUFFIX = x    ; then
92243eed67faSmbalmer    APP_MAN_SUFFIX=1
92253eed67faSmbalmerfi
92263eed67faSmbalmerif test x$APP_MAN_DIR = x    ; then
92273eed67faSmbalmer    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
92283eed67faSmbalmerfi
92293eed67faSmbalmer
92303eed67faSmbalmerif test x$LIB_MAN_SUFFIX = x    ; then
92313eed67faSmbalmer    LIB_MAN_SUFFIX=3
92323eed67faSmbalmerfi
92333eed67faSmbalmerif test x$LIB_MAN_DIR = x    ; then
92343eed67faSmbalmer    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
92353eed67faSmbalmerfi
92363eed67faSmbalmer
92373eed67faSmbalmerif test x$FILE_MAN_SUFFIX = x    ; then
92383eed67faSmbalmer    case $host_os in
92393eed67faSmbalmer	solaris*)	FILE_MAN_SUFFIX=4  ;;
92403eed67faSmbalmer	*)		FILE_MAN_SUFFIX=5  ;;
92413eed67faSmbalmer    esac
92423eed67faSmbalmerfi
92433eed67faSmbalmerif test x$FILE_MAN_DIR = x    ; then
92443eed67faSmbalmer    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
92453eed67faSmbalmerfi
92463eed67faSmbalmer
92473eed67faSmbalmerif test x$MISC_MAN_SUFFIX = x    ; then
92483eed67faSmbalmer    case $host_os in
92493eed67faSmbalmer	solaris*)	MISC_MAN_SUFFIX=5  ;;
92503eed67faSmbalmer	*)		MISC_MAN_SUFFIX=7  ;;
92513eed67faSmbalmer    esac
92523eed67faSmbalmerfi
92533eed67faSmbalmerif test x$MISC_MAN_DIR = x    ; then
92543eed67faSmbalmer    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
92553eed67faSmbalmerfi
92563eed67faSmbalmer
92573eed67faSmbalmerif test x$DRIVER_MAN_SUFFIX = x    ; then
92583eed67faSmbalmer    case $host_os in
92593eed67faSmbalmer	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
92603eed67faSmbalmer	*)		DRIVER_MAN_SUFFIX=4  ;;
92613eed67faSmbalmer    esac
92623eed67faSmbalmerfi
92633eed67faSmbalmerif test x$DRIVER_MAN_DIR = x    ; then
92643eed67faSmbalmer    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
92653eed67faSmbalmerfi
92663eed67faSmbalmer
92673eed67faSmbalmerif test x$ADMIN_MAN_SUFFIX = x    ; then
92683eed67faSmbalmer    case $host_os in
92693eed67faSmbalmer	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
92703eed67faSmbalmer	*)		ADMIN_MAN_SUFFIX=8  ;;
92713eed67faSmbalmer    esac
92723eed67faSmbalmerfi
92733eed67faSmbalmerif test x$ADMIN_MAN_DIR = x    ; then
92743eed67faSmbalmer    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
92753eed67faSmbalmerfi
92763eed67faSmbalmer
92773eed67faSmbalmer
92783eed67faSmbalmerAC_SUBST([APP_MAN_SUFFIX])
92793eed67faSmbalmerAC_SUBST([LIB_MAN_SUFFIX])
92803eed67faSmbalmerAC_SUBST([FILE_MAN_SUFFIX])
92813eed67faSmbalmerAC_SUBST([MISC_MAN_SUFFIX])
92823eed67faSmbalmerAC_SUBST([DRIVER_MAN_SUFFIX])
92833eed67faSmbalmerAC_SUBST([ADMIN_MAN_SUFFIX])
92843eed67faSmbalmerAC_SUBST([APP_MAN_DIR])
92853eed67faSmbalmerAC_SUBST([LIB_MAN_DIR])
92863eed67faSmbalmerAC_SUBST([FILE_MAN_DIR])
92873eed67faSmbalmerAC_SUBST([MISC_MAN_DIR])
92883eed67faSmbalmerAC_SUBST([DRIVER_MAN_DIR])
92893eed67faSmbalmerAC_SUBST([ADMIN_MAN_DIR])
9290dc407927Smrg
9291dc407927SmrgXORG_MAN_PAGE="X Version 11"
9292dc407927SmrgAC_SUBST([XORG_MAN_PAGE])
9293dc407927SmrgMAN_SUBSTS="\
9294dc407927Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9295dc407927Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9296dc407927Smrg	-e 's|__xservername__|Xorg|g' \
9297dc407927Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
9298dc407927Smrg	-e 's|__projectroot__|\$(prefix)|g' \
9299dc407927Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
9300dc407927Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
9301dc407927Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
9302dc407927Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
9303dc407927Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
9304dc407927Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
9305dc407927SmrgAC_SUBST([MAN_SUBSTS])
9306dc407927Smrg
93073eed67faSmbalmer]) # XORG_MANPAGE_SECTIONS
93083eed67faSmbalmer
9309dc407927Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
9310dc407927Smrg# ------------------------
9311dc407927Smrg# Minimum version: 1.7.0
9312dc407927Smrg#
9313dc407927Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
9314dc407927Smrg# provided by xorg-sgml-doctools, if installed.
9315dc407927SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
9316dc407927SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
9317dc407927SmrgXORG_SGML_PATH=
9318dc407927SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
9319dc407927Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
9320dc407927Smrg    [m4_ifval([$1],[:],
9321dc407927Smrg        [if test x"$cross_compiling" != x"yes" ; then
9322dc407927Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
9323dc407927Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
9324dc407927Smrg         fi])
9325dc407927Smrg    ])
9326dc407927Smrg
9327dc407927Smrgif test "x$XORG_SGML_PATH" != "x" ; then
9328dc407927Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
9329dc407927Smrgelse
9330dc407927Smrg   AC_MSG_RESULT([no])
9331dc407927Smrgfi
9332dc407927Smrg
9333dc407927SmrgAC_SUBST(XORG_SGML_PATH)
9334dc407927Smrg]) # XORG_CHECK_SGML_DOCTOOLS
9335dc407927Smrg
93363eed67faSmbalmer# XORG_CHECK_LINUXDOC
93373eed67faSmbalmer# -------------------
93383eed67faSmbalmer# Minimum version: 1.0.0
93393eed67faSmbalmer#
93403eed67faSmbalmer# Defines the variable MAKE_TEXT if the necessary tools and
93413eed67faSmbalmer# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
93423eed67faSmbalmer# Whether or not the necessary tools and files are found can be checked
93433eed67faSmbalmer# with the AM_CONDITIONAL "BUILD_LINUXDOC"
93443eed67faSmbalmerAC_DEFUN([XORG_CHECK_LINUXDOC],[
9345dc407927SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
9346dc407927SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
93473eed67faSmbalmer
93483eed67faSmbalmerAC_PATH_PROG(LINUXDOC, linuxdoc)
93493eed67faSmbalmer
9350dc407927SmrgAC_MSG_CHECKING([whether to build documentation])
93513eed67faSmbalmer
9352dc407927Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
93533eed67faSmbalmer   BUILDDOC=yes
93543eed67faSmbalmerelse
93553eed67faSmbalmer   BUILDDOC=no
93563eed67faSmbalmerfi
93573eed67faSmbalmer
93583eed67faSmbalmerAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
93593eed67faSmbalmer
93603eed67faSmbalmerAC_MSG_RESULT([$BUILDDOC])
93613eed67faSmbalmer
9362dc407927SmrgAC_MSG_CHECKING([whether to build pdf documentation])
93633eed67faSmbalmer
9364dc407927Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
93653eed67faSmbalmer   BUILDPDFDOC=yes
93663eed67faSmbalmerelse
93673eed67faSmbalmer   BUILDPDFDOC=no
93683eed67faSmbalmerfi
93693eed67faSmbalmer
93703eed67faSmbalmerAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
93713eed67faSmbalmer
93723eed67faSmbalmerAC_MSG_RESULT([$BUILDPDFDOC])
93733eed67faSmbalmer
9374dc407927SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
93753eed67faSmbalmerMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
93763eed67faSmbalmerMAKE_PDF="$PS2PDF"
93773eed67faSmbalmerMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
93783eed67faSmbalmer
93793eed67faSmbalmerAC_SUBST(MAKE_TEXT)
93803eed67faSmbalmerAC_SUBST(MAKE_PS)
93813eed67faSmbalmerAC_SUBST(MAKE_PDF)
93823eed67faSmbalmerAC_SUBST(MAKE_HTML)
93833eed67faSmbalmer]) # XORG_CHECK_LINUXDOC
93843eed67faSmbalmer
93853eed67faSmbalmer# XORG_CHECK_DOCBOOK
93863eed67faSmbalmer# -------------------
93873eed67faSmbalmer# Minimum version: 1.0.0
93883eed67faSmbalmer#
93893eed67faSmbalmer# Checks for the ability to build output formats from SGML DocBook source.
93903eed67faSmbalmer# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
93913eed67faSmbalmer# indicates whether the necessary tools and files are found and, if set,
93923eed67faSmbalmer# $(MAKE_XXX) blah.sgml will produce blah.xxx.
93933eed67faSmbalmerAC_DEFUN([XORG_CHECK_DOCBOOK],[
9394dc407927SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
9395dc407927Smrg
93963eed67faSmbalmerBUILDTXTDOC=no
93973eed67faSmbalmerBUILDPDFDOC=no
93983eed67faSmbalmerBUILDPSDOC=no
93993eed67faSmbalmerBUILDHTMLDOC=no
94003eed67faSmbalmer
94013eed67faSmbalmerAC_PATH_PROG(DOCBOOKPS, docbook2ps)
94023eed67faSmbalmerAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
94033eed67faSmbalmerAC_PATH_PROG(DOCBOOKHTML, docbook2html)
94043eed67faSmbalmerAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
94053eed67faSmbalmer
9406dc407927SmrgAC_MSG_CHECKING([whether to build text documentation])
9407dc407927Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
94083eed67faSmbalmer   test x$BUILD_TXTDOC != xno; then
94093eed67faSmbalmer	BUILDTXTDOC=yes
94103eed67faSmbalmerfi
94113eed67faSmbalmerAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
94123eed67faSmbalmerAC_MSG_RESULT([$BUILDTXTDOC])
94133eed67faSmbalmer
9414dc407927SmrgAC_MSG_CHECKING([whether to build PDF documentation])
9415dc407927Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
94163eed67faSmbalmer   test x$BUILD_PDFDOC != xno; then
94173eed67faSmbalmer	BUILDPDFDOC=yes
94183eed67faSmbalmerfi
94193eed67faSmbalmerAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
94203eed67faSmbalmerAC_MSG_RESULT([$BUILDPDFDOC])
94213eed67faSmbalmer
9422dc407927SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
9423dc407927Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
94243eed67faSmbalmer   test x$BUILD_PSDOC != xno; then
94253eed67faSmbalmer	BUILDPSDOC=yes
94263eed67faSmbalmerfi
94273eed67faSmbalmerAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
94283eed67faSmbalmerAC_MSG_RESULT([$BUILDPSDOC])
94293eed67faSmbalmer
9430dc407927SmrgAC_MSG_CHECKING([whether to build HTML documentation])
9431dc407927Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
94323eed67faSmbalmer   test x$BUILD_HTMLDOC != xno; then
94333eed67faSmbalmer	BUILDHTMLDOC=yes
94343eed67faSmbalmerfi
94353eed67faSmbalmerAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
94363eed67faSmbalmerAC_MSG_RESULT([$BUILDHTMLDOC])
94373eed67faSmbalmer
94383eed67faSmbalmerMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
94393eed67faSmbalmerMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
94403eed67faSmbalmerMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
94413eed67faSmbalmerMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
94423eed67faSmbalmer
94433eed67faSmbalmerAC_SUBST(MAKE_TEXT)
94443eed67faSmbalmerAC_SUBST(MAKE_PS)
94453eed67faSmbalmerAC_SUBST(MAKE_PDF)
94463eed67faSmbalmerAC_SUBST(MAKE_HTML)
94473eed67faSmbalmer]) # XORG_CHECK_DOCBOOK
94483eed67faSmbalmer
9449dc407927Smrg# XORG_WITH_XMLTO([MIN-VERSION])
9450dc407927Smrg# ----------------
9451dc407927Smrg# Minimum version: 1.5.0
9452dc407927Smrg#
9453dc407927Smrg# Documentation tools are not always available on all platforms and sometimes
9454dc407927Smrg# not at the appropriate level. This macro enables a module to test for the
9455dc407927Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9456dc407927Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
9457dc407927Smrg# as whether or not to use the xmlto package.
9458dc407927Smrg#
9459dc407927Smrg# Interface to module:
9460dc407927Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
9461dc407927Smrg# XMLTO:	returns the path of the xmlto program found
9462dc407927Smrg#		returns the path set by the user in the environment
9463dc407927Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
9464dc407927Smrg#		'no' user instructs the module not to use xmlto
9465dc407927Smrg#
9466dc407927Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
9467dc407927Smrg#
9468dc407927SmrgAC_DEFUN([XORG_WITH_XMLTO],[
9469dc407927SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
9470dc407927SmrgAC_ARG_WITH(xmlto,
9471dc407927Smrg	AS_HELP_STRING([--with-xmlto],
9472dc407927Smrg	   [Use xmlto to regenerate documentation (default: yes, if installed)]),
9473dc407927Smrg	   [use_xmlto=$withval], [use_xmlto=auto])
9474dc407927Smrg
9475dc407927Smrgif test "x$use_xmlto" = x"auto"; then
9476dc407927Smrg   AC_PATH_PROG([XMLTO], [xmlto])
9477dc407927Smrg   if test "x$XMLTO" = "x"; then
9478dc407927Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
9479dc407927Smrg	have_xmlto=no
9480dc407927Smrg   else
9481dc407927Smrg        have_xmlto=yes
9482dc407927Smrg   fi
9483dc407927Smrgelif test "x$use_xmlto" = x"yes" ; then
9484dc407927Smrg   AC_PATH_PROG([XMLTO], [xmlto])
9485dc407927Smrg   if test "x$XMLTO" = "x"; then
9486dc407927Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
9487dc407927Smrg   fi
9488dc407927Smrg   have_xmlto=yes
9489dc407927Smrgelif test "x$use_xmlto" = x"no" ; then
9490dc407927Smrg   if test "x$XMLTO" != "x"; then
9491dc407927Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
9492dc407927Smrg   fi
9493dc407927Smrg   have_xmlto=no
9494dc407927Smrgelse
9495dc407927Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
9496dc407927Smrgfi
9497dc407927Smrgm4_ifval([$1],
9498dc407927Smrg[if test "$have_xmlto" = yes; then
9499dc407927Smrg    # scrape the xmlto version
9500dc407927Smrg    AC_MSG_CHECKING([the xmlto version])
9501dc407927Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
9502dc407927Smrg    AC_MSG_RESULT([$xmlto_version])
9503dc407927Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
9504dc407927Smrg        [if test "x$use_xmlto" = xauto; then
9505dc407927Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
9506dc407927Smrg            have_xmlto=no
9507dc407927Smrg        else
9508dc407927Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
9509dc407927Smrg        fi])
9510dc407927Smrgfi])
9511dc407927SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
9512dc407927Smrg]) # XORG_WITH_XMLTO
9513dc407927Smrg
9514dc407927Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION])
9515dc407927Smrg# ----------------
9516dc407927Smrg# Minimum version: 1.5.0
9517dc407927Smrg#
9518dc407927Smrg# Documentation tools are not always available on all platforms and sometimes
9519dc407927Smrg# not at the appropriate level. This macro enables a module to test for the
9520dc407927Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9521dc407927Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
9522dc407927Smrg# as whether or not to use the asciidoc package.
9523dc407927Smrg#
9524dc407927Smrg# Interface to module:
9525dc407927Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
9526dc407927Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
9527dc407927Smrg#		 returns the path set by the user in the environment
9528dc407927Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
9529dc407927Smrg#		  'no' user instructs the module not to use asciidoc
9530dc407927Smrg#
9531dc407927Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
9532dc407927Smrg#
9533dc407927SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
9534dc407927SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
9535dc407927SmrgAC_ARG_WITH(asciidoc,
9536dc407927Smrg	AS_HELP_STRING([--with-asciidoc],
9537dc407927Smrg	   [Use asciidoc to regenerate documentation (default: yes, if installed)]),
9538dc407927Smrg	   [use_asciidoc=$withval], [use_asciidoc=auto])
9539dc407927Smrg
9540dc407927Smrgif test "x$use_asciidoc" = x"auto"; then
9541dc407927Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
9542dc407927Smrg   if test "x$ASCIIDOC" = "x"; then
9543dc407927Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
9544dc407927Smrg	have_asciidoc=no
9545dc407927Smrg   else
9546dc407927Smrg        have_asciidoc=yes
9547dc407927Smrg   fi
9548dc407927Smrgelif test "x$use_asciidoc" = x"yes" ; then
9549dc407927Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
9550dc407927Smrg   if test "x$ASCIIDOC" = "x"; then
9551dc407927Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
9552dc407927Smrg   fi
9553dc407927Smrg   have_asciidoc=yes
9554dc407927Smrgelif test "x$use_asciidoc" = x"no" ; then
9555dc407927Smrg   if test "x$ASCIIDOC" != "x"; then
9556dc407927Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
9557dc407927Smrg   fi
9558dc407927Smrg   have_asciidoc=no
9559dc407927Smrgelse
9560dc407927Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
9561dc407927Smrgfi
9562dc407927Smrgm4_ifval([$1],
9563dc407927Smrg[if test "$have_asciidoc" = yes; then
9564dc407927Smrg    # scrape the asciidoc version
9565dc407927Smrg    AC_MSG_CHECKING([the asciidoc version])
9566dc407927Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
9567dc407927Smrg    AC_MSG_RESULT([$asciidoc_version])
9568dc407927Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
9569dc407927Smrg        [if test "x$use_asciidoc" = xauto; then
9570dc407927Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
9571dc407927Smrg            have_asciidoc=no
9572dc407927Smrg        else
9573dc407927Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
9574dc407927Smrg        fi])
9575dc407927Smrgfi])
9576dc407927SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
9577dc407927Smrg]) # XORG_WITH_ASCIIDOC
9578dc407927Smrg
9579dc407927Smrg# XORG_WITH_DOXYGEN([MIN-VERSION])
9580dc407927Smrg# --------------------------------
9581dc407927Smrg# Minimum version: 1.5.0
9582dc407927Smrg#
9583dc407927Smrg# Documentation tools are not always available on all platforms and sometimes
9584dc407927Smrg# not at the appropriate level. This macro enables a module to test for the
9585dc407927Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9586dc407927Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
9587dc407927Smrg# as whether or not to use the doxygen package.
9588dc407927Smrg#
9589dc407927Smrg# Interface to module:
9590dc407927Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
9591dc407927Smrg# DOXYGEN:	 returns the path of the doxygen program found
9592dc407927Smrg#		 returns the path set by the user in the environment
9593dc407927Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
9594dc407927Smrg#		  'no' user instructs the module not to use doxygen
9595dc407927Smrg#
9596dc407927Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
9597dc407927Smrg#
9598dc407927SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
9599dc407927SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
9600dc407927SmrgAC_ARG_WITH(doxygen,
9601dc407927Smrg	AS_HELP_STRING([--with-doxygen],
9602dc407927Smrg	   [Use doxygen to regenerate documentation (default: yes, if installed)]),
9603dc407927Smrg	   [use_doxygen=$withval], [use_doxygen=auto])
9604dc407927Smrg
9605dc407927Smrgif test "x$use_doxygen" = x"auto"; then
9606dc407927Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
9607dc407927Smrg   if test "x$DOXYGEN" = "x"; then
9608dc407927Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
9609dc407927Smrg	have_doxygen=no
9610dc407927Smrg   else
9611dc407927Smrg        have_doxygen=yes
9612dc407927Smrg   fi
9613dc407927Smrgelif test "x$use_doxygen" = x"yes" ; then
9614dc407927Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
9615dc407927Smrg   if test "x$DOXYGEN" = "x"; then
9616dc407927Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
9617dc407927Smrg   fi
9618dc407927Smrg   have_doxygen=yes
9619dc407927Smrgelif test "x$use_doxygen" = x"no" ; then
9620dc407927Smrg   if test "x$DOXYGEN" != "x"; then
9621dc407927Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
9622dc407927Smrg   fi
9623dc407927Smrg   have_doxygen=no
9624dc407927Smrgelse
9625dc407927Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
9626dc407927Smrgfi
9627dc407927Smrgm4_ifval([$1],
9628dc407927Smrg[if test "$have_doxygen" = yes; then
9629dc407927Smrg    # scrape the doxygen version
9630dc407927Smrg    AC_MSG_CHECKING([the doxygen version])
9631dc407927Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
9632dc407927Smrg    AC_MSG_RESULT([$doxygen_version])
9633dc407927Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
9634dc407927Smrg        [if test "x$use_doxygen" = xauto; then
9635dc407927Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
9636dc407927Smrg            have_doxygen=no
9637dc407927Smrg        else
9638dc407927Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
9639dc407927Smrg        fi])
9640dc407927Smrgfi])
9641dc407927SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
9642dc407927Smrg]) # XORG_WITH_DOXYGEN
9643dc407927Smrg
9644dc407927Smrg# XORG_WITH_GROFF
9645dc407927Smrg# ----------------
9646dc407927Smrg# Minimum version: 1.6.0
9647dc407927Smrg#
9648dc407927Smrg# Documentation tools are not always available on all platforms and sometimes
9649dc407927Smrg# not at the appropriate level. This macro enables a module to test for the
9650dc407927Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9651dc407927Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
9652dc407927Smrg# as whether or not to use the groff package.
9653dc407927Smrg#
9654dc407927Smrg# Interface to module:
9655dc407927Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
9656dc407927Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
9657dc407927Smrg# HAVE_GROFF_MS: the -ms macros package
9658dc407927Smrg# GROFF:	 returns the path of the groff program found
9659dc407927Smrg#		 returns the path set by the user in the environment
9660dc407927Smrg# --with-groff:	 'yes' user instructs the module to use groff
9661dc407927Smrg#		 'no' user instructs the module not to use groff
9662dc407927Smrg#
9663dc407927Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
9664dc407927Smrg#
9665dc407927Smrg# OS and distros often splits groff in a basic and full package, the former
9666dc407927Smrg# having the groff program and the later having devices, fonts and macros
9667dc407927Smrg# Checking for the groff executable is not enough.
9668dc407927Smrg#
9669dc407927Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
9670dc407927Smrg# unset HAVE_GROFF or GROFF env variables.
9671dc407927Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
9672dc407927Smrg#
9673dc407927SmrgAC_DEFUN([XORG_WITH_GROFF],[
9674dc407927SmrgAC_ARG_VAR([GROFF], [Path to groff command])
9675dc407927SmrgAC_ARG_WITH(groff,
9676dc407927Smrg	AS_HELP_STRING([--with-groff],
9677dc407927Smrg	   [Use groff to regenerate documentation (default: yes, if installed)]),
9678dc407927Smrg	   [use_groff=$withval], [use_groff=auto])
9679dc407927Smrg
9680dc407927Smrgif test "x$use_groff" = x"auto"; then
9681dc407927Smrg   AC_PATH_PROG([GROFF], [groff])
9682dc407927Smrg   if test "x$GROFF" = "x"; then
9683dc407927Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
9684dc407927Smrg	have_groff=no
9685dc407927Smrg   else
9686dc407927Smrg        have_groff=yes
9687dc407927Smrg   fi
9688dc407927Smrgelif test "x$use_groff" = x"yes" ; then
9689dc407927Smrg   AC_PATH_PROG([GROFF], [groff])
9690dc407927Smrg   if test "x$GROFF" = "x"; then
9691dc407927Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
9692dc407927Smrg   fi
9693dc407927Smrg   have_groff=yes
9694dc407927Smrgelif test "x$use_groff" = x"no" ; then
9695dc407927Smrg   if test "x$GROFF" != "x"; then
9696dc407927Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
9697dc407927Smrg   fi
9698dc407927Smrg   have_groff=no
9699dc407927Smrgelse
9700dc407927Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
9701dc407927Smrgfi
9702dc407927Smrg# We have groff, test for the presence of the macro packages
9703dc407927Smrgif test "x$have_groff" = x"yes"; then
9704dc407927Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
9705dc407927Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
9706dc407927Smrg        groff_ms_works=yes
9707dc407927Smrg    else
9708dc407927Smrg        groff_ms_works=no
9709dc407927Smrg    fi
9710dc407927Smrg    AC_MSG_RESULT([$groff_ms_works])
9711dc407927Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
9712dc407927Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
9713dc407927Smrg        groff_mm_works=yes
9714dc407927Smrg    else
9715dc407927Smrg        groff_mm_works=no
9716dc407927Smrg    fi
9717dc407927Smrg    AC_MSG_RESULT([$groff_mm_works])
9718dc407927Smrgfi
9719dc407927SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
9720dc407927SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
9721dc407927SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
9722dc407927Smrg]) # XORG_WITH_GROFF
9723dc407927Smrg
9724dc407927Smrg# XORG_WITH_FOP
9725dc407927Smrg# ----------------
9726dc407927Smrg# Minimum version: 1.6.0
9727dc407927Smrg#
9728dc407927Smrg# Documentation tools are not always available on all platforms and sometimes
9729dc407927Smrg# not at the appropriate level. This macro enables a module to test for the
9730dc407927Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9731dc407927Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
9732dc407927Smrg# as whether or not to use the fop package.
9733dc407927Smrg#
9734dc407927Smrg# Interface to module:
9735dc407927Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
9736dc407927Smrg# FOP:	 	returns the path of the fop program found
9737dc407927Smrg#		returns the path set by the user in the environment
9738dc407927Smrg# --with-fop: 	'yes' user instructs the module to use fop
9739dc407927Smrg#		'no' user instructs the module not to use fop
9740dc407927Smrg#
9741dc407927Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
9742dc407927Smrg#
9743dc407927SmrgAC_DEFUN([XORG_WITH_FOP],[
9744dc407927SmrgAC_ARG_VAR([FOP], [Path to fop command])
9745dc407927SmrgAC_ARG_WITH(fop,
9746dc407927Smrg	AS_HELP_STRING([--with-fop],
9747dc407927Smrg	   [Use fop to regenerate documentation (default: yes, if installed)]),
9748dc407927Smrg	   [use_fop=$withval], [use_fop=auto])
9749dc407927Smrg
9750dc407927Smrgif test "x$use_fop" = x"auto"; then
9751dc407927Smrg   AC_PATH_PROG([FOP], [fop])
9752dc407927Smrg   if test "x$FOP" = "x"; then
9753dc407927Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
9754dc407927Smrg	have_fop=no
9755dc407927Smrg   else
9756dc407927Smrg        have_fop=yes
9757dc407927Smrg   fi
9758dc407927Smrgelif test "x$use_fop" = x"yes" ; then
9759dc407927Smrg   AC_PATH_PROG([FOP], [fop])
9760dc407927Smrg   if test "x$FOP" = "x"; then
9761dc407927Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
9762dc407927Smrg   fi
9763dc407927Smrg   have_fop=yes
9764dc407927Smrgelif test "x$use_fop" = x"no" ; then
9765dc407927Smrg   if test "x$FOP" != "x"; then
9766dc407927Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
9767dc407927Smrg   fi
9768dc407927Smrg   have_fop=no
9769dc407927Smrgelse
9770dc407927Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
9771dc407927Smrgfi
9772dc407927SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
9773dc407927Smrg]) # XORG_WITH_FOP
9774dc407927Smrg
9775dc407927Smrg# XORG_WITH_PS2PDF
9776dc407927Smrg# ----------------
9777dc407927Smrg# Minimum version: 1.6.0
9778dc407927Smrg#
9779dc407927Smrg# Documentation tools are not always available on all platforms and sometimes
9780dc407927Smrg# not at the appropriate level. This macro enables a module to test for the
9781dc407927Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9782dc407927Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
9783dc407927Smrg# as whether or not to use the ps2pdf package.
9784dc407927Smrg#
9785dc407927Smrg# Interface to module:
9786dc407927Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
9787dc407927Smrg# PS2PDF:	returns the path of the ps2pdf program found
9788dc407927Smrg#		returns the path set by the user in the environment
9789dc407927Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
9790dc407927Smrg#		 'no' user instructs the module not to use ps2pdf
9791dc407927Smrg#
9792dc407927Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
9793dc407927Smrg#
9794dc407927SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
9795dc407927SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
9796dc407927SmrgAC_ARG_WITH(ps2pdf,
9797dc407927Smrg	AS_HELP_STRING([--with-ps2pdf],
9798dc407927Smrg	   [Use ps2pdf to regenerate documentation (default: yes, if installed)]),
9799dc407927Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=auto])
9800dc407927Smrg
9801dc407927Smrgif test "x$use_ps2pdf" = x"auto"; then
9802dc407927Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
9803dc407927Smrg   if test "x$PS2PDF" = "x"; then
9804dc407927Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
9805dc407927Smrg	have_ps2pdf=no
9806dc407927Smrg   else
9807dc407927Smrg        have_ps2pdf=yes
9808dc407927Smrg   fi
9809dc407927Smrgelif test "x$use_ps2pdf" = x"yes" ; then
9810dc407927Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
9811dc407927Smrg   if test "x$PS2PDF" = "x"; then
9812dc407927Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
9813dc407927Smrg   fi
9814dc407927Smrg   have_ps2pdf=yes
9815dc407927Smrgelif test "x$use_ps2pdf" = x"no" ; then
9816dc407927Smrg   if test "x$PS2PDF" != "x"; then
9817dc407927Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
9818dc407927Smrg   fi
9819dc407927Smrg   have_ps2pdf=no
9820dc407927Smrgelse
9821dc407927Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
9822dc407927Smrgfi
9823dc407927SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
9824dc407927Smrg]) # XORG_WITH_PS2PDF
9825dc407927Smrg
9826dc407927Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
9827dc407927Smrg# ----------------
9828dc407927Smrg# Minimum version: 1.6.0
9829dc407927Smrg#
9830dc407927Smrg# Documentation tools are not always available on all platforms and sometimes
9831dc407927Smrg# not at the appropriate level. This macro enables a builder to skip all
9832dc407927Smrg# documentation targets except traditional man pages.
9833dc407927Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
9834dc407927Smrg# maximum flexibilty in controlling documentation building.
9835dc407927Smrg# Refer to:
9836dc407927Smrg# XORG_WITH_XMLTO         --with-xmlto
9837dc407927Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
9838dc407927Smrg# XORG_WITH_DOXYGEN       --with-doxygen
9839dc407927Smrg# XORG_WITH_FOP           --with-fop
9840dc407927Smrg# XORG_WITH_GROFF         --with-groff
9841dc407927Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
9842dc407927Smrg#
9843dc407927Smrg# Interface to module:
9844dc407927Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
9845dc407927Smrg# --enable-docs: 'yes' user instructs the module to generate docs
9846dc407927Smrg#		 'no' user instructs the module not to generate docs
9847dc407927Smrg# parm1:	specify the default value, yes or no.
9848dc407927Smrg#
9849dc407927SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
9850dc407927Smrgdefault=$1
9851dc407927Smrgif test "x$default" = x ; then
9852dc407927Smrg  default="yes"
9853dc407927Smrgfi
9854dc407927SmrgAC_ARG_ENABLE(docs,
9855dc407927Smrg	AS_HELP_STRING([--enable-docs],
9856dc407927Smrg	   [Enable building the documentation (default: yes)]),
9857dc407927Smrg	   [build_docs=$enableval], [build_docs=$default])
9858dc407927SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
9859dc407927SmrgAC_MSG_CHECKING([whether to build documentation])
9860dc407927SmrgAC_MSG_RESULT([$build_docs])
9861dc407927Smrg]) # XORG_ENABLE_DOCS
9862dc407927Smrg
9863dc407927Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
9864dc407927Smrg# ----------------
9865dc407927Smrg# Minimum version: 1.6.0
9866dc407927Smrg#
9867dc407927Smrg# This macro enables a builder to skip all developer documentation.
9868dc407927Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
9869dc407927Smrg# maximum flexibilty in controlling documentation building.
9870dc407927Smrg# Refer to:
9871dc407927Smrg# XORG_WITH_XMLTO         --with-xmlto
9872dc407927Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
9873dc407927Smrg# XORG_WITH_DOXYGEN       --with-doxygen
9874dc407927Smrg# XORG_WITH_FOP           --with-fop
9875dc407927Smrg# XORG_WITH_GROFF         --with-groff
9876dc407927Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
9877dc407927Smrg#
9878dc407927Smrg# Interface to module:
9879dc407927Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
9880dc407927Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
9881dc407927Smrg#			'no' user instructs the module not to generate developer docs
9882dc407927Smrg# parm1:		specify the default value, yes or no.
9883dc407927Smrg#
9884dc407927SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
9885dc407927Smrgdevel_default=$1
9886dc407927Smrgif test "x$devel_default" = x ; then
9887dc407927Smrg  devel_default="yes"
9888dc407927Smrgfi
9889dc407927SmrgAC_ARG_ENABLE(devel-docs,
9890dc407927Smrg	AS_HELP_STRING([--enable-devel-docs],
9891dc407927Smrg	   [Enable building the developer documentation (default: yes)]),
9892dc407927Smrg	   [build_devel_docs=$enableval], [build_devel_docs=$devel_default])
9893dc407927SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
9894dc407927SmrgAC_MSG_CHECKING([whether to build developer documentation])
9895dc407927SmrgAC_MSG_RESULT([$build_devel_docs])
9896dc407927Smrg]) # XORG_ENABLE_DEVEL_DOCS
9897dc407927Smrg
9898dc407927Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
9899dc407927Smrg# ----------------
9900dc407927Smrg# Minimum version: 1.6.0
9901dc407927Smrg#
9902dc407927Smrg# This macro enables a builder to skip all functional specification targets.
9903dc407927Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
9904dc407927Smrg# maximum flexibilty in controlling documentation building.
9905dc407927Smrg# Refer to:
9906dc407927Smrg# XORG_WITH_XMLTO         --with-xmlto
9907dc407927Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
9908dc407927Smrg# XORG_WITH_DOXYGEN       --with-doxygen
9909dc407927Smrg# XORG_WITH_FOP           --with-fop
9910dc407927Smrg# XORG_WITH_GROFF         --with-groff
9911dc407927Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
9912dc407927Smrg#
9913dc407927Smrg# Interface to module:
9914dc407927Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
9915dc407927Smrg# --enable-specs:	'yes' user instructs the module to generate specs
9916dc407927Smrg#			'no' user instructs the module not to generate specs
9917dc407927Smrg# parm1:		specify the default value, yes or no.
9918dc407927Smrg#
9919dc407927SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
9920dc407927Smrgspec_default=$1
9921dc407927Smrgif test "x$spec_default" = x ; then
9922dc407927Smrg  spec_default="yes"
9923dc407927Smrgfi
9924dc407927SmrgAC_ARG_ENABLE(specs,
9925dc407927Smrg	AS_HELP_STRING([--enable-specs],
9926dc407927Smrg	   [Enable building the specs (default: yes)]),
9927dc407927Smrg	   [build_specs=$enableval], [build_specs=$spec_default])
9928dc407927SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
9929dc407927SmrgAC_MSG_CHECKING([whether to build functional specifications])
9930dc407927SmrgAC_MSG_RESULT([$build_specs])
9931dc407927Smrg]) # XORG_ENABLE_SPECS
9932dc407927Smrg
99333eed67faSmbalmer# XORG_CHECK_MALLOC_ZERO
99343eed67faSmbalmer# ----------------------
99353eed67faSmbalmer# Minimum version: 1.0.0
99363eed67faSmbalmer#
99373eed67faSmbalmer# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
99383eed67faSmbalmer# malloc(0) returns NULL.  Packages should add one of these cflags to
99393eed67faSmbalmer# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
99403eed67faSmbalmerAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
99413eed67faSmbalmerAC_ARG_ENABLE(malloc0returnsnull,
9942dc407927Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
99433eed67faSmbalmer		       [malloc(0) returns NULL (default: auto)]),
99443eed67faSmbalmer	[MALLOC_ZERO_RETURNS_NULL=$enableval],
99453eed67faSmbalmer	[MALLOC_ZERO_RETURNS_NULL=auto])
99463eed67faSmbalmer
99473eed67faSmbalmerAC_MSG_CHECKING([whether malloc(0) returns NULL])
99483eed67faSmbalmerif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
99493eed67faSmbalmer	AC_RUN_IFELSE([
99503eed67faSmbalmerchar *malloc();
99513eed67faSmbalmerchar *realloc();
99523eed67faSmbalmerchar *calloc();
99533eed67faSmbalmermain() {
99543eed67faSmbalmer    char *m0, *r0, *c0, *p;
99553eed67faSmbalmer    m0 = malloc(0);
99563eed67faSmbalmer    p = malloc(10);
99573eed67faSmbalmer    r0 = realloc(p,0);
99583eed67faSmbalmer    c0 = calloc(0);
99593eed67faSmbalmer    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
99603eed67faSmbalmer}],
99613eed67faSmbalmer		[MALLOC_ZERO_RETURNS_NULL=yes],
9962dc407927Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
9963dc407927Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
99643eed67faSmbalmerfi
99653eed67faSmbalmerAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
99663eed67faSmbalmer
99673eed67faSmbalmerif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
99683eed67faSmbalmer	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
99693eed67faSmbalmer	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
99703eed67faSmbalmer	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
99713eed67faSmbalmerelse
99723eed67faSmbalmer	MALLOC_ZERO_CFLAGS=""
99733eed67faSmbalmer	XMALLOC_ZERO_CFLAGS=""
99743eed67faSmbalmer	XTMALLOC_ZERO_CFLAGS=""
99753eed67faSmbalmerfi
99763eed67faSmbalmer
99773eed67faSmbalmerAC_SUBST([MALLOC_ZERO_CFLAGS])
99783eed67faSmbalmerAC_SUBST([XMALLOC_ZERO_CFLAGS])
99793eed67faSmbalmerAC_SUBST([XTMALLOC_ZERO_CFLAGS])
99803eed67faSmbalmer]) # XORG_CHECK_MALLOC_ZERO
99813eed67faSmbalmer
99823eed67faSmbalmer# XORG_WITH_LINT()
99833eed67faSmbalmer# ----------------
99843eed67faSmbalmer# Minimum version: 1.1.0
99853eed67faSmbalmer#
9986dc407927Smrg# This macro enables the use of a tool that flags some suspicious and
9987dc407927Smrg# non-portable constructs (likely to be bugs) in C language source code.
9988dc407927Smrg# It will attempt to locate the tool and use appropriate options.
9989dc407927Smrg# There are various lint type tools on different platforms.
9990dc407927Smrg#
9991dc407927Smrg# Interface to module:
9992dc407927Smrg# LINT:		returns the path to the tool found on the platform
9993dc407927Smrg#		or the value set to LINT on the configure cmd line
9994dc407927Smrg#		also an Automake conditional
9995dc407927Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
9996dc407927Smrg#
9997dc407927Smrg# --with-lint:	'yes' user instructs the module to use lint
9998dc407927Smrg#		'no' user instructs the module not to use lint (default)
9999dc407927Smrg#
10000dc407927Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
10001dc407927Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
100023eed67faSmbalmer#
100033eed67faSmbalmerAC_DEFUN([XORG_WITH_LINT],[
100043eed67faSmbalmer
10005dc407927SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
10006dc407927SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
10007dc407927SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
100083eed67faSmbalmer		[Use a lint-style source code checker (default: disabled)])],
100093eed67faSmbalmer		[use_lint=$withval], [use_lint=no])
10010dc407927Smrg
10011dc407927Smrg# Obtain platform specific info like program name and options
10012dc407927Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
10013dc407927Smrgcase $host_os in
10014dc407927Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
10015dc407927Smrg	lint_name=splint
10016dc407927Smrg	lint_options="-badflag"
10017dc407927Smrg	;;
10018dc407927Smrg  *freebsd* | *netbsd*)
10019dc407927Smrg	lint_name=lint
10020dc407927Smrg	lint_options="-u -b"
10021dc407927Smrg	;;
10022dc407927Smrg  *solaris*)
10023dc407927Smrg	lint_name=lint
10024dc407927Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
10025dc407927Smrg	;;
10026dc407927Smrgesac
10027dc407927Smrg
10028dc407927Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
10029dc407927Smrgif test "x$use_lint" = x"yes" ; then
10030dc407927Smrg   AC_PATH_PROG([LINT], [$lint_name])
10031dc407927Smrg   if test "x$LINT" = "x"; then
10032dc407927Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
10033dc407927Smrg   fi
10034dc407927Smrgelif test "x$use_lint" = x"no" ; then
10035dc407927Smrg   if test "x$LINT" != "x"; then
10036dc407927Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
10037dc407927Smrg   fi
100383eed67faSmbalmerelse
10039dc407927Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
100403eed67faSmbalmerfi
10041dc407927Smrg
10042dc407927Smrg# User supplied flags override default flags
10043dc407927Smrgif test "x$LINT_FLAGS" != "x"; then
10044dc407927Smrg   lint_options=$LINT_FLAGS
100453eed67faSmbalmerfi
100463eed67faSmbalmer
10047dc407927SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
10048dc407927SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
100493eed67faSmbalmer
100503eed67faSmbalmer]) # XORG_WITH_LINT
100513eed67faSmbalmer
100523eed67faSmbalmer# XORG_LINT_LIBRARY(LIBNAME)
100533eed67faSmbalmer# --------------------------
100543eed67faSmbalmer# Minimum version: 1.1.0
100553eed67faSmbalmer#
100563eed67faSmbalmer# Sets up flags for building lint libraries for checking programs that call
100573eed67faSmbalmer# functions in the library.
100583eed67faSmbalmer#
10059dc407927Smrg# Interface to module:
10060dc407927Smrg# LINTLIB		- Automake variable with the name of lint library file to make
10061dc407927Smrg# MAKE_LINT_LIB		- Automake conditional
10062dc407927Smrg#
10063dc407927Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
10064dc407927Smrg#			  - 'no' user instructs the module not to create a lint library (default)
100653eed67faSmbalmer
100663eed67faSmbalmerAC_DEFUN([XORG_LINT_LIBRARY],[
100673eed67faSmbalmerAC_REQUIRE([XORG_WITH_LINT])
10068dc407927SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
100693eed67faSmbalmer	[Create lint library (default: disabled)])],
100703eed67faSmbalmer	[make_lint_lib=$enableval], [make_lint_lib=no])
10071dc407927Smrg
10072dc407927Smrgif test "x$make_lint_lib" = x"yes" ; then
10073dc407927Smrg   LINTLIB=llib-l$1.ln
10074dc407927Smrg   if test "x$LINT" = "x"; then
10075dc407927Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
10076dc407927Smrg   fi
10077dc407927Smrgelif test "x$make_lint_lib" != x"no" ; then
10078dc407927Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
100793eed67faSmbalmerfi
10080dc407927Smrg
100813eed67faSmbalmerAC_SUBST(LINTLIB)
100823eed67faSmbalmerAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
100833eed67faSmbalmer
100843eed67faSmbalmer]) # XORG_LINT_LIBRARY
100853eed67faSmbalmer
10086dc407927Smrg# XORG_CWARNFLAGS
10087dc407927Smrg# ---------------
10088dc407927Smrg# Minimum version: 1.2.0
10089dc407927Smrg#
10090dc407927Smrg# Defines CWARNFLAGS to enable C compiler warnings.
10091dc407927Smrg#
10092dc407927SmrgAC_DEFUN([XORG_CWARNFLAGS], [
10093dc407927SmrgAC_REQUIRE([AC_PROG_CC_C99])
10094dc407927Smrgif  test "x$GCC" = xyes ; then
10095dc407927Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
10096dc407927Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
10097dc407927Smrg-Wbad-function-cast -Wformat=2"
10098dc407927Smrg    case `$CC -dumpversion` in
10099dc407927Smrg    3.4.* | 4.*)
10100dc407927Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
10101dc407927Smrg	;;
10102dc407927Smrg    esac
10103dc407927Smrgelse
10104dc407927Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
10105dc407927Smrg    if test "x$SUNCC" = "xyes"; then
10106dc407927Smrg	CWARNFLAGS="-v"
10107dc407927Smrg    fi
10108dc407927Smrgfi
10109dc407927SmrgAC_SUBST(CWARNFLAGS)
10110dc407927Smrg]) # XORG_CWARNFLAGS
101113eed67faSmbalmer
10112dc407927Smrg# XORG_STRICT_OPTION
10113dc407927Smrg# -----------------------
10114dc407927Smrg# Minimum version: 1.3.0
10115dc407927Smrg#
10116dc407927Smrg# Add configure option to enable strict compilation
10117dc407927SmrgAC_DEFUN([XORG_STRICT_OPTION], [
10118dc407927Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
10119dc407927SmrgAC_REQUIRE([AC_PROG_CC_C99])
10120dc407927SmrgAC_REQUIRE([XORG_CWARNFLAGS])
10121dc407927Smrg
10122dc407927SmrgAC_ARG_ENABLE(strict-compilation,
10123dc407927Smrg			  AS_HELP_STRING([--enable-strict-compilation],
10124dc407927Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
10125dc407927Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
10126dc407927Smrgif test "x$STRICT_COMPILE" = "xyes"; then
10127dc407927Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
10128dc407927Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
10129dc407927Smrg	if test "x$GCC" = xyes ; then
10130dc407927Smrg		STRICT_CFLAGS="-pedantic -Werror"
10131dc407927Smrg	elif test "x$SUNCC" = "xyes"; then
10132dc407927Smrg		STRICT_CFLAGS="-errwarn"
10133dc407927Smrg    elif test "x$INTELCC" = "xyes"; then
10134dc407927Smrg		STRICT_CFLAGS="-Werror"
101353eed67faSmbalmer	fi
10136dc407927Smrgfi
10137dc407927SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
10138dc407927SmrgAC_SUBST([CWARNFLAGS])
10139dc407927Smrg]) # XORG_STRICT_OPTION
101403eed67faSmbalmer
10141dc407927Smrg# XORG_DEFAULT_OPTIONS
10142dc407927Smrg# --------------------
10143dc407927Smrg# Minimum version: 1.3.0
10144dc407927Smrg#
10145dc407927Smrg# Defines default options for X.Org modules.
10146dc407927Smrg#
10147dc407927SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
10148dc407927SmrgAC_REQUIRE([AC_PROG_INSTALL])
10149dc407927SmrgXORG_CWARNFLAGS
10150dc407927SmrgXORG_STRICT_OPTION
10151dc407927SmrgXORG_RELEASE_VERSION
10152dc407927SmrgXORG_CHANGELOG
10153dc407927SmrgXORG_INSTALL
10154dc407927SmrgXORG_MANPAGE_SECTIONS
10155dc407927Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
10156dc407927Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
10157dc407927Smrg]) # XORG_DEFAULT_OPTIONS
10158dc407927Smrg
10159dc407927Smrg# XORG_INSTALL()
10160dc407927Smrg# ----------------
10161dc407927Smrg# Minimum version: 1.4.0
10162dc407927Smrg#
10163dc407927Smrg# Defines the variable INSTALL_CMD as the command to copy
10164dc407927Smrg# INSTALL from $prefix/share/util-macros.
10165dc407927Smrg#
10166dc407927SmrgAC_DEFUN([XORG_INSTALL], [
10167dc407927SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
10168dc407927Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
10169dc407927SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
10170dc407927Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
10171dc407927Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
10172dc407927Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
10173dc407927SmrgAC_SUBST([INSTALL_CMD])
10174dc407927Smrg]) # XORG_INSTALL
101753eed67faSmbalmerdnl Copyright 2005 Red Hat, Inc
101763eed67faSmbalmerdnl
101773eed67faSmbalmerdnl Permission to use, copy, modify, distribute, and sell this software and its
101783eed67faSmbalmerdnl documentation for any purpose is hereby granted without fee, provided that
101793eed67faSmbalmerdnl the above copyright notice appear in all copies and that both that
101803eed67faSmbalmerdnl copyright notice and this permission notice appear in supporting
101813eed67faSmbalmerdnl documentation.
101823eed67faSmbalmerdnl
101833eed67faSmbalmerdnl The above copyright notice and this permission notice shall be included
101843eed67faSmbalmerdnl in all copies or substantial portions of the Software.
101853eed67faSmbalmerdnl
101863eed67faSmbalmerdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
101873eed67faSmbalmerdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
101883eed67faSmbalmerdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
101893eed67faSmbalmerdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
101903eed67faSmbalmerdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
101913eed67faSmbalmerdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
101923eed67faSmbalmerdnl OTHER DEALINGS IN THE SOFTWARE.
101933eed67faSmbalmerdnl
101943eed67faSmbalmerdnl Except as contained in this notice, the name of the copyright holders shall
101953eed67faSmbalmerdnl not be used in advertising or otherwise to promote the sale, use or
101963eed67faSmbalmerdnl other dealings in this Software without prior written authorization
101973eed67faSmbalmerdnl from the copyright holders.
101983eed67faSmbalmerdnl
101993eed67faSmbalmer
102003eed67faSmbalmer# XORG_RELEASE_VERSION
102013eed67faSmbalmer# --------------------
10202dc407927Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
102033eed67faSmbalmer 
102043eed67faSmbalmerAC_DEFUN([XORG_RELEASE_VERSION],[
102053eed67faSmbalmer	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
102063eed67faSmbalmer		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
102073eed67faSmbalmer		[Major version of this package])
102083eed67faSmbalmer	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
102093eed67faSmbalmer	if test "x$PVM" = "x"; then
102103eed67faSmbalmer		PVM="0"
102113eed67faSmbalmer	fi
102123eed67faSmbalmer	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
102133eed67faSmbalmer		[$PVM],
102143eed67faSmbalmer		[Minor version of this package])
102153eed67faSmbalmer	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
102163eed67faSmbalmer	if test "x$PVP" = "x"; then
102173eed67faSmbalmer		PVP="0"
102183eed67faSmbalmer	fi
102193eed67faSmbalmer	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
102203eed67faSmbalmer		[$PVP],
102213eed67faSmbalmer		[Patch version of this package])
102223eed67faSmbalmer])
102233eed67faSmbalmer
10224dc407927Smrg# XORG_CHANGELOG()
10225dc407927Smrg# ----------------
10226dc407927Smrg# Minimum version: 1.2.0
10227dc407927Smrg#
10228dc407927Smrg# Defines the variable CHANGELOG_CMD as the command to generate
10229dc407927Smrg# ChangeLog from git.
10230dc407927Smrg#
10231dc407927Smrg#
10232dc407927SmrgAC_DEFUN([XORG_CHANGELOG], [
10233dc407927SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
10234dc407927Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
10235dc407927Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
10236dc407927Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
10237dc407927SmrgAC_SUBST([CHANGELOG_CMD])
10238dc407927Smrg]) # XORG_CHANGELOG
10239dc407927Smrg
10240dc407927Smrgdnl Copyright 2005 Red Hat, Inc
10241dc407927Smrgdnl 
10242dc407927Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
10243dc407927Smrgdnl documentation for any purpose is hereby granted without fee, provided that
10244dc407927Smrgdnl the above copyright notice appear in all copies and that both that
10245dc407927Smrgdnl copyright notice and this permission notice appear in supporting
10246dc407927Smrgdnl documentation.
10247dc407927Smrgdnl 
10248dc407927Smrgdnl The above copyright notice and this permission notice shall be included
10249dc407927Smrgdnl in all copies or substantial portions of the Software.
10250dc407927Smrgdnl 
10251dc407927Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
10252dc407927Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
10253dc407927Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
10254dc407927Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
10255dc407927Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
10256dc407927Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
10257dc407927Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
10258dc407927Smrgdnl 
10259dc407927Smrgdnl Except as contained in this notice, the name of the copyright holders shall
10260dc407927Smrgdnl not be used in advertising or otherwise to promote the sale, use or
10261dc407927Smrgdnl other dealings in this Software without prior written authorization
10262dc407927Smrgdnl from the copyright holders.
10263dc407927Smrgdnl 
10264dc407927Smrg
10265dc407927Smrg# XORG_DRIVER_CHECK_EXT()
10266dc407927Smrg# --------------------------
10267dc407927Smrg# Checks for the $1 define in xorg-server.h (from the sdk).  If it
10268dc407927Smrg# is defined, then add $1 to $REQUIRED_MODULES.
10269dc407927Smrg
10270dc407927SmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
10271dc407927Smrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
10272dc407927Smrg	SAVE_CFLAGS="$CFLAGS"
10273dc407927Smrg	CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
10274dc407927Smrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
10275dc407927Smrg#include "xorg-server.h"
10276dc407927Smrg#if !defined $1
10277dc407927Smrg#error $1 not defined
10278dc407927Smrg#endif
10279dc407927Smrg		]])],
10280dc407927Smrg		[_EXT_CHECK=yes],
10281dc407927Smrg		[_EXT_CHECK=no])
10282dc407927Smrg	CFLAGS="$SAVE_CFLAGS"
10283dc407927Smrg	AC_MSG_CHECKING([if $1 is defined])
10284dc407927Smrg	AC_MSG_RESULT([$_EXT_CHECK])
10285dc407927Smrg	if test "$_EXT_CHECK" != no; then
10286dc407927Smrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
10287dc407927Smrg	fi
10288dc407927Smrg])
10289dc407927Smrg
10290