aclocal.m4 revision c43cc173
1c43cc173Smrg# generated automatically by aclocal 1.10 -*- Autoconf -*-
2c43cc173Smrg
3c43cc173Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4c43cc173Smrg# 2005, 2006  Free Software Foundation, Inc.
5c43cc173Smrg# This file is free software; the Free Software Foundation
6c43cc173Smrg# gives unlimited permission to copy and/or distribute it,
7c43cc173Smrg# with or without modifications, as long as this notice is preserved.
8c43cc173Smrg
9c43cc173Smrg# This program is distributed in the hope that it will be useful,
10c43cc173Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11c43cc173Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12c43cc173Smrg# PARTICULAR PURPOSE.
13c43cc173Smrg
14c43cc173Smrgm4_if(m4_PACKAGE_VERSION, [2.61],,
15c43cc173Smrg[m4_fatal([this file was generated for autoconf 2.61.
16c43cc173SmrgYou have another version of autoconf.  If you want to use that,
17c43cc173Smrgyou should regenerate the build system entirely.], [63])])
18c43cc173Smrg
19c43cc173Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
20c43cc173Smrg# 
21c43cc173Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
22c43cc173Smrg#
23c43cc173Smrg# This program is free software; you can redistribute it and/or modify
24c43cc173Smrg# it under the terms of the GNU General Public License as published by
25c43cc173Smrg# the Free Software Foundation; either version 2 of the License, or
26c43cc173Smrg# (at your option) any later version.
27c43cc173Smrg#
28c43cc173Smrg# This program is distributed in the hope that it will be useful, but
29c43cc173Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
30c43cc173Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
31c43cc173Smrg# General Public License for more details.
32c43cc173Smrg#
33c43cc173Smrg# You should have received a copy of the GNU General Public License
34c43cc173Smrg# along with this program; if not, write to the Free Software
35c43cc173Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
36c43cc173Smrg#
37c43cc173Smrg# As a special exception to the GNU General Public License, if you
38c43cc173Smrg# distribute this file as part of a program that contains a
39c43cc173Smrg# configuration script generated by Autoconf, you may include it under
40c43cc173Smrg# the same distribution terms that you use for the rest of that program.
41c43cc173Smrg
42c43cc173Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
43c43cc173Smrg# ----------------------------------
44c43cc173SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
45c43cc173Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
46c43cc173Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
47c43cc173SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
48c43cc173Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
49c43cc173Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
50c43cc173Smrgfi
51c43cc173Smrgif test -n "$PKG_CONFIG"; then
52c43cc173Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
53c43cc173Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
54c43cc173Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
55c43cc173Smrg		AC_MSG_RESULT([yes])
56c43cc173Smrg	else
57c43cc173Smrg		AC_MSG_RESULT([no])
58c43cc173Smrg		PKG_CONFIG=""
59c43cc173Smrg	fi
60c43cc173Smrg		
61c43cc173Smrgfi[]dnl
62c43cc173Smrg])# PKG_PROG_PKG_CONFIG
63c43cc173Smrg
64c43cc173Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
65c43cc173Smrg#
66c43cc173Smrg# Check to see whether a particular set of modules exists.  Similar
67c43cc173Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
68c43cc173Smrg#
69c43cc173Smrg#
70c43cc173Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
71c43cc173Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
72c43cc173Smrg# PKG_CHECK_EXISTS manually
73c43cc173Smrg# --------------------------------------------------------------
74c43cc173SmrgAC_DEFUN([PKG_CHECK_EXISTS],
75c43cc173Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
76c43cc173Smrgif test -n "$PKG_CONFIG" && \
77c43cc173Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
78c43cc173Smrg  m4_ifval([$2], [$2], [:])
79c43cc173Smrgm4_ifvaln([$3], [else
80c43cc173Smrg  $3])dnl
81c43cc173Smrgfi])
82c43cc173Smrg
83c43cc173Smrg
84c43cc173Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
85c43cc173Smrg# ---------------------------------------------
86c43cc173Smrgm4_define([_PKG_CONFIG],
87c43cc173Smrg[if test -n "$PKG_CONFIG"; then
88c43cc173Smrg    if test -n "$$1"; then
89c43cc173Smrg        pkg_cv_[]$1="$$1"
90c43cc173Smrg    else
91c43cc173Smrg        PKG_CHECK_EXISTS([$3],
92c43cc173Smrg                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
93c43cc173Smrg			 [pkg_failed=yes])
94c43cc173Smrg    fi
95c43cc173Smrgelse
96c43cc173Smrg	pkg_failed=untried
97c43cc173Smrgfi[]dnl
98c43cc173Smrg])# _PKG_CONFIG
99c43cc173Smrg
100c43cc173Smrg# _PKG_SHORT_ERRORS_SUPPORTED
101c43cc173Smrg# -----------------------------
102c43cc173SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
103c43cc173Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
104c43cc173Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
105c43cc173Smrg        _pkg_short_errors_supported=yes
106c43cc173Smrgelse
107c43cc173Smrg        _pkg_short_errors_supported=no
108c43cc173Smrgfi[]dnl
109c43cc173Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
110c43cc173Smrg
111c43cc173Smrg
112c43cc173Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
113c43cc173Smrg# [ACTION-IF-NOT-FOUND])
114c43cc173Smrg#
115c43cc173Smrg#
116c43cc173Smrg# Note that if there is a possibility the first call to
117c43cc173Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
118c43cc173Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
119c43cc173Smrg#
120c43cc173Smrg#
121c43cc173Smrg# --------------------------------------------------------------
122c43cc173SmrgAC_DEFUN([PKG_CHECK_MODULES],
123c43cc173Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
124c43cc173SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
125c43cc173SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
126c43cc173Smrg
127c43cc173Smrgpkg_failed=no
128c43cc173SmrgAC_MSG_CHECKING([for $1])
129c43cc173Smrg
130c43cc173Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
131c43cc173Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
132c43cc173Smrg
133c43cc173Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
134c43cc173Smrgand $1[]_LIBS to avoid the need to call pkg-config.
135c43cc173SmrgSee the pkg-config man page for more details.])
136c43cc173Smrg
137c43cc173Smrgif test $pkg_failed = yes; then
138c43cc173Smrg        _PKG_SHORT_ERRORS_SUPPORTED
139c43cc173Smrg        if test $_pkg_short_errors_supported = yes; then
140c43cc173Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
141c43cc173Smrg        else 
142c43cc173Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
143c43cc173Smrg        fi
144c43cc173Smrg	# Put the nasty error message in config.log where it belongs
145c43cc173Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
146c43cc173Smrg
147c43cc173Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
148c43cc173Smrg[Package requirements ($2) were not met:
149c43cc173Smrg
150c43cc173Smrg$$1_PKG_ERRORS
151c43cc173Smrg
152c43cc173SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
153c43cc173Smrginstalled software in a non-standard prefix.
154c43cc173Smrg
155c43cc173Smrg_PKG_TEXT
156c43cc173Smrg])],
157c43cc173Smrg		[AC_MSG_RESULT([no])
158c43cc173Smrg                $4])
159c43cc173Smrgelif test $pkg_failed = untried; then
160c43cc173Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
161c43cc173Smrg[The pkg-config script could not be found or is too old.  Make sure it
162c43cc173Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
163c43cc173Smrgpath to pkg-config.
164c43cc173Smrg
165c43cc173Smrg_PKG_TEXT
166c43cc173Smrg
167c43cc173SmrgTo get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
168c43cc173Smrg		[$4])
169c43cc173Smrgelse
170c43cc173Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
171c43cc173Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
172c43cc173Smrg        AC_MSG_RESULT([yes])
173c43cc173Smrg	ifelse([$3], , :, [$3])
174c43cc173Smrgfi[]dnl
175c43cc173Smrg])# PKG_CHECK_MODULES
176c43cc173Smrg
177c43cc173Smrgdnl
178c43cc173Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
179c43cc173Smrgdnl 
180c43cc173Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
181c43cc173Smrgdnl copy of this software and associated documentation files (the
182c43cc173Smrgdnl "Software"), to deal in the Software without restriction, including
183c43cc173Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
184c43cc173Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
185c43cc173Smrgdnl to whom the Software is furnished to do so, provided that the above
186c43cc173Smrgdnl copyright notice(s) and this permission notice appear in all copies of
187c43cc173Smrgdnl the Software and that both the above copyright notice(s) and this
188c43cc173Smrgdnl permission notice appear in supporting documentation.
189c43cc173Smrgdnl
190c43cc173Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
191c43cc173Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
192c43cc173Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
193c43cc173Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
194c43cc173Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
195c43cc173Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
196c43cc173Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
197c43cc173Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
198c43cc173Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
199c43cc173Smrgdnl
200c43cc173Smrgdnl Except as contained in this notice, the name of a copyright holder
201c43cc173Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
202c43cc173Smrgdnl or other dealings in this Software without prior written authorization
203c43cc173Smrgdnl of the copyright holder.
204c43cc173Smrg
205c43cc173Smrg# XORG_MACROS_VERSION(required-version)
206c43cc173Smrg# -------------------------------------
207c43cc173Smrg# Minimum version: 1.1.0
208c43cc173Smrg#
209c43cc173Smrg# If you're using a macro added in Version 1.1 or newer, include this in
210c43cc173Smrg# your configure.ac with the minimum required version, such as:
211c43cc173Smrg# XORG_MACROS_VERSION(1.1)
212c43cc173Smrg#
213c43cc173Smrg# To force at least a version with this macro defined, also add:
214c43cc173Smrg# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
215c43cc173Smrg#
216c43cc173Smrg#
217c43cc173Smrg# See the "minimum version" comment for each macro you use to see what 
218c43cc173Smrg# version you require.
219c43cc173SmrgAC_DEFUN([XORG_MACROS_VERSION],[
220c43cc173Smrg	[XORG_MACROS_needed_version=$1
221c43cc173Smrg	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
222c43cc173Smrg	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
223c43cc173Smrg	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
224c43cc173Smrg	[XORG_MACROS_version=1.1.5
225c43cc173Smrg	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
226c43cc173Smrg	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
227c43cc173Smrg	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
228c43cc173Smrg		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
229c43cc173Smrg	fi
230c43cc173Smrg	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
231c43cc173Smrg		AC_MSG_ERROR([configure built with too old of a version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.${XORG_MACROS_minor}.0 or newer])
232c43cc173Smrg	fi
233c43cc173Smrg	AC_MSG_RESULT([yes, $XORG_MACROS_version])
234c43cc173Smrg]) # XORG_MACROS_VERSION
235c43cc173Smrg
236c43cc173Smrg# XORG_PROG_RAWCPP()
237c43cc173Smrg# ------------------
238c43cc173Smrg# Minimum version: 1.0.0
239c43cc173Smrg#
240c43cc173Smrg# Find cpp program and necessary flags for use in pre-processing text files
241c43cc173Smrg# such as man pages and config files
242c43cc173SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
243c43cc173SmrgAC_REQUIRE([AC_PROG_CPP])
244c43cc173SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
245c43cc173Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
246c43cc173Smrg
247c43cc173Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
248c43cc173Smrg# which is not the best choice for supporting other OS'es, but covers most
249c43cc173Smrg# of the ones we need for now.
250c43cc173SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
251c43cc173SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
252c43cc173Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
253c43cc173Smrg	AC_MSG_RESULT([no])
254c43cc173Smrgelse
255c43cc173Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
256c43cc173Smrg		RAWCPPFLAGS=-undef
257c43cc173Smrg		AC_MSG_RESULT([yes])
258c43cc173Smrg	else
259c43cc173Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
260c43cc173Smrg	fi
261c43cc173Smrgfi
262c43cc173Smrgrm -f conftest.$ac_ext
263c43cc173Smrg
264c43cc173SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
265c43cc173SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
266c43cc173Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
267c43cc173Smrg	AC_MSG_RESULT([no])
268c43cc173Smrgelse
269c43cc173Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
270c43cc173Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
271c43cc173Smrg		AC_MSG_RESULT([yes])
272c43cc173Smrg	else
273c43cc173Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
274c43cc173Smrg	fi
275c43cc173Smrgfi
276c43cc173Smrgrm -f conftest.$ac_ext
277c43cc173SmrgAC_SUBST(RAWCPPFLAGS)
278c43cc173Smrg]) # XORG_PROG_RAWCPP
279c43cc173Smrg
280c43cc173Smrg# XORG_MANPAGE_SECTIONS()
281c43cc173Smrg# -----------------------
282c43cc173Smrg# Minimum version: 1.0.0
283c43cc173Smrg#
284c43cc173Smrg# Determine which sections man pages go in for the different man page types
285c43cc173Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
286c43cc173Smrg# Not sure if there's any better way than just hardcoding by OS name.
287c43cc173Smrg# Override default settings by setting environment variables
288c43cc173Smrg
289c43cc173SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
290c43cc173SmrgAC_REQUIRE([AC_CANONICAL_HOST])
291c43cc173Smrg
292c43cc173Smrgif test x$APP_MAN_SUFFIX = x    ; then
293c43cc173Smrg    APP_MAN_SUFFIX=1
294c43cc173Smrgfi
295c43cc173Smrgif test x$APP_MAN_DIR = x    ; then
296c43cc173Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
297c43cc173Smrgfi
298c43cc173Smrg
299c43cc173Smrgif test x$LIB_MAN_SUFFIX = x    ; then
300c43cc173Smrg    LIB_MAN_SUFFIX=3
301c43cc173Smrgfi
302c43cc173Smrgif test x$LIB_MAN_DIR = x    ; then
303c43cc173Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
304c43cc173Smrgfi
305c43cc173Smrg
306c43cc173Smrgif test x$FILE_MAN_SUFFIX = x    ; then
307c43cc173Smrg    case $host_os in
308c43cc173Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
309c43cc173Smrg	*)		FILE_MAN_SUFFIX=5  ;;
310c43cc173Smrg    esac
311c43cc173Smrgfi
312c43cc173Smrgif test x$FILE_MAN_DIR = x    ; then
313c43cc173Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
314c43cc173Smrgfi
315c43cc173Smrg
316c43cc173Smrgif test x$MISC_MAN_SUFFIX = x    ; then
317c43cc173Smrg    case $host_os in
318c43cc173Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
319c43cc173Smrg	*)		MISC_MAN_SUFFIX=7  ;;
320c43cc173Smrg    esac
321c43cc173Smrgfi
322c43cc173Smrgif test x$MISC_MAN_DIR = x    ; then
323c43cc173Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
324c43cc173Smrgfi
325c43cc173Smrg
326c43cc173Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
327c43cc173Smrg    case $host_os in
328c43cc173Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
329c43cc173Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
330c43cc173Smrg    esac
331c43cc173Smrgfi
332c43cc173Smrgif test x$DRIVER_MAN_DIR = x    ; then
333c43cc173Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
334c43cc173Smrgfi
335c43cc173Smrg
336c43cc173Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
337c43cc173Smrg    case $host_os in
338c43cc173Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
339c43cc173Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
340c43cc173Smrg    esac
341c43cc173Smrgfi
342c43cc173Smrgif test x$ADMIN_MAN_DIR = x    ; then
343c43cc173Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
344c43cc173Smrgfi
345c43cc173Smrg
346c43cc173Smrg
347c43cc173SmrgAC_SUBST([APP_MAN_SUFFIX])
348c43cc173SmrgAC_SUBST([LIB_MAN_SUFFIX])
349c43cc173SmrgAC_SUBST([FILE_MAN_SUFFIX])
350c43cc173SmrgAC_SUBST([MISC_MAN_SUFFIX])
351c43cc173SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
352c43cc173SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
353c43cc173SmrgAC_SUBST([APP_MAN_DIR])
354c43cc173SmrgAC_SUBST([LIB_MAN_DIR])
355c43cc173SmrgAC_SUBST([FILE_MAN_DIR])
356c43cc173SmrgAC_SUBST([MISC_MAN_DIR])
357c43cc173SmrgAC_SUBST([DRIVER_MAN_DIR])
358c43cc173SmrgAC_SUBST([ADMIN_MAN_DIR])
359c43cc173Smrg]) # XORG_MANPAGE_SECTIONS
360c43cc173Smrg
361c43cc173Smrg# XORG_CHECK_LINUXDOC
362c43cc173Smrg# -------------------
363c43cc173Smrg# Minimum version: 1.0.0
364c43cc173Smrg#
365c43cc173Smrg# Defines the variable MAKE_TEXT if the necessary tools and
366c43cc173Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
367c43cc173Smrg# Whether or not the necessary tools and files are found can be checked
368c43cc173Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
369c43cc173SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
370c43cc173SmrgXORG_SGML_PATH=$prefix/share/sgml
371c43cc173SmrgHAVE_DEFS_ENT=
372c43cc173Smrg
373c43cc173SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
374c43cc173Smrg
375c43cc173SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
376c43cc173SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
377c43cc173Smrg
378c43cc173SmrgAC_MSG_CHECKING([Whether to build documentation])
379c43cc173Smrg
380c43cc173Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
381c43cc173Smrg   BUILDDOC=yes
382c43cc173Smrgelse
383c43cc173Smrg   BUILDDOC=no
384c43cc173Smrgfi
385c43cc173Smrg
386c43cc173SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
387c43cc173Smrg
388c43cc173SmrgAC_MSG_RESULT([$BUILDDOC])
389c43cc173Smrg
390c43cc173SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
391c43cc173Smrg
392c43cc173Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
393c43cc173Smrg   BUILDPDFDOC=yes
394c43cc173Smrgelse
395c43cc173Smrg   BUILDPDFDOC=no
396c43cc173Smrgfi
397c43cc173Smrg
398c43cc173SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
399c43cc173Smrg
400c43cc173SmrgAC_MSG_RESULT([$BUILDPDFDOC])
401c43cc173Smrg
402c43cc173SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
403c43cc173SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
404c43cc173SmrgMAKE_PDF="$PS2PDF"
405c43cc173SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
406c43cc173Smrg
407c43cc173SmrgAC_SUBST(MAKE_TEXT)
408c43cc173SmrgAC_SUBST(MAKE_PS)
409c43cc173SmrgAC_SUBST(MAKE_PDF)
410c43cc173SmrgAC_SUBST(MAKE_HTML)
411c43cc173Smrg]) # XORG_CHECK_LINUXDOC
412c43cc173Smrg
413c43cc173Smrg# XORG_CHECK_DOCBOOK
414c43cc173Smrg# -------------------
415c43cc173Smrg# Minimum version: 1.0.0
416c43cc173Smrg#
417c43cc173Smrg# Checks for the ability to build output formats from SGML DocBook source.
418c43cc173Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
419c43cc173Smrg# indicates whether the necessary tools and files are found and, if set,
420c43cc173Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
421c43cc173SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
422c43cc173SmrgXORG_SGML_PATH=$prefix/share/sgml
423c43cc173SmrgHAVE_DEFS_ENT=
424c43cc173SmrgBUILDTXTDOC=no
425c43cc173SmrgBUILDPDFDOC=no
426c43cc173SmrgBUILDPSDOC=no
427c43cc173SmrgBUILDHTMLDOC=no
428c43cc173Smrg
429c43cc173SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
430c43cc173Smrg
431c43cc173SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
432c43cc173SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
433c43cc173SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
434c43cc173SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
435c43cc173Smrg
436c43cc173SmrgAC_MSG_CHECKING([Whether to build text documentation])
437c43cc173Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
438c43cc173Smrg   test x$BUILD_TXTDOC != xno; then
439c43cc173Smrg	BUILDTXTDOC=yes
440c43cc173Smrgfi
441c43cc173SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
442c43cc173SmrgAC_MSG_RESULT([$BUILDTXTDOC])
443c43cc173Smrg
444c43cc173SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
445c43cc173Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
446c43cc173Smrg   test x$BUILD_PDFDOC != xno; then
447c43cc173Smrg	BUILDPDFDOC=yes
448c43cc173Smrgfi
449c43cc173SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
450c43cc173SmrgAC_MSG_RESULT([$BUILDPDFDOC])
451c43cc173Smrg
452c43cc173SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
453c43cc173Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
454c43cc173Smrg   test x$BUILD_PSDOC != xno; then
455c43cc173Smrg	BUILDPSDOC=yes
456c43cc173Smrgfi
457c43cc173SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
458c43cc173SmrgAC_MSG_RESULT([$BUILDPSDOC])
459c43cc173Smrg
460c43cc173SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
461c43cc173Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
462c43cc173Smrg   test x$BUILD_HTMLDOC != xno; then
463c43cc173Smrg	BUILDHTMLDOC=yes
464c43cc173Smrgfi
465c43cc173SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
466c43cc173SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
467c43cc173Smrg
468c43cc173SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
469c43cc173SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
470c43cc173SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
471c43cc173SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
472c43cc173Smrg
473c43cc173SmrgAC_SUBST(MAKE_TEXT)
474c43cc173SmrgAC_SUBST(MAKE_PS)
475c43cc173SmrgAC_SUBST(MAKE_PDF)
476c43cc173SmrgAC_SUBST(MAKE_HTML)
477c43cc173Smrg]) # XORG_CHECK_DOCBOOK
478c43cc173Smrg
479c43cc173Smrg# XORG_CHECK_MALLOC_ZERO
480c43cc173Smrg# ----------------------
481c43cc173Smrg# Minimum version: 1.0.0
482c43cc173Smrg#
483c43cc173Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
484c43cc173Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
485c43cc173Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
486c43cc173SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
487c43cc173SmrgAC_ARG_ENABLE(malloc0returnsnull,
488c43cc173Smrg	AC_HELP_STRING([--enable-malloc0returnsnull],
489c43cc173Smrg		       [malloc(0) returns NULL (default: auto)]),
490c43cc173Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
491c43cc173Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
492c43cc173Smrg
493c43cc173SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
494c43cc173Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
495c43cc173Smrg	AC_RUN_IFELSE([
496c43cc173Smrgchar *malloc();
497c43cc173Smrgchar *realloc();
498c43cc173Smrgchar *calloc();
499c43cc173Smrgmain() {
500c43cc173Smrg    char *m0, *r0, *c0, *p;
501c43cc173Smrg    m0 = malloc(0);
502c43cc173Smrg    p = malloc(10);
503c43cc173Smrg    r0 = realloc(p,0);
504c43cc173Smrg    c0 = calloc(0);
505c43cc173Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
506c43cc173Smrg}],
507c43cc173Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
508c43cc173Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
509c43cc173Smrgfi
510c43cc173SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
511c43cc173Smrg
512c43cc173Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
513c43cc173Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
514c43cc173Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
515c43cc173Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
516c43cc173Smrgelse
517c43cc173Smrg	MALLOC_ZERO_CFLAGS=""
518c43cc173Smrg	XMALLOC_ZERO_CFLAGS=""
519c43cc173Smrg	XTMALLOC_ZERO_CFLAGS=""
520c43cc173Smrgfi
521c43cc173Smrg
522c43cc173SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
523c43cc173SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
524c43cc173SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
525c43cc173Smrg]) # XORG_CHECK_MALLOC_ZERO
526c43cc173Smrg
527c43cc173Smrg# XORG_WITH_LINT()
528c43cc173Smrg# ----------------
529c43cc173Smrg# Minimum version: 1.1.0
530c43cc173Smrg#
531c43cc173Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
532c43cc173Smrg# is specified.   (Use --with-lint=sparse for sparse.)
533c43cc173Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
534c43cc173Smrg# Sets $LINT_FLAGS to flags to pass to source checker
535c43cc173Smrg# Sets LINT automake conditional if enabled (default: disabled)
536c43cc173Smrg#
537c43cc173SmrgAC_DEFUN([XORG_WITH_LINT],[
538c43cc173Smrg
539c43cc173Smrg# Allow checking code with lint, sparse, etc.
540c43cc173SmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
541c43cc173Smrg		[Use a lint-style source code checker (default: disabled)])],
542c43cc173Smrg		[use_lint=$withval], [use_lint=no])
543c43cc173Smrgif test "x$use_lint" = "xyes" ; then
544c43cc173Smrg	LINT="lint"
545c43cc173Smrgelse
546c43cc173Smrg	LINT="$use_lint"
547c43cc173Smrgfi
548c43cc173Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
549c43cc173Smrg    case $LINT in
550c43cc173Smrg	lint|*/lint)
551c43cc173Smrg	    case $host_os in
552c43cc173Smrg		solaris*)
553c43cc173Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
554c43cc173Smrg			;;
555c43cc173Smrg	    esac
556c43cc173Smrg	    ;;
557c43cc173Smrg    esac
558c43cc173Smrgfi
559c43cc173Smrg
560c43cc173SmrgAC_SUBST(LINT)
561c43cc173SmrgAC_SUBST(LINT_FLAGS)
562c43cc173SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
563c43cc173Smrg
564c43cc173Smrg]) # XORG_WITH_LINT
565c43cc173Smrg
566c43cc173Smrg# XORG_LINT_LIBRARY(LIBNAME)
567c43cc173Smrg# --------------------------
568c43cc173Smrg# Minimum version: 1.1.0
569c43cc173Smrg#
570c43cc173Smrg# Sets up flags for building lint libraries for checking programs that call
571c43cc173Smrg# functions in the library.
572c43cc173Smrg# Disabled by default, enable with --enable-lint-library
573c43cc173Smrg# Sets: 
574c43cc173Smrg#	@LINTLIB@		- name of lint library file to make
575c43cc173Smrg#	MAKE_LINT_LIB		- automake conditional
576c43cc173Smrg#
577c43cc173Smrg
578c43cc173SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
579c43cc173SmrgAC_REQUIRE([XORG_WITH_LINT])
580c43cc173Smrg# Build lint "library" for more indepth checks of programs calling this library
581c43cc173SmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
582c43cc173Smrg	[Create lint library (default: disabled)])],
583c43cc173Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
584c43cc173Smrgif test "x$make_lint_lib" != "xno" ; then
585c43cc173Smrg	if test "x$LINT" = "xno" ; then
586c43cc173Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
587c43cc173Smrg	fi
588c43cc173Smrg	if test "x$make_lint_lib" = "xyes" ; then
589c43cc173Smrg		LINTLIB=llib-l$1.ln
590c43cc173Smrg	else
591c43cc173Smrg		LINTLIB=$make_lint_lib
592c43cc173Smrg	fi
593c43cc173Smrgfi
594c43cc173SmrgAC_SUBST(LINTLIB)
595c43cc173SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
596c43cc173Smrg
597c43cc173Smrg]) # XORG_LINT_LIBRARY
598c43cc173Smrg
599c43cc173Smrgdnl Copyright 2005 Red Hat, Inc
600c43cc173Smrgdnl
601c43cc173Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
602c43cc173Smrgdnl documentation for any purpose is hereby granted without fee, provided that
603c43cc173Smrgdnl the above copyright notice appear in all copies and that both that
604c43cc173Smrgdnl copyright notice and this permission notice appear in supporting
605c43cc173Smrgdnl documentation.
606c43cc173Smrgdnl
607c43cc173Smrgdnl The above copyright notice and this permission notice shall be included
608c43cc173Smrgdnl in all copies or substantial portions of the Software.
609c43cc173Smrgdnl
610c43cc173Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
611c43cc173Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
612c43cc173Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
613c43cc173Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
614c43cc173Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
615c43cc173Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
616c43cc173Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
617c43cc173Smrgdnl
618c43cc173Smrgdnl Except as contained in this notice, the name of the copyright holders shall
619c43cc173Smrgdnl not be used in advertising or otherwise to promote the sale, use or
620c43cc173Smrgdnl other dealings in this Software without prior written authorization
621c43cc173Smrgdnl from the copyright holders.
622c43cc173Smrgdnl
623c43cc173Smrg
624c43cc173Smrg# XORG_RELEASE_VERSION
625c43cc173Smrg# --------------------
626c43cc173Smrg# Adds --with/without-release-string and changes the PACKAGE and
627c43cc173Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
628c43cc173Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
629c43cc173Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
630c43cc173Smrg 
631c43cc173SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
632c43cc173Smrg	AC_ARG_WITH(release-version,
633c43cc173Smrg			AC_HELP_STRING([--with-release-version=STRING],
634c43cc173Smrg				[Use release version string in package name]),
635c43cc173Smrg			[RELEASE_VERSION="$withval"],
636c43cc173Smrg			[RELEASE_VERSION=""])
637c43cc173Smrg	if test "x$RELEASE_VERSION" != "x"; then
638c43cc173Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
639c43cc173Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
640c43cc173Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
641c43cc173Smrg	fi
642c43cc173Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
643c43cc173Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
644c43cc173Smrg		[Major version of this package])
645c43cc173Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2`
646c43cc173Smrg	if test "x$PVM" = "x"; then
647c43cc173Smrg		PVM="0"
648c43cc173Smrg	fi
649c43cc173Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
650c43cc173Smrg		[$PVM],
651c43cc173Smrg		[Minor version of this package])
652c43cc173Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3`
653c43cc173Smrg	if test "x$PVP" = "x"; then
654c43cc173Smrg		PVP="0"
655c43cc173Smrg	fi
656c43cc173Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
657c43cc173Smrg		[$PVP],
658c43cc173Smrg		[Patch version of this package])
659c43cc173Smrg])
660c43cc173Smrg
661c43cc173Smrg# Copyright (C) 2002, 2003, 2005, 2006  Free Software Foundation, Inc.
662c43cc173Smrg#
663c43cc173Smrg# This file is free software; the Free Software Foundation
664c43cc173Smrg# gives unlimited permission to copy and/or distribute it,
665c43cc173Smrg# with or without modifications, as long as this notice is preserved.
666c43cc173Smrg
667c43cc173Smrg# AM_AUTOMAKE_VERSION(VERSION)
668c43cc173Smrg# ----------------------------
669c43cc173Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
670c43cc173Smrg# generated from the m4 files accompanying Automake X.Y.
671c43cc173Smrg# (This private macro should not be called outside this file.)
672c43cc173SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
673c43cc173Smrg[am__api_version='1.10'
674c43cc173Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
675c43cc173Smrgdnl require some minimum version.  Point them to the right macro.
676c43cc173Smrgm4_if([$1], [1.10], [],
677c43cc173Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
678c43cc173Smrg])
679c43cc173Smrg
680c43cc173Smrg# _AM_AUTOCONF_VERSION(VERSION)
681c43cc173Smrg# -----------------------------
682c43cc173Smrg# aclocal traces this macro to find the Autoconf version.
683c43cc173Smrg# This is a private macro too.  Using m4_define simplifies
684c43cc173Smrg# the logic in aclocal, which can simply ignore this definition.
685c43cc173Smrgm4_define([_AM_AUTOCONF_VERSION], [])
686c43cc173Smrg
687c43cc173Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
688c43cc173Smrg# -------------------------------
689c43cc173Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
690c43cc173Smrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
691c43cc173SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
692c43cc173Smrg[AM_AUTOMAKE_VERSION([1.10])dnl
693c43cc173Smrg_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
694c43cc173Smrg
695c43cc173Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
696c43cc173Smrg
697c43cc173Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
698c43cc173Smrg#
699c43cc173Smrg# This file is free software; the Free Software Foundation
700c43cc173Smrg# gives unlimited permission to copy and/or distribute it,
701c43cc173Smrg# with or without modifications, as long as this notice is preserved.
702c43cc173Smrg
703c43cc173Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
704c43cc173Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
705c43cc173Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
706c43cc173Smrg#
707c43cc173Smrg# Of course, Automake must honor this variable whenever it calls a
708c43cc173Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
709c43cc173Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
710c43cc173Smrg# depending on how configure is run.  This is pretty annoying, since
711c43cc173Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
712c43cc173Smrg# source directory, any form will work fine, but in subdirectories a
713c43cc173Smrg# relative path needs to be adjusted first.
714c43cc173Smrg#
715c43cc173Smrg# $ac_aux_dir/missing
716c43cc173Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
717c43cc173Smrg# $top_srcdir/$ac_aux_dir/missing
718c43cc173Smrg#    fails if $ac_aux_dir is absolute,
719c43cc173Smrg#    fails when called from a subdirectory in a VPATH build with
720c43cc173Smrg#          a relative $ac_aux_dir
721c43cc173Smrg#
722c43cc173Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
723c43cc173Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
724c43cc173Smrg# harmless because $srcdir is `.', but things will broke when you
725c43cc173Smrg# start a VPATH build or use an absolute $srcdir.
726c43cc173Smrg#
727c43cc173Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
728c43cc173Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
729c43cc173Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
730c43cc173Smrg# and then we would define $MISSING as
731c43cc173Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
732c43cc173Smrg# This will work as long as MISSING is not called from configure, because
733c43cc173Smrg# unfortunately $(top_srcdir) has no meaning in configure.
734c43cc173Smrg# However there are other variables, like CC, which are often used in
735c43cc173Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
736c43cc173Smrg#
737c43cc173Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
738c43cc173Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
739c43cc173Smrg# configured tree to be moved without reconfiguration.
740c43cc173Smrg
741c43cc173SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
742c43cc173Smrg[dnl Rely on autoconf to set up CDPATH properly.
743c43cc173SmrgAC_PREREQ([2.50])dnl
744c43cc173Smrg# expand $ac_aux_dir to an absolute path
745c43cc173Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
746c43cc173Smrg])
747c43cc173Smrg
748c43cc173Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
749c43cc173Smrg
750c43cc173Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
751c43cc173Smrg# Free Software Foundation, Inc.
752c43cc173Smrg#
753c43cc173Smrg# This file is free software; the Free Software Foundation
754c43cc173Smrg# gives unlimited permission to copy and/or distribute it,
755c43cc173Smrg# with or without modifications, as long as this notice is preserved.
756c43cc173Smrg
757c43cc173Smrg# serial 8
758c43cc173Smrg
759c43cc173Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
760c43cc173Smrg# -------------------------------------
761c43cc173Smrg# Define a conditional.
762c43cc173SmrgAC_DEFUN([AM_CONDITIONAL],
763c43cc173Smrg[AC_PREREQ(2.52)dnl
764c43cc173Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
765c43cc173Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
766c43cc173SmrgAC_SUBST([$1_TRUE])dnl
767c43cc173SmrgAC_SUBST([$1_FALSE])dnl
768c43cc173Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
769c43cc173Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
770c43cc173Smrgif $2; then
771c43cc173Smrg  $1_TRUE=
772c43cc173Smrg  $1_FALSE='#'
773c43cc173Smrgelse
774c43cc173Smrg  $1_TRUE='#'
775c43cc173Smrg  $1_FALSE=
776c43cc173Smrgfi
777c43cc173SmrgAC_CONFIG_COMMANDS_PRE(
778c43cc173Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
779c43cc173Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
780c43cc173SmrgUsually this means the macro was only invoked conditionally.]])
781c43cc173Smrgfi])])
782c43cc173Smrg
783c43cc173Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
784c43cc173Smrg# Free Software Foundation, Inc.
785c43cc173Smrg#
786c43cc173Smrg# This file is free software; the Free Software Foundation
787c43cc173Smrg# gives unlimited permission to copy and/or distribute it,
788c43cc173Smrg# with or without modifications, as long as this notice is preserved.
789c43cc173Smrg
790c43cc173Smrg# serial 9
791c43cc173Smrg
792c43cc173Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
793c43cc173Smrg# written in clear, in which case automake, when reading aclocal.m4,
794c43cc173Smrg# will think it sees a *use*, and therefore will trigger all it's
795c43cc173Smrg# C support machinery.  Also note that it means that autoscan, seeing
796c43cc173Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
797c43cc173Smrg
798c43cc173Smrg
799c43cc173Smrg# _AM_DEPENDENCIES(NAME)
800c43cc173Smrg# ----------------------
801c43cc173Smrg# See how the compiler implements dependency checking.
802c43cc173Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
803c43cc173Smrg# We try a few techniques and use that to set a single cache variable.
804c43cc173Smrg#
805c43cc173Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
806c43cc173Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
807c43cc173Smrg# dependency, and given that the user is not expected to run this macro,
808c43cc173Smrg# just rely on AC_PROG_CC.
809c43cc173SmrgAC_DEFUN([_AM_DEPENDENCIES],
810c43cc173Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
811c43cc173SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
812c43cc173SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
813c43cc173SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
814c43cc173Smrg
815c43cc173Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
816c43cc173Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
817c43cc173Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
818c43cc173Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
819c43cc173Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
820c43cc173Smrg                   [depcc="$$1"   am_compiler_list=])
821c43cc173Smrg
822c43cc173SmrgAC_CACHE_CHECK([dependency style of $depcc],
823c43cc173Smrg               [am_cv_$1_dependencies_compiler_type],
824c43cc173Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
825c43cc173Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
826c43cc173Smrg  # making bogus files that we don't know about and never remove.  For
827c43cc173Smrg  # instance it was reported that on HP-UX the gcc test will end up
828c43cc173Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
829c43cc173Smrg  # in D'.
830c43cc173Smrg  mkdir conftest.dir
831c43cc173Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
832c43cc173Smrg  # using a relative directory.
833c43cc173Smrg  cp "$am_depcomp" conftest.dir
834c43cc173Smrg  cd conftest.dir
835c43cc173Smrg  # We will build objects and dependencies in a subdirectory because
836c43cc173Smrg  # it helps to detect inapplicable dependency modes.  For instance
837c43cc173Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
838c43cc173Smrg  # side effect of compilation, but ICC will put the dependencies in
839c43cc173Smrg  # the current directory while Tru64 will put them in the object
840c43cc173Smrg  # directory.
841c43cc173Smrg  mkdir sub
842c43cc173Smrg
843c43cc173Smrg  am_cv_$1_dependencies_compiler_type=none
844c43cc173Smrg  if test "$am_compiler_list" = ""; then
845c43cc173Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
846c43cc173Smrg  fi
847c43cc173Smrg  for depmode in $am_compiler_list; do
848c43cc173Smrg    # Setup a source with many dependencies, because some compilers
849c43cc173Smrg    # like to wrap large dependency lists on column 80 (with \), and
850c43cc173Smrg    # we should not choose a depcomp mode which is confused by this.
851c43cc173Smrg    #
852c43cc173Smrg    # We need to recreate these files for each test, as the compiler may
853c43cc173Smrg    # overwrite some of them when testing with obscure command lines.
854c43cc173Smrg    # This happens at least with the AIX C compiler.
855c43cc173Smrg    : > sub/conftest.c
856c43cc173Smrg    for i in 1 2 3 4 5 6; do
857c43cc173Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
858c43cc173Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
859c43cc173Smrg      # Solaris 8's {/usr,}/bin/sh.
860c43cc173Smrg      touch sub/conftst$i.h
861c43cc173Smrg    done
862c43cc173Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
863c43cc173Smrg
864c43cc173Smrg    case $depmode in
865c43cc173Smrg    nosideeffect)
866c43cc173Smrg      # after this tag, mechanisms are not by side-effect, so they'll
867c43cc173Smrg      # only be used when explicitly requested
868c43cc173Smrg      if test "x$enable_dependency_tracking" = xyes; then
869c43cc173Smrg	continue
870c43cc173Smrg      else
871c43cc173Smrg	break
872c43cc173Smrg      fi
873c43cc173Smrg      ;;
874c43cc173Smrg    none) break ;;
875c43cc173Smrg    esac
876c43cc173Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
877c43cc173Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
878c43cc173Smrg    # handle `-M -o', and we need to detect this.
879c43cc173Smrg    if depmode=$depmode \
880c43cc173Smrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
881c43cc173Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
882c43cc173Smrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
883c43cc173Smrg         >/dev/null 2>conftest.err &&
884c43cc173Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
885c43cc173Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
886c43cc173Smrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
887c43cc173Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
888c43cc173Smrg      # icc doesn't choke on unknown options, it will just issue warnings
889c43cc173Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
890c43cc173Smrg      # that says an option was ignored or not supported.
891c43cc173Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
892c43cc173Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
893c43cc173Smrg      # The diagnosis changed in icc 8.0:
894c43cc173Smrg      #   icc: Command line remark: option '-MP' not supported
895c43cc173Smrg      if (grep 'ignoring option' conftest.err ||
896c43cc173Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
897c43cc173Smrg        am_cv_$1_dependencies_compiler_type=$depmode
898c43cc173Smrg        break
899c43cc173Smrg      fi
900c43cc173Smrg    fi
901c43cc173Smrg  done
902c43cc173Smrg
903c43cc173Smrg  cd ..
904c43cc173Smrg  rm -rf conftest.dir
905c43cc173Smrgelse
906c43cc173Smrg  am_cv_$1_dependencies_compiler_type=none
907c43cc173Smrgfi
908c43cc173Smrg])
909c43cc173SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
910c43cc173SmrgAM_CONDITIONAL([am__fastdep$1], [
911c43cc173Smrg  test "x$enable_dependency_tracking" != xno \
912c43cc173Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
913c43cc173Smrg])
914c43cc173Smrg
915c43cc173Smrg
916c43cc173Smrg# AM_SET_DEPDIR
917c43cc173Smrg# -------------
918c43cc173Smrg# Choose a directory name for dependency files.
919c43cc173Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
920c43cc173SmrgAC_DEFUN([AM_SET_DEPDIR],
921c43cc173Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
922c43cc173SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
923c43cc173Smrg])
924c43cc173Smrg
925c43cc173Smrg
926c43cc173Smrg# AM_DEP_TRACK
927c43cc173Smrg# ------------
928c43cc173SmrgAC_DEFUN([AM_DEP_TRACK],
929c43cc173Smrg[AC_ARG_ENABLE(dependency-tracking,
930c43cc173Smrg[  --disable-dependency-tracking  speeds up one-time build
931c43cc173Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
932c43cc173Smrgif test "x$enable_dependency_tracking" != xno; then
933c43cc173Smrg  am_depcomp="$ac_aux_dir/depcomp"
934c43cc173Smrg  AMDEPBACKSLASH='\'
935c43cc173Smrgfi
936c43cc173SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
937c43cc173SmrgAC_SUBST([AMDEPBACKSLASH])dnl
938c43cc173Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
939c43cc173Smrg])
940c43cc173Smrg
941c43cc173Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
942c43cc173Smrg
943c43cc173Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
944c43cc173Smrg# Free Software Foundation, Inc.
945c43cc173Smrg#
946c43cc173Smrg# This file is free software; the Free Software Foundation
947c43cc173Smrg# gives unlimited permission to copy and/or distribute it,
948c43cc173Smrg# with or without modifications, as long as this notice is preserved.
949c43cc173Smrg
950c43cc173Smrg#serial 3
951c43cc173Smrg
952c43cc173Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
953c43cc173Smrg# ------------------------------
954c43cc173SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
955c43cc173Smrg[for mf in $CONFIG_FILES; do
956c43cc173Smrg  # Strip MF so we end up with the name of the file.
957c43cc173Smrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
958c43cc173Smrg  # Check whether this is an Automake generated Makefile or not.
959c43cc173Smrg  # We used to match only the files named `Makefile.in', but
960c43cc173Smrg  # some people rename them; so instead we look at the file content.
961c43cc173Smrg  # Grep'ing the first line is not enough: some people post-process
962c43cc173Smrg  # each Makefile.in and add a new line on top of each file to say so.
963c43cc173Smrg  # Grep'ing the whole file is not good either: AIX grep has a line
964c43cc173Smrg  # limit of 2048, but all sed's we know have understand at least 4000.
965c43cc173Smrg  if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
966c43cc173Smrg    dirpart=`AS_DIRNAME("$mf")`
967c43cc173Smrg  else
968c43cc173Smrg    continue
969c43cc173Smrg  fi
970c43cc173Smrg  # Extract the definition of DEPDIR, am__include, and am__quote
971c43cc173Smrg  # from the Makefile without running `make'.
972c43cc173Smrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
973c43cc173Smrg  test -z "$DEPDIR" && continue
974c43cc173Smrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
975c43cc173Smrg  test -z "am__include" && continue
976c43cc173Smrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
977c43cc173Smrg  # When using ansi2knr, U may be empty or an underscore; expand it
978c43cc173Smrg  U=`sed -n 's/^U = //p' < "$mf"`
979c43cc173Smrg  # Find all dependency output files, they are included files with
980c43cc173Smrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
981c43cc173Smrg  # simplest approach to changing $(DEPDIR) to its actual value in the
982c43cc173Smrg  # expansion.
983c43cc173Smrg  for file in `sed -n "
984c43cc173Smrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
985c43cc173Smrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
986c43cc173Smrg    # Make sure the directory exists.
987c43cc173Smrg    test -f "$dirpart/$file" && continue
988c43cc173Smrg    fdir=`AS_DIRNAME(["$file"])`
989c43cc173Smrg    AS_MKDIR_P([$dirpart/$fdir])
990c43cc173Smrg    # echo "creating $dirpart/$file"
991c43cc173Smrg    echo '# dummy' > "$dirpart/$file"
992c43cc173Smrg  done
993c43cc173Smrgdone
994c43cc173Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
995c43cc173Smrg
996c43cc173Smrg
997c43cc173Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
998c43cc173Smrg# -----------------------------
999c43cc173Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
1000c43cc173Smrg#
1001c43cc173Smrg# This code is only required when automatic dependency tracking
1002c43cc173Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
1003c43cc173Smrg# need in order to bootstrap the dependency handling code.
1004c43cc173SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1005c43cc173Smrg[AC_CONFIG_COMMANDS([depfiles],
1006c43cc173Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1007c43cc173Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1008c43cc173Smrg])
1009c43cc173Smrg
1010c43cc173Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
1011c43cc173Smrg# Free Software Foundation, Inc.
1012c43cc173Smrg#
1013c43cc173Smrg# This file is free software; the Free Software Foundation
1014c43cc173Smrg# gives unlimited permission to copy and/or distribute it,
1015c43cc173Smrg# with or without modifications, as long as this notice is preserved.
1016c43cc173Smrg
1017c43cc173Smrg# serial 8
1018c43cc173Smrg
1019c43cc173Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
1020c43cc173SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
1021c43cc173Smrg
1022c43cc173Smrg# Do all the work for Automake.                             -*- Autoconf -*-
1023c43cc173Smrg
1024c43cc173Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
1025c43cc173Smrg# 2005, 2006 Free Software Foundation, Inc.
1026c43cc173Smrg#
1027c43cc173Smrg# This file is free software; the Free Software Foundation
1028c43cc173Smrg# gives unlimited permission to copy and/or distribute it,
1029c43cc173Smrg# with or without modifications, as long as this notice is preserved.
1030c43cc173Smrg
1031c43cc173Smrg# serial 12
1032c43cc173Smrg
1033c43cc173Smrg# This macro actually does too much.  Some checks are only needed if
1034c43cc173Smrg# your package does certain things.  But this isn't really a big deal.
1035c43cc173Smrg
1036c43cc173Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1037c43cc173Smrg# AM_INIT_AUTOMAKE([OPTIONS])
1038c43cc173Smrg# -----------------------------------------------
1039c43cc173Smrg# The call with PACKAGE and VERSION arguments is the old style
1040c43cc173Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
1041c43cc173Smrg# and VERSION should now be passed to AC_INIT and removed from
1042c43cc173Smrg# the call to AM_INIT_AUTOMAKE.
1043c43cc173Smrg# We support both call styles for the transition.  After
1044c43cc173Smrg# the next Automake release, Autoconf can make the AC_INIT
1045c43cc173Smrg# arguments mandatory, and then we can depend on a new Autoconf
1046c43cc173Smrg# release and drop the old call support.
1047c43cc173SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
1048c43cc173Smrg[AC_PREREQ([2.60])dnl
1049c43cc173Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
1050c43cc173Smrgdnl the ones we care about.
1051c43cc173Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1052c43cc173SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1053c43cc173SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
1054c43cc173Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
1055c43cc173Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
1056c43cc173Smrg  # is not polluted with repeated "-I."
1057c43cc173Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
1058c43cc173Smrg  # test to see if srcdir already configured
1059c43cc173Smrg  if test -f $srcdir/config.status; then
1060c43cc173Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1061c43cc173Smrg  fi
1062c43cc173Smrgfi
1063c43cc173Smrg
1064c43cc173Smrg# test whether we have cygpath
1065c43cc173Smrgif test -z "$CYGPATH_W"; then
1066c43cc173Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
1067c43cc173Smrg    CYGPATH_W='cygpath -w'
1068c43cc173Smrg  else
1069c43cc173Smrg    CYGPATH_W=echo
1070c43cc173Smrg  fi
1071c43cc173Smrgfi
1072c43cc173SmrgAC_SUBST([CYGPATH_W])
1073c43cc173Smrg
1074c43cc173Smrg# Define the identity of the package.
1075c43cc173Smrgdnl Distinguish between old-style and new-style calls.
1076c43cc173Smrgm4_ifval([$2],
1077c43cc173Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1078c43cc173Smrg AC_SUBST([PACKAGE], [$1])dnl
1079c43cc173Smrg AC_SUBST([VERSION], [$2])],
1080c43cc173Smrg[_AM_SET_OPTIONS([$1])dnl
1081c43cc173Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
1082c43cc173Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
1083c43cc173Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
1084c43cc173Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1085c43cc173Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1086c43cc173Smrg
1087c43cc173Smrg_AM_IF_OPTION([no-define],,
1088c43cc173Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1089c43cc173Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
1090c43cc173Smrg
1091c43cc173Smrg# Some tools Automake needs.
1092c43cc173SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
1093c43cc173SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
1094c43cc173SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
1095c43cc173SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
1096c43cc173SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
1097c43cc173SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
1098c43cc173SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
1099c43cc173SmrgAM_PROG_INSTALL_SH
1100c43cc173SmrgAM_PROG_INSTALL_STRIP
1101c43cc173SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
1102c43cc173Smrg# We need awk for the "check" target.  The system "awk" is bad on
1103c43cc173Smrg# some platforms.
1104c43cc173SmrgAC_REQUIRE([AC_PROG_AWK])dnl
1105c43cc173SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
1106c43cc173SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
1107c43cc173Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1108c43cc173Smrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1109c43cc173Smrg	      		     [_AM_PROG_TAR([v7])])])
1110c43cc173Smrg_AM_IF_OPTION([no-dependencies],,
1111c43cc173Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
1112c43cc173Smrg                  [_AM_DEPENDENCIES(CC)],
1113c43cc173Smrg                  [define([AC_PROG_CC],
1114c43cc173Smrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
1115c43cc173SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
1116c43cc173Smrg                  [_AM_DEPENDENCIES(CXX)],
1117c43cc173Smrg                  [define([AC_PROG_CXX],
1118c43cc173Smrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
1119c43cc173SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
1120c43cc173Smrg                  [_AM_DEPENDENCIES(OBJC)],
1121c43cc173Smrg                  [define([AC_PROG_OBJC],
1122c43cc173Smrg                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
1123c43cc173Smrg])
1124c43cc173Smrg])
1125c43cc173Smrg
1126c43cc173Smrg
1127c43cc173Smrg# When config.status generates a header, we must update the stamp-h file.
1128c43cc173Smrg# This file resides in the same directory as the config header
1129c43cc173Smrg# that is generated.  The stamp files are numbered to have different names.
1130c43cc173Smrg
1131c43cc173Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1132c43cc173Smrg# loop where config.status creates the headers, so we can generate
1133c43cc173Smrg# our stamp files there.
1134c43cc173SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1135c43cc173Smrg[# Compute $1's index in $config_headers.
1136c43cc173Smrg_am_stamp_count=1
1137c43cc173Smrgfor _am_header in $config_headers :; do
1138c43cc173Smrg  case $_am_header in
1139c43cc173Smrg    $1 | $1:* )
1140c43cc173Smrg      break ;;
1141c43cc173Smrg    * )
1142c43cc173Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1143c43cc173Smrg  esac
1144c43cc173Smrgdone
1145c43cc173Smrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
1146c43cc173Smrg
1147c43cc173Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
1148c43cc173Smrg#
1149c43cc173Smrg# This file is free software; the Free Software Foundation
1150c43cc173Smrg# gives unlimited permission to copy and/or distribute it,
1151c43cc173Smrg# with or without modifications, as long as this notice is preserved.
1152c43cc173Smrg
1153c43cc173Smrg# AM_PROG_INSTALL_SH
1154c43cc173Smrg# ------------------
1155c43cc173Smrg# Define $install_sh.
1156c43cc173SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
1157c43cc173Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1158c43cc173Smrginstall_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
1159c43cc173SmrgAC_SUBST(install_sh)])
1160c43cc173Smrg
1161c43cc173Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
1162c43cc173Smrg#
1163c43cc173Smrg# This file is free software; the Free Software Foundation
1164c43cc173Smrg# gives unlimited permission to copy and/or distribute it,
1165c43cc173Smrg# with or without modifications, as long as this notice is preserved.
1166c43cc173Smrg
1167c43cc173Smrg# serial 2
1168c43cc173Smrg
1169c43cc173Smrg# Check whether the underlying file-system supports filenames
1170c43cc173Smrg# with a leading dot.  For instance MS-DOS doesn't.
1171c43cc173SmrgAC_DEFUN([AM_SET_LEADING_DOT],
1172c43cc173Smrg[rm -rf .tst 2>/dev/null
1173c43cc173Smrgmkdir .tst 2>/dev/null
1174c43cc173Smrgif test -d .tst; then
1175c43cc173Smrg  am__leading_dot=.
1176c43cc173Smrgelse
1177c43cc173Smrg  am__leading_dot=_
1178c43cc173Smrgfi
1179c43cc173Smrgrmdir .tst 2>/dev/null
1180c43cc173SmrgAC_SUBST([am__leading_dot])])
1181c43cc173Smrg
1182c43cc173Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
1183c43cc173Smrg
1184c43cc173Smrg# serial 48 AC_PROG_LIBTOOL
1185c43cc173Smrg
1186c43cc173Smrg
1187c43cc173Smrg# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
1188c43cc173Smrg# -----------------------------------------------------------
1189c43cc173Smrg# If this macro is not defined by Autoconf, define it here.
1190c43cc173Smrgm4_ifdef([AC_PROVIDE_IFELSE],
1191c43cc173Smrg         [],
1192c43cc173Smrg         [m4_define([AC_PROVIDE_IFELSE],
1193c43cc173Smrg	         [m4_ifdef([AC_PROVIDE_$1],
1194c43cc173Smrg		           [$2], [$3])])])
1195c43cc173Smrg
1196c43cc173Smrg
1197c43cc173Smrg# AC_PROG_LIBTOOL
1198c43cc173Smrg# ---------------
1199c43cc173SmrgAC_DEFUN([AC_PROG_LIBTOOL],
1200c43cc173Smrg[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
1201c43cc173Smrgdnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
1202c43cc173Smrgdnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
1203c43cc173Smrg  AC_PROVIDE_IFELSE([AC_PROG_CXX],
1204c43cc173Smrg    [AC_LIBTOOL_CXX],
1205c43cc173Smrg    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
1206c43cc173Smrg  ])])
1207c43cc173Smrgdnl And a similar setup for Fortran 77 support
1208c43cc173Smrg  AC_PROVIDE_IFELSE([AC_PROG_F77],
1209c43cc173Smrg    [AC_LIBTOOL_F77],
1210c43cc173Smrg    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
1211c43cc173Smrg])])
1212c43cc173Smrg
1213c43cc173Smrgdnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
1214c43cc173Smrgdnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
1215c43cc173Smrgdnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
1216c43cc173Smrg  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
1217c43cc173Smrg    [AC_LIBTOOL_GCJ],
1218c43cc173Smrg    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
1219c43cc173Smrg      [AC_LIBTOOL_GCJ],
1220c43cc173Smrg      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
1221c43cc173Smrg	[AC_LIBTOOL_GCJ],
1222c43cc173Smrg      [ifdef([AC_PROG_GCJ],
1223c43cc173Smrg	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
1224c43cc173Smrg       ifdef([A][M_PROG_GCJ],
1225c43cc173Smrg	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
1226c43cc173Smrg       ifdef([LT_AC_PROG_GCJ],
1227c43cc173Smrg	     [define([LT_AC_PROG_GCJ],
1228c43cc173Smrg		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
1229c43cc173Smrg])])# AC_PROG_LIBTOOL
1230c43cc173Smrg
1231c43cc173Smrg
1232c43cc173Smrg# _AC_PROG_LIBTOOL
1233c43cc173Smrg# ----------------
1234c43cc173SmrgAC_DEFUN([_AC_PROG_LIBTOOL],
1235c43cc173Smrg[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
1236c43cc173SmrgAC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
1237c43cc173SmrgAC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
1238c43cc173SmrgAC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
1239c43cc173Smrg
1240c43cc173Smrg# This can be used to rebuild libtool when needed
1241c43cc173SmrgLIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
1242c43cc173Smrg
1243c43cc173Smrg# Always use our own libtool.
1244c43cc173SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
1245c43cc173SmrgAC_SUBST(LIBTOOL)dnl
1246c43cc173Smrg
1247c43cc173Smrg# Prevent multiple expansion
1248c43cc173Smrgdefine([AC_PROG_LIBTOOL], [])
1249c43cc173Smrg])# _AC_PROG_LIBTOOL
1250c43cc173Smrg
1251c43cc173Smrg
1252c43cc173Smrg# AC_LIBTOOL_SETUP
1253c43cc173Smrg# ----------------
1254c43cc173SmrgAC_DEFUN([AC_LIBTOOL_SETUP],
1255c43cc173Smrg[AC_PREREQ(2.50)dnl
1256c43cc173SmrgAC_REQUIRE([AC_ENABLE_SHARED])dnl
1257c43cc173SmrgAC_REQUIRE([AC_ENABLE_STATIC])dnl
1258c43cc173SmrgAC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
1259c43cc173SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
1260c43cc173SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
1261c43cc173SmrgAC_REQUIRE([AC_PROG_CC])dnl
1262c43cc173SmrgAC_REQUIRE([AC_PROG_LD])dnl
1263c43cc173SmrgAC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
1264c43cc173SmrgAC_REQUIRE([AC_PROG_NM])dnl
1265c43cc173Smrg
1266c43cc173SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
1267c43cc173SmrgAC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
1268c43cc173Smrg# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
1269c43cc173SmrgAC_REQUIRE([AC_OBJEXT])dnl
1270c43cc173SmrgAC_REQUIRE([AC_EXEEXT])dnl
1271c43cc173Smrgdnl
1272c43cc173Smrg
1273c43cc173SmrgAC_LIBTOOL_SYS_MAX_CMD_LEN
1274c43cc173SmrgAC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
1275c43cc173SmrgAC_LIBTOOL_OBJDIR
1276c43cc173Smrg
1277c43cc173SmrgAC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
1278c43cc173Smrg_LT_AC_PROG_ECHO_BACKSLASH
1279c43cc173Smrg
1280c43cc173Smrgcase $host_os in
1281c43cc173Smrgaix3*)
1282c43cc173Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
1283c43cc173Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
1284c43cc173Smrg  # vanish in a puff of smoke.
1285c43cc173Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
1286c43cc173Smrg    COLLECT_NAMES=
1287c43cc173Smrg    export COLLECT_NAMES
1288c43cc173Smrg  fi
1289c43cc173Smrg  ;;
1290c43cc173Smrgesac
1291c43cc173Smrg
1292c43cc173Smrg# Sed substitution that helps us do robust quoting.  It backslashifies
1293c43cc173Smrg# metacharacters that are still active within double-quoted strings.
1294c43cc173SmrgXsed='sed -e 1s/^X//'
1295c43cc173Smrg[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
1296c43cc173Smrg
1297c43cc173Smrg# Same as above, but do not quote variable references.
1298c43cc173Smrg[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
1299c43cc173Smrg
1300c43cc173Smrg# Sed substitution to delay expansion of an escaped shell variable in a
1301c43cc173Smrg# double_quote_subst'ed string.
1302c43cc173Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1303c43cc173Smrg
1304c43cc173Smrg# Sed substitution to avoid accidental globbing in evaled expressions
1305c43cc173Smrgno_glob_subst='s/\*/\\\*/g'
1306c43cc173Smrg
1307c43cc173Smrg# Constants:
1308c43cc173Smrgrm="rm -f"
1309c43cc173Smrg
1310c43cc173Smrg# Global variables:
1311c43cc173Smrgdefault_ofile=libtool
1312c43cc173Smrgcan_build_shared=yes
1313c43cc173Smrg
1314c43cc173Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
1315c43cc173Smrg# which needs '.lib').
1316c43cc173Smrglibext=a
1317c43cc173Smrgltmain="$ac_aux_dir/ltmain.sh"
1318c43cc173Smrgofile="$default_ofile"
1319c43cc173Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
1320c43cc173Smrg
1321c43cc173SmrgAC_CHECK_TOOL(AR, ar, false)
1322c43cc173SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
1323c43cc173SmrgAC_CHECK_TOOL(STRIP, strip, :)
1324c43cc173Smrg
1325c43cc173Smrgold_CC="$CC"
1326c43cc173Smrgold_CFLAGS="$CFLAGS"
1327c43cc173Smrg
1328c43cc173Smrg# Set sane defaults for various variables
1329c43cc173Smrgtest -z "$AR" && AR=ar
1330c43cc173Smrgtest -z "$AR_FLAGS" && AR_FLAGS=cru
1331c43cc173Smrgtest -z "$AS" && AS=as
1332c43cc173Smrgtest -z "$CC" && CC=cc
1333c43cc173Smrgtest -z "$LTCC" && LTCC=$CC
1334c43cc173Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
1335c43cc173Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
1336c43cc173Smrgtest -z "$LD" && LD=ld
1337c43cc173Smrgtest -z "$LN_S" && LN_S="ln -s"
1338c43cc173Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
1339c43cc173Smrgtest -z "$NM" && NM=nm
1340c43cc173Smrgtest -z "$SED" && SED=sed
1341c43cc173Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
1342c43cc173Smrgtest -z "$RANLIB" && RANLIB=:
1343c43cc173Smrgtest -z "$STRIP" && STRIP=:
1344c43cc173Smrgtest -z "$ac_objext" && ac_objext=o
1345c43cc173Smrg
1346c43cc173Smrg# Determine commands to create old-style static archives.
1347c43cc173Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
1348c43cc173Smrgold_postinstall_cmds='chmod 644 $oldlib'
1349c43cc173Smrgold_postuninstall_cmds=
1350c43cc173Smrg
1351c43cc173Smrgif test -n "$RANLIB"; then
1352c43cc173Smrg  case $host_os in
1353c43cc173Smrg  openbsd*)
1354c43cc173Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
1355c43cc173Smrg    ;;
1356c43cc173Smrg  *)
1357c43cc173Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
1358c43cc173Smrg    ;;
1359c43cc173Smrg  esac
1360c43cc173Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
1361c43cc173Smrgfi
1362c43cc173Smrg
1363c43cc173Smrg_LT_CC_BASENAME([$compiler])
1364c43cc173Smrg
1365c43cc173Smrg# Only perform the check for file, if the check method requires it
1366c43cc173Smrgcase $deplibs_check_method in
1367c43cc173Smrgfile_magic*)
1368c43cc173Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
1369c43cc173Smrg    AC_PATH_MAGIC
1370c43cc173Smrg  fi
1371c43cc173Smrg  ;;
1372c43cc173Smrgesac
1373c43cc173Smrg
1374c43cc173SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
1375c43cc173SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
1376c43cc173Smrgenable_win32_dll=yes, enable_win32_dll=no)
1377c43cc173Smrg
1378c43cc173SmrgAC_ARG_ENABLE([libtool-lock],
1379c43cc173Smrg    [AC_HELP_STRING([--disable-libtool-lock],
1380c43cc173Smrg	[avoid locking (might break parallel builds)])])
1381c43cc173Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1382c43cc173Smrg
1383c43cc173SmrgAC_ARG_WITH([pic],
1384c43cc173Smrg    [AC_HELP_STRING([--with-pic],
1385c43cc173Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
1386c43cc173Smrg    [pic_mode="$withval"],
1387c43cc173Smrg    [pic_mode=default])
1388c43cc173Smrgtest -z "$pic_mode" && pic_mode=default
1389c43cc173Smrg
1390c43cc173Smrg# Use C for the default configuration in the libtool script
1391c43cc173Smrgtagname=
1392c43cc173SmrgAC_LIBTOOL_LANG_C_CONFIG
1393c43cc173Smrg_LT_AC_TAGCONFIG
1394c43cc173Smrg])# AC_LIBTOOL_SETUP
1395c43cc173Smrg
1396c43cc173Smrg
1397c43cc173Smrg# _LT_AC_SYS_COMPILER
1398c43cc173Smrg# -------------------
1399c43cc173SmrgAC_DEFUN([_LT_AC_SYS_COMPILER],
1400c43cc173Smrg[AC_REQUIRE([AC_PROG_CC])dnl
1401c43cc173Smrg
1402c43cc173Smrg# If no C compiler was specified, use CC.
1403c43cc173SmrgLTCC=${LTCC-"$CC"}
1404c43cc173Smrg
1405c43cc173Smrg# If no C compiler flags were specified, use CFLAGS.
1406c43cc173SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
1407c43cc173Smrg
1408c43cc173Smrg# Allow CC to be a program name with arguments.
1409c43cc173Smrgcompiler=$CC
1410c43cc173Smrg])# _LT_AC_SYS_COMPILER
1411c43cc173Smrg
1412c43cc173Smrg
1413c43cc173Smrg# _LT_CC_BASENAME(CC)
1414c43cc173Smrg# -------------------
1415c43cc173Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
1416c43cc173SmrgAC_DEFUN([_LT_CC_BASENAME],
1417c43cc173Smrg[for cc_temp in $1""; do
1418c43cc173Smrg  case $cc_temp in
1419c43cc173Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
1420c43cc173Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
1421c43cc173Smrg    \-*) ;;
1422c43cc173Smrg    *) break;;
1423c43cc173Smrg  esac
1424c43cc173Smrgdone
1425c43cc173Smrgcc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
1426c43cc173Smrg])
1427c43cc173Smrg
1428c43cc173Smrg
1429c43cc173Smrg# _LT_COMPILER_BOILERPLATE
1430c43cc173Smrg# ------------------------
1431c43cc173Smrg# Check for compiler boilerplate output or warnings with
1432c43cc173Smrg# the simple compiler test code.
1433c43cc173SmrgAC_DEFUN([_LT_COMPILER_BOILERPLATE],
1434c43cc173Smrg[ac_outfile=conftest.$ac_objext
1435c43cc173Smrgprintf "$lt_simple_compile_test_code" >conftest.$ac_ext
1436c43cc173Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
1437c43cc173Smrg_lt_compiler_boilerplate=`cat conftest.err`
1438c43cc173Smrg$rm conftest*
1439c43cc173Smrg])# _LT_COMPILER_BOILERPLATE
1440c43cc173Smrg
1441c43cc173Smrg
1442c43cc173Smrg# _LT_LINKER_BOILERPLATE
1443c43cc173Smrg# ----------------------
1444c43cc173Smrg# Check for linker boilerplate output or warnings with
1445c43cc173Smrg# the simple link test code.
1446c43cc173SmrgAC_DEFUN([_LT_LINKER_BOILERPLATE],
1447c43cc173Smrg[ac_outfile=conftest.$ac_objext
1448c43cc173Smrgprintf "$lt_simple_link_test_code" >conftest.$ac_ext
1449c43cc173Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
1450c43cc173Smrg_lt_linker_boilerplate=`cat conftest.err`
1451c43cc173Smrg$rm conftest*
1452c43cc173Smrg])# _LT_LINKER_BOILERPLATE
1453c43cc173Smrg
1454c43cc173Smrg
1455c43cc173Smrg# _LT_AC_SYS_LIBPATH_AIX
1456c43cc173Smrg# ----------------------
1457c43cc173Smrg# Links a minimal program and checks the executable
1458c43cc173Smrg# for the system default hardcoded library path. In most cases,
1459c43cc173Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
1460c43cc173Smrg# the location of the communication and MPI libs are included too.
1461c43cc173Smrg# If we don't find anything, use the default library path according
1462c43cc173Smrg# to the aix ld manual.
1463c43cc173SmrgAC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
1464c43cc173Smrg[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
1465c43cc173Smrgaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
1466c43cc173Smrg}'`
1467c43cc173Smrg# Check for a 64-bit object if we didn't find anything.
1468c43cc173Smrgif test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
1469c43cc173Smrg}'`; fi],[])
1470c43cc173Smrgif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
1471c43cc173Smrg])# _LT_AC_SYS_LIBPATH_AIX
1472c43cc173Smrg
1473c43cc173Smrg
1474c43cc173Smrg# _LT_AC_SHELL_INIT(ARG)
1475c43cc173Smrg# ----------------------
1476c43cc173SmrgAC_DEFUN([_LT_AC_SHELL_INIT],
1477c43cc173Smrg[ifdef([AC_DIVERSION_NOTICE],
1478c43cc173Smrg	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
1479c43cc173Smrg	 [AC_DIVERT_PUSH(NOTICE)])
1480c43cc173Smrg$1
1481c43cc173SmrgAC_DIVERT_POP
1482c43cc173Smrg])# _LT_AC_SHELL_INIT
1483c43cc173Smrg
1484c43cc173Smrg
1485c43cc173Smrg# _LT_AC_PROG_ECHO_BACKSLASH
1486c43cc173Smrg# --------------------------
1487c43cc173Smrg# Add some code to the start of the generated configure script which
1488c43cc173Smrg# will find an echo command which doesn't interpret backslashes.
1489c43cc173SmrgAC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
1490c43cc173Smrg[_LT_AC_SHELL_INIT([
1491c43cc173Smrg# Check that we are running under the correct shell.
1492c43cc173SmrgSHELL=${CONFIG_SHELL-/bin/sh}
1493c43cc173Smrg
1494c43cc173Smrgcase X$ECHO in
1495c43cc173SmrgX*--fallback-echo)
1496c43cc173Smrg  # Remove one level of quotation (which was required for Make).
1497c43cc173Smrg  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
1498c43cc173Smrg  ;;
1499c43cc173Smrgesac
1500c43cc173Smrg
1501c43cc173Smrgecho=${ECHO-echo}
1502c43cc173Smrgif test "X[$]1" = X--no-reexec; then
1503c43cc173Smrg  # Discard the --no-reexec flag, and continue.
1504c43cc173Smrg  shift
1505c43cc173Smrgelif test "X[$]1" = X--fallback-echo; then
1506c43cc173Smrg  # Avoid inline document here, it may be left over
1507c43cc173Smrg  :
1508c43cc173Smrgelif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
1509c43cc173Smrg  # Yippee, $echo works!
1510c43cc173Smrg  :
1511c43cc173Smrgelse
1512c43cc173Smrg  # Restart under the correct shell.
1513c43cc173Smrg  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
1514c43cc173Smrgfi
1515c43cc173Smrg
1516c43cc173Smrgif test "X[$]1" = X--fallback-echo; then
1517c43cc173Smrg  # used as fallback echo
1518c43cc173Smrg  shift
1519c43cc173Smrg  cat <<EOF
1520c43cc173Smrg[$]*
1521c43cc173SmrgEOF
1522c43cc173Smrg  exit 0
1523c43cc173Smrgfi
1524c43cc173Smrg
1525c43cc173Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
1526c43cc173Smrg# if CDPATH is set.
1527c43cc173Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1528c43cc173Smrg
1529c43cc173Smrgif test -z "$ECHO"; then
1530c43cc173Smrgif test "X${echo_test_string+set}" != Xset; then
1531c43cc173Smrg# find a string as large as possible, as long as the shell can cope with it
1532c43cc173Smrg  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
1533c43cc173Smrg    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
1534c43cc173Smrg    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
1535c43cc173Smrg       echo_test_string=`eval $cmd` &&
1536c43cc173Smrg       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
1537c43cc173Smrg    then
1538c43cc173Smrg      break
1539c43cc173Smrg    fi
1540c43cc173Smrg  done
1541c43cc173Smrgfi
1542c43cc173Smrg
1543c43cc173Smrgif test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
1544c43cc173Smrg   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
1545c43cc173Smrg   test "X$echo_testing_string" = "X$echo_test_string"; then
1546c43cc173Smrg  :
1547c43cc173Smrgelse
1548c43cc173Smrg  # The Solaris, AIX, and Digital Unix default echo programs unquote
1549c43cc173Smrg  # backslashes.  This makes it impossible to quote backslashes using
1550c43cc173Smrg  #   echo "$something" | sed 's/\\/\\\\/g'
1551c43cc173Smrg  #
1552c43cc173Smrg  # So, first we look for a working echo in the user's PATH.
1553c43cc173Smrg
1554c43cc173Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
1555c43cc173Smrg  for dir in $PATH /usr/ucb; do
1556c43cc173Smrg    IFS="$lt_save_ifs"
1557c43cc173Smrg    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
1558c43cc173Smrg       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
1559c43cc173Smrg       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
1560c43cc173Smrg       test "X$echo_testing_string" = "X$echo_test_string"; then
1561c43cc173Smrg      echo="$dir/echo"
1562c43cc173Smrg      break
1563c43cc173Smrg    fi
1564c43cc173Smrg  done
1565c43cc173Smrg  IFS="$lt_save_ifs"
1566c43cc173Smrg
1567c43cc173Smrg  if test "X$echo" = Xecho; then
1568c43cc173Smrg    # We didn't find a better echo, so look for alternatives.
1569c43cc173Smrg    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
1570c43cc173Smrg       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
1571c43cc173Smrg       test "X$echo_testing_string" = "X$echo_test_string"; then
1572c43cc173Smrg      # This shell has a builtin print -r that does the trick.
1573c43cc173Smrg      echo='print -r'
1574c43cc173Smrg    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
1575c43cc173Smrg	 test "X$CONFIG_SHELL" != X/bin/ksh; then
1576c43cc173Smrg      # If we have ksh, try running configure again with it.
1577c43cc173Smrg      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
1578c43cc173Smrg      export ORIGINAL_CONFIG_SHELL
1579c43cc173Smrg      CONFIG_SHELL=/bin/ksh
1580c43cc173Smrg      export CONFIG_SHELL
1581c43cc173Smrg      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
1582c43cc173Smrg    else
1583c43cc173Smrg      # Try using printf.
1584c43cc173Smrg      echo='printf %s\n'
1585c43cc173Smrg      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
1586c43cc173Smrg	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
1587c43cc173Smrg	 test "X$echo_testing_string" = "X$echo_test_string"; then
1588c43cc173Smrg	# Cool, printf works
1589c43cc173Smrg	:
1590c43cc173Smrg      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1591c43cc173Smrg	   test "X$echo_testing_string" = 'X\t' &&
1592c43cc173Smrg	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1593c43cc173Smrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
1594c43cc173Smrg	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
1595c43cc173Smrg	export CONFIG_SHELL
1596c43cc173Smrg	SHELL="$CONFIG_SHELL"
1597c43cc173Smrg	export SHELL
1598c43cc173Smrg	echo="$CONFIG_SHELL [$]0 --fallback-echo"
1599c43cc173Smrg      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1600c43cc173Smrg	   test "X$echo_testing_string" = 'X\t' &&
1601c43cc173Smrg	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1602c43cc173Smrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
1603c43cc173Smrg	echo="$CONFIG_SHELL [$]0 --fallback-echo"
1604c43cc173Smrg      else
1605c43cc173Smrg	# maybe with a smaller string...
1606c43cc173Smrg	prev=:
1607c43cc173Smrg
1608c43cc173Smrg	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
1609c43cc173Smrg	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
1610c43cc173Smrg	  then
1611c43cc173Smrg	    break
1612c43cc173Smrg	  fi
1613c43cc173Smrg	  prev="$cmd"
1614c43cc173Smrg	done
1615c43cc173Smrg
1616c43cc173Smrg	if test "$prev" != 'sed 50q "[$]0"'; then
1617c43cc173Smrg	  echo_test_string=`eval $prev`
1618c43cc173Smrg	  export echo_test_string
1619c43cc173Smrg	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
1620c43cc173Smrg	else
1621c43cc173Smrg	  # Oops.  We lost completely, so just stick with echo.
1622c43cc173Smrg	  echo=echo
1623c43cc173Smrg	fi
1624c43cc173Smrg      fi
1625c43cc173Smrg    fi
1626c43cc173Smrg  fi
1627c43cc173Smrgfi
1628c43cc173Smrgfi
1629c43cc173Smrg
1630c43cc173Smrg# Copy echo and quote the copy suitably for passing to libtool from
1631c43cc173Smrg# the Makefile, instead of quoting the original, which is used later.
1632c43cc173SmrgECHO=$echo
1633c43cc173Smrgif test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
1634c43cc173Smrg   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
1635c43cc173Smrgfi
1636c43cc173Smrg
1637c43cc173SmrgAC_SUBST(ECHO)
1638c43cc173Smrg])])# _LT_AC_PROG_ECHO_BACKSLASH
1639c43cc173Smrg
1640c43cc173Smrg
1641c43cc173Smrg# _LT_AC_LOCK
1642c43cc173Smrg# -----------
1643c43cc173SmrgAC_DEFUN([_LT_AC_LOCK],
1644c43cc173Smrg[AC_ARG_ENABLE([libtool-lock],
1645c43cc173Smrg    [AC_HELP_STRING([--disable-libtool-lock],
1646c43cc173Smrg	[avoid locking (might break parallel builds)])])
1647c43cc173Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1648c43cc173Smrg
1649c43cc173Smrg# Some flags need to be propagated to the compiler or linker for good
1650c43cc173Smrg# libtool support.
1651c43cc173Smrgcase $host in
1652c43cc173Smrgia64-*-hpux*)
1653c43cc173Smrg  # Find out which ABI we are using.
1654c43cc173Smrg  echo 'int i;' > conftest.$ac_ext
1655c43cc173Smrg  if AC_TRY_EVAL(ac_compile); then
1656c43cc173Smrg    case `/usr/bin/file conftest.$ac_objext` in
1657c43cc173Smrg    *ELF-32*)
1658c43cc173Smrg      HPUX_IA64_MODE="32"
1659c43cc173Smrg      ;;
1660c43cc173Smrg    *ELF-64*)
1661c43cc173Smrg      HPUX_IA64_MODE="64"
1662c43cc173Smrg      ;;
1663c43cc173Smrg    esac
1664c43cc173Smrg  fi
1665c43cc173Smrg  rm -rf conftest*
1666c43cc173Smrg  ;;
1667c43cc173Smrg*-*-irix6*)
1668c43cc173Smrg  # Find out which ABI we are using.
1669c43cc173Smrg  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1670c43cc173Smrg  if AC_TRY_EVAL(ac_compile); then
1671c43cc173Smrg   if test "$lt_cv_prog_gnu_ld" = yes; then
1672c43cc173Smrg    case `/usr/bin/file conftest.$ac_objext` in
1673c43cc173Smrg    *32-bit*)
1674c43cc173Smrg      LD="${LD-ld} -melf32bsmip"
1675c43cc173Smrg      ;;
1676c43cc173Smrg    *N32*)
1677c43cc173Smrg      LD="${LD-ld} -melf32bmipn32"
1678c43cc173Smrg      ;;
1679c43cc173Smrg    *64-bit*)
1680c43cc173Smrg      LD="${LD-ld} -melf64bmip"
1681c43cc173Smrg      ;;
1682c43cc173Smrg    esac
1683c43cc173Smrg   else
1684c43cc173Smrg    case `/usr/bin/file conftest.$ac_objext` in
1685c43cc173Smrg    *32-bit*)
1686c43cc173Smrg      LD="${LD-ld} -32"
1687c43cc173Smrg      ;;
1688c43cc173Smrg    *N32*)
1689c43cc173Smrg      LD="${LD-ld} -n32"
1690c43cc173Smrg      ;;
1691c43cc173Smrg    *64-bit*)
1692c43cc173Smrg      LD="${LD-ld} -64"
1693c43cc173Smrg      ;;
1694c43cc173Smrg    esac
1695c43cc173Smrg   fi
1696c43cc173Smrg  fi
1697c43cc173Smrg  rm -rf conftest*
1698c43cc173Smrg  ;;
1699c43cc173Smrg
1700c43cc173Smrgx86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
1701c43cc173Smrg  # Find out which ABI we are using.
1702c43cc173Smrg  echo 'int i;' > conftest.$ac_ext
1703c43cc173Smrg  if AC_TRY_EVAL(ac_compile); then
1704c43cc173Smrg    case `/usr/bin/file conftest.o` in
1705c43cc173Smrg    *32-bit*)
1706c43cc173Smrg      case $host in
1707c43cc173Smrg        x86_64-*linux*)
1708c43cc173Smrg          LD="${LD-ld} -m elf_i386"
1709c43cc173Smrg          ;;
1710c43cc173Smrg        ppc64-*linux*|powerpc64-*linux*)
1711c43cc173Smrg          LD="${LD-ld} -m elf32ppclinux"
1712c43cc173Smrg          ;;
1713c43cc173Smrg        s390x-*linux*)
1714c43cc173Smrg          LD="${LD-ld} -m elf_s390"
1715c43cc173Smrg          ;;
1716c43cc173Smrg        sparc64-*linux*)
1717c43cc173Smrg          LD="${LD-ld} -m elf32_sparc"
1718c43cc173Smrg          ;;
1719c43cc173Smrg      esac
1720c43cc173Smrg      ;;
1721c43cc173Smrg    *64-bit*)
1722c43cc173Smrg      case $host in
1723c43cc173Smrg        x86_64-*linux*)
1724c43cc173Smrg          LD="${LD-ld} -m elf_x86_64"
1725c43cc173Smrg          ;;
1726c43cc173Smrg        ppc*-*linux*|powerpc*-*linux*)
1727c43cc173Smrg          LD="${LD-ld} -m elf64ppc"
1728c43cc173Smrg          ;;
1729c43cc173Smrg        s390*-*linux*)
1730c43cc173Smrg          LD="${LD-ld} -m elf64_s390"
1731c43cc173Smrg          ;;
1732c43cc173Smrg        sparc*-*linux*)
1733c43cc173Smrg          LD="${LD-ld} -m elf64_sparc"
1734c43cc173Smrg          ;;
1735c43cc173Smrg      esac
1736c43cc173Smrg      ;;
1737c43cc173Smrg    esac
1738c43cc173Smrg  fi
1739c43cc173Smrg  rm -rf conftest*
1740c43cc173Smrg  ;;
1741c43cc173Smrg
1742c43cc173Smrg*-*-sco3.2v5*)
1743c43cc173Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1744c43cc173Smrg  SAVE_CFLAGS="$CFLAGS"
1745c43cc173Smrg  CFLAGS="$CFLAGS -belf"
1746c43cc173Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1747c43cc173Smrg    [AC_LANG_PUSH(C)
1748c43cc173Smrg     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1749c43cc173Smrg     AC_LANG_POP])
1750c43cc173Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1751c43cc173Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1752c43cc173Smrg    CFLAGS="$SAVE_CFLAGS"
1753c43cc173Smrg  fi
1754c43cc173Smrg  ;;
1755c43cc173Smrgsparc*-*solaris*)
1756c43cc173Smrg  # Find out which ABI we are using.
1757c43cc173Smrg  echo 'int i;' > conftest.$ac_ext
1758c43cc173Smrg  if AC_TRY_EVAL(ac_compile); then
1759c43cc173Smrg    case `/usr/bin/file conftest.o` in
1760c43cc173Smrg    *64-bit*)
1761c43cc173Smrg      case $lt_cv_prog_gnu_ld in
1762c43cc173Smrg      yes*) LD="${LD-ld} -m elf64_sparc" ;;
1763c43cc173Smrg      *)    LD="${LD-ld} -64" ;;
1764c43cc173Smrg      esac
1765c43cc173Smrg      ;;
1766c43cc173Smrg    esac
1767c43cc173Smrg  fi
1768c43cc173Smrg  rm -rf conftest*
1769c43cc173Smrg  ;;
1770c43cc173Smrg
1771c43cc173SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
1772c43cc173Smrg[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
1773c43cc173Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1774c43cc173Smrg  AC_CHECK_TOOL(AS, as, false)
1775c43cc173Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
1776c43cc173Smrg  ;;
1777c43cc173Smrg  ])
1778c43cc173Smrgesac
1779c43cc173Smrg
1780c43cc173Smrgneed_locks="$enable_libtool_lock"
1781c43cc173Smrg
1782c43cc173Smrg])# _LT_AC_LOCK
1783c43cc173Smrg
1784c43cc173Smrg
1785c43cc173Smrg# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1786c43cc173Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1787c43cc173Smrg# ----------------------------------------------------------------
1788c43cc173Smrg# Check whether the given compiler option works
1789c43cc173SmrgAC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
1790c43cc173Smrg[AC_REQUIRE([LT_AC_PROG_SED])
1791c43cc173SmrgAC_CACHE_CHECK([$1], [$2],
1792c43cc173Smrg  [$2=no
1793c43cc173Smrg  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1794c43cc173Smrg   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
1795c43cc173Smrg   lt_compiler_flag="$3"
1796c43cc173Smrg   # Insert the option either (1) after the last *FLAGS variable, or
1797c43cc173Smrg   # (2) before a word containing "conftest.", or (3) at the end.
1798c43cc173Smrg   # Note that $ac_compile itself does not contain backslashes and begins
1799c43cc173Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
1800c43cc173Smrg   # The option is referenced via a variable to avoid confusing sed.
1801c43cc173Smrg   lt_compile=`echo "$ac_compile" | $SED \
1802c43cc173Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1803c43cc173Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1804c43cc173Smrg   -e 's:$: $lt_compiler_flag:'`
1805c43cc173Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1806c43cc173Smrg   (eval "$lt_compile" 2>conftest.err)
1807c43cc173Smrg   ac_status=$?
1808c43cc173Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
1809c43cc173Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1810c43cc173Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
1811c43cc173Smrg     # The compiler can only warn and ignore the option if not recognized
1812c43cc173Smrg     # So say no if there are warnings other than the usual output.
1813c43cc173Smrg     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
1814c43cc173Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1815c43cc173Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1816c43cc173Smrg       $2=yes
1817c43cc173Smrg     fi
1818c43cc173Smrg   fi
1819c43cc173Smrg   $rm conftest*
1820c43cc173Smrg])
1821c43cc173Smrg
1822c43cc173Smrgif test x"[$]$2" = xyes; then
1823c43cc173Smrg    ifelse([$5], , :, [$5])
1824c43cc173Smrgelse
1825c43cc173Smrg    ifelse([$6], , :, [$6])
1826c43cc173Smrgfi
1827c43cc173Smrg])# AC_LIBTOOL_COMPILER_OPTION
1828c43cc173Smrg
1829c43cc173Smrg
1830c43cc173Smrg# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1831c43cc173Smrg#                          [ACTION-SUCCESS], [ACTION-FAILURE])
1832c43cc173Smrg# ------------------------------------------------------------
1833c43cc173Smrg# Check whether the given compiler option works
1834c43cc173SmrgAC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
1835c43cc173Smrg[AC_CACHE_CHECK([$1], [$2],
1836c43cc173Smrg  [$2=no
1837c43cc173Smrg   save_LDFLAGS="$LDFLAGS"
1838c43cc173Smrg   LDFLAGS="$LDFLAGS $3"
1839c43cc173Smrg   printf "$lt_simple_link_test_code" > conftest.$ac_ext
1840c43cc173Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1841c43cc173Smrg     # The linker can only warn and ignore the option if not recognized
1842c43cc173Smrg     # So say no if there are warnings
1843c43cc173Smrg     if test -s conftest.err; then
1844c43cc173Smrg       # Append any errors to the config.log.
1845c43cc173Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
1846c43cc173Smrg       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
1847c43cc173Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1848c43cc173Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
1849c43cc173Smrg         $2=yes
1850c43cc173Smrg       fi
1851c43cc173Smrg     else
1852c43cc173Smrg       $2=yes
1853c43cc173Smrg     fi
1854c43cc173Smrg   fi
1855c43cc173Smrg   $rm conftest*
1856c43cc173Smrg   LDFLAGS="$save_LDFLAGS"
1857c43cc173Smrg])
1858c43cc173Smrg
1859c43cc173Smrgif test x"[$]$2" = xyes; then
1860c43cc173Smrg    ifelse([$4], , :, [$4])
1861c43cc173Smrgelse
1862c43cc173Smrg    ifelse([$5], , :, [$5])
1863c43cc173Smrgfi
1864c43cc173Smrg])# AC_LIBTOOL_LINKER_OPTION
1865c43cc173Smrg
1866c43cc173Smrg
1867c43cc173Smrg# AC_LIBTOOL_SYS_MAX_CMD_LEN
1868c43cc173Smrg# --------------------------
1869c43cc173SmrgAC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
1870c43cc173Smrg[# find the maximum length of command line arguments
1871c43cc173SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
1872c43cc173SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1873c43cc173Smrg  i=0
1874c43cc173Smrg  teststring="ABCD"
1875c43cc173Smrg
1876c43cc173Smrg  case $build_os in
1877c43cc173Smrg  msdosdjgpp*)
1878c43cc173Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
1879c43cc173Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
1880c43cc173Smrg    # during glob expansion).  Even if it were fixed, the result of this
1881c43cc173Smrg    # check would be larger than it should be.
1882c43cc173Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
1883c43cc173Smrg    ;;
1884c43cc173Smrg
1885c43cc173Smrg  gnu*)
1886c43cc173Smrg    # Under GNU Hurd, this test is not required because there is
1887c43cc173Smrg    # no limit to the length of command line arguments.
1888c43cc173Smrg    # Libtool will interpret -1 as no limit whatsoever
1889c43cc173Smrg    lt_cv_sys_max_cmd_len=-1;
1890c43cc173Smrg    ;;
1891c43cc173Smrg
1892c43cc173Smrg  cygwin* | mingw*)
1893c43cc173Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
1894c43cc173Smrg    # about 5 minutes as the teststring grows exponentially.
1895c43cc173Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
1896c43cc173Smrg    # you end up with a "frozen" computer, even though with patience
1897c43cc173Smrg    # the test eventually succeeds (with a max line length of 256k).
1898c43cc173Smrg    # Instead, let's just punt: use the minimum linelength reported by
1899c43cc173Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
1900c43cc173Smrg    lt_cv_sys_max_cmd_len=8192;
1901c43cc173Smrg    ;;
1902c43cc173Smrg
1903c43cc173Smrg  amigaos*)
1904c43cc173Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
1905c43cc173Smrg    # So we just punt and use a minimum line length of 8192.
1906c43cc173Smrg    lt_cv_sys_max_cmd_len=8192;
1907c43cc173Smrg    ;;
1908c43cc173Smrg
1909c43cc173Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
1910c43cc173Smrg    # This has been around since 386BSD, at least.  Likely further.
1911c43cc173Smrg    if test -x /sbin/sysctl; then
1912c43cc173Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1913c43cc173Smrg    elif test -x /usr/sbin/sysctl; then
1914c43cc173Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1915c43cc173Smrg    else
1916c43cc173Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
1917c43cc173Smrg    fi
1918c43cc173Smrg    # And add a safety zone
1919c43cc173Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1920c43cc173Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1921c43cc173Smrg    ;;
1922c43cc173Smrg
1923c43cc173Smrg  interix*)
1924c43cc173Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
1925c43cc173Smrg    lt_cv_sys_max_cmd_len=196608
1926c43cc173Smrg    ;;
1927c43cc173Smrg
1928c43cc173Smrg  osf*)
1929c43cc173Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1930c43cc173Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1931c43cc173Smrg    # nice to cause kernel panics so lets avoid the loop below.
1932c43cc173Smrg    # First set a reasonable default.
1933c43cc173Smrg    lt_cv_sys_max_cmd_len=16384
1934c43cc173Smrg    #
1935c43cc173Smrg    if test -x /sbin/sysconfig; then
1936c43cc173Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1937c43cc173Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
1938c43cc173Smrg      esac
1939c43cc173Smrg    fi
1940c43cc173Smrg    ;;
1941c43cc173Smrg  sco3.2v5*)
1942c43cc173Smrg    lt_cv_sys_max_cmd_len=102400
1943c43cc173Smrg    ;;
1944c43cc173Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
1945c43cc173Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1946c43cc173Smrg    if test -n "$kargmax"; then
1947c43cc173Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ 	]]//'`
1948c43cc173Smrg    else
1949c43cc173Smrg      lt_cv_sys_max_cmd_len=32768
1950c43cc173Smrg    fi
1951c43cc173Smrg    ;;
1952c43cc173Smrg  *)
1953c43cc173Smrg    # If test is not a shell built-in, we'll probably end up computing a
1954c43cc173Smrg    # maximum length that is only half of the actual maximum length, but
1955c43cc173Smrg    # we can't tell.
1956c43cc173Smrg    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1957c43cc173Smrg    while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
1958c43cc173Smrg	       = "XX$teststring") >/dev/null 2>&1 &&
1959c43cc173Smrg	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
1960c43cc173Smrg	    lt_cv_sys_max_cmd_len=$new_result &&
1961c43cc173Smrg	    test $i != 17 # 1/2 MB should be enough
1962c43cc173Smrg    do
1963c43cc173Smrg      i=`expr $i + 1`
1964c43cc173Smrg      teststring=$teststring$teststring
1965c43cc173Smrg    done
1966c43cc173Smrg    teststring=
1967c43cc173Smrg    # Add a significant safety factor because C++ compilers can tack on massive
1968c43cc173Smrg    # amounts of additional arguments before passing them to the linker.
1969c43cc173Smrg    # It appears as though 1/2 is a usable value.
1970c43cc173Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1971c43cc173Smrg    ;;
1972c43cc173Smrg  esac
1973c43cc173Smrg])
1974c43cc173Smrgif test -n $lt_cv_sys_max_cmd_len ; then
1975c43cc173Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1976c43cc173Smrgelse
1977c43cc173Smrg  AC_MSG_RESULT(none)
1978c43cc173Smrgfi
1979c43cc173Smrg])# AC_LIBTOOL_SYS_MAX_CMD_LEN
1980c43cc173Smrg
1981c43cc173Smrg
1982c43cc173Smrg# _LT_AC_CHECK_DLFCN
1983c43cc173Smrg# ------------------
1984c43cc173SmrgAC_DEFUN([_LT_AC_CHECK_DLFCN],
1985c43cc173Smrg[AC_CHECK_HEADERS(dlfcn.h)dnl
1986c43cc173Smrg])# _LT_AC_CHECK_DLFCN
1987c43cc173Smrg
1988c43cc173Smrg
1989c43cc173Smrg# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1990c43cc173Smrg#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1991c43cc173Smrg# ---------------------------------------------------------------------
1992c43cc173SmrgAC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
1993c43cc173Smrg[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
1994c43cc173Smrgif test "$cross_compiling" = yes; then :
1995c43cc173Smrg  [$4]
1996c43cc173Smrgelse
1997c43cc173Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1998c43cc173Smrg  lt_status=$lt_dlunknown
1999c43cc173Smrg  cat > conftest.$ac_ext <<EOF
2000c43cc173Smrg[#line __oline__ "configure"
2001c43cc173Smrg#include "confdefs.h"
2002c43cc173Smrg
2003c43cc173Smrg#if HAVE_DLFCN_H
2004c43cc173Smrg#include <dlfcn.h>
2005c43cc173Smrg#endif
2006c43cc173Smrg
2007c43cc173Smrg#include <stdio.h>
2008c43cc173Smrg
2009c43cc173Smrg#ifdef RTLD_GLOBAL
2010c43cc173Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
2011c43cc173Smrg#else
2012c43cc173Smrg#  ifdef DL_GLOBAL
2013c43cc173Smrg#    define LT_DLGLOBAL		DL_GLOBAL
2014c43cc173Smrg#  else
2015c43cc173Smrg#    define LT_DLGLOBAL		0
2016c43cc173Smrg#  endif
2017c43cc173Smrg#endif
2018c43cc173Smrg
2019c43cc173Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
2020c43cc173Smrg   find out it does not work in some platform. */
2021c43cc173Smrg#ifndef LT_DLLAZY_OR_NOW
2022c43cc173Smrg#  ifdef RTLD_LAZY
2023c43cc173Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
2024c43cc173Smrg#  else
2025c43cc173Smrg#    ifdef DL_LAZY
2026c43cc173Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
2027c43cc173Smrg#    else
2028c43cc173Smrg#      ifdef RTLD_NOW
2029c43cc173Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
2030c43cc173Smrg#      else
2031c43cc173Smrg#        ifdef DL_NOW
2032c43cc173Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
2033c43cc173Smrg#        else
2034c43cc173Smrg#          define LT_DLLAZY_OR_NOW	0
2035c43cc173Smrg#        endif
2036c43cc173Smrg#      endif
2037c43cc173Smrg#    endif
2038c43cc173Smrg#  endif
2039c43cc173Smrg#endif
2040c43cc173Smrg
2041c43cc173Smrg#ifdef __cplusplus
2042c43cc173Smrgextern "C" void exit (int);
2043c43cc173Smrg#endif
2044c43cc173Smrg
2045c43cc173Smrgvoid fnord() { int i=42;}
2046c43cc173Smrgint main ()
2047c43cc173Smrg{
2048c43cc173Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
2049c43cc173Smrg  int status = $lt_dlunknown;
2050c43cc173Smrg
2051c43cc173Smrg  if (self)
2052c43cc173Smrg    {
2053c43cc173Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
2054c43cc173Smrg      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
2055c43cc173Smrg      /* dlclose (self); */
2056c43cc173Smrg    }
2057c43cc173Smrg  else
2058c43cc173Smrg    puts (dlerror ());
2059c43cc173Smrg
2060c43cc173Smrg    exit (status);
2061c43cc173Smrg}]
2062c43cc173SmrgEOF
2063c43cc173Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
2064c43cc173Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
2065c43cc173Smrg    lt_status=$?
2066c43cc173Smrg    case x$lt_status in
2067c43cc173Smrg      x$lt_dlno_uscore) $1 ;;
2068c43cc173Smrg      x$lt_dlneed_uscore) $2 ;;
2069c43cc173Smrg      x$lt_dlunknown|x*) $3 ;;
2070c43cc173Smrg    esac
2071c43cc173Smrg  else :
2072c43cc173Smrg    # compilation failed
2073c43cc173Smrg    $3
2074c43cc173Smrg  fi
2075c43cc173Smrgfi
2076c43cc173Smrgrm -fr conftest*
2077c43cc173Smrg])# _LT_AC_TRY_DLOPEN_SELF
2078c43cc173Smrg
2079c43cc173Smrg
2080c43cc173Smrg# AC_LIBTOOL_DLOPEN_SELF
2081c43cc173Smrg# ----------------------
2082c43cc173SmrgAC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
2083c43cc173Smrg[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
2084c43cc173Smrgif test "x$enable_dlopen" != xyes; then
2085c43cc173Smrg  enable_dlopen=unknown
2086c43cc173Smrg  enable_dlopen_self=unknown
2087c43cc173Smrg  enable_dlopen_self_static=unknown
2088c43cc173Smrgelse
2089c43cc173Smrg  lt_cv_dlopen=no
2090c43cc173Smrg  lt_cv_dlopen_libs=
2091c43cc173Smrg
2092c43cc173Smrg  case $host_os in
2093c43cc173Smrg  beos*)
2094c43cc173Smrg    lt_cv_dlopen="load_add_on"
2095c43cc173Smrg    lt_cv_dlopen_libs=
2096c43cc173Smrg    lt_cv_dlopen_self=yes
2097c43cc173Smrg    ;;
2098c43cc173Smrg
2099c43cc173Smrg  mingw* | pw32*)
2100c43cc173Smrg    lt_cv_dlopen="LoadLibrary"
2101c43cc173Smrg    lt_cv_dlopen_libs=
2102c43cc173Smrg   ;;
2103c43cc173Smrg
2104c43cc173Smrg  cygwin*)
2105c43cc173Smrg    lt_cv_dlopen="dlopen"
2106c43cc173Smrg    lt_cv_dlopen_libs=
2107c43cc173Smrg   ;;
2108c43cc173Smrg
2109c43cc173Smrg  darwin*)
2110c43cc173Smrg  # if libdl is installed we need to link against it
2111c43cc173Smrg    AC_CHECK_LIB([dl], [dlopen],
2112c43cc173Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
2113c43cc173Smrg    lt_cv_dlopen="dyld"
2114c43cc173Smrg    lt_cv_dlopen_libs=
2115c43cc173Smrg    lt_cv_dlopen_self=yes
2116c43cc173Smrg    ])
2117c43cc173Smrg   ;;
2118c43cc173Smrg
2119c43cc173Smrg  *)
2120c43cc173Smrg    AC_CHECK_FUNC([shl_load],
2121c43cc173Smrg	  [lt_cv_dlopen="shl_load"],
2122c43cc173Smrg      [AC_CHECK_LIB([dld], [shl_load],
2123c43cc173Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
2124c43cc173Smrg	[AC_CHECK_FUNC([dlopen],
2125c43cc173Smrg	      [lt_cv_dlopen="dlopen"],
2126c43cc173Smrg	  [AC_CHECK_LIB([dl], [dlopen],
2127c43cc173Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
2128c43cc173Smrg	    [AC_CHECK_LIB([svld], [dlopen],
2129c43cc173Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
2130c43cc173Smrg	      [AC_CHECK_LIB([dld], [dld_link],
2131c43cc173Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
2132c43cc173Smrg	      ])
2133c43cc173Smrg	    ])
2134c43cc173Smrg	  ])
2135c43cc173Smrg	])
2136c43cc173Smrg      ])
2137c43cc173Smrg    ;;
2138c43cc173Smrg  esac
2139c43cc173Smrg
2140c43cc173Smrg  if test "x$lt_cv_dlopen" != xno; then
2141c43cc173Smrg    enable_dlopen=yes
2142c43cc173Smrg  else
2143c43cc173Smrg    enable_dlopen=no
2144c43cc173Smrg  fi
2145c43cc173Smrg
2146c43cc173Smrg  case $lt_cv_dlopen in
2147c43cc173Smrg  dlopen)
2148c43cc173Smrg    save_CPPFLAGS="$CPPFLAGS"
2149c43cc173Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2150c43cc173Smrg
2151c43cc173Smrg    save_LDFLAGS="$LDFLAGS"
2152c43cc173Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2153c43cc173Smrg
2154c43cc173Smrg    save_LIBS="$LIBS"
2155c43cc173Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
2156c43cc173Smrg
2157c43cc173Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
2158c43cc173Smrg	  lt_cv_dlopen_self, [dnl
2159c43cc173Smrg	  _LT_AC_TRY_DLOPEN_SELF(
2160c43cc173Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
2161c43cc173Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
2162c43cc173Smrg    ])
2163c43cc173Smrg
2164c43cc173Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
2165c43cc173Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
2166c43cc173Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
2167c43cc173Smrg    	  lt_cv_dlopen_self_static, [dnl
2168c43cc173Smrg	  _LT_AC_TRY_DLOPEN_SELF(
2169c43cc173Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
2170c43cc173Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
2171c43cc173Smrg      ])
2172c43cc173Smrg    fi
2173c43cc173Smrg
2174c43cc173Smrg    CPPFLAGS="$save_CPPFLAGS"
2175c43cc173Smrg    LDFLAGS="$save_LDFLAGS"
2176c43cc173Smrg    LIBS="$save_LIBS"
2177c43cc173Smrg    ;;
2178c43cc173Smrg  esac
2179c43cc173Smrg
2180c43cc173Smrg  case $lt_cv_dlopen_self in
2181c43cc173Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2182c43cc173Smrg  *) enable_dlopen_self=unknown ;;
2183c43cc173Smrg  esac
2184c43cc173Smrg
2185c43cc173Smrg  case $lt_cv_dlopen_self_static in
2186c43cc173Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2187c43cc173Smrg  *) enable_dlopen_self_static=unknown ;;
2188c43cc173Smrg  esac
2189c43cc173Smrgfi
2190c43cc173Smrg])# AC_LIBTOOL_DLOPEN_SELF
2191c43cc173Smrg
2192c43cc173Smrg
2193c43cc173Smrg# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
2194c43cc173Smrg# ---------------------------------
2195c43cc173Smrg# Check to see if options -c and -o are simultaneously supported by compiler
2196c43cc173SmrgAC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
2197c43cc173Smrg[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
2198c43cc173SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
2199c43cc173Smrg  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
2200c43cc173Smrg  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
2201c43cc173Smrg   $rm -r conftest 2>/dev/null
2202c43cc173Smrg   mkdir conftest
2203c43cc173Smrg   cd conftest
2204c43cc173Smrg   mkdir out
2205c43cc173Smrg   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
2206c43cc173Smrg
2207c43cc173Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
2208c43cc173Smrg   # Insert the option either (1) after the last *FLAGS variable, or
2209c43cc173Smrg   # (2) before a word containing "conftest.", or (3) at the end.
2210c43cc173Smrg   # Note that $ac_compile itself does not contain backslashes and begins
2211c43cc173Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
2212c43cc173Smrg   lt_compile=`echo "$ac_compile" | $SED \
2213c43cc173Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2214c43cc173Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2215c43cc173Smrg   -e 's:$: $lt_compiler_flag:'`
2216c43cc173Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2217c43cc173Smrg   (eval "$lt_compile" 2>out/conftest.err)
2218c43cc173Smrg   ac_status=$?
2219c43cc173Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
2220c43cc173Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2221c43cc173Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
2222c43cc173Smrg   then
2223c43cc173Smrg     # The compiler can only warn and ignore the option if not recognized
2224c43cc173Smrg     # So say no if there are warnings
2225c43cc173Smrg     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
2226c43cc173Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
2227c43cc173Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
2228c43cc173Smrg       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
2229c43cc173Smrg     fi
2230c43cc173Smrg   fi
2231c43cc173Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
2232c43cc173Smrg   $rm conftest*
2233c43cc173Smrg   # SGI C++ compiler will create directory out/ii_files/ for
2234c43cc173Smrg   # template instantiation
2235c43cc173Smrg   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
2236c43cc173Smrg   $rm out/* && rmdir out
2237c43cc173Smrg   cd ..
2238c43cc173Smrg   rmdir conftest
2239c43cc173Smrg   $rm conftest*
2240c43cc173Smrg])
2241c43cc173Smrg])# AC_LIBTOOL_PROG_CC_C_O
2242c43cc173Smrg
2243c43cc173Smrg
2244c43cc173Smrg# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
2245c43cc173Smrg# -----------------------------------------
2246c43cc173Smrg# Check to see if we can do hard links to lock some files if needed
2247c43cc173SmrgAC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
2248c43cc173Smrg[AC_REQUIRE([_LT_AC_LOCK])dnl
2249c43cc173Smrg
2250c43cc173Smrghard_links="nottested"
2251c43cc173Smrgif test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
2252c43cc173Smrg  # do not overwrite the value of need_locks provided by the user
2253c43cc173Smrg  AC_MSG_CHECKING([if we can lock with hard links])
2254c43cc173Smrg  hard_links=yes
2255c43cc173Smrg  $rm conftest*
2256c43cc173Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2257c43cc173Smrg  touch conftest.a
2258c43cc173Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
2259c43cc173Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2260c43cc173Smrg  AC_MSG_RESULT([$hard_links])
2261c43cc173Smrg  if test "$hard_links" = no; then
2262c43cc173Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
2263c43cc173Smrg    need_locks=warn
2264c43cc173Smrg  fi
2265c43cc173Smrgelse
2266c43cc173Smrg  need_locks=no
2267c43cc173Smrgfi
2268c43cc173Smrg])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
2269c43cc173Smrg
2270c43cc173Smrg
2271c43cc173Smrg# AC_LIBTOOL_OBJDIR
2272c43cc173Smrg# -----------------
2273c43cc173SmrgAC_DEFUN([AC_LIBTOOL_OBJDIR],
2274c43cc173Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
2275c43cc173Smrg[rm -f .libs 2>/dev/null
2276c43cc173Smrgmkdir .libs 2>/dev/null
2277c43cc173Smrgif test -d .libs; then
2278c43cc173Smrg  lt_cv_objdir=.libs
2279c43cc173Smrgelse
2280c43cc173Smrg  # MS-DOS does not allow filenames that begin with a dot.
2281c43cc173Smrg  lt_cv_objdir=_libs
2282c43cc173Smrgfi
2283c43cc173Smrgrmdir .libs 2>/dev/null])
2284c43cc173Smrgobjdir=$lt_cv_objdir
2285c43cc173Smrg])# AC_LIBTOOL_OBJDIR
2286c43cc173Smrg
2287c43cc173Smrg
2288c43cc173Smrg# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
2289c43cc173Smrg# ----------------------------------------------
2290c43cc173Smrg# Check hardcoding attributes.
2291c43cc173SmrgAC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
2292c43cc173Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
2293c43cc173Smrg_LT_AC_TAGVAR(hardcode_action, $1)=
2294c43cc173Smrgif test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
2295c43cc173Smrg   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
2296c43cc173Smrg   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
2297c43cc173Smrg
2298c43cc173Smrg  # We can hardcode non-existant directories.
2299c43cc173Smrg  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
2300c43cc173Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
2301c43cc173Smrg     # have to relink, otherwise we might link with an installed library
2302c43cc173Smrg     # when we should be linking with a yet-to-be-installed one
2303c43cc173Smrg     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
2304c43cc173Smrg     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
2305c43cc173Smrg    # Linking always hardcodes the temporary library directory.
2306c43cc173Smrg    _LT_AC_TAGVAR(hardcode_action, $1)=relink
2307c43cc173Smrg  else
2308c43cc173Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
2309c43cc173Smrg    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
2310c43cc173Smrg  fi
2311c43cc173Smrgelse
2312c43cc173Smrg  # We cannot hardcode anything, or else we can only hardcode existing
2313c43cc173Smrg  # directories.
2314c43cc173Smrg  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
2315c43cc173Smrgfi
2316c43cc173SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
2317c43cc173Smrg
2318c43cc173Smrgif test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
2319c43cc173Smrg  # Fast installation is not supported
2320c43cc173Smrg  enable_fast_install=no
2321c43cc173Smrgelif test "$shlibpath_overrides_runpath" = yes ||
2322c43cc173Smrg     test "$enable_shared" = no; then
2323c43cc173Smrg  # Fast installation is not necessary
2324c43cc173Smrg  enable_fast_install=needless
2325c43cc173Smrgfi
2326c43cc173Smrg])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
2327c43cc173Smrg
2328c43cc173Smrg
2329c43cc173Smrg# AC_LIBTOOL_SYS_LIB_STRIP
2330c43cc173Smrg# ------------------------
2331c43cc173SmrgAC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
2332c43cc173Smrg[striplib=
2333c43cc173Smrgold_striplib=
2334c43cc173SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
2335c43cc173Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
2336c43cc173Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2337c43cc173Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2338c43cc173Smrg  AC_MSG_RESULT([yes])
2339c43cc173Smrgelse
2340c43cc173Smrg# FIXME - insert some real tests, host_os isn't really good enough
2341c43cc173Smrg  case $host_os in
2342c43cc173Smrg   darwin*)
2343c43cc173Smrg       if test -n "$STRIP" ; then
2344c43cc173Smrg         striplib="$STRIP -x"
2345c43cc173Smrg         AC_MSG_RESULT([yes])
2346c43cc173Smrg       else
2347c43cc173Smrg  AC_MSG_RESULT([no])
2348c43cc173Smrgfi
2349c43cc173Smrg       ;;
2350c43cc173Smrg   *)
2351c43cc173Smrg  AC_MSG_RESULT([no])
2352c43cc173Smrg    ;;
2353c43cc173Smrg  esac
2354c43cc173Smrgfi
2355c43cc173Smrg])# AC_LIBTOOL_SYS_LIB_STRIP
2356c43cc173Smrg
2357c43cc173Smrg
2358c43cc173Smrg# AC_LIBTOOL_SYS_DYNAMIC_LINKER
2359c43cc173Smrg# -----------------------------
2360c43cc173Smrg# PORTME Fill in your ld.so characteristics
2361c43cc173SmrgAC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
2362c43cc173Smrg[AC_MSG_CHECKING([dynamic linker characteristics])
2363c43cc173Smrglibrary_names_spec=
2364c43cc173Smrglibname_spec='lib$name'
2365c43cc173Smrgsoname_spec=
2366c43cc173Smrgshrext_cmds=".so"
2367c43cc173Smrgpostinstall_cmds=
2368c43cc173Smrgpostuninstall_cmds=
2369c43cc173Smrgfinish_cmds=
2370c43cc173Smrgfinish_eval=
2371c43cc173Smrgshlibpath_var=
2372c43cc173Smrgshlibpath_overrides_runpath=unknown
2373c43cc173Smrgversion_type=none
2374c43cc173Smrgdynamic_linker="$host_os ld.so"
2375c43cc173Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
2376c43cc173Smrgif test "$GCC" = yes; then
2377c43cc173Smrg  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
2378c43cc173Smrg  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
2379c43cc173Smrg    # if the path contains ";" then we assume it to be the separator
2380c43cc173Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
2381c43cc173Smrg    # assumed that no part of a normal pathname contains ";" but that should
2382c43cc173Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
2383c43cc173Smrg    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2384c43cc173Smrg  else
2385c43cc173Smrg    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
2386c43cc173Smrg  fi
2387c43cc173Smrgelse
2388c43cc173Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2389c43cc173Smrgfi
2390c43cc173Smrgneed_lib_prefix=unknown
2391c43cc173Smrghardcode_into_libs=no
2392c43cc173Smrg
2393c43cc173Smrg# when you set need_version to no, make sure it does not cause -set_version
2394c43cc173Smrg# flags to be left without arguments
2395c43cc173Smrgneed_version=unknown
2396c43cc173Smrg
2397c43cc173Smrgcase $host_os in
2398c43cc173Smrgaix3*)
2399c43cc173Smrg  version_type=linux
2400c43cc173Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
2401c43cc173Smrg  shlibpath_var=LIBPATH
2402c43cc173Smrg
2403c43cc173Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
2404c43cc173Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2405c43cc173Smrg  ;;
2406c43cc173Smrg
2407c43cc173Smrgaix4* | aix5*)
2408c43cc173Smrg  version_type=linux
2409c43cc173Smrg  need_lib_prefix=no
2410c43cc173Smrg  need_version=no
2411c43cc173Smrg  hardcode_into_libs=yes
2412c43cc173Smrg  if test "$host_cpu" = ia64; then
2413c43cc173Smrg    # AIX 5 supports IA64
2414c43cc173Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
2415c43cc173Smrg    shlibpath_var=LD_LIBRARY_PATH
2416c43cc173Smrg  else
2417c43cc173Smrg    # With GCC up to 2.95.x, collect2 would create an import file
2418c43cc173Smrg    # for dependence libraries.  The import file would start with
2419c43cc173Smrg    # the line `#! .'.  This would cause the generated library to
2420c43cc173Smrg    # depend on `.', always an invalid library.  This was fixed in
2421c43cc173Smrg    # development snapshots of GCC prior to 3.0.
2422c43cc173Smrg    case $host_os in
2423c43cc173Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
2424c43cc173Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2425c43cc173Smrg	   echo ' yes '
2426c43cc173Smrg	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
2427c43cc173Smrg	:
2428c43cc173Smrg      else
2429c43cc173Smrg	can_build_shared=no
2430c43cc173Smrg      fi
2431c43cc173Smrg      ;;
2432c43cc173Smrg    esac
2433c43cc173Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
2434c43cc173Smrg    # soname into executable. Probably we can add versioning support to
2435c43cc173Smrg    # collect2, so additional links can be useful in future.
2436c43cc173Smrg    if test "$aix_use_runtimelinking" = yes; then
2437c43cc173Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2438c43cc173Smrg      # instead of lib<name>.a to let people know that these are not
2439c43cc173Smrg      # typical AIX shared libraries.
2440c43cc173Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2441c43cc173Smrg    else
2442c43cc173Smrg      # We preserve .a as extension for shared libraries through AIX4.2
2443c43cc173Smrg      # and later when we are not doing run time linking.
2444c43cc173Smrg      library_names_spec='${libname}${release}.a $libname.a'
2445c43cc173Smrg      soname_spec='${libname}${release}${shared_ext}$major'
2446c43cc173Smrg    fi
2447c43cc173Smrg    shlibpath_var=LIBPATH
2448c43cc173Smrg  fi
2449c43cc173Smrg  ;;
2450c43cc173Smrg
2451c43cc173Smrgamigaos*)
2452c43cc173Smrg  library_names_spec='$libname.ixlibrary $libname.a'
2453c43cc173Smrg  # Create ${libname}_ixlibrary.a entries in /sys/libs.
2454c43cc173Smrg  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'
2455c43cc173Smrg  ;;
2456c43cc173Smrg
2457c43cc173Smrgbeos*)
2458c43cc173Smrg  library_names_spec='${libname}${shared_ext}'
2459c43cc173Smrg  dynamic_linker="$host_os ld.so"
2460c43cc173Smrg  shlibpath_var=LIBRARY_PATH
2461c43cc173Smrg  ;;
2462c43cc173Smrg
2463c43cc173Smrgbsdi[[45]]*)
2464c43cc173Smrg  version_type=linux
2465c43cc173Smrg  need_version=no
2466c43cc173Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2467c43cc173Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2468c43cc173Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2469c43cc173Smrg  shlibpath_var=LD_LIBRARY_PATH
2470c43cc173Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2471c43cc173Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2472c43cc173Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
2473c43cc173Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2474c43cc173Smrg  # libtool to hard-code these into programs
2475c43cc173Smrg  ;;
2476c43cc173Smrg
2477c43cc173Smrgcygwin* | mingw* | pw32*)
2478c43cc173Smrg  version_type=windows
2479c43cc173Smrg  shrext_cmds=".dll"
2480c43cc173Smrg  need_version=no
2481c43cc173Smrg  need_lib_prefix=no
2482c43cc173Smrg
2483c43cc173Smrg  case $GCC,$host_os in
2484c43cc173Smrg  yes,cygwin* | yes,mingw* | yes,pw32*)
2485c43cc173Smrg    library_names_spec='$libname.dll.a'
2486c43cc173Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2487c43cc173Smrg    postinstall_cmds='base_file=`basename \${file}`~
2488c43cc173Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
2489c43cc173Smrg      dldir=$destdir/`dirname \$dlpath`~
2490c43cc173Smrg      test -d \$dldir || mkdir -p \$dldir~
2491c43cc173Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
2492c43cc173Smrg      chmod a+x \$dldir/$dlname'
2493c43cc173Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2494c43cc173Smrg      dlpath=$dir/\$dldll~
2495c43cc173Smrg       $rm \$dlpath'
2496c43cc173Smrg    shlibpath_overrides_runpath=yes
2497c43cc173Smrg
2498c43cc173Smrg    case $host_os in
2499c43cc173Smrg    cygwin*)
2500c43cc173Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2501c43cc173Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2502c43cc173Smrg      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
2503c43cc173Smrg      ;;
2504c43cc173Smrg    mingw*)
2505c43cc173Smrg      # MinGW DLLs use traditional 'lib' prefix
2506c43cc173Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2507c43cc173Smrg      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
2508c43cc173Smrg      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
2509c43cc173Smrg        # It is most probably a Windows format PATH printed by
2510c43cc173Smrg        # mingw gcc, but we are running on Cygwin. Gcc prints its search
2511c43cc173Smrg        # path with ; separators, and with drive letters. We can handle the
2512c43cc173Smrg        # drive letters (cygwin fileutils understands them), so leave them,
2513c43cc173Smrg        # especially as we might pass files found there to a mingw objdump,
2514c43cc173Smrg        # which wouldn't understand a cygwinified path. Ahh.
2515c43cc173Smrg        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2516c43cc173Smrg      else
2517c43cc173Smrg        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
2518c43cc173Smrg      fi
2519c43cc173Smrg      ;;
2520c43cc173Smrg    pw32*)
2521c43cc173Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
2522c43cc173Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2523c43cc173Smrg      ;;
2524c43cc173Smrg    esac
2525c43cc173Smrg    ;;
2526c43cc173Smrg
2527c43cc173Smrg  *)
2528c43cc173Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
2529c43cc173Smrg    ;;
2530c43cc173Smrg  esac
2531c43cc173Smrg  dynamic_linker='Win32 ld.exe'
2532c43cc173Smrg  # FIXME: first we should search . and the directory the executable is in
2533c43cc173Smrg  shlibpath_var=PATH
2534c43cc173Smrg  ;;
2535c43cc173Smrg
2536c43cc173Smrgdarwin* | rhapsody*)
2537c43cc173Smrg  dynamic_linker="$host_os dyld"
2538c43cc173Smrg  version_type=darwin
2539c43cc173Smrg  need_lib_prefix=no
2540c43cc173Smrg  need_version=no
2541c43cc173Smrg  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
2542c43cc173Smrg  soname_spec='${libname}${release}${major}$shared_ext'
2543c43cc173Smrg  shlibpath_overrides_runpath=yes
2544c43cc173Smrg  shlibpath_var=DYLD_LIBRARY_PATH
2545c43cc173Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2546c43cc173Smrg  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
2547c43cc173Smrg  if test "$GCC" = yes; then
2548c43cc173Smrg    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
2549c43cc173Smrg  else
2550c43cc173Smrg    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
2551c43cc173Smrg  fi
2552c43cc173Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2553c43cc173Smrg  ;;
2554c43cc173Smrg
2555c43cc173Smrgdgux*)
2556c43cc173Smrg  version_type=linux
2557c43cc173Smrg  need_lib_prefix=no
2558c43cc173Smrg  need_version=no
2559c43cc173Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
2560c43cc173Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2561c43cc173Smrg  shlibpath_var=LD_LIBRARY_PATH
2562c43cc173Smrg  ;;
2563c43cc173Smrg
2564c43cc173Smrgfreebsd1*)
2565c43cc173Smrg  dynamic_linker=no
2566c43cc173Smrg  ;;
2567c43cc173Smrg
2568c43cc173Smrgkfreebsd*-gnu)
2569c43cc173Smrg  version_type=linux
2570c43cc173Smrg  need_lib_prefix=no
2571c43cc173Smrg  need_version=no
2572c43cc173Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2573c43cc173Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2574c43cc173Smrg  shlibpath_var=LD_LIBRARY_PATH
2575c43cc173Smrg  shlibpath_overrides_runpath=no
2576c43cc173Smrg  hardcode_into_libs=yes
2577c43cc173Smrg  dynamic_linker='GNU ld.so'
2578c43cc173Smrg  ;;
2579c43cc173Smrg
2580c43cc173Smrgfreebsd* | dragonfly*)
2581c43cc173Smrg  # DragonFly does not have aout.  When/if they implement a new
2582c43cc173Smrg  # versioning mechanism, adjust this.
2583c43cc173Smrg  if test -x /usr/bin/objformat; then
2584c43cc173Smrg    objformat=`/usr/bin/objformat`
2585c43cc173Smrg  else
2586c43cc173Smrg    case $host_os in
2587c43cc173Smrg    freebsd[[123]]*) objformat=aout ;;
2588c43cc173Smrg    *) objformat=elf ;;
2589c43cc173Smrg    esac
2590c43cc173Smrg  fi
2591c43cc173Smrg  version_type=freebsd-$objformat
2592c43cc173Smrg  case $version_type in
2593c43cc173Smrg    freebsd-elf*)
2594c43cc173Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2595c43cc173Smrg      need_version=no
2596c43cc173Smrg      need_lib_prefix=no
2597c43cc173Smrg      ;;
2598c43cc173Smrg    freebsd-*)
2599c43cc173Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
2600c43cc173Smrg      need_version=yes
2601c43cc173Smrg      ;;
2602c43cc173Smrg  esac
2603c43cc173Smrg  shlibpath_var=LD_LIBRARY_PATH
2604c43cc173Smrg  case $host_os in
2605c43cc173Smrg  freebsd2*)
2606c43cc173Smrg    shlibpath_overrides_runpath=yes
2607c43cc173Smrg    ;;
2608c43cc173Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2609c43cc173Smrg    shlibpath_overrides_runpath=yes
2610c43cc173Smrg    hardcode_into_libs=yes
2611c43cc173Smrg    ;;
2612c43cc173Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2613c43cc173Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2614c43cc173Smrg    shlibpath_overrides_runpath=no
2615c43cc173Smrg    hardcode_into_libs=yes
2616c43cc173Smrg    ;;
2617c43cc173Smrg  freebsd*) # from 4.6 on
2618c43cc173Smrg    shlibpath_overrides_runpath=yes
2619c43cc173Smrg    hardcode_into_libs=yes
2620c43cc173Smrg    ;;
2621c43cc173Smrg  esac
2622c43cc173Smrg  ;;
2623c43cc173Smrg
2624c43cc173Smrggnu*)
2625c43cc173Smrg  version_type=linux
2626c43cc173Smrg  need_lib_prefix=no
2627c43cc173Smrg  need_version=no
2628c43cc173Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2629c43cc173Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2630c43cc173Smrg  shlibpath_var=LD_LIBRARY_PATH
2631c43cc173Smrg  hardcode_into_libs=yes
2632c43cc173Smrg  ;;
2633c43cc173Smrg
2634c43cc173Smrghpux9* | hpux10* | hpux11*)
2635c43cc173Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
2636c43cc173Smrg  # link against other versions.
2637c43cc173Smrg  version_type=sunos
2638c43cc173Smrg  need_lib_prefix=no
2639c43cc173Smrg  need_version=no
2640c43cc173Smrg  case $host_cpu in
2641c43cc173Smrg  ia64*)
2642c43cc173Smrg    shrext_cmds='.so'
2643c43cc173Smrg    hardcode_into_libs=yes
2644c43cc173Smrg    dynamic_linker="$host_os dld.so"
2645c43cc173Smrg    shlibpath_var=LD_LIBRARY_PATH
2646c43cc173Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2647c43cc173Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2648c43cc173Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2649c43cc173Smrg    if test "X$HPUX_IA64_MODE" = X32; then
2650c43cc173Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2651c43cc173Smrg    else
2652c43cc173Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2653c43cc173Smrg    fi
2654c43cc173Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2655c43cc173Smrg    ;;
2656c43cc173Smrg   hppa*64*)
2657c43cc173Smrg     shrext_cmds='.sl'
2658c43cc173Smrg     hardcode_into_libs=yes
2659c43cc173Smrg     dynamic_linker="$host_os dld.sl"
2660c43cc173Smrg     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2661c43cc173Smrg     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2662c43cc173Smrg     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2663c43cc173Smrg     soname_spec='${libname}${release}${shared_ext}$major'
2664c43cc173Smrg     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2665c43cc173Smrg     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2666c43cc173Smrg     ;;
2667c43cc173Smrg   *)
2668c43cc173Smrg    shrext_cmds='.sl'
2669c43cc173Smrg    dynamic_linker="$host_os dld.sl"
2670c43cc173Smrg    shlibpath_var=SHLIB_PATH
2671c43cc173Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2672c43cc173Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2673c43cc173Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2674c43cc173Smrg    ;;
2675c43cc173Smrg  esac
2676c43cc173Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555.
2677c43cc173Smrg  postinstall_cmds='chmod 555 $lib'
2678c43cc173Smrg  ;;
2679c43cc173Smrg
2680c43cc173Smrginterix3*)
2681c43cc173Smrg  version_type=linux
2682c43cc173Smrg  need_lib_prefix=no
2683c43cc173Smrg  need_version=no
2684c43cc173Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2685c43cc173Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2686c43cc173Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2687c43cc173Smrg  shlibpath_var=LD_LIBRARY_PATH
2688c43cc173Smrg  shlibpath_overrides_runpath=no
2689c43cc173Smrg  hardcode_into_libs=yes
2690c43cc173Smrg  ;;
2691c43cc173Smrg
2692c43cc173Smrgirix5* | irix6* | nonstopux*)
2693c43cc173Smrg  case $host_os in
2694c43cc173Smrg    nonstopux*) version_type=nonstopux ;;
2695c43cc173Smrg    *)
2696c43cc173Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
2697c43cc173Smrg		version_type=linux
2698c43cc173Smrg	else
2699c43cc173Smrg		version_type=irix
2700c43cc173Smrg	fi ;;
2701c43cc173Smrg  esac
2702c43cc173Smrg  need_lib_prefix=no
2703c43cc173Smrg  need_version=no
2704c43cc173Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2705c43cc173Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
2706c43cc173Smrg  case $host_os in
2707c43cc173Smrg  irix5* | nonstopux*)
2708c43cc173Smrg    libsuff= shlibsuff=
2709c43cc173Smrg    ;;
2710c43cc173Smrg  *)
2711c43cc173Smrg    case $LD in # libtool.m4 will add one of these switches to LD
2712c43cc173Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2713c43cc173Smrg      libsuff= shlibsuff= libmagic=32-bit;;
2714c43cc173Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2715c43cc173Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
2716c43cc173Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2717c43cc173Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
2718c43cc173Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
2719c43cc173Smrg    esac
2720c43cc173Smrg    ;;
2721c43cc173Smrg  esac
2722c43cc173Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2723c43cc173Smrg  shlibpath_overrides_runpath=no
2724c43cc173Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2725c43cc173Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2726c43cc173Smrg  hardcode_into_libs=yes
2727c43cc173Smrg  ;;
2728c43cc173Smrg
2729c43cc173Smrg# No shared lib support for Linux oldld, aout, or coff.
2730c43cc173Smrglinux*oldld* | linux*aout* | linux*coff*)
2731c43cc173Smrg  dynamic_linker=no
2732c43cc173Smrg  ;;
2733c43cc173Smrg
2734c43cc173Smrg# This must be Linux ELF.
2735c43cc173Smrglinux*)
2736c43cc173Smrg  version_type=linux
2737c43cc173Smrg  need_lib_prefix=no
2738c43cc173Smrg  need_version=no
2739c43cc173Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2740c43cc173Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2741c43cc173Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2742c43cc173Smrg  shlibpath_var=LD_LIBRARY_PATH
2743c43cc173Smrg  shlibpath_overrides_runpath=no
2744c43cc173Smrg  # This implies no fast_install, which is unacceptable.
2745c43cc173Smrg  # Some rework will be needed to allow for fast_install
2746c43cc173Smrg  # before this can be enabled.
2747c43cc173Smrg  hardcode_into_libs=yes
2748c43cc173Smrg
2749c43cc173Smrg  # Append ld.so.conf contents to the search path
2750c43cc173Smrg  if test -f /etc/ld.so.conf; then
2751c43cc173Smrg    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
2752c43cc173Smrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
2753c43cc173Smrg  fi
2754c43cc173Smrg
2755c43cc173Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
2756c43cc173Smrg  # powerpc, because MkLinux only supported shared libraries with the
2757c43cc173Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
2758c43cc173Smrg  # most powerpc-linux boxes support dynamic linking these days and
2759c43cc173Smrg  # people can always --disable-shared, the test was removed, and we
2760c43cc173Smrg  # assume the GNU/Linux dynamic linker is in use.
2761c43cc173Smrg  dynamic_linker='GNU/Linux ld.so'
2762c43cc173Smrg  ;;
2763c43cc173Smrg
2764c43cc173Smrgknetbsd*-gnu)
2765c43cc173Smrg  version_type=linux
2766c43cc173Smrg  need_lib_prefix=no
2767c43cc173Smrg  need_version=no
2768c43cc173Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2769c43cc173Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2770c43cc173Smrg  shlibpath_var=LD_LIBRARY_PATH
2771c43cc173Smrg  shlibpath_overrides_runpath=no
2772c43cc173Smrg  hardcode_into_libs=yes
2773c43cc173Smrg  dynamic_linker='GNU ld.so'
2774c43cc173Smrg  ;;
2775c43cc173Smrg
2776c43cc173Smrgnetbsd*)
2777c43cc173Smrg  version_type=sunos
2778c43cc173Smrg  need_lib_prefix=no
2779c43cc173Smrg  need_version=no
2780c43cc173Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
2781c43cc173Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2782c43cc173Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2783c43cc173Smrg    dynamic_linker='NetBSD (a.out) ld.so'
2784c43cc173Smrg  else
2785c43cc173Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2786c43cc173Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2787c43cc173Smrg    dynamic_linker='NetBSD ld.elf_so'
2788c43cc173Smrg  fi
2789c43cc173Smrg  shlibpath_var=LD_LIBRARY_PATH
2790c43cc173Smrg  shlibpath_overrides_runpath=yes
2791c43cc173Smrg  hardcode_into_libs=yes
2792c43cc173Smrg  ;;
2793c43cc173Smrg
2794c43cc173Smrgnewsos6)
2795c43cc173Smrg  version_type=linux
2796c43cc173Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2797c43cc173Smrg  shlibpath_var=LD_LIBRARY_PATH
2798c43cc173Smrg  shlibpath_overrides_runpath=yes
2799c43cc173Smrg  ;;
2800c43cc173Smrg
2801c43cc173Smrgnto-qnx*)
2802c43cc173Smrg  version_type=linux
2803c43cc173Smrg  need_lib_prefix=no
2804c43cc173Smrg  need_version=no
2805c43cc173Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2806c43cc173Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2807c43cc173Smrg  shlibpath_var=LD_LIBRARY_PATH
2808c43cc173Smrg  shlibpath_overrides_runpath=yes
2809c43cc173Smrg  ;;
2810c43cc173Smrg
2811c43cc173Smrgopenbsd*)
2812c43cc173Smrg  version_type=sunos
2813c43cc173Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
2814c43cc173Smrg  need_lib_prefix=no
2815c43cc173Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
2816c43cc173Smrg  case $host_os in
2817c43cc173Smrg    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
2818c43cc173Smrg    *)                         need_version=no  ;;
2819c43cc173Smrg  esac
2820c43cc173Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2821c43cc173Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2822c43cc173Smrg  shlibpath_var=LD_LIBRARY_PATH
2823c43cc173Smrg  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2824c43cc173Smrg    case $host_os in
2825c43cc173Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
2826c43cc173Smrg	shlibpath_overrides_runpath=no
2827c43cc173Smrg	;;
2828c43cc173Smrg      *)
2829c43cc173Smrg	shlibpath_overrides_runpath=yes
2830c43cc173Smrg	;;
2831c43cc173Smrg      esac
2832c43cc173Smrg  else
2833c43cc173Smrg    shlibpath_overrides_runpath=yes
2834c43cc173Smrg  fi
2835c43cc173Smrg  ;;
2836c43cc173Smrg
2837c43cc173Smrgos2*)
2838c43cc173Smrg  libname_spec='$name'
2839c43cc173Smrg  shrext_cmds=".dll"
2840c43cc173Smrg  need_lib_prefix=no
2841c43cc173Smrg  library_names_spec='$libname${shared_ext} $libname.a'
2842c43cc173Smrg  dynamic_linker='OS/2 ld.exe'
2843c43cc173Smrg  shlibpath_var=LIBPATH
2844c43cc173Smrg  ;;
2845c43cc173Smrg
2846c43cc173Smrgosf3* | osf4* | osf5*)
2847c43cc173Smrg  version_type=osf
2848c43cc173Smrg  need_lib_prefix=no
2849c43cc173Smrg  need_version=no
2850c43cc173Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2851c43cc173Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2852c43cc173Smrg  shlibpath_var=LD_LIBRARY_PATH
2853c43cc173Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2854c43cc173Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2855c43cc173Smrg  ;;
2856c43cc173Smrg
2857c43cc173Smrgsolaris*)
2858c43cc173Smrg  version_type=linux
2859c43cc173Smrg  need_lib_prefix=no
2860c43cc173Smrg  need_version=no
2861c43cc173Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2862c43cc173Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2863c43cc173Smrg  shlibpath_var=LD_LIBRARY_PATH
2864c43cc173Smrg  shlibpath_overrides_runpath=yes
2865c43cc173Smrg  hardcode_into_libs=yes
2866c43cc173Smrg  # ldd complains unless libraries are executable
2867c43cc173Smrg  postinstall_cmds='chmod +x $lib'
2868c43cc173Smrg  ;;
2869c43cc173Smrg
2870c43cc173Smrgsunos4*)
2871c43cc173Smrg  version_type=sunos
2872c43cc173Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2873c43cc173Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2874c43cc173Smrg  shlibpath_var=LD_LIBRARY_PATH
2875c43cc173Smrg  shlibpath_overrides_runpath=yes
2876c43cc173Smrg  if test "$with_gnu_ld" = yes; then
2877c43cc173Smrg    need_lib_prefix=no
2878c43cc173Smrg  fi
2879c43cc173Smrg  need_version=yes
2880c43cc173Smrg  ;;
2881c43cc173Smrg
2882c43cc173Smrgsysv4 | sysv4.3*)
2883c43cc173Smrg  version_type=linux
2884c43cc173Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2885c43cc173Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2886c43cc173Smrg  shlibpath_var=LD_LIBRARY_PATH
2887c43cc173Smrg  case $host_vendor in
2888c43cc173Smrg    sni)
2889c43cc173Smrg      shlibpath_overrides_runpath=no
2890c43cc173Smrg      need_lib_prefix=no
2891c43cc173Smrg      export_dynamic_flag_spec='${wl}-Blargedynsym'
2892c43cc173Smrg      runpath_var=LD_RUN_PATH
2893c43cc173Smrg      ;;
2894c43cc173Smrg    siemens)
2895c43cc173Smrg      need_lib_prefix=no
2896c43cc173Smrg      ;;
2897c43cc173Smrg    motorola)
2898c43cc173Smrg      need_lib_prefix=no
2899c43cc173Smrg      need_version=no
2900c43cc173Smrg      shlibpath_overrides_runpath=no
2901c43cc173Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2902c43cc173Smrg      ;;
2903c43cc173Smrg  esac
2904c43cc173Smrg  ;;
2905c43cc173Smrg
2906c43cc173Smrgsysv4*MP*)
2907c43cc173Smrg  if test -d /usr/nec ;then
2908c43cc173Smrg    version_type=linux
2909c43cc173Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
2910c43cc173Smrg    soname_spec='$libname${shared_ext}.$major'
2911c43cc173Smrg    shlibpath_var=LD_LIBRARY_PATH
2912c43cc173Smrg  fi
2913c43cc173Smrg  ;;
2914c43cc173Smrg
2915c43cc173Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
2916c43cc173Smrg  version_type=freebsd-elf
2917c43cc173Smrg  need_lib_prefix=no
2918c43cc173Smrg  need_version=no
2919c43cc173Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2920c43cc173Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2921c43cc173Smrg  shlibpath_var=LD_LIBRARY_PATH
2922c43cc173Smrg  hardcode_into_libs=yes
2923c43cc173Smrg  if test "$with_gnu_ld" = yes; then
2924c43cc173Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
2925c43cc173Smrg    shlibpath_overrides_runpath=no
2926c43cc173Smrg  else
2927c43cc173Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
2928c43cc173Smrg    shlibpath_overrides_runpath=yes
2929c43cc173Smrg    case $host_os in
2930c43cc173Smrg      sco3.2v5*)
2931c43cc173Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
2932c43cc173Smrg	;;
2933c43cc173Smrg    esac
2934c43cc173Smrg  fi
2935c43cc173Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
2936c43cc173Smrg  ;;
2937c43cc173Smrg
2938c43cc173Smrguts4*)
2939c43cc173Smrg  version_type=linux
2940c43cc173Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2941c43cc173Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2942c43cc173Smrg  shlibpath_var=LD_LIBRARY_PATH
2943c43cc173Smrg  ;;
2944c43cc173Smrg
2945c43cc173Smrg*)
2946c43cc173Smrg  dynamic_linker=no
2947c43cc173Smrg  ;;
2948c43cc173Smrgesac
2949c43cc173SmrgAC_MSG_RESULT([$dynamic_linker])
2950c43cc173Smrgtest "$dynamic_linker" = no && can_build_shared=no
2951c43cc173Smrg
2952c43cc173Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2953c43cc173Smrgif test "$GCC" = yes; then
2954c43cc173Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2955c43cc173Smrgfi
2956c43cc173Smrg])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
2957c43cc173Smrg
2958c43cc173Smrg
2959c43cc173Smrg# _LT_AC_TAGCONFIG
2960c43cc173Smrg# ----------------
2961c43cc173SmrgAC_DEFUN([_LT_AC_TAGCONFIG],
2962c43cc173Smrg[AC_ARG_WITH([tags],
2963c43cc173Smrg    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
2964c43cc173Smrg        [include additional configurations @<:@automatic@:>@])],
2965c43cc173Smrg    [tagnames="$withval"])
2966c43cc173Smrg
2967c43cc173Smrgif test -f "$ltmain" && test -n "$tagnames"; then
2968c43cc173Smrg  if test ! -f "${ofile}"; then
2969c43cc173Smrg    AC_MSG_WARN([output file `$ofile' does not exist])
2970c43cc173Smrg  fi
2971c43cc173Smrg
2972c43cc173Smrg  if test -z "$LTCC"; then
2973c43cc173Smrg    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
2974c43cc173Smrg    if test -z "$LTCC"; then
2975c43cc173Smrg      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
2976c43cc173Smrg    else
2977c43cc173Smrg      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
2978c43cc173Smrg    fi
2979c43cc173Smrg  fi
2980c43cc173Smrg  if test -z "$LTCFLAGS"; then
2981c43cc173Smrg    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
2982c43cc173Smrg  fi
2983c43cc173Smrg
2984c43cc173Smrg  # Extract list of available tagged configurations in $ofile.
2985c43cc173Smrg  # Note that this assumes the entire list is on one line.
2986c43cc173Smrg  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
2987c43cc173Smrg
2988c43cc173Smrg  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
2989c43cc173Smrg  for tagname in $tagnames; do
2990c43cc173Smrg    IFS="$lt_save_ifs"
2991c43cc173Smrg    # Check whether tagname contains only valid characters
2992c43cc173Smrg    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
2993c43cc173Smrg    "") ;;
2994c43cc173Smrg    *)  AC_MSG_ERROR([invalid tag name: $tagname])
2995c43cc173Smrg	;;
2996c43cc173Smrg    esac
2997c43cc173Smrg
2998c43cc173Smrg    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
2999c43cc173Smrg    then
3000c43cc173Smrg      AC_MSG_ERROR([tag name \"$tagname\" already exists])
3001c43cc173Smrg    fi
3002c43cc173Smrg
3003c43cc173Smrg    # Update the list of available tags.
3004c43cc173Smrg    if test -n "$tagname"; then
3005c43cc173Smrg      echo appending configuration tag \"$tagname\" to $ofile
3006c43cc173Smrg
3007c43cc173Smrg      case $tagname in
3008c43cc173Smrg      CXX)
3009c43cc173Smrg	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
3010c43cc173Smrg	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
3011c43cc173Smrg	    (test "X$CXX" != "Xg++"))) ; then
3012c43cc173Smrg	  AC_LIBTOOL_LANG_CXX_CONFIG
3013c43cc173Smrg	else
3014c43cc173Smrg	  tagname=""
3015c43cc173Smrg	fi
3016c43cc173Smrg	;;
3017c43cc173Smrg
3018c43cc173Smrg      F77)
3019c43cc173Smrg	if test -n "$F77" && test "X$F77" != "Xno"; then
3020c43cc173Smrg	  AC_LIBTOOL_LANG_F77_CONFIG
3021c43cc173Smrg	else
3022c43cc173Smrg	  tagname=""
3023c43cc173Smrg	fi
3024c43cc173Smrg	;;
3025c43cc173Smrg
3026c43cc173Smrg      GCJ)
3027c43cc173Smrg	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
3028c43cc173Smrg	  AC_LIBTOOL_LANG_GCJ_CONFIG
3029c43cc173Smrg	else
3030c43cc173Smrg	  tagname=""
3031c43cc173Smrg	fi
3032c43cc173Smrg	;;
3033c43cc173Smrg
3034c43cc173Smrg      RC)
3035c43cc173Smrg	AC_LIBTOOL_LANG_RC_CONFIG
3036c43cc173Smrg	;;
3037c43cc173Smrg
3038c43cc173Smrg      *)
3039c43cc173Smrg	AC_MSG_ERROR([Unsupported tag name: $tagname])
3040c43cc173Smrg	;;
3041c43cc173Smrg      esac
3042c43cc173Smrg
3043c43cc173Smrg      # Append the new tag name to the list of available tags.
3044c43cc173Smrg      if test -n "$tagname" ; then
3045c43cc173Smrg      available_tags="$available_tags $tagname"
3046c43cc173Smrg    fi
3047c43cc173Smrg    fi
3048c43cc173Smrg  done
3049c43cc173Smrg  IFS="$lt_save_ifs"
3050c43cc173Smrg
3051c43cc173Smrg  # Now substitute the updated list of available tags.
3052c43cc173Smrg  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
3053c43cc173Smrg    mv "${ofile}T" "$ofile"
3054c43cc173Smrg    chmod +x "$ofile"
3055c43cc173Smrg  else
3056c43cc173Smrg    rm -f "${ofile}T"
3057c43cc173Smrg    AC_MSG_ERROR([unable to update list of available tagged configurations.])
3058c43cc173Smrg  fi
3059c43cc173Smrgfi
3060c43cc173Smrg])# _LT_AC_TAGCONFIG
3061c43cc173Smrg
3062c43cc173Smrg
3063c43cc173Smrg# AC_LIBTOOL_DLOPEN
3064c43cc173Smrg# -----------------
3065c43cc173Smrg# enable checks for dlopen support
3066c43cc173SmrgAC_DEFUN([AC_LIBTOOL_DLOPEN],
3067c43cc173Smrg [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
3068c43cc173Smrg])# AC_LIBTOOL_DLOPEN
3069c43cc173Smrg
3070c43cc173Smrg
3071c43cc173Smrg# AC_LIBTOOL_WIN32_DLL
3072c43cc173Smrg# --------------------
3073c43cc173Smrg# declare package support for building win32 DLLs
3074c43cc173SmrgAC_DEFUN([AC_LIBTOOL_WIN32_DLL],
3075c43cc173Smrg[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
3076c43cc173Smrg])# AC_LIBTOOL_WIN32_DLL
3077c43cc173Smrg
3078c43cc173Smrg
3079c43cc173Smrg# AC_ENABLE_SHARED([DEFAULT])
3080c43cc173Smrg# ---------------------------
3081c43cc173Smrg# implement the --enable-shared flag
3082c43cc173Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
3083c43cc173SmrgAC_DEFUN([AC_ENABLE_SHARED],
3084c43cc173Smrg[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
3085c43cc173SmrgAC_ARG_ENABLE([shared],
3086c43cc173Smrg    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
3087c43cc173Smrg	[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
3088c43cc173Smrg    [p=${PACKAGE-default}
3089c43cc173Smrg    case $enableval in
3090c43cc173Smrg    yes) enable_shared=yes ;;
3091c43cc173Smrg    no) enable_shared=no ;;
3092c43cc173Smrg    *)
3093c43cc173Smrg      enable_shared=no
3094c43cc173Smrg      # Look at the argument we got.  We use all the common list separators.
3095c43cc173Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
3096c43cc173Smrg      for pkg in $enableval; do
3097c43cc173Smrg	IFS="$lt_save_ifs"
3098c43cc173Smrg	if test "X$pkg" = "X$p"; then
3099c43cc173Smrg	  enable_shared=yes
3100c43cc173Smrg	fi
3101c43cc173Smrg      done
3102c43cc173Smrg      IFS="$lt_save_ifs"
3103c43cc173Smrg      ;;
3104c43cc173Smrg    esac],
3105c43cc173Smrg    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
3106c43cc173Smrg])# AC_ENABLE_SHARED
3107c43cc173Smrg
3108c43cc173Smrg
3109c43cc173Smrg# AC_DISABLE_SHARED
3110c43cc173Smrg# -----------------
3111c43cc173Smrg# set the default shared flag to --disable-shared
3112c43cc173SmrgAC_DEFUN([AC_DISABLE_SHARED],
3113c43cc173Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3114c43cc173SmrgAC_ENABLE_SHARED(no)
3115c43cc173Smrg])# AC_DISABLE_SHARED
3116c43cc173Smrg
3117c43cc173Smrg
3118c43cc173Smrg# AC_ENABLE_STATIC([DEFAULT])
3119c43cc173Smrg# ---------------------------
3120c43cc173Smrg# implement the --enable-static flag
3121c43cc173Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
3122c43cc173SmrgAC_DEFUN([AC_ENABLE_STATIC],
3123c43cc173Smrg[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
3124c43cc173SmrgAC_ARG_ENABLE([static],
3125c43cc173Smrg    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
3126c43cc173Smrg	[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
3127c43cc173Smrg    [p=${PACKAGE-default}
3128c43cc173Smrg    case $enableval in
3129c43cc173Smrg    yes) enable_static=yes ;;
3130c43cc173Smrg    no) enable_static=no ;;
3131c43cc173Smrg    *)
3132c43cc173Smrg     enable_static=no
3133c43cc173Smrg      # Look at the argument we got.  We use all the common list separators.
3134c43cc173Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
3135c43cc173Smrg      for pkg in $enableval; do
3136c43cc173Smrg	IFS="$lt_save_ifs"
3137c43cc173Smrg	if test "X$pkg" = "X$p"; then
3138c43cc173Smrg	  enable_static=yes
3139c43cc173Smrg	fi
3140c43cc173Smrg      done
3141c43cc173Smrg      IFS="$lt_save_ifs"
3142c43cc173Smrg      ;;
3143c43cc173Smrg    esac],
3144c43cc173Smrg    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
3145c43cc173Smrg])# AC_ENABLE_STATIC
3146c43cc173Smrg
3147c43cc173Smrg
3148c43cc173Smrg# AC_DISABLE_STATIC
3149c43cc173Smrg# -----------------
3150c43cc173Smrg# set the default static flag to --disable-static
3151c43cc173SmrgAC_DEFUN([AC_DISABLE_STATIC],
3152c43cc173Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3153c43cc173SmrgAC_ENABLE_STATIC(no)
3154c43cc173Smrg])# AC_DISABLE_STATIC
3155c43cc173Smrg
3156c43cc173Smrg
3157c43cc173Smrg# AC_ENABLE_FAST_INSTALL([DEFAULT])
3158c43cc173Smrg# ---------------------------------
3159c43cc173Smrg# implement the --enable-fast-install flag
3160c43cc173Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
3161c43cc173SmrgAC_DEFUN([AC_ENABLE_FAST_INSTALL],
3162c43cc173Smrg[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
3163c43cc173SmrgAC_ARG_ENABLE([fast-install],
3164c43cc173Smrg    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
3165c43cc173Smrg    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
3166c43cc173Smrg    [p=${PACKAGE-default}
3167c43cc173Smrg    case $enableval in
3168c43cc173Smrg    yes) enable_fast_install=yes ;;
3169c43cc173Smrg    no) enable_fast_install=no ;;
3170c43cc173Smrg    *)
3171c43cc173Smrg      enable_fast_install=no
3172c43cc173Smrg      # Look at the argument we got.  We use all the common list separators.
3173c43cc173Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
3174c43cc173Smrg      for pkg in $enableval; do
3175c43cc173Smrg	IFS="$lt_save_ifs"
3176c43cc173Smrg	if test "X$pkg" = "X$p"; then
3177c43cc173Smrg	  enable_fast_install=yes
3178c43cc173Smrg	fi
3179c43cc173Smrg      done
3180c43cc173Smrg      IFS="$lt_save_ifs"
3181c43cc173Smrg      ;;
3182c43cc173Smrg    esac],
3183c43cc173Smrg    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
3184c43cc173Smrg])# AC_ENABLE_FAST_INSTALL
3185c43cc173Smrg
3186c43cc173Smrg
3187c43cc173Smrg# AC_DISABLE_FAST_INSTALL
3188c43cc173Smrg# -----------------------
3189c43cc173Smrg# set the default to --disable-fast-install
3190c43cc173SmrgAC_DEFUN([AC_DISABLE_FAST_INSTALL],
3191c43cc173Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3192c43cc173SmrgAC_ENABLE_FAST_INSTALL(no)
3193c43cc173Smrg])# AC_DISABLE_FAST_INSTALL
3194c43cc173Smrg
3195c43cc173Smrg
3196c43cc173Smrg# AC_LIBTOOL_PICMODE([MODE])
3197c43cc173Smrg# --------------------------
3198c43cc173Smrg# implement the --with-pic flag
3199c43cc173Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
3200c43cc173SmrgAC_DEFUN([AC_LIBTOOL_PICMODE],
3201c43cc173Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3202c43cc173Smrgpic_mode=ifelse($#,1,$1,default)
3203c43cc173Smrg])# AC_LIBTOOL_PICMODE
3204c43cc173Smrg
3205c43cc173Smrg
3206c43cc173Smrg# AC_PROG_EGREP
3207c43cc173Smrg# -------------
3208c43cc173Smrg# This is predefined starting with Autoconf 2.54, so this conditional
3209c43cc173Smrg# definition can be removed once we require Autoconf 2.54 or later.
3210c43cc173Smrgm4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
3211c43cc173Smrg[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
3212c43cc173Smrg   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
3213c43cc173Smrg    then ac_cv_prog_egrep='grep -E'
3214c43cc173Smrg    else ac_cv_prog_egrep='egrep'
3215c43cc173Smrg    fi])
3216c43cc173Smrg EGREP=$ac_cv_prog_egrep
3217c43cc173Smrg AC_SUBST([EGREP])
3218c43cc173Smrg])])
3219c43cc173Smrg
3220c43cc173Smrg
3221c43cc173Smrg# AC_PATH_TOOL_PREFIX
3222c43cc173Smrg# -------------------
3223c43cc173Smrg# find a file program which can recognise shared library
3224c43cc173SmrgAC_DEFUN([AC_PATH_TOOL_PREFIX],
3225c43cc173Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
3226c43cc173SmrgAC_MSG_CHECKING([for $1])
3227c43cc173SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3228c43cc173Smrg[case $MAGIC_CMD in
3229c43cc173Smrg[[\\/*] |  ?:[\\/]*])
3230c43cc173Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
3231c43cc173Smrg  ;;
3232c43cc173Smrg*)
3233c43cc173Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
3234c43cc173Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3235c43cc173Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
3236c43cc173Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
3237c43cc173Smrgdnl not every word.  This closes a longstanding sh security hole.
3238c43cc173Smrg  ac_dummy="ifelse([$2], , $PATH, [$2])"
3239c43cc173Smrg  for ac_dir in $ac_dummy; do
3240c43cc173Smrg    IFS="$lt_save_ifs"
3241c43cc173Smrg    test -z "$ac_dir" && ac_dir=.
3242c43cc173Smrg    if test -f $ac_dir/$1; then
3243c43cc173Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
3244c43cc173Smrg      if test -n "$file_magic_test_file"; then
3245c43cc173Smrg	case $deplibs_check_method in
3246c43cc173Smrg	"file_magic "*)
3247c43cc173Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
3248c43cc173Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3249c43cc173Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3250c43cc173Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
3251c43cc173Smrg	    :
3252c43cc173Smrg	  else
3253c43cc173Smrg	    cat <<EOF 1>&2
3254c43cc173Smrg
3255c43cc173Smrg*** Warning: the command libtool uses to detect shared libraries,
3256c43cc173Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
3257c43cc173Smrg*** The result is that libtool may fail to recognize shared libraries
3258c43cc173Smrg*** as such.  This will affect the creation of libtool libraries that
3259c43cc173Smrg*** depend on shared libraries, but programs linked with such libtool
3260c43cc173Smrg*** libraries will work regardless of this problem.  Nevertheless, you
3261c43cc173Smrg*** may want to report the problem to your system manager and/or to
3262c43cc173Smrg*** bug-libtool@gnu.org
3263c43cc173Smrg
3264c43cc173SmrgEOF
3265c43cc173Smrg	  fi ;;
3266c43cc173Smrg	esac
3267c43cc173Smrg      fi
3268c43cc173Smrg      break
3269c43cc173Smrg    fi
3270c43cc173Smrg  done
3271c43cc173Smrg  IFS="$lt_save_ifs"
3272c43cc173Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
3273c43cc173Smrg  ;;
3274c43cc173Smrgesac])
3275c43cc173SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3276c43cc173Smrgif test -n "$MAGIC_CMD"; then
3277c43cc173Smrg  AC_MSG_RESULT($MAGIC_CMD)
3278c43cc173Smrgelse
3279c43cc173Smrg  AC_MSG_RESULT(no)
3280c43cc173Smrgfi
3281c43cc173Smrg])# AC_PATH_TOOL_PREFIX
3282c43cc173Smrg
3283c43cc173Smrg
3284c43cc173Smrg# AC_PATH_MAGIC
3285c43cc173Smrg# -------------
3286c43cc173Smrg# find a file program which can recognise a shared library
3287c43cc173SmrgAC_DEFUN([AC_PATH_MAGIC],
3288c43cc173Smrg[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
3289c43cc173Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
3290c43cc173Smrg  if test -n "$ac_tool_prefix"; then
3291c43cc173Smrg    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
3292c43cc173Smrg  else
3293c43cc173Smrg    MAGIC_CMD=:
3294c43cc173Smrg  fi
3295c43cc173Smrgfi
3296c43cc173Smrg])# AC_PATH_MAGIC
3297c43cc173Smrg
3298c43cc173Smrg
3299c43cc173Smrg# AC_PROG_LD
3300c43cc173Smrg# ----------
3301c43cc173Smrg# find the pathname to the GNU or non-GNU linker
3302c43cc173SmrgAC_DEFUN([AC_PROG_LD],
3303c43cc173Smrg[AC_ARG_WITH([gnu-ld],
3304c43cc173Smrg    [AC_HELP_STRING([--with-gnu-ld],
3305c43cc173Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
3306c43cc173Smrg    [test "$withval" = no || with_gnu_ld=yes],
3307c43cc173Smrg    [with_gnu_ld=no])
3308c43cc173SmrgAC_REQUIRE([LT_AC_PROG_SED])dnl
3309c43cc173SmrgAC_REQUIRE([AC_PROG_CC])dnl
3310c43cc173SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
3311c43cc173SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
3312c43cc173Smrgac_prog=ld
3313c43cc173Smrgif test "$GCC" = yes; then
3314c43cc173Smrg  # Check if gcc -print-prog-name=ld gives a path.
3315c43cc173Smrg  AC_MSG_CHECKING([for ld used by $CC])
3316c43cc173Smrg  case $host in
3317c43cc173Smrg  *-*-mingw*)
3318c43cc173Smrg    # gcc leaves a trailing carriage return which upsets mingw
3319c43cc173Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3320c43cc173Smrg  *)
3321c43cc173Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3322c43cc173Smrg  esac
3323c43cc173Smrg  case $ac_prog in
3324c43cc173Smrg    # Accept absolute paths.
3325c43cc173Smrg    [[\\/]]* | ?:[[\\/]]*)
3326c43cc173Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
3327c43cc173Smrg      # Canonicalize the pathname of ld
3328c43cc173Smrg      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
3329c43cc173Smrg      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3330c43cc173Smrg	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
3331c43cc173Smrg      done
3332c43cc173Smrg      test -z "$LD" && LD="$ac_prog"
3333c43cc173Smrg      ;;
3334c43cc173Smrg  "")
3335c43cc173Smrg    # If it fails, then pretend we aren't using GCC.
3336c43cc173Smrg    ac_prog=ld
3337c43cc173Smrg    ;;
3338c43cc173Smrg  *)
3339c43cc173Smrg    # If it is relative, then search for the first ld in PATH.
3340c43cc173Smrg    with_gnu_ld=unknown
3341c43cc173Smrg    ;;
3342c43cc173Smrg  esac
3343c43cc173Smrgelif test "$with_gnu_ld" = yes; then
3344c43cc173Smrg  AC_MSG_CHECKING([for GNU ld])
3345c43cc173Smrgelse
3346c43cc173Smrg  AC_MSG_CHECKING([for non-GNU ld])
3347c43cc173Smrgfi
3348c43cc173SmrgAC_CACHE_VAL(lt_cv_path_LD,
3349c43cc173Smrg[if test -z "$LD"; then
3350c43cc173Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3351c43cc173Smrg  for ac_dir in $PATH; do
3352c43cc173Smrg    IFS="$lt_save_ifs"
3353c43cc173Smrg    test -z "$ac_dir" && ac_dir=.
3354c43cc173Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3355c43cc173Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
3356c43cc173Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
3357c43cc173Smrg      # but apparently some variants of GNU ld only accept -v.
3358c43cc173Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
3359c43cc173Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
3360c43cc173Smrg      *GNU* | *'with BFD'*)
3361c43cc173Smrg	test "$with_gnu_ld" != no && break
3362c43cc173Smrg	;;
3363c43cc173Smrg      *)
3364c43cc173Smrg	test "$with_gnu_ld" != yes && break
3365c43cc173Smrg	;;
3366c43cc173Smrg      esac
3367c43cc173Smrg    fi
3368c43cc173Smrg  done
3369c43cc173Smrg  IFS="$lt_save_ifs"
3370c43cc173Smrgelse
3371c43cc173Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
3372c43cc173Smrgfi])
3373c43cc173SmrgLD="$lt_cv_path_LD"
3374c43cc173Smrgif test -n "$LD"; then
3375c43cc173Smrg  AC_MSG_RESULT($LD)
3376c43cc173Smrgelse
3377c43cc173Smrg  AC_MSG_RESULT(no)
3378c43cc173Smrgfi
3379c43cc173Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3380c43cc173SmrgAC_PROG_LD_GNU
3381c43cc173Smrg])# AC_PROG_LD
3382c43cc173Smrg
3383c43cc173Smrg
3384c43cc173Smrg# AC_PROG_LD_GNU
3385c43cc173Smrg# --------------
3386c43cc173SmrgAC_DEFUN([AC_PROG_LD_GNU],
3387c43cc173Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
3388c43cc173SmrgAC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3389c43cc173Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
3390c43cc173Smrgcase `$LD -v 2>&1 </dev/null` in
3391c43cc173Smrg*GNU* | *'with BFD'*)
3392c43cc173Smrg  lt_cv_prog_gnu_ld=yes
3393c43cc173Smrg  ;;
3394c43cc173Smrg*)
3395c43cc173Smrg  lt_cv_prog_gnu_ld=no
3396c43cc173Smrg  ;;
3397c43cc173Smrgesac])
3398c43cc173Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
3399c43cc173Smrg])# AC_PROG_LD_GNU
3400c43cc173Smrg
3401c43cc173Smrg
3402c43cc173Smrg# AC_PROG_LD_RELOAD_FLAG
3403c43cc173Smrg# ----------------------
3404c43cc173Smrg# find reload flag for linker
3405c43cc173Smrg#   -- PORTME Some linkers may need a different reload flag.
3406c43cc173SmrgAC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
3407c43cc173Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
3408c43cc173Smrg  lt_cv_ld_reload_flag,
3409c43cc173Smrg  [lt_cv_ld_reload_flag='-r'])
3410c43cc173Smrgreload_flag=$lt_cv_ld_reload_flag
3411c43cc173Smrgcase $reload_flag in
3412c43cc173Smrg"" | " "*) ;;
3413c43cc173Smrg*) reload_flag=" $reload_flag" ;;
3414c43cc173Smrgesac
3415c43cc173Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
3416c43cc173Smrgcase $host_os in
3417c43cc173Smrg  darwin*)
3418c43cc173Smrg    if test "$GCC" = yes; then
3419c43cc173Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
3420c43cc173Smrg    else
3421c43cc173Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
3422c43cc173Smrg    fi
3423c43cc173Smrg    ;;
3424c43cc173Smrgesac
3425c43cc173Smrg])# AC_PROG_LD_RELOAD_FLAG
3426c43cc173Smrg
3427c43cc173Smrg
3428c43cc173Smrg# AC_DEPLIBS_CHECK_METHOD
3429c43cc173Smrg# -----------------------
3430c43cc173Smrg# how to check for library dependencies
3431c43cc173Smrg#  -- PORTME fill in with the dynamic library characteristics
3432c43cc173SmrgAC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
3433c43cc173Smrg[AC_CACHE_CHECK([how to recognise dependent libraries],
3434c43cc173Smrglt_cv_deplibs_check_method,
3435c43cc173Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
3436c43cc173Smrglt_cv_file_magic_test_file=
3437c43cc173Smrglt_cv_deplibs_check_method='unknown'
3438c43cc173Smrg# Need to set the preceding variable on all platforms that support
3439c43cc173Smrg# interlibrary dependencies.
3440c43cc173Smrg# 'none' -- dependencies not supported.
3441c43cc173Smrg# `unknown' -- same as none, but documents that we really don't know.
3442c43cc173Smrg# 'pass_all' -- all dependencies passed with no checks.
3443c43cc173Smrg# 'test_compile' -- check by making test program.
3444c43cc173Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
3445c43cc173Smrg# which responds to the $file_magic_cmd with a given extended regex.
3446c43cc173Smrg# If you have `file' or equivalent on your system and you're not sure
3447c43cc173Smrg# whether `pass_all' will *always* work, you probably want this one.
3448c43cc173Smrg
3449c43cc173Smrgcase $host_os in
3450c43cc173Smrgaix4* | aix5*)
3451c43cc173Smrg  lt_cv_deplibs_check_method=pass_all
3452c43cc173Smrg  ;;
3453c43cc173Smrg
3454c43cc173Smrgbeos*)
3455c43cc173Smrg  lt_cv_deplibs_check_method=pass_all
3456c43cc173Smrg  ;;
3457c43cc173Smrg
3458c43cc173Smrgbsdi[[45]]*)
3459c43cc173Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3460c43cc173Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
3461c43cc173Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
3462c43cc173Smrg  ;;
3463c43cc173Smrg
3464c43cc173Smrgcygwin*)
3465c43cc173Smrg  # func_win32_libid is a shell function defined in ltmain.sh
3466c43cc173Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3467c43cc173Smrg  lt_cv_file_magic_cmd='func_win32_libid'
3468c43cc173Smrg  ;;
3469c43cc173Smrg
3470c43cc173Smrgmingw* | pw32*)
3471c43cc173Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
3472c43cc173Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
3473c43cc173Smrg  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
3474c43cc173Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
3475c43cc173Smrg  ;;
3476c43cc173Smrg
3477c43cc173Smrgdarwin* | rhapsody*)
3478c43cc173Smrg  lt_cv_deplibs_check_method=pass_all
3479c43cc173Smrg  ;;
3480c43cc173Smrg
3481c43cc173Smrgfreebsd* | kfreebsd*-gnu | dragonfly*)
3482c43cc173Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3483c43cc173Smrg    case $host_cpu in
3484c43cc173Smrg    i*86 )
3485c43cc173Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
3486c43cc173Smrg      # Let's accept both of them until this is cleared up.
3487c43cc173Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3488c43cc173Smrg      lt_cv_file_magic_cmd=/usr/bin/file
3489c43cc173Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3490c43cc173Smrg      ;;
3491c43cc173Smrg    esac
3492c43cc173Smrg  else
3493c43cc173Smrg    lt_cv_deplibs_check_method=pass_all
3494c43cc173Smrg  fi
3495c43cc173Smrg  ;;
3496c43cc173Smrg
3497c43cc173Smrggnu*)
3498c43cc173Smrg  lt_cv_deplibs_check_method=pass_all
3499c43cc173Smrg  ;;
3500c43cc173Smrg
3501c43cc173Smrghpux10.20* | hpux11*)
3502c43cc173Smrg  lt_cv_file_magic_cmd=/usr/bin/file
3503c43cc173Smrg  case $host_cpu in
3504c43cc173Smrg  ia64*)
3505c43cc173Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3506c43cc173Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3507c43cc173Smrg    ;;
3508c43cc173Smrg  hppa*64*)
3509c43cc173Smrg    [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]']
3510c43cc173Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3511c43cc173Smrg    ;;
3512c43cc173Smrg  *)
3513c43cc173Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
3514c43cc173Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3515c43cc173Smrg    ;;
3516c43cc173Smrg  esac
3517c43cc173Smrg  ;;
3518c43cc173Smrg
3519c43cc173Smrginterix3*)
3520c43cc173Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3521c43cc173Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3522c43cc173Smrg  ;;
3523c43cc173Smrg
3524c43cc173Smrgirix5* | irix6* | nonstopux*)
3525c43cc173Smrg  case $LD in
3526c43cc173Smrg  *-32|*"-32 ") libmagic=32-bit;;
3527c43cc173Smrg  *-n32|*"-n32 ") libmagic=N32;;
3528c43cc173Smrg  *-64|*"-64 ") libmagic=64-bit;;
3529c43cc173Smrg  *) libmagic=never-match;;
3530c43cc173Smrg  esac
3531c43cc173Smrg  lt_cv_deplibs_check_method=pass_all
3532c43cc173Smrg  ;;
3533c43cc173Smrg
3534c43cc173Smrg# This must be Linux ELF.
3535c43cc173Smrglinux*)
3536c43cc173Smrg  lt_cv_deplibs_check_method=pass_all
3537c43cc173Smrg  ;;
3538c43cc173Smrg
3539c43cc173Smrgnetbsd*)
3540c43cc173Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3541c43cc173Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3542c43cc173Smrg  else
3543c43cc173Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3544c43cc173Smrg  fi
3545c43cc173Smrg  ;;
3546c43cc173Smrg
3547c43cc173Smrgnewos6*)
3548c43cc173Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3549c43cc173Smrg  lt_cv_file_magic_cmd=/usr/bin/file
3550c43cc173Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3551c43cc173Smrg  ;;
3552c43cc173Smrg
3553c43cc173Smrgnto-qnx*)
3554c43cc173Smrg  lt_cv_deplibs_check_method=unknown
3555c43cc173Smrg  ;;
3556c43cc173Smrg
3557c43cc173Smrgopenbsd*)
3558c43cc173Smrg  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3559c43cc173Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3560c43cc173Smrg  else
3561c43cc173Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3562c43cc173Smrg  fi
3563c43cc173Smrg  ;;
3564c43cc173Smrg
3565c43cc173Smrgosf3* | osf4* | osf5*)
3566c43cc173Smrg  lt_cv_deplibs_check_method=pass_all
3567c43cc173Smrg  ;;
3568c43cc173Smrg
3569c43cc173Smrgsolaris*)
3570c43cc173Smrg  lt_cv_deplibs_check_method=pass_all
3571c43cc173Smrg  ;;
3572c43cc173Smrg
3573c43cc173Smrgsysv4 | sysv4.3*)
3574c43cc173Smrg  case $host_vendor in
3575c43cc173Smrg  motorola)
3576c43cc173Smrg    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]]'
3577c43cc173Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3578c43cc173Smrg    ;;
3579c43cc173Smrg  ncr)
3580c43cc173Smrg    lt_cv_deplibs_check_method=pass_all
3581c43cc173Smrg    ;;
3582c43cc173Smrg  sequent)
3583c43cc173Smrg    lt_cv_file_magic_cmd='/bin/file'
3584c43cc173Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3585c43cc173Smrg    ;;
3586c43cc173Smrg  sni)
3587c43cc173Smrg    lt_cv_file_magic_cmd='/bin/file'
3588c43cc173Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3589c43cc173Smrg    lt_cv_file_magic_test_file=/lib/libc.so
3590c43cc173Smrg    ;;
3591c43cc173Smrg  siemens)
3592c43cc173Smrg    lt_cv_deplibs_check_method=pass_all
3593c43cc173Smrg    ;;
3594c43cc173Smrg  pc)
3595c43cc173Smrg    lt_cv_deplibs_check_method=pass_all
3596c43cc173Smrg    ;;
3597c43cc173Smrg  esac
3598c43cc173Smrg  ;;
3599c43cc173Smrg
3600c43cc173Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3601c43cc173Smrg  lt_cv_deplibs_check_method=pass_all
3602c43cc173Smrg  ;;
3603c43cc173Smrgesac
3604c43cc173Smrg])
3605c43cc173Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
3606c43cc173Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
3607c43cc173Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
3608c43cc173Smrg])# AC_DEPLIBS_CHECK_METHOD
3609c43cc173Smrg
3610c43cc173Smrg
3611c43cc173Smrg# AC_PROG_NM
3612c43cc173Smrg# ----------
3613c43cc173Smrg# find the pathname to a BSD-compatible name lister
3614c43cc173SmrgAC_DEFUN([AC_PROG_NM],
3615c43cc173Smrg[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
3616c43cc173Smrg[if test -n "$NM"; then
3617c43cc173Smrg  # Let the user override the test.
3618c43cc173Smrg  lt_cv_path_NM="$NM"
3619c43cc173Smrgelse
3620c43cc173Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
3621c43cc173Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then 
3622c43cc173Smrg    lt_nm_to_check="$lt_nm_to_check nm"
3623c43cc173Smrg  fi
3624c43cc173Smrg  for lt_tmp_nm in $lt_nm_to_check; do
3625c43cc173Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3626c43cc173Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3627c43cc173Smrg      IFS="$lt_save_ifs"
3628c43cc173Smrg      test -z "$ac_dir" && ac_dir=.
3629c43cc173Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
3630c43cc173Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
3631c43cc173Smrg	# Check to see if the nm accepts a BSD-compat flag.
3632c43cc173Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
3633c43cc173Smrg	#   nm: unknown option "B" ignored
3634c43cc173Smrg	# Tru64's nm complains that /dev/null is an invalid object file
3635c43cc173Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
3636c43cc173Smrg	*/dev/null* | *'Invalid file or object type'*)
3637c43cc173Smrg	  lt_cv_path_NM="$tmp_nm -B"
3638c43cc173Smrg	  break
3639c43cc173Smrg	  ;;
3640c43cc173Smrg	*)
3641c43cc173Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3642c43cc173Smrg	  */dev/null*)
3643c43cc173Smrg	    lt_cv_path_NM="$tmp_nm -p"
3644c43cc173Smrg	    break
3645c43cc173Smrg	    ;;
3646c43cc173Smrg	  *)
3647c43cc173Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3648c43cc173Smrg	    continue # so that we can try to find one that supports BSD flags
3649c43cc173Smrg	    ;;
3650c43cc173Smrg	  esac
3651c43cc173Smrg	  ;;
3652c43cc173Smrg	esac
3653c43cc173Smrg      fi
3654c43cc173Smrg    done
3655c43cc173Smrg    IFS="$lt_save_ifs"
3656c43cc173Smrg  done
3657c43cc173Smrg  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
3658c43cc173Smrgfi])
3659c43cc173SmrgNM="$lt_cv_path_NM"
3660c43cc173Smrg])# AC_PROG_NM
3661c43cc173Smrg
3662c43cc173Smrg
3663c43cc173Smrg# AC_CHECK_LIBM
3664c43cc173Smrg# -------------
3665c43cc173Smrg# check for math library
3666c43cc173SmrgAC_DEFUN([AC_CHECK_LIBM],
3667c43cc173Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3668c43cc173SmrgLIBM=
3669c43cc173Smrgcase $host in
3670c43cc173Smrg*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
3671c43cc173Smrg  # These system don't have libm, or don't need it
3672c43cc173Smrg  ;;
3673c43cc173Smrg*-ncr-sysv4.3*)
3674c43cc173Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3675c43cc173Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3676c43cc173Smrg  ;;
3677c43cc173Smrg*)
3678c43cc173Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
3679c43cc173Smrg  ;;
3680c43cc173Smrgesac
3681c43cc173Smrg])# AC_CHECK_LIBM
3682c43cc173Smrg
3683c43cc173Smrg
3684c43cc173Smrg# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
3685c43cc173Smrg# -----------------------------------
3686c43cc173Smrg# sets LIBLTDL to the link flags for the libltdl convenience library and
3687c43cc173Smrg# LTDLINCL to the include flags for the libltdl header and adds
3688c43cc173Smrg# --enable-ltdl-convenience to the configure arguments.  Note that
3689c43cc173Smrg# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
3690c43cc173Smrg# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
3691c43cc173Smrg# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
3692c43cc173Smrg# (note the single quotes!).  If your package is not flat and you're not
3693c43cc173Smrg# using automake, define top_builddir and top_srcdir appropriately in
3694c43cc173Smrg# the Makefiles.
3695c43cc173SmrgAC_DEFUN([AC_LIBLTDL_CONVENIENCE],
3696c43cc173Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3697c43cc173Smrg  case $enable_ltdl_convenience in
3698c43cc173Smrg  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
3699c43cc173Smrg  "") enable_ltdl_convenience=yes
3700c43cc173Smrg      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
3701c43cc173Smrg  esac
3702c43cc173Smrg  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
3703c43cc173Smrg  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
3704c43cc173Smrg  # For backwards non-gettext consistent compatibility...
3705c43cc173Smrg  INCLTDL="$LTDLINCL"
3706c43cc173Smrg])# AC_LIBLTDL_CONVENIENCE
3707c43cc173Smrg
3708c43cc173Smrg
3709c43cc173Smrg# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
3710c43cc173Smrg# -----------------------------------
3711c43cc173Smrg# sets LIBLTDL to the link flags for the libltdl installable library and
3712c43cc173Smrg# LTDLINCL to the include flags for the libltdl header and adds
3713c43cc173Smrg# --enable-ltdl-install to the configure arguments.  Note that
3714c43cc173Smrg# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
3715c43cc173Smrg# and an installed libltdl is not found, it is assumed to be `libltdl'.
3716c43cc173Smrg# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
3717c43cc173Smrg# '${top_srcdir}/' (note the single quotes!).  If your package is not
3718c43cc173Smrg# flat and you're not using automake, define top_builddir and top_srcdir
3719c43cc173Smrg# appropriately in the Makefiles.
3720c43cc173Smrg# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
3721c43cc173SmrgAC_DEFUN([AC_LIBLTDL_INSTALLABLE],
3722c43cc173Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3723c43cc173Smrg  AC_CHECK_LIB(ltdl, lt_dlinit,
3724c43cc173Smrg  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
3725c43cc173Smrg  [if test x"$enable_ltdl_install" = xno; then
3726c43cc173Smrg     AC_MSG_WARN([libltdl not installed, but installation disabled])
3727c43cc173Smrg   else
3728c43cc173Smrg     enable_ltdl_install=yes
3729c43cc173Smrg   fi
3730c43cc173Smrg  ])
3731c43cc173Smrg  if test x"$enable_ltdl_install" = x"yes"; then
3732c43cc173Smrg    ac_configure_args="$ac_configure_args --enable-ltdl-install"
3733c43cc173Smrg    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
3734c43cc173Smrg    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
3735c43cc173Smrg  else
3736c43cc173Smrg    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
3737c43cc173Smrg    LIBLTDL="-lltdl"
3738c43cc173Smrg    LTDLINCL=
3739c43cc173Smrg  fi
3740c43cc173Smrg  # For backwards non-gettext consistent compatibility...
3741c43cc173Smrg  INCLTDL="$LTDLINCL"
3742c43cc173Smrg])# AC_LIBLTDL_INSTALLABLE
3743c43cc173Smrg
3744c43cc173Smrg
3745c43cc173Smrg# AC_LIBTOOL_CXX
3746c43cc173Smrg# --------------
3747c43cc173Smrg# enable support for C++ libraries
3748c43cc173SmrgAC_DEFUN([AC_LIBTOOL_CXX],
3749c43cc173Smrg[AC_REQUIRE([_LT_AC_LANG_CXX])
3750c43cc173Smrg])# AC_LIBTOOL_CXX
3751c43cc173Smrg
3752c43cc173Smrg
3753c43cc173Smrg# _LT_AC_LANG_CXX
3754c43cc173Smrg# ---------------
3755c43cc173SmrgAC_DEFUN([_LT_AC_LANG_CXX],
3756c43cc173Smrg[AC_REQUIRE([AC_PROG_CXX])
3757c43cc173SmrgAC_REQUIRE([_LT_AC_PROG_CXXCPP])
3758c43cc173Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
3759c43cc173Smrg])# _LT_AC_LANG_CXX
3760c43cc173Smrg
3761c43cc173Smrg# _LT_AC_PROG_CXXCPP
3762c43cc173Smrg# ------------------
3763c43cc173SmrgAC_DEFUN([_LT_AC_PROG_CXXCPP],
3764c43cc173Smrg[
3765c43cc173SmrgAC_REQUIRE([AC_PROG_CXX])
3766c43cc173Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
3767c43cc173Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
3768c43cc173Smrg    (test "X$CXX" != "Xg++"))) ; then
3769c43cc173Smrg  AC_PROG_CXXCPP
3770c43cc173Smrgfi
3771c43cc173Smrg])# _LT_AC_PROG_CXXCPP
3772c43cc173Smrg
3773c43cc173Smrg# AC_LIBTOOL_F77
3774c43cc173Smrg# --------------
3775c43cc173Smrg# enable support for Fortran 77 libraries
3776c43cc173SmrgAC_DEFUN([AC_LIBTOOL_F77],
3777c43cc173Smrg[AC_REQUIRE([_LT_AC_LANG_F77])
3778c43cc173Smrg])# AC_LIBTOOL_F77
3779c43cc173Smrg
3780c43cc173Smrg
3781c43cc173Smrg# _LT_AC_LANG_F77
3782c43cc173Smrg# ---------------
3783c43cc173SmrgAC_DEFUN([_LT_AC_LANG_F77],
3784c43cc173Smrg[AC_REQUIRE([AC_PROG_F77])
3785c43cc173Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
3786c43cc173Smrg])# _LT_AC_LANG_F77
3787c43cc173Smrg
3788c43cc173Smrg
3789c43cc173Smrg# AC_LIBTOOL_GCJ
3790c43cc173Smrg# --------------
3791c43cc173Smrg# enable support for GCJ libraries
3792c43cc173SmrgAC_DEFUN([AC_LIBTOOL_GCJ],
3793c43cc173Smrg[AC_REQUIRE([_LT_AC_LANG_GCJ])
3794c43cc173Smrg])# AC_LIBTOOL_GCJ
3795c43cc173Smrg
3796c43cc173Smrg
3797c43cc173Smrg# _LT_AC_LANG_GCJ
3798c43cc173Smrg# ---------------
3799c43cc173SmrgAC_DEFUN([_LT_AC_LANG_GCJ],
3800c43cc173Smrg[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
3801c43cc173Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
3802c43cc173Smrg    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
3803c43cc173Smrg      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
3804c43cc173Smrg	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
3805c43cc173Smrg	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
3806c43cc173Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
3807c43cc173Smrg])# _LT_AC_LANG_GCJ
3808c43cc173Smrg
3809c43cc173Smrg
3810c43cc173Smrg# AC_LIBTOOL_RC
3811c43cc173Smrg# -------------
3812c43cc173Smrg# enable support for Windows resource files
3813c43cc173SmrgAC_DEFUN([AC_LIBTOOL_RC],
3814c43cc173Smrg[AC_REQUIRE([LT_AC_PROG_RC])
3815c43cc173Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
3816c43cc173Smrg])# AC_LIBTOOL_RC
3817c43cc173Smrg
3818c43cc173Smrg
3819c43cc173Smrg# AC_LIBTOOL_LANG_C_CONFIG
3820c43cc173Smrg# ------------------------
3821c43cc173Smrg# Ensure that the configuration vars for the C compiler are
3822c43cc173Smrg# suitably defined.  Those variables are subsequently used by
3823c43cc173Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
3824c43cc173SmrgAC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
3825c43cc173SmrgAC_DEFUN([_LT_AC_LANG_C_CONFIG],
3826c43cc173Smrg[lt_save_CC="$CC"
3827c43cc173SmrgAC_LANG_PUSH(C)
3828c43cc173Smrg
3829c43cc173Smrg# Source file extension for C test sources.
3830c43cc173Smrgac_ext=c
3831c43cc173Smrg
3832c43cc173Smrg# Object file extension for compiled C test sources.
3833c43cc173Smrgobjext=o
3834c43cc173Smrg_LT_AC_TAGVAR(objext, $1)=$objext
3835c43cc173Smrg
3836c43cc173Smrg# Code to be used in simple compile tests
3837c43cc173Smrglt_simple_compile_test_code="int some_variable = 0;\n"
3838c43cc173Smrg
3839c43cc173Smrg# Code to be used in simple link tests
3840c43cc173Smrglt_simple_link_test_code='int main(){return(0);}\n'
3841c43cc173Smrg
3842c43cc173Smrg_LT_AC_SYS_COMPILER
3843c43cc173Smrg
3844c43cc173Smrg# save warnings/boilerplate of simple test code
3845c43cc173Smrg_LT_COMPILER_BOILERPLATE
3846c43cc173Smrg_LT_LINKER_BOILERPLATE
3847c43cc173Smrg
3848c43cc173SmrgAC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
3849c43cc173SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
3850c43cc173SmrgAC_LIBTOOL_PROG_CC_C_O($1)
3851c43cc173SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
3852c43cc173SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
3853c43cc173SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
3854c43cc173SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
3855c43cc173SmrgAC_LIBTOOL_SYS_LIB_STRIP
3856c43cc173SmrgAC_LIBTOOL_DLOPEN_SELF
3857c43cc173Smrg
3858c43cc173Smrg# Report which library types will actually be built
3859c43cc173SmrgAC_MSG_CHECKING([if libtool supports shared libraries])
3860c43cc173SmrgAC_MSG_RESULT([$can_build_shared])
3861c43cc173Smrg
3862c43cc173SmrgAC_MSG_CHECKING([whether to build shared libraries])
3863c43cc173Smrgtest "$can_build_shared" = "no" && enable_shared=no
3864c43cc173Smrg
3865c43cc173Smrg# On AIX, shared libraries and static libraries use the same namespace, and
3866c43cc173Smrg# are all built from PIC.
3867c43cc173Smrgcase $host_os in
3868c43cc173Smrgaix3*)
3869c43cc173Smrg  test "$enable_shared" = yes && enable_static=no
3870c43cc173Smrg  if test -n "$RANLIB"; then
3871c43cc173Smrg    archive_cmds="$archive_cmds~\$RANLIB \$lib"
3872c43cc173Smrg    postinstall_cmds='$RANLIB $lib'
3873c43cc173Smrg  fi
3874c43cc173Smrg  ;;
3875c43cc173Smrg
3876c43cc173Smrgaix4* | aix5*)
3877c43cc173Smrg  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
3878c43cc173Smrg    test "$enable_shared" = yes && enable_static=no
3879c43cc173Smrg  fi
3880c43cc173Smrg    ;;
3881c43cc173Smrgesac
3882c43cc173SmrgAC_MSG_RESULT([$enable_shared])
3883c43cc173Smrg
3884c43cc173SmrgAC_MSG_CHECKING([whether to build static libraries])
3885c43cc173Smrg# Make sure either enable_shared or enable_static is yes.
3886c43cc173Smrgtest "$enable_shared" = yes || enable_static=yes
3887c43cc173SmrgAC_MSG_RESULT([$enable_static])
3888c43cc173Smrg
3889c43cc173SmrgAC_LIBTOOL_CONFIG($1)
3890c43cc173Smrg
3891c43cc173SmrgAC_LANG_POP
3892c43cc173SmrgCC="$lt_save_CC"
3893c43cc173Smrg])# AC_LIBTOOL_LANG_C_CONFIG
3894c43cc173Smrg
3895c43cc173Smrg
3896c43cc173Smrg# AC_LIBTOOL_LANG_CXX_CONFIG
3897c43cc173Smrg# --------------------------
3898c43cc173Smrg# Ensure that the configuration vars for the C compiler are
3899c43cc173Smrg# suitably defined.  Those variables are subsequently used by
3900c43cc173Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
3901c43cc173SmrgAC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
3902c43cc173SmrgAC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
3903c43cc173Smrg[AC_LANG_PUSH(C++)
3904c43cc173SmrgAC_REQUIRE([AC_PROG_CXX])
3905c43cc173SmrgAC_REQUIRE([_LT_AC_PROG_CXXCPP])
3906c43cc173Smrg
3907c43cc173Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3908c43cc173Smrg_LT_AC_TAGVAR(allow_undefined_flag, $1)=
3909c43cc173Smrg_LT_AC_TAGVAR(always_export_symbols, $1)=no
3910c43cc173Smrg_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
3911c43cc173Smrg_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
3912c43cc173Smrg_LT_AC_TAGVAR(hardcode_direct, $1)=no
3913c43cc173Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
3914c43cc173Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
3915c43cc173Smrg_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
3916c43cc173Smrg_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
3917c43cc173Smrg_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
3918c43cc173Smrg_LT_AC_TAGVAR(hardcode_automatic, $1)=no
3919c43cc173Smrg_LT_AC_TAGVAR(module_cmds, $1)=
3920c43cc173Smrg_LT_AC_TAGVAR(module_expsym_cmds, $1)=
3921c43cc173Smrg_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
3922c43cc173Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
3923c43cc173Smrg_LT_AC_TAGVAR(no_undefined_flag, $1)=
3924c43cc173Smrg_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
3925c43cc173Smrg_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
3926c43cc173Smrg
3927c43cc173Smrg# Dependencies to place before and after the object being linked:
3928c43cc173Smrg_LT_AC_TAGVAR(predep_objects, $1)=
3929c43cc173Smrg_LT_AC_TAGVAR(postdep_objects, $1)=
3930c43cc173Smrg_LT_AC_TAGVAR(predeps, $1)=
3931c43cc173Smrg_LT_AC_TAGVAR(postdeps, $1)=
3932c43cc173Smrg_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
3933c43cc173Smrg
3934c43cc173Smrg# Source file extension for C++ test sources.
3935c43cc173Smrgac_ext=cpp
3936c43cc173Smrg
3937c43cc173Smrg# Object file extension for compiled C++ test sources.
3938c43cc173Smrgobjext=o
3939c43cc173Smrg_LT_AC_TAGVAR(objext, $1)=$objext
3940c43cc173Smrg
3941c43cc173Smrg# Code to be used in simple compile tests
3942c43cc173Smrglt_simple_compile_test_code="int some_variable = 0;\n"
3943c43cc173Smrg
3944c43cc173Smrg# Code to be used in simple link tests
3945c43cc173Smrglt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n'
3946c43cc173Smrg
3947c43cc173Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
3948c43cc173Smrg_LT_AC_SYS_COMPILER
3949c43cc173Smrg
3950c43cc173Smrg# save warnings/boilerplate of simple test code
3951c43cc173Smrg_LT_COMPILER_BOILERPLATE
3952c43cc173Smrg_LT_LINKER_BOILERPLATE
3953c43cc173Smrg
3954c43cc173Smrg# Allow CC to be a program name with arguments.
3955c43cc173Smrglt_save_CC=$CC
3956c43cc173Smrglt_save_LD=$LD
3957c43cc173Smrglt_save_GCC=$GCC
3958c43cc173SmrgGCC=$GXX
3959c43cc173Smrglt_save_with_gnu_ld=$with_gnu_ld
3960c43cc173Smrglt_save_path_LD=$lt_cv_path_LD
3961c43cc173Smrgif test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
3962c43cc173Smrg  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
3963c43cc173Smrgelse
3964c43cc173Smrg  $as_unset lt_cv_prog_gnu_ld
3965c43cc173Smrgfi
3966c43cc173Smrgif test -n "${lt_cv_path_LDCXX+set}"; then
3967c43cc173Smrg  lt_cv_path_LD=$lt_cv_path_LDCXX
3968c43cc173Smrgelse
3969c43cc173Smrg  $as_unset lt_cv_path_LD
3970c43cc173Smrgfi
3971c43cc173Smrgtest -z "${LDCXX+set}" || LD=$LDCXX
3972c43cc173SmrgCC=${CXX-"c++"}
3973c43cc173Smrgcompiler=$CC
3974c43cc173Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
3975c43cc173Smrg_LT_CC_BASENAME([$compiler])
3976c43cc173Smrg
3977c43cc173Smrg# We don't want -fno-exception wen compiling C++ code, so set the
3978c43cc173Smrg# no_builtin_flag separately
3979c43cc173Smrgif test "$GXX" = yes; then
3980c43cc173Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
3981c43cc173Smrgelse
3982c43cc173Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3983c43cc173Smrgfi
3984c43cc173Smrg
3985c43cc173Smrgif test "$GXX" = yes; then
3986c43cc173Smrg  # Set up default GNU C++ configuration
3987c43cc173Smrg
3988c43cc173Smrg  AC_PROG_LD
3989c43cc173Smrg
3990c43cc173Smrg  # Check if GNU C++ uses GNU ld as the underlying linker, since the
3991c43cc173Smrg  # archiving commands below assume that GNU ld is being used.
3992c43cc173Smrg  if test "$with_gnu_ld" = yes; then
3993c43cc173Smrg    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
3994c43cc173Smrg    _LT_AC_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'
3995c43cc173Smrg
3996c43cc173Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
3997c43cc173Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
3998c43cc173Smrg
3999c43cc173Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
4000c43cc173Smrg    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
4001c43cc173Smrg    #     investigate it a little bit more. (MM)
4002c43cc173Smrg    wlarc='${wl}'
4003c43cc173Smrg
4004c43cc173Smrg    # ancient GNU ld didn't support --whole-archive et. al.
4005c43cc173Smrg    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
4006c43cc173Smrg	grep 'no-whole-archive' > /dev/null; then
4007c43cc173Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
4008c43cc173Smrg    else
4009c43cc173Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
4010c43cc173Smrg    fi
4011c43cc173Smrg  else
4012c43cc173Smrg    with_gnu_ld=no
4013c43cc173Smrg    wlarc=
4014c43cc173Smrg
4015c43cc173Smrg    # A generic and very simple default shared library creation
4016c43cc173Smrg    # command for GNU C++ for the case where it uses the native
4017c43cc173Smrg    # linker, instead of GNU ld.  If possible, this setting should
4018c43cc173Smrg    # overridden to take advantage of the native linker features on
4019c43cc173Smrg    # the platform it is being used on.
4020c43cc173Smrg    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
4021c43cc173Smrg  fi
4022c43cc173Smrg
4023c43cc173Smrg  # Commands to make compiler produce verbose output that lists
4024c43cc173Smrg  # what "hidden" libraries, object files and flags are used when
4025c43cc173Smrg  # linking a shared library.
4026c43cc173Smrg  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
4027c43cc173Smrg
4028c43cc173Smrgelse
4029c43cc173Smrg  GXX=no
4030c43cc173Smrg  with_gnu_ld=no
4031c43cc173Smrg  wlarc=
4032c43cc173Smrgfi
4033c43cc173Smrg
4034c43cc173Smrg# PORTME: fill in a description of your system's C++ link characteristics
4035c43cc173SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4036c43cc173Smrg_LT_AC_TAGVAR(ld_shlibs, $1)=yes
4037c43cc173Smrgcase $host_os in
4038c43cc173Smrg  aix3*)
4039c43cc173Smrg    # FIXME: insert proper C++ library support
4040c43cc173Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
4041c43cc173Smrg    ;;
4042c43cc173Smrg  aix4* | aix5*)
4043c43cc173Smrg    if test "$host_cpu" = ia64; then
4044c43cc173Smrg      # On IA64, the linker does run time linking by default, so we don't
4045c43cc173Smrg      # have to do anything special.
4046c43cc173Smrg      aix_use_runtimelinking=no
4047c43cc173Smrg      exp_sym_flag='-Bexport'
4048c43cc173Smrg      no_entry_flag=""
4049c43cc173Smrg    else
4050c43cc173Smrg      aix_use_runtimelinking=no
4051c43cc173Smrg
4052c43cc173Smrg      # Test if we are trying to use run time linking or normal
4053c43cc173Smrg      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
4054c43cc173Smrg      # need to do runtime linking.
4055c43cc173Smrg      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
4056c43cc173Smrg	for ld_flag in $LDFLAGS; do
4057c43cc173Smrg	  case $ld_flag in
4058c43cc173Smrg	  *-brtl*)
4059c43cc173Smrg	    aix_use_runtimelinking=yes
4060c43cc173Smrg	    break
4061c43cc173Smrg	    ;;
4062c43cc173Smrg	  esac
4063c43cc173Smrg	done
4064c43cc173Smrg	;;
4065c43cc173Smrg      esac
4066c43cc173Smrg
4067c43cc173Smrg      exp_sym_flag='-bexport'
4068c43cc173Smrg      no_entry_flag='-bnoentry'
4069c43cc173Smrg    fi
4070c43cc173Smrg
4071c43cc173Smrg    # When large executables or shared objects are built, AIX ld can
4072c43cc173Smrg    # have problems creating the table of contents.  If linking a library
4073c43cc173Smrg    # or program results in "error TOC overflow" add -mminimal-toc to
4074c43cc173Smrg    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
4075c43cc173Smrg    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
4076c43cc173Smrg
4077c43cc173Smrg    _LT_AC_TAGVAR(archive_cmds, $1)=''
4078c43cc173Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
4079c43cc173Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
4080c43cc173Smrg    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
4081c43cc173Smrg
4082c43cc173Smrg    if test "$GXX" = yes; then
4083c43cc173Smrg      case $host_os in aix4.[[012]]|aix4.[[012]].*)
4084c43cc173Smrg      # We only want to do this on AIX 4.2 and lower, the check
4085c43cc173Smrg      # below for broken collect2 doesn't work under 4.3+
4086c43cc173Smrg	collect2name=`${CC} -print-prog-name=collect2`
4087c43cc173Smrg	if test -f "$collect2name" && \
4088c43cc173Smrg	   strings "$collect2name" | grep resolve_lib_name >/dev/null
4089c43cc173Smrg	then
4090c43cc173Smrg	  # We have reworked collect2
4091c43cc173Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
4092c43cc173Smrg	else
4093c43cc173Smrg	  # We have old collect2
4094c43cc173Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
4095c43cc173Smrg	  # It fails to find uninstalled libraries when the uninstalled
4096c43cc173Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
4097c43cc173Smrg	  # to unsupported forces relinking
4098c43cc173Smrg	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
4099c43cc173Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4100c43cc173Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
4101c43cc173Smrg	fi
4102c43cc173Smrg	;;
4103c43cc173Smrg      esac
4104c43cc173Smrg      shared_flag='-shared'
4105c43cc173Smrg      if test "$aix_use_runtimelinking" = yes; then
4106c43cc173Smrg	shared_flag="$shared_flag "'${wl}-G'
4107c43cc173Smrg      fi
4108c43cc173Smrg    else
4109c43cc173Smrg      # not using gcc
4110c43cc173Smrg      if test "$host_cpu" = ia64; then
4111c43cc173Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
4112c43cc173Smrg	# chokes on -Wl,-G. The following line is correct:
4113c43cc173Smrg	shared_flag='-G'
4114c43cc173Smrg      else
4115c43cc173Smrg	if test "$aix_use_runtimelinking" = yes; then
4116c43cc173Smrg	  shared_flag='${wl}-G'
4117c43cc173Smrg	else
4118c43cc173Smrg	  shared_flag='${wl}-bM:SRE'
4119c43cc173Smrg	fi
4120c43cc173Smrg      fi
4121c43cc173Smrg    fi
4122c43cc173Smrg
4123c43cc173Smrg    # It seems that -bexpall does not export symbols beginning with
4124c43cc173Smrg    # underscore (_), so it is better to generate a list of symbols to export.
4125c43cc173Smrg    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
4126c43cc173Smrg    if test "$aix_use_runtimelinking" = yes; then
4127c43cc173Smrg      # Warning - without using the other runtime loading flags (-brtl),
4128c43cc173Smrg      # -berok will link without error, but may produce a broken library.
4129c43cc173Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
4130c43cc173Smrg      # Determine the default libpath from the value encoded in an empty executable.
4131c43cc173Smrg      _LT_AC_SYS_LIBPATH_AIX
4132c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
4133c43cc173Smrg
4134c43cc173Smrg      _LT_AC_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 "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
4135c43cc173Smrg     else
4136c43cc173Smrg      if test "$host_cpu" = ia64; then
4137c43cc173Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
4138c43cc173Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
4139c43cc173Smrg	_LT_AC_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"
4140c43cc173Smrg      else
4141c43cc173Smrg	# Determine the default libpath from the value encoded in an empty executable.
4142c43cc173Smrg	_LT_AC_SYS_LIBPATH_AIX
4143c43cc173Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
4144c43cc173Smrg	# Warning - without using the other run time loading flags,
4145c43cc173Smrg	# -berok will link without error, but may produce a broken library.
4146c43cc173Smrg	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
4147c43cc173Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
4148c43cc173Smrg	# Exported symbols can be pulled into shared objects from archives
4149c43cc173Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
4150c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
4151c43cc173Smrg	# This is similar to how AIX traditionally builds its shared libraries.
4152c43cc173Smrg	_LT_AC_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'
4153c43cc173Smrg      fi
4154c43cc173Smrg    fi
4155c43cc173Smrg    ;;
4156c43cc173Smrg
4157c43cc173Smrg  beos*)
4158c43cc173Smrg    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
4159c43cc173Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
4160c43cc173Smrg      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
4161c43cc173Smrg      # support --undefined.  This deserves some investigation.  FIXME
4162c43cc173Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4163c43cc173Smrg    else
4164c43cc173Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
4165c43cc173Smrg    fi
4166c43cc173Smrg    ;;
4167c43cc173Smrg
4168c43cc173Smrg  chorus*)
4169c43cc173Smrg    case $cc_basename in
4170c43cc173Smrg      *)
4171c43cc173Smrg	# FIXME: insert proper C++ library support
4172c43cc173Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
4173c43cc173Smrg	;;
4174c43cc173Smrg    esac
4175c43cc173Smrg    ;;
4176c43cc173Smrg
4177c43cc173Smrg  cygwin* | mingw* | pw32*)
4178c43cc173Smrg    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
4179c43cc173Smrg    # as there is no search path for DLLs.
4180c43cc173Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4181c43cc173Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
4182c43cc173Smrg    _LT_AC_TAGVAR(always_export_symbols, $1)=no
4183c43cc173Smrg    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4184c43cc173Smrg
4185c43cc173Smrg    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
4186c43cc173Smrg      _LT_AC_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'
4187c43cc173Smrg      # If the export-symbols file already is a .def file (1st line
4188c43cc173Smrg      # is EXPORTS), use it as is; otherwise, prepend...
4189c43cc173Smrg      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
4190c43cc173Smrg	cp $export_symbols $output_objdir/$soname.def;
4191c43cc173Smrg      else
4192c43cc173Smrg	echo EXPORTS > $output_objdir/$soname.def;
4193c43cc173Smrg	cat $export_symbols >> $output_objdir/$soname.def;
4194c43cc173Smrg      fi~
4195c43cc173Smrg      $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'
4196c43cc173Smrg    else
4197c43cc173Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
4198c43cc173Smrg    fi
4199c43cc173Smrg  ;;
4200c43cc173Smrg      darwin* | rhapsody*)
4201c43cc173Smrg        case $host_os in
4202c43cc173Smrg        rhapsody* | darwin1.[[012]])
4203c43cc173Smrg         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
4204c43cc173Smrg         ;;
4205c43cc173Smrg       *) # Darwin 1.3 on
4206c43cc173Smrg         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
4207c43cc173Smrg           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
4208c43cc173Smrg         else
4209c43cc173Smrg           case ${MACOSX_DEPLOYMENT_TARGET} in
4210c43cc173Smrg             10.[[012]])
4211c43cc173Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
4212c43cc173Smrg               ;;
4213c43cc173Smrg             10.*)
4214c43cc173Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
4215c43cc173Smrg               ;;
4216c43cc173Smrg           esac
4217c43cc173Smrg         fi
4218c43cc173Smrg         ;;
4219c43cc173Smrg        esac
4220c43cc173Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
4221c43cc173Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
4222c43cc173Smrg      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
4223c43cc173Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4224c43cc173Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
4225c43cc173Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
4226c43cc173Smrg
4227c43cc173Smrg    if test "$GXX" = yes ; then
4228c43cc173Smrg      lt_int_apple_cc_single_mod=no
4229c43cc173Smrg      output_verbose_link_cmd='echo'
4230c43cc173Smrg      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
4231c43cc173Smrg       lt_int_apple_cc_single_mod=yes
4232c43cc173Smrg      fi
4233c43cc173Smrg      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
4234c43cc173Smrg       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
4235c43cc173Smrg      else
4236c43cc173Smrg          _LT_AC_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'
4237c43cc173Smrg        fi
4238c43cc173Smrg        _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
4239c43cc173Smrg        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
4240c43cc173Smrg          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
4241c43cc173Smrg            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
4242c43cc173Smrg          else
4243c43cc173Smrg            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
4244c43cc173Smrg          fi
4245c43cc173Smrg            _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
4246c43cc173Smrg      else
4247c43cc173Smrg      case $cc_basename in
4248c43cc173Smrg        xlc*)
4249c43cc173Smrg         output_verbose_link_cmd='echo'
4250c43cc173Smrg          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
4251c43cc173Smrg          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
4252c43cc173Smrg          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
4253c43cc173Smrg          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
4254c43cc173Smrg          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
4255c43cc173Smrg          ;;
4256c43cc173Smrg       *)
4257c43cc173Smrg         _LT_AC_TAGVAR(ld_shlibs, $1)=no
4258c43cc173Smrg          ;;
4259c43cc173Smrg      esac
4260c43cc173Smrg      fi
4261c43cc173Smrg        ;;
4262c43cc173Smrg
4263c43cc173Smrg  dgux*)
4264c43cc173Smrg    case $cc_basename in
4265c43cc173Smrg      ec++*)
4266c43cc173Smrg	# FIXME: insert proper C++ library support
4267c43cc173Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
4268c43cc173Smrg	;;
4269c43cc173Smrg      ghcx*)
4270c43cc173Smrg	# Green Hills C++ Compiler
4271c43cc173Smrg	# FIXME: insert proper C++ library support
4272c43cc173Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
4273c43cc173Smrg	;;
4274c43cc173Smrg      *)
4275c43cc173Smrg	# FIXME: insert proper C++ library support
4276c43cc173Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
4277c43cc173Smrg	;;
4278c43cc173Smrg    esac
4279c43cc173Smrg    ;;
4280c43cc173Smrg  freebsd[[12]]*)
4281c43cc173Smrg    # C++ shared libraries reported to be fairly broken before switch to ELF
4282c43cc173Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
4283c43cc173Smrg    ;;
4284c43cc173Smrg  freebsd-elf*)
4285c43cc173Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
4286c43cc173Smrg    ;;
4287c43cc173Smrg  freebsd* | kfreebsd*-gnu | dragonfly*)
4288c43cc173Smrg    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
4289c43cc173Smrg    # conventions
4290c43cc173Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
4291c43cc173Smrg    ;;
4292c43cc173Smrg  gnu*)
4293c43cc173Smrg    ;;
4294c43cc173Smrg  hpux9*)
4295c43cc173Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4296c43cc173Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
4297c43cc173Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4298c43cc173Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
4299c43cc173Smrg    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
4300c43cc173Smrg				# but as the default
4301c43cc173Smrg				# location of the library.
4302c43cc173Smrg
4303c43cc173Smrg    case $cc_basename in
4304c43cc173Smrg    CC*)
4305c43cc173Smrg      # FIXME: insert proper C++ library support
4306c43cc173Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
4307c43cc173Smrg      ;;
4308c43cc173Smrg    aCC*)
4309c43cc173Smrg      _LT_AC_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'
4310c43cc173Smrg      # Commands to make compiler produce verbose output that lists
4311c43cc173Smrg      # what "hidden" libraries, object files and flags are used when
4312c43cc173Smrg      # linking a shared library.
4313c43cc173Smrg      #
4314c43cc173Smrg      # There doesn't appear to be a way to prevent this compiler from
4315c43cc173Smrg      # explicitly linking system object files so we need to strip them
4316c43cc173Smrg      # from the output so that they don't get included in the library
4317c43cc173Smrg      # dependencies.
4318c43cc173Smrg      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 $list'
4319c43cc173Smrg      ;;
4320c43cc173Smrg    *)
4321c43cc173Smrg      if test "$GXX" = yes; then
4322c43cc173Smrg        _LT_AC_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'
4323c43cc173Smrg      else
4324c43cc173Smrg        # FIXME: insert proper C++ library support
4325c43cc173Smrg        _LT_AC_TAGVAR(ld_shlibs, $1)=no
4326c43cc173Smrg      fi
4327c43cc173Smrg      ;;
4328c43cc173Smrg    esac
4329c43cc173Smrg    ;;
4330c43cc173Smrg  hpux10*|hpux11*)
4331c43cc173Smrg    if test $with_gnu_ld = no; then
4332c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4333c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
4334c43cc173Smrg
4335c43cc173Smrg      case $host_cpu in
4336c43cc173Smrg      hppa*64*|ia64*)
4337c43cc173Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
4338c43cc173Smrg        ;;
4339c43cc173Smrg      *)
4340c43cc173Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4341c43cc173Smrg        ;;
4342c43cc173Smrg      esac
4343c43cc173Smrg    fi
4344c43cc173Smrg    case $host_cpu in
4345c43cc173Smrg    hppa*64*|ia64*)
4346c43cc173Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
4347c43cc173Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
4348c43cc173Smrg      ;;
4349c43cc173Smrg    *)
4350c43cc173Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
4351c43cc173Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
4352c43cc173Smrg					      # but as the default
4353c43cc173Smrg					      # location of the library.
4354c43cc173Smrg      ;;
4355c43cc173Smrg    esac
4356c43cc173Smrg
4357c43cc173Smrg    case $cc_basename in
4358c43cc173Smrg      CC*)
4359c43cc173Smrg	# FIXME: insert proper C++ library support
4360c43cc173Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
4361c43cc173Smrg	;;
4362c43cc173Smrg      aCC*)
4363c43cc173Smrg	case $host_cpu in
4364c43cc173Smrg	hppa*64*)
4365c43cc173Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
4366c43cc173Smrg	  ;;
4367c43cc173Smrg	ia64*)
4368c43cc173Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
4369c43cc173Smrg	  ;;
4370c43cc173Smrg	*)
4371c43cc173Smrg	  _LT_AC_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'
4372c43cc173Smrg	  ;;
4373c43cc173Smrg	esac
4374c43cc173Smrg	# Commands to make compiler produce verbose output that lists
4375c43cc173Smrg	# what "hidden" libraries, object files and flags are used when
4376c43cc173Smrg	# linking a shared library.
4377c43cc173Smrg	#
4378c43cc173Smrg	# There doesn't appear to be a way to prevent this compiler from
4379c43cc173Smrg	# explicitly linking system object files so we need to strip them
4380c43cc173Smrg	# from the output so that they don't get included in the library
4381c43cc173Smrg	# dependencies.
4382c43cc173Smrg	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 $list'
4383c43cc173Smrg	;;
4384c43cc173Smrg      *)
4385c43cc173Smrg	if test "$GXX" = yes; then
4386c43cc173Smrg	  if test $with_gnu_ld = no; then
4387c43cc173Smrg	    case $host_cpu in
4388c43cc173Smrg	    hppa*64*)
4389c43cc173Smrg	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
4390c43cc173Smrg	      ;;
4391c43cc173Smrg	    ia64*)
4392c43cc173Smrg	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
4393c43cc173Smrg	      ;;
4394c43cc173Smrg	    *)
4395c43cc173Smrg	      _LT_AC_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'
4396c43cc173Smrg	      ;;
4397c43cc173Smrg	    esac
4398c43cc173Smrg	  fi
4399c43cc173Smrg	else
4400c43cc173Smrg	  # FIXME: insert proper C++ library support
4401c43cc173Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
4402c43cc173Smrg	fi
4403c43cc173Smrg	;;
4404c43cc173Smrg    esac
4405c43cc173Smrg    ;;
4406c43cc173Smrg  interix3*)
4407c43cc173Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=no
4408c43cc173Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
4409c43cc173Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4410c43cc173Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4411c43cc173Smrg    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
4412c43cc173Smrg    # Instead, shared libraries are loaded at an image base (0x10000000 by
4413c43cc173Smrg    # default) and relocated if they conflict, which is a slow very memory
4414c43cc173Smrg    # consuming and fragmenting process.  To avoid this, we pick a random,
4415c43cc173Smrg    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
4416c43cc173Smrg    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
4417c43cc173Smrg    _LT_AC_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'
4418c43cc173Smrg    _LT_AC_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'
4419c43cc173Smrg    ;;
4420c43cc173Smrg  irix5* | irix6*)
4421c43cc173Smrg    case $cc_basename in
4422c43cc173Smrg      CC*)
4423c43cc173Smrg	# SGI C++
4424c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
4425c43cc173Smrg
4426c43cc173Smrg	# Archives containing C++ object files must be created using
4427c43cc173Smrg	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
4428c43cc173Smrg	# necessary to make sure instantiated templates are included
4429c43cc173Smrg	# in the archive.
4430c43cc173Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
4431c43cc173Smrg	;;
4432c43cc173Smrg      *)
4433c43cc173Smrg	if test "$GXX" = yes; then
4434c43cc173Smrg	  if test "$with_gnu_ld" = no; then
4435c43cc173Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
4436c43cc173Smrg	  else
4437c43cc173Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
4438c43cc173Smrg	  fi
4439c43cc173Smrg	fi
4440c43cc173Smrg	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
4441c43cc173Smrg	;;
4442c43cc173Smrg    esac
4443c43cc173Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4444c43cc173Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
4445c43cc173Smrg    ;;
4446c43cc173Smrg  linux*)
4447c43cc173Smrg    case $cc_basename in
4448c43cc173Smrg      KCC*)
4449c43cc173Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
4450c43cc173Smrg
4451c43cc173Smrg	# KCC will only create a shared library if the output file
4452c43cc173Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
4453c43cc173Smrg	# to its proper name (with version) after linking.
4454c43cc173Smrg	_LT_AC_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'
4455c43cc173Smrg	_LT_AC_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'
4456c43cc173Smrg	# Commands to make compiler produce verbose output that lists
4457c43cc173Smrg	# what "hidden" libraries, object files and flags are used when
4458c43cc173Smrg	# linking a shared library.
4459c43cc173Smrg	#
4460c43cc173Smrg	# There doesn't appear to be a way to prevent this compiler from
4461c43cc173Smrg	# explicitly linking system object files so we need to strip them
4462c43cc173Smrg	# from the output so that they don't get included in the library
4463c43cc173Smrg	# dependencies.
4464c43cc173Smrg	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 $list'
4465c43cc173Smrg
4466c43cc173Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
4467c43cc173Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
4468c43cc173Smrg
4469c43cc173Smrg	# Archives containing C++ object files must be created using
4470c43cc173Smrg	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
4471c43cc173Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
4472c43cc173Smrg	;;
4473c43cc173Smrg      icpc*)
4474c43cc173Smrg	# Intel C++
4475c43cc173Smrg	with_gnu_ld=yes
4476c43cc173Smrg	# version 8.0 and above of icpc choke on multiply defined symbols
4477c43cc173Smrg	# if we add $predep_objects and $postdep_objects, however 7.1 and
4478c43cc173Smrg	# earlier do not add the objects themselves.
4479c43cc173Smrg	case `$CC -V 2>&1` in
4480c43cc173Smrg	*"Version 7."*)
4481c43cc173Smrg  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
4482c43cc173Smrg  	  _LT_AC_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'
4483c43cc173Smrg	  ;;
4484c43cc173Smrg	*)  # Version 8.0 or newer
4485c43cc173Smrg	  tmp_idyn=
4486c43cc173Smrg	  case $host_cpu in
4487c43cc173Smrg	    ia64*) tmp_idyn=' -i_dynamic';;
4488c43cc173Smrg	  esac
4489c43cc173Smrg  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4490c43cc173Smrg	  _LT_AC_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'
4491c43cc173Smrg	  ;;
4492c43cc173Smrg	esac
4493c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
4494c43cc173Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4495c43cc173Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
4496c43cc173Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
4497c43cc173Smrg	;;
4498c43cc173Smrg      pgCC*)
4499c43cc173Smrg        # Portland Group C++ compiler
4500c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
4501c43cc173Smrg  	_LT_AC_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'
4502c43cc173Smrg
4503c43cc173Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
4504c43cc173Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
4505c43cc173Smrg	_LT_AC_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'
4506c43cc173Smrg        ;;
4507c43cc173Smrg      cxx*)
4508c43cc173Smrg	# Compaq C++
4509c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
4510c43cc173Smrg	_LT_AC_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'
4511c43cc173Smrg
4512c43cc173Smrg	runpath_var=LD_RUN_PATH
4513c43cc173Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
4514c43cc173Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
4515c43cc173Smrg
4516c43cc173Smrg	# Commands to make compiler produce verbose output that lists
4517c43cc173Smrg	# what "hidden" libraries, object files and flags are used when
4518c43cc173Smrg	# linking a shared library.
4519c43cc173Smrg	#
4520c43cc173Smrg	# There doesn't appear to be a way to prevent this compiler from
4521c43cc173Smrg	# explicitly linking system object files so we need to strip them
4522c43cc173Smrg	# from the output so that they don't get included in the library
4523c43cc173Smrg	# dependencies.
4524c43cc173Smrg	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
4525c43cc173Smrg	;;
4526c43cc173Smrg    esac
4527c43cc173Smrg    ;;
4528c43cc173Smrg  lynxos*)
4529c43cc173Smrg    # FIXME: insert proper C++ library support
4530c43cc173Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
4531c43cc173Smrg    ;;
4532c43cc173Smrg  m88k*)
4533c43cc173Smrg    # FIXME: insert proper C++ library support
4534c43cc173Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
4535c43cc173Smrg    ;;
4536c43cc173Smrg  mvs*)
4537c43cc173Smrg    case $cc_basename in
4538c43cc173Smrg      cxx*)
4539c43cc173Smrg	# FIXME: insert proper C++ library support
4540c43cc173Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
4541c43cc173Smrg	;;
4542c43cc173Smrg      *)
4543c43cc173Smrg	# FIXME: insert proper C++ library support
4544c43cc173Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
4545c43cc173Smrg	;;
4546c43cc173Smrg    esac
4547c43cc173Smrg    ;;
4548c43cc173Smrg  netbsd*)
4549c43cc173Smrg    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
4550c43cc173Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
4551c43cc173Smrg      wlarc=
4552c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4553c43cc173Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
4554c43cc173Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
4555c43cc173Smrg    fi
4556c43cc173Smrg    # Workaround some broken pre-1.5 toolchains
4557c43cc173Smrg    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
4558c43cc173Smrg    ;;
4559c43cc173Smrg  openbsd2*)
4560c43cc173Smrg    # C++ shared libraries are fairly broken
4561c43cc173Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
4562c43cc173Smrg    ;;
4563c43cc173Smrg  openbsd*)
4564c43cc173Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
4565c43cc173Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
4566c43cc173Smrg    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
4567c43cc173Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4568c43cc173Smrg    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4569c43cc173Smrg      _LT_AC_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'
4570c43cc173Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4571c43cc173Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
4572c43cc173Smrg    fi
4573c43cc173Smrg    output_verbose_link_cmd='echo'
4574c43cc173Smrg    ;;
4575c43cc173Smrg  osf3*)
4576c43cc173Smrg    case $cc_basename in
4577c43cc173Smrg      KCC*)
4578c43cc173Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
4579c43cc173Smrg
4580c43cc173Smrg	# KCC will only create a shared library if the output file
4581c43cc173Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
4582c43cc173Smrg	# to its proper name (with version) after linking.
4583c43cc173Smrg	_LT_AC_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'
4584c43cc173Smrg
4585c43cc173Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4586c43cc173Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
4587c43cc173Smrg
4588c43cc173Smrg	# Archives containing C++ object files must be created using
4589c43cc173Smrg	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
4590c43cc173Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
4591c43cc173Smrg
4592c43cc173Smrg	;;
4593c43cc173Smrg      RCC*)
4594c43cc173Smrg	# Rational C++ 2.4.1
4595c43cc173Smrg	# FIXME: insert proper C++ library support
4596c43cc173Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
4597c43cc173Smrg	;;
4598c43cc173Smrg      cxx*)
4599c43cc173Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
4600c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
4601c43cc173Smrg
4602c43cc173Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4603c43cc173Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
4604c43cc173Smrg
4605c43cc173Smrg	# Commands to make compiler produce verbose output that lists
4606c43cc173Smrg	# what "hidden" libraries, object files and flags are used when
4607c43cc173Smrg	# linking a shared library.
4608c43cc173Smrg	#
4609c43cc173Smrg	# There doesn't appear to be a way to prevent this compiler from
4610c43cc173Smrg	# explicitly linking system object files so we need to strip them
4611c43cc173Smrg	# from the output so that they don't get included in the library
4612c43cc173Smrg	# dependencies.
4613c43cc173Smrg	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
4614c43cc173Smrg	;;
4615c43cc173Smrg      *)
4616c43cc173Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
4617c43cc173Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
4618c43cc173Smrg	  _LT_AC_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 ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
4619c43cc173Smrg
4620c43cc173Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4621c43cc173Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
4622c43cc173Smrg
4623c43cc173Smrg	  # Commands to make compiler produce verbose output that lists
4624c43cc173Smrg	  # what "hidden" libraries, object files and flags are used when
4625c43cc173Smrg	  # linking a shared library.
4626c43cc173Smrg	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
4627c43cc173Smrg
4628c43cc173Smrg	else
4629c43cc173Smrg	  # FIXME: insert proper C++ library support
4630c43cc173Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
4631c43cc173Smrg	fi
4632c43cc173Smrg	;;
4633c43cc173Smrg    esac
4634c43cc173Smrg    ;;
4635c43cc173Smrg  osf4* | osf5*)
4636c43cc173Smrg    case $cc_basename in
4637c43cc173Smrg      KCC*)
4638c43cc173Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
4639c43cc173Smrg
4640c43cc173Smrg	# KCC will only create a shared library if the output file
4641c43cc173Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
4642c43cc173Smrg	# to its proper name (with version) after linking.
4643c43cc173Smrg	_LT_AC_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'
4644c43cc173Smrg
4645c43cc173Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4646c43cc173Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
4647c43cc173Smrg
4648c43cc173Smrg	# Archives containing C++ object files must be created using
4649c43cc173Smrg	# the KAI C++ compiler.
4650c43cc173Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
4651c43cc173Smrg	;;
4652c43cc173Smrg      RCC*)
4653c43cc173Smrg	# Rational C++ 2.4.1
4654c43cc173Smrg	# FIXME: insert proper C++ library support
4655c43cc173Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
4656c43cc173Smrg	;;
4657c43cc173Smrg      cxx*)
4658c43cc173Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
4659c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
4660c43cc173Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
4661c43cc173Smrg	  echo "-hidden">> $lib.exp~
4662c43cc173Smrg	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
4663c43cc173Smrg	  $rm $lib.exp'
4664c43cc173Smrg
4665c43cc173Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
4666c43cc173Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
4667c43cc173Smrg
4668c43cc173Smrg	# Commands to make compiler produce verbose output that lists
4669c43cc173Smrg	# what "hidden" libraries, object files and flags are used when
4670c43cc173Smrg	# linking a shared library.
4671c43cc173Smrg	#
4672c43cc173Smrg	# There doesn't appear to be a way to prevent this compiler from
4673c43cc173Smrg	# explicitly linking system object files so we need to strip them
4674c43cc173Smrg	# from the output so that they don't get included in the library
4675c43cc173Smrg	# dependencies.
4676c43cc173Smrg	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
4677c43cc173Smrg	;;
4678c43cc173Smrg      *)
4679c43cc173Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
4680c43cc173Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
4681c43cc173Smrg	 _LT_AC_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` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
4682c43cc173Smrg
4683c43cc173Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4684c43cc173Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
4685c43cc173Smrg
4686c43cc173Smrg	  # Commands to make compiler produce verbose output that lists
4687c43cc173Smrg	  # what "hidden" libraries, object files and flags are used when
4688c43cc173Smrg	  # linking a shared library.
4689c43cc173Smrg	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
4690c43cc173Smrg
4691c43cc173Smrg	else
4692c43cc173Smrg	  # FIXME: insert proper C++ library support
4693c43cc173Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
4694c43cc173Smrg	fi
4695c43cc173Smrg	;;
4696c43cc173Smrg    esac
4697c43cc173Smrg    ;;
4698c43cc173Smrg  psos*)
4699c43cc173Smrg    # FIXME: insert proper C++ library support
4700c43cc173Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
4701c43cc173Smrg    ;;
4702c43cc173Smrg  sunos4*)
4703c43cc173Smrg    case $cc_basename in
4704c43cc173Smrg      CC*)
4705c43cc173Smrg	# Sun C++ 4.x
4706c43cc173Smrg	# FIXME: insert proper C++ library support
4707c43cc173Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
4708c43cc173Smrg	;;
4709c43cc173Smrg      lcc*)
4710c43cc173Smrg	# Lucid
4711c43cc173Smrg	# FIXME: insert proper C++ library support
4712c43cc173Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
4713c43cc173Smrg	;;
4714c43cc173Smrg      *)
4715c43cc173Smrg	# FIXME: insert proper C++ library support
4716c43cc173Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
4717c43cc173Smrg	;;
4718c43cc173Smrg    esac
4719c43cc173Smrg    ;;
4720c43cc173Smrg  solaris*)
4721c43cc173Smrg    case $cc_basename in
4722c43cc173Smrg      CC*)
4723c43cc173Smrg	# Sun C++ 4.2, 5.x and Centerline C++
4724c43cc173Smrg        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
4725c43cc173Smrg	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
4726c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
4727c43cc173Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
4728c43cc173Smrg	$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'
4729c43cc173Smrg
4730c43cc173Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4731c43cc173Smrg	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
4732c43cc173Smrg	case $host_os in
4733c43cc173Smrg	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
4734c43cc173Smrg	  *)
4735c43cc173Smrg	    # The C++ compiler is used as linker so we must use $wl
4736c43cc173Smrg	    # flag to pass the commands to the underlying system
4737c43cc173Smrg	    # linker. We must also pass each convience library through
4738c43cc173Smrg	    # to the system linker between allextract/defaultextract.
4739c43cc173Smrg	    # The C++ compiler will combine linker options so we
4740c43cc173Smrg	    # cannot just pass the convience library names through
4741c43cc173Smrg	    # without $wl.
4742c43cc173Smrg	    # Supported since Solaris 2.6 (maybe 2.5.1?)
4743c43cc173Smrg	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
4744c43cc173Smrg	    ;;
4745c43cc173Smrg	esac
4746c43cc173Smrg	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
4747c43cc173Smrg
4748c43cc173Smrg	output_verbose_link_cmd='echo'
4749c43cc173Smrg
4750c43cc173Smrg	# Archives containing C++ object files must be created using
4751c43cc173Smrg	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
4752c43cc173Smrg	# necessary to make sure instantiated templates are included
4753c43cc173Smrg	# in the archive.
4754c43cc173Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
4755c43cc173Smrg	;;
4756c43cc173Smrg      gcx*)
4757c43cc173Smrg	# Green Hills C++ Compiler
4758c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
4759c43cc173Smrg
4760c43cc173Smrg	# The C++ compiler must be used to create the archive.
4761c43cc173Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
4762c43cc173Smrg	;;
4763c43cc173Smrg      *)
4764c43cc173Smrg	# GNU C++ compiler with Solaris linker
4765c43cc173Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
4766c43cc173Smrg	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
4767c43cc173Smrg	  if $CC --version | grep -v '^2\.7' > /dev/null; then
4768c43cc173Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
4769c43cc173Smrg	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
4770c43cc173Smrg		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
4771c43cc173Smrg
4772c43cc173Smrg	    # Commands to make compiler produce verbose output that lists
4773c43cc173Smrg	    # what "hidden" libraries, object files and flags are used when
4774c43cc173Smrg	    # linking a shared library.
4775c43cc173Smrg	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
4776c43cc173Smrg	  else
4777c43cc173Smrg	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
4778c43cc173Smrg	    # platform.
4779c43cc173Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
4780c43cc173Smrg	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
4781c43cc173Smrg		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
4782c43cc173Smrg
4783c43cc173Smrg	    # Commands to make compiler produce verbose output that lists
4784c43cc173Smrg	    # what "hidden" libraries, object files and flags are used when
4785c43cc173Smrg	    # linking a shared library.
4786c43cc173Smrg	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
4787c43cc173Smrg	  fi
4788c43cc173Smrg
4789c43cc173Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
4790c43cc173Smrg	fi
4791c43cc173Smrg	;;
4792c43cc173Smrg    esac
4793c43cc173Smrg    ;;
4794c43cc173Smrg  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
4795c43cc173Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
4796c43cc173Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
4797c43cc173Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
4798c43cc173Smrg    runpath_var='LD_RUN_PATH'
4799c43cc173Smrg
4800c43cc173Smrg    case $cc_basename in
4801c43cc173Smrg      CC*)
4802c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
4803c43cc173Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
4804c43cc173Smrg	;;
4805c43cc173Smrg      *)
4806c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
4807c43cc173Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
4808c43cc173Smrg	;;
4809c43cc173Smrg    esac
4810c43cc173Smrg    ;;
4811c43cc173Smrg  sysv5* | sco3.2v5* | sco5v6*)
4812c43cc173Smrg    # Note: We can NOT use -z defs as we might desire, because we do not
4813c43cc173Smrg    # link with -lc, and that would cause any symbols used from libc to
4814c43cc173Smrg    # always be unresolved, which means just about no library would
4815c43cc173Smrg    # ever link correctly.  If we're not using GNU ld we use -z text
4816c43cc173Smrg    # though, which does catch some bad symbols but isn't as heavy-handed
4817c43cc173Smrg    # as -z defs.
4818c43cc173Smrg    # For security reasons, it is highly recommended that you always
4819c43cc173Smrg    # use absolute paths for naming shared libraries, and exclude the
4820c43cc173Smrg    # DT_RUNPATH tag from executables and libraries.  But doing so
4821c43cc173Smrg    # requires that you compile everything twice, which is a pain.
4822c43cc173Smrg    # So that behaviour is only enabled if SCOABSPATH is set to a
4823c43cc173Smrg    # non-empty value in the environment.  Most likely only useful for
4824c43cc173Smrg    # creating official distributions of packages.
4825c43cc173Smrg    # This is a hack until libtool officially supports absolute path
4826c43cc173Smrg    # names for shared libraries.
4827c43cc173Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
4828c43cc173Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
4829c43cc173Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
4830c43cc173Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
4831c43cc173Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
4832c43cc173Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
4833c43cc173Smrg    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
4834c43cc173Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
4835c43cc173Smrg    runpath_var='LD_RUN_PATH'
4836c43cc173Smrg
4837c43cc173Smrg    case $cc_basename in
4838c43cc173Smrg      CC*)
4839c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
4840c43cc173Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
4841c43cc173Smrg	;;
4842c43cc173Smrg      *)
4843c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
4844c43cc173Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
4845c43cc173Smrg	;;
4846c43cc173Smrg    esac
4847c43cc173Smrg    ;;
4848c43cc173Smrg  tandem*)
4849c43cc173Smrg    case $cc_basename in
4850c43cc173Smrg      NCC*)
4851c43cc173Smrg	# NonStop-UX NCC 3.20
4852c43cc173Smrg	# FIXME: insert proper C++ library support
4853c43cc173Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
4854c43cc173Smrg	;;
4855c43cc173Smrg      *)
4856c43cc173Smrg	# FIXME: insert proper C++ library support
4857c43cc173Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
4858c43cc173Smrg	;;
4859c43cc173Smrg    esac
4860c43cc173Smrg    ;;
4861c43cc173Smrg  vxworks*)
4862c43cc173Smrg    # FIXME: insert proper C++ library support
4863c43cc173Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
4864c43cc173Smrg    ;;
4865c43cc173Smrg  *)
4866c43cc173Smrg    # FIXME: insert proper C++ library support
4867c43cc173Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
4868c43cc173Smrg    ;;
4869c43cc173Smrgesac
4870c43cc173SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
4871c43cc173Smrgtest "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
4872c43cc173Smrg
4873c43cc173Smrg_LT_AC_TAGVAR(GCC, $1)="$GXX"
4874c43cc173Smrg_LT_AC_TAGVAR(LD, $1)="$LD"
4875c43cc173Smrg
4876c43cc173SmrgAC_LIBTOOL_POSTDEP_PREDEP($1)
4877c43cc173SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
4878c43cc173SmrgAC_LIBTOOL_PROG_CC_C_O($1)
4879c43cc173SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
4880c43cc173SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
4881c43cc173SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
4882c43cc173SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
4883c43cc173Smrg
4884c43cc173SmrgAC_LIBTOOL_CONFIG($1)
4885c43cc173Smrg
4886c43cc173SmrgAC_LANG_POP
4887c43cc173SmrgCC=$lt_save_CC
4888c43cc173SmrgLDCXX=$LD
4889c43cc173SmrgLD=$lt_save_LD
4890c43cc173SmrgGCC=$lt_save_GCC
4891c43cc173Smrgwith_gnu_ldcxx=$with_gnu_ld
4892c43cc173Smrgwith_gnu_ld=$lt_save_with_gnu_ld
4893c43cc173Smrglt_cv_path_LDCXX=$lt_cv_path_LD
4894c43cc173Smrglt_cv_path_LD=$lt_save_path_LD
4895c43cc173Smrglt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
4896c43cc173Smrglt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
4897c43cc173Smrg])# AC_LIBTOOL_LANG_CXX_CONFIG
4898c43cc173Smrg
4899c43cc173Smrg# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
4900c43cc173Smrg# ------------------------------------
4901c43cc173Smrg# Figure out "hidden" library dependencies from verbose
4902c43cc173Smrg# compiler output when linking a shared library.
4903c43cc173Smrg# Parse the compiler output and extract the necessary
4904c43cc173Smrg# objects, libraries and library flags.
4905c43cc173SmrgAC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
4906c43cc173Smrgdnl we can't use the lt_simple_compile_test_code here,
4907c43cc173Smrgdnl because it contains code intended for an executable,
4908c43cc173Smrgdnl not a library.  It's possible we should let each
4909c43cc173Smrgdnl tag define a new lt_????_link_test_code variable,
4910c43cc173Smrgdnl but it's only used here...
4911c43cc173Smrgifelse([$1],[],[cat > conftest.$ac_ext <<EOF
4912c43cc173Smrgint a;
4913c43cc173Smrgvoid foo (void) { a = 0; }
4914c43cc173SmrgEOF
4915c43cc173Smrg],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
4916c43cc173Smrgclass Foo
4917c43cc173Smrg{
4918c43cc173Smrgpublic:
4919c43cc173Smrg  Foo (void) { a = 0; }
4920c43cc173Smrgprivate:
4921c43cc173Smrg  int a;
4922c43cc173Smrg};
4923c43cc173SmrgEOF
4924c43cc173Smrg],[$1],[F77],[cat > conftest.$ac_ext <<EOF
4925c43cc173Smrg      subroutine foo
4926c43cc173Smrg      implicit none
4927c43cc173Smrg      integer*4 a
4928c43cc173Smrg      a=0
4929c43cc173Smrg      return
4930c43cc173Smrg      end
4931c43cc173SmrgEOF
4932c43cc173Smrg],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
4933c43cc173Smrgpublic class foo {
4934c43cc173Smrg  private int a;
4935c43cc173Smrg  public void bar (void) {
4936c43cc173Smrg    a = 0;
4937c43cc173Smrg  }
4938c43cc173Smrg};
4939c43cc173SmrgEOF
4940c43cc173Smrg])
4941c43cc173Smrgdnl Parse the compiler output and extract the necessary
4942c43cc173Smrgdnl objects, libraries and library flags.
4943c43cc173Smrgif AC_TRY_EVAL(ac_compile); then
4944c43cc173Smrg  # Parse the compiler output and extract the necessary
4945c43cc173Smrg  # objects, libraries and library flags.
4946c43cc173Smrg
4947c43cc173Smrg  # Sentinel used to keep track of whether or not we are before
4948c43cc173Smrg  # the conftest object file.
4949c43cc173Smrg  pre_test_object_deps_done=no
4950c43cc173Smrg
4951c43cc173Smrg  # The `*' in the case matches for architectures that use `case' in
4952c43cc173Smrg  # $output_verbose_cmd can trigger glob expansion during the loop
4953c43cc173Smrg  # eval without this substitution.
4954c43cc173Smrg  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
4955c43cc173Smrg
4956c43cc173Smrg  for p in `eval $output_verbose_link_cmd`; do
4957c43cc173Smrg    case $p in
4958c43cc173Smrg
4959c43cc173Smrg    -L* | -R* | -l*)
4960c43cc173Smrg       # Some compilers place space between "-{L,R}" and the path.
4961c43cc173Smrg       # Remove the space.
4962c43cc173Smrg       if test $p = "-L" \
4963c43cc173Smrg	  || test $p = "-R"; then
4964c43cc173Smrg	 prev=$p
4965c43cc173Smrg	 continue
4966c43cc173Smrg       else
4967c43cc173Smrg	 prev=
4968c43cc173Smrg       fi
4969c43cc173Smrg
4970c43cc173Smrg       if test "$pre_test_object_deps_done" = no; then
4971c43cc173Smrg	 case $p in
4972c43cc173Smrg	 -L* | -R*)
4973c43cc173Smrg	   # Internal compiler library paths should come after those
4974c43cc173Smrg	   # provided the user.  The postdeps already come after the
4975c43cc173Smrg	   # user supplied libs so there is no need to process them.
4976c43cc173Smrg	   if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
4977c43cc173Smrg	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
4978c43cc173Smrg	   else
4979c43cc173Smrg	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
4980c43cc173Smrg	   fi
4981c43cc173Smrg	   ;;
4982c43cc173Smrg	 # The "-l" case would never come before the object being
4983c43cc173Smrg	 # linked, so don't bother handling this case.
4984c43cc173Smrg	 esac
4985c43cc173Smrg       else
4986c43cc173Smrg	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
4987c43cc173Smrg	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
4988c43cc173Smrg	 else
4989c43cc173Smrg	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
4990c43cc173Smrg	 fi
4991c43cc173Smrg       fi
4992c43cc173Smrg       ;;
4993c43cc173Smrg
4994c43cc173Smrg    *.$objext)
4995c43cc173Smrg       # This assumes that the test object file only shows up
4996c43cc173Smrg       # once in the compiler output.
4997c43cc173Smrg       if test "$p" = "conftest.$objext"; then
4998c43cc173Smrg	 pre_test_object_deps_done=yes
4999c43cc173Smrg	 continue
5000c43cc173Smrg       fi
5001c43cc173Smrg
5002c43cc173Smrg       if test "$pre_test_object_deps_done" = no; then
5003c43cc173Smrg	 if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
5004c43cc173Smrg	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
5005c43cc173Smrg	 else
5006c43cc173Smrg	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
5007c43cc173Smrg	 fi
5008c43cc173Smrg       else
5009c43cc173Smrg	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
5010c43cc173Smrg	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
5011c43cc173Smrg	 else
5012c43cc173Smrg	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
5013c43cc173Smrg	 fi
5014c43cc173Smrg       fi
5015c43cc173Smrg       ;;
5016c43cc173Smrg
5017c43cc173Smrg    *) ;; # Ignore the rest.
5018c43cc173Smrg
5019c43cc173Smrg    esac
5020c43cc173Smrg  done
5021c43cc173Smrg
5022c43cc173Smrg  # Clean up.
5023c43cc173Smrg  rm -f a.out a.exe
5024c43cc173Smrgelse
5025c43cc173Smrg  echo "libtool.m4: error: problem compiling $1 test program"
5026c43cc173Smrgfi
5027c43cc173Smrg
5028c43cc173Smrg$rm -f confest.$objext
5029c43cc173Smrg
5030c43cc173Smrg# PORTME: override above test on systems where it is broken
5031c43cc173Smrgifelse([$1],[CXX],
5032c43cc173Smrg[case $host_os in
5033c43cc173Smrginterix3*)
5034c43cc173Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
5035c43cc173Smrg  # hack all around it, let's just trust "g++" to DTRT.
5036c43cc173Smrg  _LT_AC_TAGVAR(predep_objects,$1)=
5037c43cc173Smrg  _LT_AC_TAGVAR(postdep_objects,$1)=
5038c43cc173Smrg  _LT_AC_TAGVAR(postdeps,$1)=
5039c43cc173Smrg  ;;
5040c43cc173Smrg
5041c43cc173Smrgsolaris*)
5042c43cc173Smrg  case $cc_basename in
5043c43cc173Smrg  CC*)
5044c43cc173Smrg    # Adding this requires a known-good setup of shared libraries for
5045c43cc173Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
5046c43cc173Smrg    # archive will be linked into the output, leading to subtle bugs.
5047c43cc173Smrg    _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
5048c43cc173Smrg    ;;
5049c43cc173Smrg  esac
5050c43cc173Smrg  ;;
5051c43cc173Smrgesac
5052c43cc173Smrg])
5053c43cc173Smrg
5054c43cc173Smrgcase " $_LT_AC_TAGVAR(postdeps, $1) " in
5055c43cc173Smrg*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
5056c43cc173Smrgesac
5057c43cc173Smrg])# AC_LIBTOOL_POSTDEP_PREDEP
5058c43cc173Smrg
5059c43cc173Smrg# AC_LIBTOOL_LANG_F77_CONFIG
5060c43cc173Smrg# --------------------------
5061c43cc173Smrg# Ensure that the configuration vars for the C compiler are
5062c43cc173Smrg# suitably defined.  Those variables are subsequently used by
5063c43cc173Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
5064c43cc173SmrgAC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
5065c43cc173SmrgAC_DEFUN([_LT_AC_LANG_F77_CONFIG],
5066c43cc173Smrg[AC_REQUIRE([AC_PROG_F77])
5067c43cc173SmrgAC_LANG_PUSH(Fortran 77)
5068c43cc173Smrg
5069c43cc173Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
5070c43cc173Smrg_LT_AC_TAGVAR(allow_undefined_flag, $1)=
5071c43cc173Smrg_LT_AC_TAGVAR(always_export_symbols, $1)=no
5072c43cc173Smrg_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
5073c43cc173Smrg_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
5074c43cc173Smrg_LT_AC_TAGVAR(hardcode_direct, $1)=no
5075c43cc173Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
5076c43cc173Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
5077c43cc173Smrg_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
5078c43cc173Smrg_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
5079c43cc173Smrg_LT_AC_TAGVAR(hardcode_automatic, $1)=no
5080c43cc173Smrg_LT_AC_TAGVAR(module_cmds, $1)=
5081c43cc173Smrg_LT_AC_TAGVAR(module_expsym_cmds, $1)=
5082c43cc173Smrg_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
5083c43cc173Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
5084c43cc173Smrg_LT_AC_TAGVAR(no_undefined_flag, $1)=
5085c43cc173Smrg_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
5086c43cc173Smrg_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5087c43cc173Smrg
5088c43cc173Smrg# Source file extension for f77 test sources.
5089c43cc173Smrgac_ext=f
5090c43cc173Smrg
5091c43cc173Smrg# Object file extension for compiled f77 test sources.
5092c43cc173Smrgobjext=o
5093c43cc173Smrg_LT_AC_TAGVAR(objext, $1)=$objext
5094c43cc173Smrg
5095c43cc173Smrg# Code to be used in simple compile tests
5096c43cc173Smrglt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
5097c43cc173Smrg
5098c43cc173Smrg# Code to be used in simple link tests
5099c43cc173Smrglt_simple_link_test_code="      program t\n      end\n"
5100c43cc173Smrg
5101c43cc173Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
5102c43cc173Smrg_LT_AC_SYS_COMPILER
5103c43cc173Smrg
5104c43cc173Smrg# save warnings/boilerplate of simple test code
5105c43cc173Smrg_LT_COMPILER_BOILERPLATE
5106c43cc173Smrg_LT_LINKER_BOILERPLATE
5107c43cc173Smrg
5108c43cc173Smrg# Allow CC to be a program name with arguments.
5109c43cc173Smrglt_save_CC="$CC"
5110c43cc173SmrgCC=${F77-"f77"}
5111c43cc173Smrgcompiler=$CC
5112c43cc173Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
5113c43cc173Smrg_LT_CC_BASENAME([$compiler])
5114c43cc173Smrg
5115c43cc173SmrgAC_MSG_CHECKING([if libtool supports shared libraries])
5116c43cc173SmrgAC_MSG_RESULT([$can_build_shared])
5117c43cc173Smrg
5118c43cc173SmrgAC_MSG_CHECKING([whether to build shared libraries])
5119c43cc173Smrgtest "$can_build_shared" = "no" && enable_shared=no
5120c43cc173Smrg
5121c43cc173Smrg# On AIX, shared libraries and static libraries use the same namespace, and
5122c43cc173Smrg# are all built from PIC.
5123c43cc173Smrgcase $host_os in
5124c43cc173Smrgaix3*)
5125c43cc173Smrg  test "$enable_shared" = yes && enable_static=no
5126c43cc173Smrg  if test -n "$RANLIB"; then
5127c43cc173Smrg    archive_cmds="$archive_cmds~\$RANLIB \$lib"
5128c43cc173Smrg    postinstall_cmds='$RANLIB $lib'
5129c43cc173Smrg  fi
5130c43cc173Smrg  ;;
5131c43cc173Smrgaix4* | aix5*)
5132c43cc173Smrg  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
5133c43cc173Smrg    test "$enable_shared" = yes && enable_static=no
5134c43cc173Smrg  fi
5135c43cc173Smrg  ;;
5136c43cc173Smrgesac
5137c43cc173SmrgAC_MSG_RESULT([$enable_shared])
5138c43cc173Smrg
5139c43cc173SmrgAC_MSG_CHECKING([whether to build static libraries])
5140c43cc173Smrg# Make sure either enable_shared or enable_static is yes.
5141c43cc173Smrgtest "$enable_shared" = yes || enable_static=yes
5142c43cc173SmrgAC_MSG_RESULT([$enable_static])
5143c43cc173Smrg
5144c43cc173Smrg_LT_AC_TAGVAR(GCC, $1)="$G77"
5145c43cc173Smrg_LT_AC_TAGVAR(LD, $1)="$LD"
5146c43cc173Smrg
5147c43cc173SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
5148c43cc173SmrgAC_LIBTOOL_PROG_CC_C_O($1)
5149c43cc173SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
5150c43cc173SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
5151c43cc173SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
5152c43cc173SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
5153c43cc173Smrg
5154c43cc173SmrgAC_LIBTOOL_CONFIG($1)
5155c43cc173Smrg
5156c43cc173SmrgAC_LANG_POP
5157c43cc173SmrgCC="$lt_save_CC"
5158c43cc173Smrg])# AC_LIBTOOL_LANG_F77_CONFIG
5159c43cc173Smrg
5160c43cc173Smrg
5161c43cc173Smrg# AC_LIBTOOL_LANG_GCJ_CONFIG
5162c43cc173Smrg# --------------------------
5163c43cc173Smrg# Ensure that the configuration vars for the C compiler are
5164c43cc173Smrg# suitably defined.  Those variables are subsequently used by
5165c43cc173Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
5166c43cc173SmrgAC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
5167c43cc173SmrgAC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
5168c43cc173Smrg[AC_LANG_SAVE
5169c43cc173Smrg
5170c43cc173Smrg# Source file extension for Java test sources.
5171c43cc173Smrgac_ext=java
5172c43cc173Smrg
5173c43cc173Smrg# Object file extension for compiled Java test sources.
5174c43cc173Smrgobjext=o
5175c43cc173Smrg_LT_AC_TAGVAR(objext, $1)=$objext
5176c43cc173Smrg
5177c43cc173Smrg# Code to be used in simple compile tests
5178c43cc173Smrglt_simple_compile_test_code="class foo {}\n"
5179c43cc173Smrg
5180c43cc173Smrg# Code to be used in simple link tests
5181c43cc173Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
5182c43cc173Smrg
5183c43cc173Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
5184c43cc173Smrg_LT_AC_SYS_COMPILER
5185c43cc173Smrg
5186c43cc173Smrg# save warnings/boilerplate of simple test code
5187c43cc173Smrg_LT_COMPILER_BOILERPLATE
5188c43cc173Smrg_LT_LINKER_BOILERPLATE
5189c43cc173Smrg
5190c43cc173Smrg# Allow CC to be a program name with arguments.
5191c43cc173Smrglt_save_CC="$CC"
5192c43cc173SmrgCC=${GCJ-"gcj"}
5193c43cc173Smrgcompiler=$CC
5194c43cc173Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
5195c43cc173Smrg_LT_CC_BASENAME([$compiler])
5196c43cc173Smrg
5197c43cc173Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
5198c43cc173Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
5199c43cc173Smrg
5200c43cc173Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
5201c43cc173Smrg
5202c43cc173SmrgAC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
5203c43cc173SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
5204c43cc173SmrgAC_LIBTOOL_PROG_CC_C_O($1)
5205c43cc173SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
5206c43cc173SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
5207c43cc173SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
5208c43cc173SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
5209c43cc173Smrg
5210c43cc173SmrgAC_LIBTOOL_CONFIG($1)
5211c43cc173Smrg
5212c43cc173SmrgAC_LANG_RESTORE
5213c43cc173SmrgCC="$lt_save_CC"
5214c43cc173Smrg])# AC_LIBTOOL_LANG_GCJ_CONFIG
5215c43cc173Smrg
5216c43cc173Smrg
5217c43cc173Smrg# AC_LIBTOOL_LANG_RC_CONFIG
5218c43cc173Smrg# -------------------------
5219c43cc173Smrg# Ensure that the configuration vars for the Windows resource compiler are
5220c43cc173Smrg# suitably defined.  Those variables are subsequently used by
5221c43cc173Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
5222c43cc173SmrgAC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
5223c43cc173SmrgAC_DEFUN([_LT_AC_LANG_RC_CONFIG],
5224c43cc173Smrg[AC_LANG_SAVE
5225c43cc173Smrg
5226c43cc173Smrg# Source file extension for RC test sources.
5227c43cc173Smrgac_ext=rc
5228c43cc173Smrg
5229c43cc173Smrg# Object file extension for compiled RC test sources.
5230c43cc173Smrgobjext=o
5231c43cc173Smrg_LT_AC_TAGVAR(objext, $1)=$objext
5232c43cc173Smrg
5233c43cc173Smrg# Code to be used in simple compile tests
5234c43cc173Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
5235c43cc173Smrg
5236c43cc173Smrg# Code to be used in simple link tests
5237c43cc173Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
5238c43cc173Smrg
5239c43cc173Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
5240c43cc173Smrg_LT_AC_SYS_COMPILER
5241c43cc173Smrg
5242c43cc173Smrg# save warnings/boilerplate of simple test code
5243c43cc173Smrg_LT_COMPILER_BOILERPLATE
5244c43cc173Smrg_LT_LINKER_BOILERPLATE
5245c43cc173Smrg
5246c43cc173Smrg# Allow CC to be a program name with arguments.
5247c43cc173Smrglt_save_CC="$CC"
5248c43cc173SmrgCC=${RC-"windres"}
5249c43cc173Smrgcompiler=$CC
5250c43cc173Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
5251c43cc173Smrg_LT_CC_BASENAME([$compiler])
5252c43cc173Smrg_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
5253c43cc173Smrg
5254c43cc173SmrgAC_LIBTOOL_CONFIG($1)
5255c43cc173Smrg
5256c43cc173SmrgAC_LANG_RESTORE
5257c43cc173SmrgCC="$lt_save_CC"
5258c43cc173Smrg])# AC_LIBTOOL_LANG_RC_CONFIG
5259c43cc173Smrg
5260c43cc173Smrg
5261c43cc173Smrg# AC_LIBTOOL_CONFIG([TAGNAME])
5262c43cc173Smrg# ----------------------------
5263c43cc173Smrg# If TAGNAME is not passed, then create an initial libtool script
5264c43cc173Smrg# with a default configuration from the untagged config vars.  Otherwise
5265c43cc173Smrg# add code to config.status for appending the configuration named by
5266c43cc173Smrg# TAGNAME from the matching tagged config vars.
5267c43cc173SmrgAC_DEFUN([AC_LIBTOOL_CONFIG],
5268c43cc173Smrg[# The else clause should only fire when bootstrapping the
5269c43cc173Smrg# libtool distribution, otherwise you forgot to ship ltmain.sh
5270c43cc173Smrg# with your package, and you will get complaints that there are
5271c43cc173Smrg# no rules to generate ltmain.sh.
5272c43cc173Smrgif test -f "$ltmain"; then
5273c43cc173Smrg  # See if we are running on zsh, and set the options which allow our commands through
5274c43cc173Smrg  # without removal of \ escapes.
5275c43cc173Smrg  if test -n "${ZSH_VERSION+set}" ; then
5276c43cc173Smrg    setopt NO_GLOB_SUBST
5277c43cc173Smrg  fi
5278c43cc173Smrg  # Now quote all the things that may contain metacharacters while being
5279c43cc173Smrg  # careful not to overquote the AC_SUBSTed values.  We take copies of the
5280c43cc173Smrg  # variables and quote the copies for generation of the libtool script.
5281c43cc173Smrg  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
5282c43cc173Smrg    SED SHELL STRIP \
5283c43cc173Smrg    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
5284c43cc173Smrg    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
5285c43cc173Smrg    deplibs_check_method reload_flag reload_cmds need_locks \
5286c43cc173Smrg    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
5287c43cc173Smrg    lt_cv_sys_global_symbol_to_c_name_address \
5288c43cc173Smrg    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
5289c43cc173Smrg    old_postinstall_cmds old_postuninstall_cmds \
5290c43cc173Smrg    _LT_AC_TAGVAR(compiler, $1) \
5291c43cc173Smrg    _LT_AC_TAGVAR(CC, $1) \
5292c43cc173Smrg    _LT_AC_TAGVAR(LD, $1) \
5293c43cc173Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
5294c43cc173Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
5295c43cc173Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
5296c43cc173Smrg    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
5297c43cc173Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
5298c43cc173Smrg    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
5299c43cc173Smrg    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
5300c43cc173Smrg    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
5301c43cc173Smrg    _LT_AC_TAGVAR(old_archive_cmds, $1) \
5302c43cc173Smrg    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
5303c43cc173Smrg    _LT_AC_TAGVAR(predep_objects, $1) \
5304c43cc173Smrg    _LT_AC_TAGVAR(postdep_objects, $1) \
5305c43cc173Smrg    _LT_AC_TAGVAR(predeps, $1) \
5306c43cc173Smrg    _LT_AC_TAGVAR(postdeps, $1) \
5307c43cc173Smrg    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
5308c43cc173Smrg    _LT_AC_TAGVAR(archive_cmds, $1) \
5309c43cc173Smrg    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
5310c43cc173Smrg    _LT_AC_TAGVAR(postinstall_cmds, $1) \
5311c43cc173Smrg    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
5312c43cc173Smrg    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
5313c43cc173Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
5314c43cc173Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1) \
5315c43cc173Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
5316c43cc173Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
5317c43cc173Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
5318c43cc173Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
5319c43cc173Smrg    _LT_AC_TAGVAR(hardcode_automatic, $1) \
5320c43cc173Smrg    _LT_AC_TAGVAR(module_cmds, $1) \
5321c43cc173Smrg    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
5322c43cc173Smrg    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
5323c43cc173Smrg    _LT_AC_TAGVAR(exclude_expsyms, $1) \
5324c43cc173Smrg    _LT_AC_TAGVAR(include_expsyms, $1); do
5325c43cc173Smrg
5326c43cc173Smrg    case $var in
5327c43cc173Smrg    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
5328c43cc173Smrg    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
5329c43cc173Smrg    _LT_AC_TAGVAR(archive_cmds, $1) | \
5330c43cc173Smrg    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
5331c43cc173Smrg    _LT_AC_TAGVAR(module_cmds, $1) | \
5332c43cc173Smrg    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
5333c43cc173Smrg    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
5334c43cc173Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
5335c43cc173Smrg    extract_expsyms_cmds | reload_cmds | finish_cmds | \
5336c43cc173Smrg    postinstall_cmds | postuninstall_cmds | \
5337c43cc173Smrg    old_postinstall_cmds | old_postuninstall_cmds | \
5338c43cc173Smrg    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
5339c43cc173Smrg      # Double-quote double-evaled strings.
5340c43cc173Smrg      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
5341c43cc173Smrg      ;;
5342c43cc173Smrg    *)
5343c43cc173Smrg      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
5344c43cc173Smrg      ;;
5345c43cc173Smrg    esac
5346c43cc173Smrg  done
5347c43cc173Smrg
5348c43cc173Smrg  case $lt_echo in
5349c43cc173Smrg  *'\[$]0 --fallback-echo"')
5350c43cc173Smrg    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
5351c43cc173Smrg    ;;
5352c43cc173Smrg  esac
5353c43cc173Smrg
5354c43cc173Smrgifelse([$1], [],
5355c43cc173Smrg  [cfgfile="${ofile}T"
5356c43cc173Smrg  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
5357c43cc173Smrg  $rm -f "$cfgfile"
5358c43cc173Smrg  AC_MSG_NOTICE([creating $ofile])],
5359c43cc173Smrg  [cfgfile="$ofile"])
5360c43cc173Smrg
5361c43cc173Smrg  cat <<__EOF__ >> "$cfgfile"
5362c43cc173Smrgifelse([$1], [],
5363c43cc173Smrg[#! $SHELL
5364c43cc173Smrg
5365c43cc173Smrg# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
5366c43cc173Smrg# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
5367c43cc173Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
5368c43cc173Smrg#
5369c43cc173Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
5370c43cc173Smrg# Free Software Foundation, Inc.
5371c43cc173Smrg#
5372c43cc173Smrg# This file is part of GNU Libtool:
5373c43cc173Smrg# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
5374c43cc173Smrg#
5375c43cc173Smrg# This program is free software; you can redistribute it and/or modify
5376c43cc173Smrg# it under the terms of the GNU General Public License as published by
5377c43cc173Smrg# the Free Software Foundation; either version 2 of the License, or
5378c43cc173Smrg# (at your option) any later version.
5379c43cc173Smrg#
5380c43cc173Smrg# This program is distributed in the hope that it will be useful, but
5381c43cc173Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
5382c43cc173Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
5383c43cc173Smrg# General Public License for more details.
5384c43cc173Smrg#
5385c43cc173Smrg# You should have received a copy of the GNU General Public License
5386c43cc173Smrg# along with this program; if not, write to the Free Software
5387c43cc173Smrg# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
5388c43cc173Smrg#
5389c43cc173Smrg# As a special exception to the GNU General Public License, if you
5390c43cc173Smrg# distribute this file as part of a program that contains a
5391c43cc173Smrg# configuration script generated by Autoconf, you may include it under
5392c43cc173Smrg# the same distribution terms that you use for the rest of that program.
5393c43cc173Smrg
5394c43cc173Smrg# A sed program that does not truncate output.
5395c43cc173SmrgSED=$lt_SED
5396c43cc173Smrg
5397c43cc173Smrg# Sed that helps us avoid accidentally triggering echo(1) options like -n.
5398c43cc173SmrgXsed="$SED -e 1s/^X//"
5399c43cc173Smrg
5400c43cc173Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
5401c43cc173Smrg# if CDPATH is set.
5402c43cc173Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5403c43cc173Smrg
5404c43cc173Smrg# The names of the tagged configurations supported by this script.
5405c43cc173Smrgavailable_tags=
5406c43cc173Smrg
5407c43cc173Smrg# ### BEGIN LIBTOOL CONFIG],
5408c43cc173Smrg[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
5409c43cc173Smrg
5410c43cc173Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
5411c43cc173Smrg
5412c43cc173Smrg# Shell to use when invoking shell scripts.
5413c43cc173SmrgSHELL=$lt_SHELL
5414c43cc173Smrg
5415c43cc173Smrg# Whether or not to build shared libraries.
5416c43cc173Smrgbuild_libtool_libs=$enable_shared
5417c43cc173Smrg
5418c43cc173Smrg# Whether or not to build static libraries.
5419c43cc173Smrgbuild_old_libs=$enable_static
5420c43cc173Smrg
5421c43cc173Smrg# Whether or not to add -lc for building shared libraries.
5422c43cc173Smrgbuild_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
5423c43cc173Smrg
5424c43cc173Smrg# Whether or not to disallow shared libs when runtime libs are static
5425c43cc173Smrgallow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
5426c43cc173Smrg
5427c43cc173Smrg# Whether or not to optimize for fast installation.
5428c43cc173Smrgfast_install=$enable_fast_install
5429c43cc173Smrg
5430c43cc173Smrg# The host system.
5431c43cc173Smrghost_alias=$host_alias
5432c43cc173Smrghost=$host
5433c43cc173Smrghost_os=$host_os
5434c43cc173Smrg
5435c43cc173Smrg# The build system.
5436c43cc173Smrgbuild_alias=$build_alias
5437c43cc173Smrgbuild=$build
5438c43cc173Smrgbuild_os=$build_os
5439c43cc173Smrg
5440c43cc173Smrg# An echo program that does not interpret backslashes.
5441c43cc173Smrgecho=$lt_echo
5442c43cc173Smrg
5443c43cc173Smrg# The archiver.
5444c43cc173SmrgAR=$lt_AR
5445c43cc173SmrgAR_FLAGS=$lt_AR_FLAGS
5446c43cc173Smrg
5447c43cc173Smrg# A C compiler.
5448c43cc173SmrgLTCC=$lt_LTCC
5449c43cc173Smrg
5450c43cc173Smrg# LTCC compiler flags.
5451c43cc173SmrgLTCFLAGS=$lt_LTCFLAGS
5452c43cc173Smrg
5453c43cc173Smrg# A language-specific compiler.
5454c43cc173SmrgCC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
5455c43cc173Smrg
5456c43cc173Smrg# Is the compiler the GNU C compiler?
5457c43cc173Smrgwith_gcc=$_LT_AC_TAGVAR(GCC, $1)
5458c43cc173Smrg
5459c43cc173Smrg# An ERE matcher.
5460c43cc173SmrgEGREP=$lt_EGREP
5461c43cc173Smrg
5462c43cc173Smrg# The linker used to build libraries.
5463c43cc173SmrgLD=$lt_[]_LT_AC_TAGVAR(LD, $1)
5464c43cc173Smrg
5465c43cc173Smrg# Whether we need hard or soft links.
5466c43cc173SmrgLN_S=$lt_LN_S
5467c43cc173Smrg
5468c43cc173Smrg# A BSD-compatible nm program.
5469c43cc173SmrgNM=$lt_NM
5470c43cc173Smrg
5471c43cc173Smrg# A symbol stripping program
5472c43cc173SmrgSTRIP=$lt_STRIP
5473c43cc173Smrg
5474c43cc173Smrg# Used to examine libraries when file_magic_cmd begins "file"
5475c43cc173SmrgMAGIC_CMD=$MAGIC_CMD
5476c43cc173Smrg
5477c43cc173Smrg# Used on cygwin: DLL creation program.
5478c43cc173SmrgDLLTOOL="$DLLTOOL"
5479c43cc173Smrg
5480c43cc173Smrg# Used on cygwin: object dumper.
5481c43cc173SmrgOBJDUMP="$OBJDUMP"
5482c43cc173Smrg
5483c43cc173Smrg# Used on cygwin: assembler.
5484c43cc173SmrgAS="$AS"
5485c43cc173Smrg
5486c43cc173Smrg# The name of the directory that contains temporary libtool files.
5487c43cc173Smrgobjdir=$objdir
5488c43cc173Smrg
5489c43cc173Smrg# How to create reloadable object files.
5490c43cc173Smrgreload_flag=$lt_reload_flag
5491c43cc173Smrgreload_cmds=$lt_reload_cmds
5492c43cc173Smrg
5493c43cc173Smrg# How to pass a linker flag through the compiler.
5494c43cc173Smrgwl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
5495c43cc173Smrg
5496c43cc173Smrg# Object file suffix (normally "o").
5497c43cc173Smrgobjext="$ac_objext"
5498c43cc173Smrg
5499c43cc173Smrg# Old archive suffix (normally "a").
5500c43cc173Smrglibext="$libext"
5501c43cc173Smrg
5502c43cc173Smrg# Shared library suffix (normally ".so").
5503c43cc173Smrgshrext_cmds='$shrext_cmds'
5504c43cc173Smrg
5505c43cc173Smrg# Executable file suffix (normally "").
5506c43cc173Smrgexeext="$exeext"
5507c43cc173Smrg
5508c43cc173Smrg# Additional compiler flags for building library objects.
5509c43cc173Smrgpic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
5510c43cc173Smrgpic_mode=$pic_mode
5511c43cc173Smrg
5512c43cc173Smrg# What is the maximum length of a command?
5513c43cc173Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
5514c43cc173Smrg
5515c43cc173Smrg# Does compiler simultaneously support -c and -o options?
5516c43cc173Smrgcompiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
5517c43cc173Smrg
5518c43cc173Smrg# Must we lock files when doing compilation?
5519c43cc173Smrgneed_locks=$lt_need_locks
5520c43cc173Smrg
5521c43cc173Smrg# Do we need the lib prefix for modules?
5522c43cc173Smrgneed_lib_prefix=$need_lib_prefix
5523c43cc173Smrg
5524c43cc173Smrg# Do we need a version for libraries?
5525c43cc173Smrgneed_version=$need_version
5526c43cc173Smrg
5527c43cc173Smrg# Whether dlopen is supported.
5528c43cc173Smrgdlopen_support=$enable_dlopen
5529c43cc173Smrg
5530c43cc173Smrg# Whether dlopen of programs is supported.
5531c43cc173Smrgdlopen_self=$enable_dlopen_self
5532c43cc173Smrg
5533c43cc173Smrg# Whether dlopen of statically linked programs is supported.
5534c43cc173Smrgdlopen_self_static=$enable_dlopen_self_static
5535c43cc173Smrg
5536c43cc173Smrg# Compiler flag to prevent dynamic linking.
5537c43cc173Smrglink_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
5538c43cc173Smrg
5539c43cc173Smrg# Compiler flag to turn off builtin functions.
5540c43cc173Smrgno_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
5541c43cc173Smrg
5542c43cc173Smrg# Compiler flag to allow reflexive dlopens.
5543c43cc173Smrgexport_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
5544c43cc173Smrg
5545c43cc173Smrg# Compiler flag to generate shared objects directly from archives.
5546c43cc173Smrgwhole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
5547c43cc173Smrg
5548c43cc173Smrg# Compiler flag to generate thread-safe objects.
5549c43cc173Smrgthread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
5550c43cc173Smrg
5551c43cc173Smrg# Library versioning type.
5552c43cc173Smrgversion_type=$version_type
5553c43cc173Smrg
5554c43cc173Smrg# Format of library name prefix.
5555c43cc173Smrglibname_spec=$lt_libname_spec
5556c43cc173Smrg
5557c43cc173Smrg# List of archive names.  First name is the real one, the rest are links.
5558c43cc173Smrg# The last name is the one that the linker finds with -lNAME.
5559c43cc173Smrglibrary_names_spec=$lt_library_names_spec
5560c43cc173Smrg
5561c43cc173Smrg# The coded name of the library, if different from the real name.
5562c43cc173Smrgsoname_spec=$lt_soname_spec
5563c43cc173Smrg
5564c43cc173Smrg# Commands used to build and install an old-style archive.
5565c43cc173SmrgRANLIB=$lt_RANLIB
5566c43cc173Smrgold_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
5567c43cc173Smrgold_postinstall_cmds=$lt_old_postinstall_cmds
5568c43cc173Smrgold_postuninstall_cmds=$lt_old_postuninstall_cmds
5569c43cc173Smrg
5570c43cc173Smrg# Create an old-style archive from a shared archive.
5571c43cc173Smrgold_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
5572c43cc173Smrg
5573c43cc173Smrg# Create a temporary old-style archive to link instead of a shared archive.
5574c43cc173Smrgold_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
5575c43cc173Smrg
5576c43cc173Smrg# Commands used to build and install a shared archive.
5577c43cc173Smrgarchive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
5578c43cc173Smrgarchive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
5579c43cc173Smrgpostinstall_cmds=$lt_postinstall_cmds
5580c43cc173Smrgpostuninstall_cmds=$lt_postuninstall_cmds
5581c43cc173Smrg
5582c43cc173Smrg# Commands used to build a loadable module (assumed same as above if empty)
5583c43cc173Smrgmodule_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
5584c43cc173Smrgmodule_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
5585c43cc173Smrg
5586c43cc173Smrg# Commands to strip libraries.
5587c43cc173Smrgold_striplib=$lt_old_striplib
5588c43cc173Smrgstriplib=$lt_striplib
5589c43cc173Smrg
5590c43cc173Smrg# Dependencies to place before the objects being linked to create a
5591c43cc173Smrg# shared library.
5592c43cc173Smrgpredep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
5593c43cc173Smrg
5594c43cc173Smrg# Dependencies to place after the objects being linked to create a
5595c43cc173Smrg# shared library.
5596c43cc173Smrgpostdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
5597c43cc173Smrg
5598c43cc173Smrg# Dependencies to place before the objects being linked to create a
5599c43cc173Smrg# shared library.
5600c43cc173Smrgpredeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
5601c43cc173Smrg
5602c43cc173Smrg# Dependencies to place after the objects being linked to create a
5603c43cc173Smrg# shared library.
5604c43cc173Smrgpostdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
5605c43cc173Smrg
5606c43cc173Smrg# The library search path used internally by the compiler when linking
5607c43cc173Smrg# a shared library.
5608c43cc173Smrgcompiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
5609c43cc173Smrg
5610c43cc173Smrg# Method to check whether dependent libraries are shared objects.
5611c43cc173Smrgdeplibs_check_method=$lt_deplibs_check_method
5612c43cc173Smrg
5613c43cc173Smrg# Command to use when deplibs_check_method == file_magic.
5614c43cc173Smrgfile_magic_cmd=$lt_file_magic_cmd
5615c43cc173Smrg
5616c43cc173Smrg# Flag that allows shared libraries with undefined symbols to be built.
5617c43cc173Smrgallow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
5618c43cc173Smrg
5619c43cc173Smrg# Flag that forces no undefined symbols.
5620c43cc173Smrgno_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
5621c43cc173Smrg
5622c43cc173Smrg# Commands used to finish a libtool library installation in a directory.
5623c43cc173Smrgfinish_cmds=$lt_finish_cmds
5624c43cc173Smrg
5625c43cc173Smrg# Same as above, but a single script fragment to be evaled but not shown.
5626c43cc173Smrgfinish_eval=$lt_finish_eval
5627c43cc173Smrg
5628c43cc173Smrg# Take the output of nm and produce a listing of raw symbols and C names.
5629c43cc173Smrgglobal_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
5630c43cc173Smrg
5631c43cc173Smrg# Transform the output of nm in a proper C declaration
5632c43cc173Smrgglobal_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
5633c43cc173Smrg
5634c43cc173Smrg# Transform the output of nm in a C name address pair
5635c43cc173Smrgglobal_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
5636c43cc173Smrg
5637c43cc173Smrg# This is the shared library runtime path variable.
5638c43cc173Smrgrunpath_var=$runpath_var
5639c43cc173Smrg
5640c43cc173Smrg# This is the shared library path variable.
5641c43cc173Smrgshlibpath_var=$shlibpath_var
5642c43cc173Smrg
5643c43cc173Smrg# Is shlibpath searched before the hard-coded library search path?
5644c43cc173Smrgshlibpath_overrides_runpath=$shlibpath_overrides_runpath
5645c43cc173Smrg
5646c43cc173Smrg# How to hardcode a shared library path into an executable.
5647c43cc173Smrghardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
5648c43cc173Smrg
5649c43cc173Smrg# Whether we should hardcode library paths into libraries.
5650c43cc173Smrghardcode_into_libs=$hardcode_into_libs
5651c43cc173Smrg
5652c43cc173Smrg# Flag to hardcode \$libdir into a binary during linking.
5653c43cc173Smrg# This must work even if \$libdir does not exist.
5654c43cc173Smrghardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
5655c43cc173Smrg
5656c43cc173Smrg# If ld is used when linking, flag to hardcode \$libdir into
5657c43cc173Smrg# a binary during linking. This must work even if \$libdir does
5658c43cc173Smrg# not exist.
5659c43cc173Smrghardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
5660c43cc173Smrg
5661c43cc173Smrg# Whether we need a single -rpath flag with a separated argument.
5662c43cc173Smrghardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
5663c43cc173Smrg
5664c43cc173Smrg# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
5665c43cc173Smrg# resulting binary.
5666c43cc173Smrghardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
5667c43cc173Smrg
5668c43cc173Smrg# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
5669c43cc173Smrg# resulting binary.
5670c43cc173Smrghardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
5671c43cc173Smrg
5672c43cc173Smrg# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
5673c43cc173Smrg# the resulting binary.
5674c43cc173Smrghardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
5675c43cc173Smrg
5676c43cc173Smrg# Set to yes if building a shared library automatically hardcodes DIR into the library
5677c43cc173Smrg# and all subsequent libraries and executables linked against it.
5678c43cc173Smrghardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
5679c43cc173Smrg
5680c43cc173Smrg# Variables whose values should be saved in libtool wrapper scripts and
5681c43cc173Smrg# restored at relink time.
5682c43cc173Smrgvariables_saved_for_relink="$variables_saved_for_relink"
5683c43cc173Smrg
5684c43cc173Smrg# Whether libtool must link a program against all its dependency libraries.
5685c43cc173Smrglink_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
5686c43cc173Smrg
5687c43cc173Smrg# Compile-time system search path for libraries
5688c43cc173Smrgsys_lib_search_path_spec=$lt_sys_lib_search_path_spec
5689c43cc173Smrg
5690c43cc173Smrg# Run-time system search path for libraries
5691c43cc173Smrgsys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
5692c43cc173Smrg
5693c43cc173Smrg# Fix the shell variable \$srcfile for the compiler.
5694c43cc173Smrgfix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
5695c43cc173Smrg
5696c43cc173Smrg# Set to yes if exported symbols are required.
5697c43cc173Smrgalways_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
5698c43cc173Smrg
5699c43cc173Smrg# The commands to list exported symbols.
5700c43cc173Smrgexport_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
5701c43cc173Smrg
5702c43cc173Smrg# The commands to extract the exported symbol list from a shared archive.
5703c43cc173Smrgextract_expsyms_cmds=$lt_extract_expsyms_cmds
5704c43cc173Smrg
5705c43cc173Smrg# Symbols that should not be listed in the preloaded symbols.
5706c43cc173Smrgexclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
5707c43cc173Smrg
5708c43cc173Smrg# Symbols that must always be exported.
5709c43cc173Smrginclude_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
5710c43cc173Smrg
5711c43cc173Smrgifelse([$1],[],
5712c43cc173Smrg[# ### END LIBTOOL CONFIG],
5713c43cc173Smrg[# ### END LIBTOOL TAG CONFIG: $tagname])
5714c43cc173Smrg
5715c43cc173Smrg__EOF__
5716c43cc173Smrg
5717c43cc173Smrgifelse([$1],[], [
5718c43cc173Smrg  case $host_os in
5719c43cc173Smrg  aix3*)
5720c43cc173Smrg    cat <<\EOF >> "$cfgfile"
5721c43cc173Smrg
5722c43cc173Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
5723c43cc173Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
5724c43cc173Smrg# vanish in a puff of smoke.
5725c43cc173Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
5726c43cc173Smrg  COLLECT_NAMES=
5727c43cc173Smrg  export COLLECT_NAMES
5728c43cc173Smrgfi
5729c43cc173SmrgEOF
5730c43cc173Smrg    ;;
5731c43cc173Smrg  esac
5732c43cc173Smrg
5733c43cc173Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
5734c43cc173Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
5735c43cc173Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
5736c43cc173Smrg  # is reportedly fixed, but why not run on old versions too?
5737c43cc173Smrg  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
5738c43cc173Smrg
5739c43cc173Smrg  mv -f "$cfgfile" "$ofile" || \
5740c43cc173Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
5741c43cc173Smrg  chmod +x "$ofile"
5742c43cc173Smrg])
5743c43cc173Smrgelse
5744c43cc173Smrg  # If there is no Makefile yet, we rely on a make rule to execute
5745c43cc173Smrg  # `config.status --recheck' to rerun these tests and create the
5746c43cc173Smrg  # libtool script then.
5747c43cc173Smrg  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
5748c43cc173Smrg  if test -f "$ltmain_in"; then
5749c43cc173Smrg    test -f Makefile && make "$ltmain"
5750c43cc173Smrg  fi
5751c43cc173Smrgfi
5752c43cc173Smrg])# AC_LIBTOOL_CONFIG
5753c43cc173Smrg
5754c43cc173Smrg
5755c43cc173Smrg# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
5756c43cc173Smrg# -------------------------------------------
5757c43cc173SmrgAC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
5758c43cc173Smrg[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
5759c43cc173Smrg
5760c43cc173Smrg_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
5761c43cc173Smrg
5762c43cc173Smrgif test "$GCC" = yes; then
5763c43cc173Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
5764c43cc173Smrg
5765c43cc173Smrg  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
5766c43cc173Smrg    lt_cv_prog_compiler_rtti_exceptions,
5767c43cc173Smrg    [-fno-rtti -fno-exceptions], [],
5768c43cc173Smrg    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
5769c43cc173Smrgfi
5770c43cc173Smrg])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
5771c43cc173Smrg
5772c43cc173Smrg
5773c43cc173Smrg# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
5774c43cc173Smrg# ---------------------------------
5775c43cc173SmrgAC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
5776c43cc173Smrg[AC_REQUIRE([AC_CANONICAL_HOST])
5777c43cc173SmrgAC_REQUIRE([AC_PROG_NM])
5778c43cc173SmrgAC_REQUIRE([AC_OBJEXT])
5779c43cc173Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
5780c43cc173SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
5781c43cc173SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
5782c43cc173Smrg[
5783c43cc173Smrg# These are sane defaults that work on at least a few old systems.
5784c43cc173Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
5785c43cc173Smrg
5786c43cc173Smrg# Character class describing NM global symbol codes.
5787c43cc173Smrgsymcode='[[BCDEGRST]]'
5788c43cc173Smrg
5789c43cc173Smrg# Regexp to match symbols that can be accessed directly from C.
5790c43cc173Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
5791c43cc173Smrg
5792c43cc173Smrg# Transform an extracted symbol line into a proper C declaration
5793c43cc173Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
5794c43cc173Smrg
5795c43cc173Smrg# Transform an extracted symbol line into symbol name and symbol address
5796c43cc173Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
5797c43cc173Smrg
5798c43cc173Smrg# Define system-specific variables.
5799c43cc173Smrgcase $host_os in
5800c43cc173Smrgaix*)
5801c43cc173Smrg  symcode='[[BCDT]]'
5802c43cc173Smrg  ;;
5803c43cc173Smrgcygwin* | mingw* | pw32*)
5804c43cc173Smrg  symcode='[[ABCDGISTW]]'
5805c43cc173Smrg  ;;
5806c43cc173Smrghpux*) # Its linker distinguishes data from code symbols
5807c43cc173Smrg  if test "$host_cpu" = ia64; then
5808c43cc173Smrg    symcode='[[ABCDEGRST]]'
5809c43cc173Smrg  fi
5810c43cc173Smrg  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
5811c43cc173Smrg  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
5812c43cc173Smrg  ;;
5813c43cc173Smrglinux*)
5814c43cc173Smrg  if test "$host_cpu" = ia64; then
5815c43cc173Smrg    symcode='[[ABCDGIRSTW]]'
5816c43cc173Smrg    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
5817c43cc173Smrg    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
5818c43cc173Smrg  fi
5819c43cc173Smrg  ;;
5820c43cc173Smrgirix* | nonstopux*)
5821c43cc173Smrg  symcode='[[BCDEGRST]]'
5822c43cc173Smrg  ;;
5823c43cc173Smrgosf*)
5824c43cc173Smrg  symcode='[[BCDEGQRST]]'
5825c43cc173Smrg  ;;
5826c43cc173Smrgsolaris*)
5827c43cc173Smrg  symcode='[[BDRT]]'
5828c43cc173Smrg  ;;
5829c43cc173Smrgsco3.2v5*)
5830c43cc173Smrg  symcode='[[DT]]'
5831c43cc173Smrg  ;;
5832c43cc173Smrgsysv4.2uw2*)
5833c43cc173Smrg  symcode='[[DT]]'
5834c43cc173Smrg  ;;
5835c43cc173Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
5836c43cc173Smrg  symcode='[[ABDT]]'
5837c43cc173Smrg  ;;
5838c43cc173Smrgsysv4)
5839c43cc173Smrg  symcode='[[DFNSTU]]'
5840c43cc173Smrg  ;;
5841c43cc173Smrgesac
5842c43cc173Smrg
5843c43cc173Smrg# Handle CRLF in mingw tool chain
5844c43cc173Smrgopt_cr=
5845c43cc173Smrgcase $build_os in
5846c43cc173Smrgmingw*)
5847c43cc173Smrg  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
5848c43cc173Smrg  ;;
5849c43cc173Smrgesac
5850c43cc173Smrg
5851c43cc173Smrg# If we're using GNU nm, then use its standard symbol codes.
5852c43cc173Smrgcase `$NM -V 2>&1` in
5853c43cc173Smrg*GNU* | *'with BFD'*)
5854c43cc173Smrg  symcode='[[ABCDGIRSTW]]' ;;
5855c43cc173Smrgesac
5856c43cc173Smrg
5857c43cc173Smrg# Try without a prefix undercore, then with it.
5858c43cc173Smrgfor ac_symprfx in "" "_"; do
5859c43cc173Smrg
5860c43cc173Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
5861c43cc173Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
5862c43cc173Smrg
5863c43cc173Smrg  # Write the raw and C identifiers.
5864c43cc173Smrg  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
5865c43cc173Smrg
5866c43cc173Smrg  # Check to see that the pipe works correctly.
5867c43cc173Smrg  pipe_works=no
5868c43cc173Smrg
5869c43cc173Smrg  rm -f conftest*
5870c43cc173Smrg  cat > conftest.$ac_ext <<EOF
5871c43cc173Smrg#ifdef __cplusplus
5872c43cc173Smrgextern "C" {
5873c43cc173Smrg#endif
5874c43cc173Smrgchar nm_test_var;
5875c43cc173Smrgvoid nm_test_func(){}
5876c43cc173Smrg#ifdef __cplusplus
5877c43cc173Smrg}
5878c43cc173Smrg#endif
5879c43cc173Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
5880c43cc173SmrgEOF
5881c43cc173Smrg
5882c43cc173Smrg  if AC_TRY_EVAL(ac_compile); then
5883c43cc173Smrg    # Now try to grab the symbols.
5884c43cc173Smrg    nlist=conftest.nm
5885c43cc173Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
5886c43cc173Smrg      # Try sorting and uniquifying the output.
5887c43cc173Smrg      if sort "$nlist" | uniq > "$nlist"T; then
5888c43cc173Smrg	mv -f "$nlist"T "$nlist"
5889c43cc173Smrg      else
5890c43cc173Smrg	rm -f "$nlist"T
5891c43cc173Smrg      fi
5892c43cc173Smrg
5893c43cc173Smrg      # Make sure that we snagged all the symbols we need.
5894c43cc173Smrg      if grep ' nm_test_var$' "$nlist" >/dev/null; then
5895c43cc173Smrg	if grep ' nm_test_func$' "$nlist" >/dev/null; then
5896c43cc173Smrg	  cat <<EOF > conftest.$ac_ext
5897c43cc173Smrg#ifdef __cplusplus
5898c43cc173Smrgextern "C" {
5899c43cc173Smrg#endif
5900c43cc173Smrg
5901c43cc173SmrgEOF
5902c43cc173Smrg	  # Now generate the symbol file.
5903c43cc173Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
5904c43cc173Smrg
5905c43cc173Smrg	  cat <<EOF >> conftest.$ac_ext
5906c43cc173Smrg#if defined (__STDC__) && __STDC__
5907c43cc173Smrg# define lt_ptr_t void *
5908c43cc173Smrg#else
5909c43cc173Smrg# define lt_ptr_t char *
5910c43cc173Smrg# define const
5911c43cc173Smrg#endif
5912c43cc173Smrg
5913c43cc173Smrg/* The mapping between symbol names and symbols. */
5914c43cc173Smrgconst struct {
5915c43cc173Smrg  const char *name;
5916c43cc173Smrg  lt_ptr_t address;
5917c43cc173Smrg}
5918c43cc173Smrglt_preloaded_symbols[[]] =
5919c43cc173Smrg{
5920c43cc173SmrgEOF
5921c43cc173Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
5922c43cc173Smrg	  cat <<\EOF >> conftest.$ac_ext
5923c43cc173Smrg  {0, (lt_ptr_t) 0}
5924c43cc173Smrg};
5925c43cc173Smrg
5926c43cc173Smrg#ifdef __cplusplus
5927c43cc173Smrg}
5928c43cc173Smrg#endif
5929c43cc173SmrgEOF
5930c43cc173Smrg	  # Now try linking the two files.
5931c43cc173Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
5932c43cc173Smrg	  lt_save_LIBS="$LIBS"
5933c43cc173Smrg	  lt_save_CFLAGS="$CFLAGS"
5934c43cc173Smrg	  LIBS="conftstm.$ac_objext"
5935c43cc173Smrg	  CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
5936c43cc173Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
5937c43cc173Smrg	    pipe_works=yes
5938c43cc173Smrg	  fi
5939c43cc173Smrg	  LIBS="$lt_save_LIBS"
5940c43cc173Smrg	  CFLAGS="$lt_save_CFLAGS"
5941c43cc173Smrg	else
5942c43cc173Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
5943c43cc173Smrg	fi
5944c43cc173Smrg      else
5945c43cc173Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
5946c43cc173Smrg      fi
5947c43cc173Smrg    else
5948c43cc173Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
5949c43cc173Smrg    fi
5950c43cc173Smrg  else
5951c43cc173Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
5952c43cc173Smrg    cat conftest.$ac_ext >&5
5953c43cc173Smrg  fi
5954c43cc173Smrg  rm -f conftest* conftst*
5955c43cc173Smrg
5956c43cc173Smrg  # Do not use the global_symbol_pipe unless it works.
5957c43cc173Smrg  if test "$pipe_works" = yes; then
5958c43cc173Smrg    break
5959c43cc173Smrg  else
5960c43cc173Smrg    lt_cv_sys_global_symbol_pipe=
5961c43cc173Smrg  fi
5962c43cc173Smrgdone
5963c43cc173Smrg])
5964c43cc173Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
5965c43cc173Smrg  lt_cv_sys_global_symbol_to_cdecl=
5966c43cc173Smrgfi
5967c43cc173Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
5968c43cc173Smrg  AC_MSG_RESULT(failed)
5969c43cc173Smrgelse
5970c43cc173Smrg  AC_MSG_RESULT(ok)
5971c43cc173Smrgfi
5972c43cc173Smrg]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
5973c43cc173Smrg
5974c43cc173Smrg
5975c43cc173Smrg# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
5976c43cc173Smrg# ---------------------------------------
5977c43cc173SmrgAC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
5978c43cc173Smrg[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
5979c43cc173Smrg_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5980c43cc173Smrg_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
5981c43cc173Smrg
5982c43cc173SmrgAC_MSG_CHECKING([for $compiler option to produce PIC])
5983c43cc173Smrg ifelse([$1],[CXX],[
5984c43cc173Smrg  # C++ specific cases for pic, static, wl, etc.
5985c43cc173Smrg  if test "$GXX" = yes; then
5986c43cc173Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5987c43cc173Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
5988c43cc173Smrg
5989c43cc173Smrg    case $host_os in
5990c43cc173Smrg    aix*)
5991c43cc173Smrg      # All AIX code is PIC.
5992c43cc173Smrg      if test "$host_cpu" = ia64; then
5993c43cc173Smrg	# AIX 5 now supports IA64 processor
5994c43cc173Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5995c43cc173Smrg      fi
5996c43cc173Smrg      ;;
5997c43cc173Smrg    amigaos*)
5998c43cc173Smrg      # FIXME: we need at least 68020 code to build shared libraries, but
5999c43cc173Smrg      # adding the `-m68020' flag to GCC prevents building anything better,
6000c43cc173Smrg      # like `-m68040'.
6001c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
6002c43cc173Smrg      ;;
6003c43cc173Smrg    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
6004c43cc173Smrg      # PIC is the default for these OSes.
6005c43cc173Smrg      ;;
6006c43cc173Smrg    mingw* | os2* | pw32*)
6007c43cc173Smrg      # This hack is so that the source file can tell whether it is being
6008c43cc173Smrg      # built for inclusion in a dll (and should export symbols for example).
6009c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
6010c43cc173Smrg      ;;
6011c43cc173Smrg    darwin* | rhapsody*)
6012c43cc173Smrg      # PIC is the default on this platform
6013c43cc173Smrg      # Common symbols not allowed in MH_DYLIB files
6014c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
6015c43cc173Smrg      ;;
6016c43cc173Smrg    *djgpp*)
6017c43cc173Smrg      # DJGPP does not support shared libraries at all
6018c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
6019c43cc173Smrg      ;;
6020c43cc173Smrg    interix3*)
6021c43cc173Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
6022c43cc173Smrg      # Instead, we relocate shared libraries at runtime.
6023c43cc173Smrg      ;;
6024c43cc173Smrg    sysv4*MP*)
6025c43cc173Smrg      if test -d /usr/nec; then
6026c43cc173Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
6027c43cc173Smrg      fi
6028c43cc173Smrg      ;;
6029c43cc173Smrg    hpux*)
6030c43cc173Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
6031c43cc173Smrg      # not for PA HP-UX.
6032c43cc173Smrg      case $host_cpu in
6033c43cc173Smrg      hppa*64*|ia64*)
6034c43cc173Smrg	;;
6035c43cc173Smrg      *)
6036c43cc173Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
6037c43cc173Smrg	;;
6038c43cc173Smrg      esac
6039c43cc173Smrg      ;;
6040c43cc173Smrg    *)
6041c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
6042c43cc173Smrg      ;;
6043c43cc173Smrg    esac
6044c43cc173Smrg  else
6045c43cc173Smrg    case $host_os in
6046c43cc173Smrg      aix4* | aix5*)
6047c43cc173Smrg	# All AIX code is PIC.
6048c43cc173Smrg	if test "$host_cpu" = ia64; then
6049c43cc173Smrg	  # AIX 5 now supports IA64 processor
6050c43cc173Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6051c43cc173Smrg	else
6052c43cc173Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
6053c43cc173Smrg	fi
6054c43cc173Smrg	;;
6055c43cc173Smrg      chorus*)
6056c43cc173Smrg	case $cc_basename in
6057c43cc173Smrg	cxch68*)
6058c43cc173Smrg	  # Green Hills C++ Compiler
6059c43cc173Smrg	  # _LT_AC_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"
6060c43cc173Smrg	  ;;
6061c43cc173Smrg	esac
6062c43cc173Smrg	;;
6063c43cc173Smrg       darwin*)
6064c43cc173Smrg         # PIC is the default on this platform
6065c43cc173Smrg         # Common symbols not allowed in MH_DYLIB files
6066c43cc173Smrg         case $cc_basename in
6067c43cc173Smrg           xlc*)
6068c43cc173Smrg           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
6069c43cc173Smrg           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6070c43cc173Smrg           ;;
6071c43cc173Smrg         esac
6072c43cc173Smrg       ;;
6073c43cc173Smrg      dgux*)
6074c43cc173Smrg	case $cc_basename in
6075c43cc173Smrg	  ec++*)
6076c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6077c43cc173Smrg	    ;;
6078c43cc173Smrg	  ghcx*)
6079c43cc173Smrg	    # Green Hills C++ Compiler
6080c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
6081c43cc173Smrg	    ;;
6082c43cc173Smrg	  *)
6083c43cc173Smrg	    ;;
6084c43cc173Smrg	esac
6085c43cc173Smrg	;;
6086c43cc173Smrg      freebsd* | kfreebsd*-gnu | dragonfly*)
6087c43cc173Smrg	# FreeBSD uses GNU C++
6088c43cc173Smrg	;;
6089c43cc173Smrg      hpux9* | hpux10* | hpux11*)
6090c43cc173Smrg	case $cc_basename in
6091c43cc173Smrg	  CC*)
6092c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6093c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
6094c43cc173Smrg	    if test "$host_cpu" != ia64; then
6095c43cc173Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
6096c43cc173Smrg	    fi
6097c43cc173Smrg	    ;;
6098c43cc173Smrg	  aCC*)
6099c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6100c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
6101c43cc173Smrg	    case $host_cpu in
6102c43cc173Smrg	    hppa*64*|ia64*)
6103c43cc173Smrg	      # +Z the default
6104c43cc173Smrg	      ;;
6105c43cc173Smrg	    *)
6106c43cc173Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
6107c43cc173Smrg	      ;;
6108c43cc173Smrg	    esac
6109c43cc173Smrg	    ;;
6110c43cc173Smrg	  *)
6111c43cc173Smrg	    ;;
6112c43cc173Smrg	esac
6113c43cc173Smrg	;;
6114c43cc173Smrg      interix*)
6115c43cc173Smrg	# This is c89, which is MS Visual C++ (no shared libs)
6116c43cc173Smrg	# Anyone wants to do a port?
6117c43cc173Smrg	;;
6118c43cc173Smrg      irix5* | irix6* | nonstopux*)
6119c43cc173Smrg	case $cc_basename in
6120c43cc173Smrg	  CC*)
6121c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6122c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
6123c43cc173Smrg	    # CC pic flag -KPIC is the default.
6124c43cc173Smrg	    ;;
6125c43cc173Smrg	  *)
6126c43cc173Smrg	    ;;
6127c43cc173Smrg	esac
6128c43cc173Smrg	;;
6129c43cc173Smrg      linux*)
6130c43cc173Smrg	case $cc_basename in
6131c43cc173Smrg	  KCC*)
6132c43cc173Smrg	    # KAI C++ Compiler
6133c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
6134c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
6135c43cc173Smrg	    ;;
6136c43cc173Smrg	  icpc* | ecpc*)
6137c43cc173Smrg	    # Intel C++
6138c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6139c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6140c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
6141c43cc173Smrg	    ;;
6142c43cc173Smrg	  pgCC*)
6143c43cc173Smrg	    # Portland Group C++ compiler.
6144c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6145c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
6146c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6147c43cc173Smrg	    ;;
6148c43cc173Smrg	  cxx*)
6149c43cc173Smrg	    # Compaq C++
6150c43cc173Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
6151c43cc173Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
6152c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
6153c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
6154c43cc173Smrg	    ;;
6155c43cc173Smrg	  *)
6156c43cc173Smrg	    ;;
6157c43cc173Smrg	esac
6158c43cc173Smrg	;;
6159c43cc173Smrg      lynxos*)
6160c43cc173Smrg	;;
6161c43cc173Smrg      m88k*)
6162c43cc173Smrg	;;
6163c43cc173Smrg      mvs*)
6164c43cc173Smrg	case $cc_basename in
6165c43cc173Smrg	  cxx*)
6166c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
6167c43cc173Smrg	    ;;
6168c43cc173Smrg	  *)
6169c43cc173Smrg	    ;;
6170c43cc173Smrg	esac
6171c43cc173Smrg	;;
6172c43cc173Smrg      netbsd*)
6173c43cc173Smrg	;;
6174c43cc173Smrg      osf3* | osf4* | osf5*)
6175c43cc173Smrg	case $cc_basename in
6176c43cc173Smrg	  KCC*)
6177c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
6178c43cc173Smrg	    ;;
6179c43cc173Smrg	  RCC*)
6180c43cc173Smrg	    # Rational C++ 2.4.1
6181c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
6182c43cc173Smrg	    ;;
6183c43cc173Smrg	  cxx*)
6184c43cc173Smrg	    # Digital/Compaq C++
6185c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6186c43cc173Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
6187c43cc173Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
6188c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
6189c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
6190c43cc173Smrg	    ;;
6191c43cc173Smrg	  *)
6192c43cc173Smrg	    ;;
6193c43cc173Smrg	esac
6194c43cc173Smrg	;;
6195c43cc173Smrg      psos*)
6196c43cc173Smrg	;;
6197c43cc173Smrg      solaris*)
6198c43cc173Smrg	case $cc_basename in
6199c43cc173Smrg	  CC*)
6200c43cc173Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
6201c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6202c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6203c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
6204c43cc173Smrg	    ;;
6205c43cc173Smrg	  gcx*)
6206c43cc173Smrg	    # Green Hills C++ Compiler
6207c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
6208c43cc173Smrg	    ;;
6209c43cc173Smrg	  *)
6210c43cc173Smrg	    ;;
6211c43cc173Smrg	esac
6212c43cc173Smrg	;;
6213c43cc173Smrg      sunos4*)
6214c43cc173Smrg	case $cc_basename in
6215c43cc173Smrg	  CC*)
6216c43cc173Smrg	    # Sun C++ 4.x
6217c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
6218c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6219c43cc173Smrg	    ;;
6220c43cc173Smrg	  lcc*)
6221c43cc173Smrg	    # Lucid
6222c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
6223c43cc173Smrg	    ;;
6224c43cc173Smrg	  *)
6225c43cc173Smrg	    ;;
6226c43cc173Smrg	esac
6227c43cc173Smrg	;;
6228c43cc173Smrg      tandem*)
6229c43cc173Smrg	case $cc_basename in
6230c43cc173Smrg	  NCC*)
6231c43cc173Smrg	    # NonStop-UX NCC 3.20
6232c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6233c43cc173Smrg	    ;;
6234c43cc173Smrg	  *)
6235c43cc173Smrg	    ;;
6236c43cc173Smrg	esac
6237c43cc173Smrg	;;
6238c43cc173Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
6239c43cc173Smrg	case $cc_basename in
6240c43cc173Smrg	  CC*)
6241c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6242c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6243c43cc173Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6244c43cc173Smrg	    ;;
6245c43cc173Smrg	esac
6246c43cc173Smrg	;;
6247c43cc173Smrg      vxworks*)
6248c43cc173Smrg	;;
6249c43cc173Smrg      *)
6250c43cc173Smrg	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
6251c43cc173Smrg	;;
6252c43cc173Smrg    esac
6253c43cc173Smrg  fi
6254c43cc173Smrg],
6255c43cc173Smrg[
6256c43cc173Smrg  if test "$GCC" = yes; then
6257c43cc173Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6258c43cc173Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
6259c43cc173Smrg
6260c43cc173Smrg    case $host_os in
6261c43cc173Smrg      aix*)
6262c43cc173Smrg      # All AIX code is PIC.
6263c43cc173Smrg      if test "$host_cpu" = ia64; then
6264c43cc173Smrg	# AIX 5 now supports IA64 processor
6265c43cc173Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6266c43cc173Smrg      fi
6267c43cc173Smrg      ;;
6268c43cc173Smrg
6269c43cc173Smrg    amigaos*)
6270c43cc173Smrg      # FIXME: we need at least 68020 code to build shared libraries, but
6271c43cc173Smrg      # adding the `-m68020' flag to GCC prevents building anything better,
6272c43cc173Smrg      # like `-m68040'.
6273c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
6274c43cc173Smrg      ;;
6275c43cc173Smrg
6276c43cc173Smrg    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
6277c43cc173Smrg      # PIC is the default for these OSes.
6278c43cc173Smrg      ;;
6279c43cc173Smrg
6280c43cc173Smrg    mingw* | pw32* | os2*)
6281c43cc173Smrg      # This hack is so that the source file can tell whether it is being
6282c43cc173Smrg      # built for inclusion in a dll (and should export symbols for example).
6283c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
6284c43cc173Smrg      ;;
6285c43cc173Smrg
6286c43cc173Smrg    darwin* | rhapsody*)
6287c43cc173Smrg      # PIC is the default on this platform
6288c43cc173Smrg      # Common symbols not allowed in MH_DYLIB files
6289c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
6290c43cc173Smrg      ;;
6291c43cc173Smrg
6292c43cc173Smrg    interix3*)
6293c43cc173Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
6294c43cc173Smrg      # Instead, we relocate shared libraries at runtime.
6295c43cc173Smrg      ;;
6296c43cc173Smrg
6297c43cc173Smrg    msdosdjgpp*)
6298c43cc173Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
6299c43cc173Smrg      # on systems that don't support them.
6300c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
6301c43cc173Smrg      enable_shared=no
6302c43cc173Smrg      ;;
6303c43cc173Smrg
6304c43cc173Smrg    sysv4*MP*)
6305c43cc173Smrg      if test -d /usr/nec; then
6306c43cc173Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
6307c43cc173Smrg      fi
6308c43cc173Smrg      ;;
6309c43cc173Smrg
6310c43cc173Smrg    hpux*)
6311c43cc173Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
6312c43cc173Smrg      # not for PA HP-UX.
6313c43cc173Smrg      case $host_cpu in
6314c43cc173Smrg      hppa*64*|ia64*)
6315c43cc173Smrg	# +Z the default
6316c43cc173Smrg	;;
6317c43cc173Smrg      *)
6318c43cc173Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
6319c43cc173Smrg	;;
6320c43cc173Smrg      esac
6321c43cc173Smrg      ;;
6322c43cc173Smrg
6323c43cc173Smrg    *)
6324c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
6325c43cc173Smrg      ;;
6326c43cc173Smrg    esac
6327c43cc173Smrg  else
6328c43cc173Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
6329c43cc173Smrg    case $host_os in
6330c43cc173Smrg    aix*)
6331c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6332c43cc173Smrg      if test "$host_cpu" = ia64; then
6333c43cc173Smrg	# AIX 5 now supports IA64 processor
6334c43cc173Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6335c43cc173Smrg      else
6336c43cc173Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
6337c43cc173Smrg      fi
6338c43cc173Smrg      ;;
6339c43cc173Smrg      darwin*)
6340c43cc173Smrg        # PIC is the default on this platform
6341c43cc173Smrg        # Common symbols not allowed in MH_DYLIB files
6342c43cc173Smrg       case $cc_basename in
6343c43cc173Smrg         xlc*)
6344c43cc173Smrg         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
6345c43cc173Smrg         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6346c43cc173Smrg         ;;
6347c43cc173Smrg       esac
6348c43cc173Smrg       ;;
6349c43cc173Smrg
6350c43cc173Smrg    mingw* | pw32* | os2*)
6351c43cc173Smrg      # This hack is so that the source file can tell whether it is being
6352c43cc173Smrg      # built for inclusion in a dll (and should export symbols for example).
6353c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
6354c43cc173Smrg      ;;
6355c43cc173Smrg
6356c43cc173Smrg    hpux9* | hpux10* | hpux11*)
6357c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6358c43cc173Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
6359c43cc173Smrg      # not for PA HP-UX.
6360c43cc173Smrg      case $host_cpu in
6361c43cc173Smrg      hppa*64*|ia64*)
6362c43cc173Smrg	# +Z the default
6363c43cc173Smrg	;;
6364c43cc173Smrg      *)
6365c43cc173Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
6366c43cc173Smrg	;;
6367c43cc173Smrg      esac
6368c43cc173Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
6369c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
6370c43cc173Smrg      ;;
6371c43cc173Smrg
6372c43cc173Smrg    irix5* | irix6* | nonstopux*)
6373c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6374c43cc173Smrg      # PIC (with -KPIC) is the default.
6375c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
6376c43cc173Smrg      ;;
6377c43cc173Smrg
6378c43cc173Smrg    newsos6)
6379c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6380c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6381c43cc173Smrg      ;;
6382c43cc173Smrg
6383c43cc173Smrg    linux*)
6384c43cc173Smrg      case $cc_basename in
6385c43cc173Smrg      icc* | ecc*)
6386c43cc173Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6387c43cc173Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6388c43cc173Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
6389c43cc173Smrg        ;;
6390c43cc173Smrg      pgcc* | pgf77* | pgf90* | pgf95*)
6391c43cc173Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
6392c43cc173Smrg	# which looks to be a dead project)
6393c43cc173Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6394c43cc173Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
6395c43cc173Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6396c43cc173Smrg        ;;
6397c43cc173Smrg      ccc*)
6398c43cc173Smrg        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6399c43cc173Smrg        # All Alpha code is PIC.
6400c43cc173Smrg        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
6401c43cc173Smrg        ;;
6402c43cc173Smrg      esac
6403c43cc173Smrg      ;;
6404c43cc173Smrg
6405c43cc173Smrg    osf3* | osf4* | osf5*)
6406c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6407c43cc173Smrg      # All OSF/1 code is PIC.
6408c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
6409c43cc173Smrg      ;;
6410c43cc173Smrg
6411c43cc173Smrg    solaris*)
6412c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6413c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6414c43cc173Smrg      case $cc_basename in
6415c43cc173Smrg      f77* | f90* | f95*)
6416c43cc173Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
6417c43cc173Smrg      *)
6418c43cc173Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
6419c43cc173Smrg      esac
6420c43cc173Smrg      ;;
6421c43cc173Smrg
6422c43cc173Smrg    sunos4*)
6423c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
6424c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
6425c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6426c43cc173Smrg      ;;
6427c43cc173Smrg
6428c43cc173Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
6429c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6430c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6431c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6432c43cc173Smrg      ;;
6433c43cc173Smrg
6434c43cc173Smrg    sysv4*MP*)
6435c43cc173Smrg      if test -d /usr/nec ;then
6436c43cc173Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
6437c43cc173Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6438c43cc173Smrg      fi
6439c43cc173Smrg      ;;
6440c43cc173Smrg
6441c43cc173Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
6442c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6443c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6444c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6445c43cc173Smrg      ;;
6446c43cc173Smrg
6447c43cc173Smrg    unicos*)
6448c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6449c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
6450c43cc173Smrg      ;;
6451c43cc173Smrg
6452c43cc173Smrg    uts4*)
6453c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
6454c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6455c43cc173Smrg      ;;
6456c43cc173Smrg
6457c43cc173Smrg    *)
6458c43cc173Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
6459c43cc173Smrg      ;;
6460c43cc173Smrg    esac
6461c43cc173Smrg  fi
6462c43cc173Smrg])
6463c43cc173SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
6464c43cc173Smrg
6465c43cc173Smrg#
6466c43cc173Smrg# Check to make sure the PIC flag actually works.
6467c43cc173Smrg#
6468c43cc173Smrgif test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
6469c43cc173Smrg  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
6470c43cc173Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
6471c43cc173Smrg    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
6472c43cc173Smrg    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
6473c43cc173Smrg     "" | " "*) ;;
6474c43cc173Smrg     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
6475c43cc173Smrg     esac],
6476c43cc173Smrg    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
6477c43cc173Smrg     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
6478c43cc173Smrgfi
6479c43cc173Smrgcase $host_os in
6480c43cc173Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
6481c43cc173Smrg  *djgpp*)
6482c43cc173Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
6483c43cc173Smrg    ;;
6484c43cc173Smrg  *)
6485c43cc173Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
6486c43cc173Smrg    ;;
6487c43cc173Smrgesac
6488c43cc173Smrg
6489c43cc173Smrg#
6490c43cc173Smrg# Check to make sure the static flag actually works.
6491c43cc173Smrg#
6492c43cc173Smrgwl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
6493c43cc173SmrgAC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
6494c43cc173Smrg  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
6495c43cc173Smrg  $lt_tmp_static_flag,
6496c43cc173Smrg  [],
6497c43cc173Smrg  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
6498c43cc173Smrg])
6499c43cc173Smrg
6500c43cc173Smrg
6501c43cc173Smrg# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
6502c43cc173Smrg# ------------------------------------
6503c43cc173Smrg# See if the linker supports building shared libraries.
6504c43cc173SmrgAC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
6505c43cc173Smrg[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
6506c43cc173Smrgifelse([$1],[CXX],[
6507c43cc173Smrg  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
6508c43cc173Smrg  case $host_os in
6509c43cc173Smrg  aix4* | aix5*)
6510c43cc173Smrg    # If we're using GNU nm, then we don't want the "-C" option.
6511c43cc173Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
6512c43cc173Smrg    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
6513c43cc173Smrg      _LT_AC_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'
6514c43cc173Smrg    else
6515c43cc173Smrg      _LT_AC_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'
6516c43cc173Smrg    fi
6517c43cc173Smrg    ;;
6518c43cc173Smrg  pw32*)
6519c43cc173Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
6520c43cc173Smrg  ;;
6521c43cc173Smrg  cygwin* | mingw*)
6522c43cc173Smrg    _LT_AC_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'
6523c43cc173Smrg  ;;
6524c43cc173Smrg  *)
6525c43cc173Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
6526c43cc173Smrg  ;;
6527c43cc173Smrg  esac
6528c43cc173Smrg],[
6529c43cc173Smrg  runpath_var=
6530c43cc173Smrg  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
6531c43cc173Smrg  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6532c43cc173Smrg  _LT_AC_TAGVAR(archive_cmds, $1)=
6533c43cc173Smrg  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
6534c43cc173Smrg  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
6535c43cc173Smrg  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
6536c43cc173Smrg  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
6537c43cc173Smrg  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
6538c43cc173Smrg  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
6539c43cc173Smrg  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
6540c43cc173Smrg  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6541c43cc173Smrg  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
6542c43cc173Smrg  _LT_AC_TAGVAR(hardcode_direct, $1)=no
6543c43cc173Smrg  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
6544c43cc173Smrg  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6545c43cc173Smrg  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
6546c43cc173Smrg  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
6547c43cc173Smrg  _LT_AC_TAGVAR(module_cmds, $1)=
6548c43cc173Smrg  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
6549c43cc173Smrg  _LT_AC_TAGVAR(always_export_symbols, $1)=no
6550c43cc173Smrg  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
6551c43cc173Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
6552c43cc173Smrg  # included in the symbol list
6553c43cc173Smrg  _LT_AC_TAGVAR(include_expsyms, $1)=
6554c43cc173Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
6555c43cc173Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
6556c43cc173Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
6557c43cc173Smrg  # as well as any symbol that contains `d'.
6558c43cc173Smrg  _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
6559c43cc173Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
6560c43cc173Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
6561c43cc173Smrg  # the symbol is explicitly referenced.  Since portable code cannot
6562c43cc173Smrg  # rely on this symbol name, it's probably fine to never include it in
6563c43cc173Smrg  # preloaded symbol tables.
6564c43cc173Smrg  extract_expsyms_cmds=
6565c43cc173Smrg  # Just being paranoid about ensuring that cc_basename is set.
6566c43cc173Smrg  _LT_CC_BASENAME([$compiler])
6567c43cc173Smrg  case $host_os in
6568c43cc173Smrg  cygwin* | mingw* | pw32*)
6569c43cc173Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
6570c43cc173Smrg    # When not using gcc, we currently assume that we are using
6571c43cc173Smrg    # Microsoft Visual C++.
6572c43cc173Smrg    if test "$GCC" != yes; then
6573c43cc173Smrg      with_gnu_ld=no
6574c43cc173Smrg    fi
6575c43cc173Smrg    ;;
6576c43cc173Smrg  interix*)
6577c43cc173Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
6578c43cc173Smrg    with_gnu_ld=yes
6579c43cc173Smrg    ;;
6580c43cc173Smrg  openbsd*)
6581c43cc173Smrg    with_gnu_ld=no
6582c43cc173Smrg    ;;
6583c43cc173Smrg  esac
6584c43cc173Smrg
6585c43cc173Smrg  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
6586c43cc173Smrg  if test "$with_gnu_ld" = yes; then
6587c43cc173Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
6588c43cc173Smrg    wlarc='${wl}'
6589c43cc173Smrg
6590c43cc173Smrg    # Set some defaults for GNU ld with shared library support. These
6591c43cc173Smrg    # are reset later if shared libraries are not supported. Putting them
6592c43cc173Smrg    # here allows them to be overridden if necessary.
6593c43cc173Smrg    runpath_var=LD_RUN_PATH
6594c43cc173Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
6595c43cc173Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6596c43cc173Smrg    # ancient GNU ld didn't support --whole-archive et. al.
6597c43cc173Smrg    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
6598c43cc173Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6599c43cc173Smrg      else
6600c43cc173Smrg  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
6601c43cc173Smrg    fi
6602c43cc173Smrg    supports_anon_versioning=no
6603c43cc173Smrg    case `$LD -v 2>/dev/null` in
6604c43cc173Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
6605c43cc173Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
6606c43cc173Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
6607c43cc173Smrg      *\ 2.11.*) ;; # other 2.11 versions
6608c43cc173Smrg      *) supports_anon_versioning=yes ;;
6609c43cc173Smrg    esac
6610c43cc173Smrg
6611c43cc173Smrg    # See if GNU ld supports shared libraries.
6612c43cc173Smrg    case $host_os in
6613c43cc173Smrg    aix3* | aix4* | aix5*)
6614c43cc173Smrg      # On AIX/PPC, the GNU linker is very broken
6615c43cc173Smrg      if test "$host_cpu" != ia64; then
6616c43cc173Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6617c43cc173Smrg	cat <<EOF 1>&2
6618c43cc173Smrg
6619c43cc173Smrg*** Warning: the GNU linker, at least up to release 2.9.1, is reported
6620c43cc173Smrg*** to be unable to reliably create shared libraries on AIX.
6621c43cc173Smrg*** Therefore, libtool is disabling shared libraries support.  If you
6622c43cc173Smrg*** really care for shared libraries, you may want to modify your PATH
6623c43cc173Smrg*** so that a non-GNU linker is found, and then restart.
6624c43cc173Smrg
6625c43cc173SmrgEOF
6626c43cc173Smrg      fi
6627c43cc173Smrg      ;;
6628c43cc173Smrg
6629c43cc173Smrg    amigaos*)
6630c43cc173Smrg      _LT_AC_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)'
6631c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6632c43cc173Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6633c43cc173Smrg
6634c43cc173Smrg      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
6635c43cc173Smrg      # that the semantics of dynamic libraries on AmigaOS, at least up
6636c43cc173Smrg      # to version 4, is to share data among multiple programs linked
6637c43cc173Smrg      # with the same dynamic library.  Since this doesn't match the
6638c43cc173Smrg      # behavior of shared libraries on other platforms, we can't use
6639c43cc173Smrg      # them.
6640c43cc173Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
6641c43cc173Smrg      ;;
6642c43cc173Smrg
6643c43cc173Smrg    beos*)
6644c43cc173Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
6645c43cc173Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
6646c43cc173Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
6647c43cc173Smrg	# support --undefined.  This deserves some investigation.  FIXME
6648c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6649c43cc173Smrg      else
6650c43cc173Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6651c43cc173Smrg      fi
6652c43cc173Smrg      ;;
6653c43cc173Smrg
6654c43cc173Smrg    cygwin* | mingw* | pw32*)
6655c43cc173Smrg      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6656c43cc173Smrg      # as there is no search path for DLLs.
6657c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6658c43cc173Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
6659c43cc173Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=no
6660c43cc173Smrg      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6661c43cc173Smrg      _LT_AC_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'
6662c43cc173Smrg
6663c43cc173Smrg      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
6664c43cc173Smrg        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
6665c43cc173Smrg	# If the export-symbols file already is a .def file (1st line
6666c43cc173Smrg	# is EXPORTS), use it as is; otherwise, prepend...
6667c43cc173Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6668c43cc173Smrg	  cp $export_symbols $output_objdir/$soname.def;
6669c43cc173Smrg	else
6670c43cc173Smrg	  echo EXPORTS > $output_objdir/$soname.def;
6671c43cc173Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
6672c43cc173Smrg	fi~
6673c43cc173Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
6674c43cc173Smrg      else
6675c43cc173Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6676c43cc173Smrg      fi
6677c43cc173Smrg      ;;
6678c43cc173Smrg
6679c43cc173Smrg    interix3*)
6680c43cc173Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
6681c43cc173Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6682c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6683c43cc173Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6684c43cc173Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
6685c43cc173Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
6686c43cc173Smrg      # default) and relocated if they conflict, which is a slow very memory
6687c43cc173Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
6688c43cc173Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
6689c43cc173Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
6690c43cc173Smrg      _LT_AC_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'
6691c43cc173Smrg      _LT_AC_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'
6692c43cc173Smrg      ;;
6693c43cc173Smrg
6694c43cc173Smrg    linux*)
6695c43cc173Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
6696c43cc173Smrg	tmp_addflag=
6697c43cc173Smrg	case $cc_basename,$host_cpu in
6698c43cc173Smrg	pgcc*)				# Portland Group C compiler
6699c43cc173Smrg	  _LT_AC_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'
6700c43cc173Smrg	  tmp_addflag=' $pic_flag'
6701c43cc173Smrg	  ;;
6702c43cc173Smrg	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
6703c43cc173Smrg	  _LT_AC_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'
6704c43cc173Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
6705c43cc173Smrg	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
6706c43cc173Smrg	  tmp_addflag=' -i_dynamic' ;;
6707c43cc173Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
6708c43cc173Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
6709c43cc173Smrg	ifc* | ifort*)			# Intel Fortran compiler
6710c43cc173Smrg	  tmp_addflag=' -nofor_main' ;;
6711c43cc173Smrg	esac
6712c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6713c43cc173Smrg
6714c43cc173Smrg	if test $supports_anon_versioning = yes; then
6715c43cc173Smrg	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
6716c43cc173Smrg  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
6717c43cc173Smrg  $echo "local: *; };" >> $output_objdir/$libname.ver~
6718c43cc173Smrg	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
6719c43cc173Smrg	fi
6720c43cc173Smrg      else
6721c43cc173Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6722c43cc173Smrg      fi
6723c43cc173Smrg      ;;
6724c43cc173Smrg
6725c43cc173Smrg    netbsd*)
6726c43cc173Smrg      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
6727c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
6728c43cc173Smrg	wlarc=
6729c43cc173Smrg      else
6730c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6731c43cc173Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
6732c43cc173Smrg      fi
6733c43cc173Smrg      ;;
6734c43cc173Smrg
6735c43cc173Smrg    solaris*)
6736c43cc173Smrg      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
6737c43cc173Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6738c43cc173Smrg	cat <<EOF 1>&2
6739c43cc173Smrg
6740c43cc173Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
6741c43cc173Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
6742c43cc173Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
6743c43cc173Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
6744c43cc173Smrg*** your PATH or compiler configuration so that the native linker is
6745c43cc173Smrg*** used, and then restart.
6746c43cc173Smrg
6747c43cc173SmrgEOF
6748c43cc173Smrg      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
6749c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6750c43cc173Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
6751c43cc173Smrg      else
6752c43cc173Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6753c43cc173Smrg      fi
6754c43cc173Smrg      ;;
6755c43cc173Smrg
6756c43cc173Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
6757c43cc173Smrg      case `$LD -v 2>&1` in
6758c43cc173Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) 
6759c43cc173Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6760c43cc173Smrg	cat <<_LT_EOF 1>&2
6761c43cc173Smrg
6762c43cc173Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
6763c43cc173Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
6764c43cc173Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
6765c43cc173Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
6766c43cc173Smrg*** your PATH or compiler configuration so that the native linker is
6767c43cc173Smrg*** used, and then restart.
6768c43cc173Smrg
6769c43cc173Smrg_LT_EOF
6770c43cc173Smrg	;;
6771c43cc173Smrg	*)
6772c43cc173Smrg	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
6773c43cc173Smrg	    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
6774c43cc173Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
6775c43cc173Smrg	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
6776c43cc173Smrg	  else
6777c43cc173Smrg	    _LT_AC_TAGVAR(ld_shlibs, $1)=no
6778c43cc173Smrg	  fi
6779c43cc173Smrg	;;
6780c43cc173Smrg      esac
6781c43cc173Smrg      ;;
6782c43cc173Smrg
6783c43cc173Smrg    sunos4*)
6784c43cc173Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6785c43cc173Smrg      wlarc=
6786c43cc173Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6787c43cc173Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6788c43cc173Smrg      ;;
6789c43cc173Smrg
6790c43cc173Smrg    *)
6791c43cc173Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
6792c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6793c43cc173Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
6794c43cc173Smrg      else
6795c43cc173Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6796c43cc173Smrg      fi
6797c43cc173Smrg      ;;
6798c43cc173Smrg    esac
6799c43cc173Smrg
6800c43cc173Smrg    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
6801c43cc173Smrg      runpath_var=
6802c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
6803c43cc173Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
6804c43cc173Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
6805c43cc173Smrg    fi
6806c43cc173Smrg  else
6807c43cc173Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
6808c43cc173Smrg    case $host_os in
6809c43cc173Smrg    aix3*)
6810c43cc173Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
6811c43cc173Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
6812c43cc173Smrg      _LT_AC_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'
6813c43cc173Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
6814c43cc173Smrg      # are no directories specified by -L.
6815c43cc173Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6816c43cc173Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
6817c43cc173Smrg	# Neither direct hardcoding nor static linking is supported with a
6818c43cc173Smrg	# broken collect2.
6819c43cc173Smrg	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
6820c43cc173Smrg      fi
6821c43cc173Smrg      ;;
6822c43cc173Smrg
6823c43cc173Smrg    aix4* | aix5*)
6824c43cc173Smrg      if test "$host_cpu" = ia64; then
6825c43cc173Smrg	# On IA64, the linker does run time linking by default, so we don't
6826c43cc173Smrg	# have to do anything special.
6827c43cc173Smrg	aix_use_runtimelinking=no
6828c43cc173Smrg	exp_sym_flag='-Bexport'
6829c43cc173Smrg	no_entry_flag=""
6830c43cc173Smrg      else
6831c43cc173Smrg	# If we're using GNU nm, then we don't want the "-C" option.
6832c43cc173Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
6833c43cc173Smrg	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
6834c43cc173Smrg	  _LT_AC_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'
6835c43cc173Smrg	else
6836c43cc173Smrg	  _LT_AC_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'
6837c43cc173Smrg	fi
6838c43cc173Smrg	aix_use_runtimelinking=no
6839c43cc173Smrg
6840c43cc173Smrg	# Test if we are trying to use run time linking or normal
6841c43cc173Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
6842c43cc173Smrg	# need to do runtime linking.
6843c43cc173Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
6844c43cc173Smrg	  for ld_flag in $LDFLAGS; do
6845c43cc173Smrg  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
6846c43cc173Smrg  	    aix_use_runtimelinking=yes
6847c43cc173Smrg  	    break
6848c43cc173Smrg  	  fi
6849c43cc173Smrg	  done
6850c43cc173Smrg	  ;;
6851c43cc173Smrg	esac
6852c43cc173Smrg
6853c43cc173Smrg	exp_sym_flag='-bexport'
6854c43cc173Smrg	no_entry_flag='-bnoentry'
6855c43cc173Smrg      fi
6856c43cc173Smrg
6857c43cc173Smrg      # When large executables or shared objects are built, AIX ld can
6858c43cc173Smrg      # have problems creating the table of contents.  If linking a library
6859c43cc173Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
6860c43cc173Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6861c43cc173Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6862c43cc173Smrg
6863c43cc173Smrg      _LT_AC_TAGVAR(archive_cmds, $1)=''
6864c43cc173Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6865c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
6866c43cc173Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6867c43cc173Smrg
6868c43cc173Smrg      if test "$GCC" = yes; then
6869c43cc173Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
6870c43cc173Smrg	# We only want to do this on AIX 4.2 and lower, the check
6871c43cc173Smrg	# below for broken collect2 doesn't work under 4.3+
6872c43cc173Smrg	  collect2name=`${CC} -print-prog-name=collect2`
6873c43cc173Smrg	  if test -f "$collect2name" && \
6874c43cc173Smrg  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
6875c43cc173Smrg	  then
6876c43cc173Smrg  	  # We have reworked collect2
6877c43cc173Smrg  	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6878c43cc173Smrg	  else
6879c43cc173Smrg  	  # We have old collect2
6880c43cc173Smrg  	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
6881c43cc173Smrg  	  # It fails to find uninstalled libraries when the uninstalled
6882c43cc173Smrg  	  # path is not listed in the libpath.  Setting hardcode_minus_L
6883c43cc173Smrg  	  # to unsupported forces relinking
6884c43cc173Smrg  	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6885c43cc173Smrg  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6886c43cc173Smrg  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
6887c43cc173Smrg	  fi
6888c43cc173Smrg	  ;;
6889c43cc173Smrg	esac
6890c43cc173Smrg	shared_flag='-shared'
6891c43cc173Smrg	if test "$aix_use_runtimelinking" = yes; then
6892c43cc173Smrg	  shared_flag="$shared_flag "'${wl}-G'
6893c43cc173Smrg	fi
6894c43cc173Smrg      else
6895c43cc173Smrg	# not using gcc
6896c43cc173Smrg	if test "$host_cpu" = ia64; then
6897c43cc173Smrg  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6898c43cc173Smrg  	# chokes on -Wl,-G. The following line is correct:
6899c43cc173Smrg	  shared_flag='-G'
6900c43cc173Smrg	else
6901c43cc173Smrg	  if test "$aix_use_runtimelinking" = yes; then
6902c43cc173Smrg	    shared_flag='${wl}-G'
6903c43cc173Smrg	  else
6904c43cc173Smrg	    shared_flag='${wl}-bM:SRE'
6905c43cc173Smrg	  fi
6906c43cc173Smrg	fi
6907c43cc173Smrg      fi
6908c43cc173Smrg
6909c43cc173Smrg      # It seems that -bexpall does not export symbols beginning with
6910c43cc173Smrg      # underscore (_), so it is better to generate a list of symbols to export.
6911c43cc173Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
6912c43cc173Smrg      if test "$aix_use_runtimelinking" = yes; then
6913c43cc173Smrg	# Warning - without using the other runtime loading flags (-brtl),
6914c43cc173Smrg	# -berok will link without error, but may produce a broken library.
6915c43cc173Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
6916c43cc173Smrg       # Determine the default libpath from the value encoded in an empty executable.
6917c43cc173Smrg       _LT_AC_SYS_LIBPATH_AIX
6918c43cc173Smrg       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6919c43cc173Smrg	_LT_AC_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 "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
6920c43cc173Smrg       else
6921c43cc173Smrg	if test "$host_cpu" = ia64; then
6922c43cc173Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6923c43cc173Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6924c43cc173Smrg	  _LT_AC_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"
6925c43cc173Smrg	else
6926c43cc173Smrg	 # Determine the default libpath from the value encoded in an empty executable.
6927c43cc173Smrg	 _LT_AC_SYS_LIBPATH_AIX
6928c43cc173Smrg	 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6929c43cc173Smrg	  # Warning - without using the other run time loading flags,
6930c43cc173Smrg	  # -berok will link without error, but may produce a broken library.
6931c43cc173Smrg	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6932c43cc173Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6933c43cc173Smrg	  # Exported symbols can be pulled into shared objects from archives
6934c43cc173Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6935c43cc173Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
6936c43cc173Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
6937c43cc173Smrg	  _LT_AC_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'
6938c43cc173Smrg	fi
6939c43cc173Smrg      fi
6940c43cc173Smrg      ;;
6941c43cc173Smrg
6942c43cc173Smrg    amigaos*)
6943c43cc173Smrg      _LT_AC_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)'
6944c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6945c43cc173Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6946c43cc173Smrg      # see comment about different semantics on the GNU ld section
6947c43cc173Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
6948c43cc173Smrg      ;;
6949c43cc173Smrg
6950c43cc173Smrg    bsdi[[45]]*)
6951c43cc173Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
6952c43cc173Smrg      ;;
6953c43cc173Smrg
6954c43cc173Smrg    cygwin* | mingw* | pw32*)
6955c43cc173Smrg      # When not using gcc, we currently assume that we are using
6956c43cc173Smrg      # Microsoft Visual C++.
6957c43cc173Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
6958c43cc173Smrg      # no search path for DLLs.
6959c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6960c43cc173Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
6961c43cc173Smrg      # Tell ltmain to make .lib files, not .a files.
6962c43cc173Smrg      libext=lib
6963c43cc173Smrg      # Tell ltmain to make .dll files, not .so files.
6964c43cc173Smrg      shrext_cmds=".dll"
6965c43cc173Smrg      # FIXME: Setting linknames here is a bad hack.
6966c43cc173Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
6967c43cc173Smrg      # The linker will automatically build a .lib file if we build a DLL.
6968c43cc173Smrg      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
6969c43cc173Smrg      # FIXME: Should let the user specify the lib program.
6970c43cc173Smrg      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
6971c43cc173Smrg      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
6972c43cc173Smrg      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6973c43cc173Smrg      ;;
6974c43cc173Smrg
6975c43cc173Smrg    darwin* | rhapsody*)
6976c43cc173Smrg      case $host_os in
6977c43cc173Smrg        rhapsody* | darwin1.[[012]])
6978c43cc173Smrg         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
6979c43cc173Smrg         ;;
6980c43cc173Smrg       *) # Darwin 1.3 on
6981c43cc173Smrg         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
6982c43cc173Smrg           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
6983c43cc173Smrg         else
6984c43cc173Smrg           case ${MACOSX_DEPLOYMENT_TARGET} in
6985c43cc173Smrg             10.[[012]])
6986c43cc173Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
6987c43cc173Smrg               ;;
6988c43cc173Smrg             10.*)
6989c43cc173Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
6990c43cc173Smrg               ;;
6991c43cc173Smrg           esac
6992c43cc173Smrg         fi
6993c43cc173Smrg         ;;
6994c43cc173Smrg      esac
6995c43cc173Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6996c43cc173Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
6997c43cc173Smrg      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
6998c43cc173Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6999c43cc173Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
7000c43cc173Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
7001c43cc173Smrg    if test "$GCC" = yes ; then
7002c43cc173Smrg    	output_verbose_link_cmd='echo'
7003c43cc173Smrg        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
7004c43cc173Smrg      _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
7005c43cc173Smrg      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
7006c43cc173Smrg      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
7007c43cc173Smrg      _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
7008c43cc173Smrg    else
7009c43cc173Smrg      case $cc_basename in
7010c43cc173Smrg        xlc*)
7011c43cc173Smrg         output_verbose_link_cmd='echo'
7012c43cc173Smrg         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
7013c43cc173Smrg         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
7014c43cc173Smrg          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
7015c43cc173Smrg         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
7016c43cc173Smrg          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
7017c43cc173Smrg          ;;
7018c43cc173Smrg       *)
7019c43cc173Smrg         _LT_AC_TAGVAR(ld_shlibs, $1)=no
7020c43cc173Smrg          ;;
7021c43cc173Smrg      esac
7022c43cc173Smrg    fi
7023c43cc173Smrg      ;;
7024c43cc173Smrg
7025c43cc173Smrg    dgux*)
7026c43cc173Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7027c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7028c43cc173Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7029c43cc173Smrg      ;;
7030c43cc173Smrg
7031c43cc173Smrg    freebsd1*)
7032c43cc173Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
7033c43cc173Smrg      ;;
7034c43cc173Smrg
7035c43cc173Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
7036c43cc173Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
7037c43cc173Smrg    # does not break anything, and helps significantly (at the cost of a little
7038c43cc173Smrg    # extra space).
7039c43cc173Smrg    freebsd2.2*)
7040c43cc173Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
7041c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7042c43cc173Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
7043c43cc173Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7044c43cc173Smrg      ;;
7045c43cc173Smrg
7046c43cc173Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
7047c43cc173Smrg    freebsd2*)
7048c43cc173Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
7049c43cc173Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
7050c43cc173Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
7051c43cc173Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7052c43cc173Smrg      ;;
7053c43cc173Smrg
7054c43cc173Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
7055c43cc173Smrg    freebsd* | kfreebsd*-gnu | dragonfly*)
7056c43cc173Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
7057c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7058c43cc173Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
7059c43cc173Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7060c43cc173Smrg      ;;
7061c43cc173Smrg
7062c43cc173Smrg    hpux9*)
7063c43cc173Smrg      if test "$GCC" = yes; then
7064c43cc173Smrg	_LT_AC_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'
7065c43cc173Smrg      else
7066c43cc173Smrg	_LT_AC_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'
7067c43cc173Smrg      fi
7068c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7069c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
7070c43cc173Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
7071c43cc173Smrg
7072c43cc173Smrg      # hardcode_minus_L: Not really in the search PATH,
7073c43cc173Smrg      # but as the default location of the library.
7074c43cc173Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
7075c43cc173Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7076c43cc173Smrg      ;;
7077c43cc173Smrg
7078c43cc173Smrg    hpux10*)
7079c43cc173Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
7080c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
7081c43cc173Smrg      else
7082c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
7083c43cc173Smrg      fi
7084c43cc173Smrg      if test "$with_gnu_ld" = no; then
7085c43cc173Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7086c43cc173Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
7087c43cc173Smrg
7088c43cc173Smrg	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
7089c43cc173Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7090c43cc173Smrg
7091c43cc173Smrg	# hardcode_minus_L: Not really in the search PATH,
7092c43cc173Smrg	# but as the default location of the library.
7093c43cc173Smrg	_LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
7094c43cc173Smrg      fi
7095c43cc173Smrg      ;;
7096c43cc173Smrg
7097c43cc173Smrg    hpux11*)
7098c43cc173Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
7099c43cc173Smrg	case $host_cpu in
7100c43cc173Smrg	hppa*64*)
7101c43cc173Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
7102c43cc173Smrg	  ;;
7103c43cc173Smrg	ia64*)
7104c43cc173Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
7105c43cc173Smrg	  ;;
7106c43cc173Smrg	*)
7107c43cc173Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
7108c43cc173Smrg	  ;;
7109c43cc173Smrg	esac
7110c43cc173Smrg      else
7111c43cc173Smrg	case $host_cpu in
7112c43cc173Smrg	hppa*64*)
7113c43cc173Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
7114c43cc173Smrg	  ;;
7115c43cc173Smrg	ia64*)
7116c43cc173Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
7117c43cc173Smrg	  ;;
7118c43cc173Smrg	*)
7119c43cc173Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
7120c43cc173Smrg	  ;;
7121c43cc173Smrg	esac
7122c43cc173Smrg      fi
7123c43cc173Smrg      if test "$with_gnu_ld" = no; then
7124c43cc173Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7125c43cc173Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
7126c43cc173Smrg
7127c43cc173Smrg	case $host_cpu in
7128c43cc173Smrg	hppa*64*|ia64*)
7129c43cc173Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
7130c43cc173Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
7131c43cc173Smrg	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7132c43cc173Smrg	  ;;
7133c43cc173Smrg	*)
7134c43cc173Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
7135c43cc173Smrg	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7136c43cc173Smrg
7137c43cc173Smrg	  # hardcode_minus_L: Not really in the search PATH,
7138c43cc173Smrg	  # but as the default location of the library.
7139c43cc173Smrg	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
7140c43cc173Smrg	  ;;
7141c43cc173Smrg	esac
7142c43cc173Smrg      fi
7143c43cc173Smrg      ;;
7144c43cc173Smrg
7145c43cc173Smrg    irix5* | irix6* | nonstopux*)
7146c43cc173Smrg      if test "$GCC" = yes; then
7147c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
7148c43cc173Smrg      else
7149c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
7150c43cc173Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
7151c43cc173Smrg      fi
7152c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7153c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
7154c43cc173Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
7155c43cc173Smrg      ;;
7156c43cc173Smrg
7157c43cc173Smrg    netbsd*)
7158c43cc173Smrg      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
7159c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
7160c43cc173Smrg      else
7161c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
7162c43cc173Smrg      fi
7163c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7164c43cc173Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
7165c43cc173Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7166c43cc173Smrg      ;;
7167c43cc173Smrg
7168c43cc173Smrg    newsos6)
7169c43cc173Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7170c43cc173Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
7171c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7172c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
7173c43cc173Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7174c43cc173Smrg      ;;
7175c43cc173Smrg
7176c43cc173Smrg    openbsd*)
7177c43cc173Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
7178c43cc173Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7179c43cc173Smrg      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
7180c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
7181c43cc173Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
7182c43cc173Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7183c43cc173Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7184c43cc173Smrg      else
7185c43cc173Smrg       case $host_os in
7186c43cc173Smrg	 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
7187c43cc173Smrg	   _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
7188c43cc173Smrg	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7189c43cc173Smrg	   ;;
7190c43cc173Smrg	 *)
7191c43cc173Smrg	   _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
7192c43cc173Smrg	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7193c43cc173Smrg	   ;;
7194c43cc173Smrg       esac
7195c43cc173Smrg      fi
7196c43cc173Smrg      ;;
7197c43cc173Smrg
7198c43cc173Smrg    os2*)
7199c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7200c43cc173Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
7201c43cc173Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
7202c43cc173Smrg      _LT_AC_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'
7203c43cc173Smrg      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
7204c43cc173Smrg      ;;
7205c43cc173Smrg
7206c43cc173Smrg    osf3*)
7207c43cc173Smrg      if test "$GCC" = yes; then
7208c43cc173Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7209c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
7210c43cc173Smrg      else
7211c43cc173Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7212c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
7213c43cc173Smrg      fi
7214c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7215c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
7216c43cc173Smrg      ;;
7217c43cc173Smrg
7218c43cc173Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
7219c43cc173Smrg      if test "$GCC" = yes; then
7220c43cc173Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7221c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
7222c43cc173Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7223c43cc173Smrg      else
7224c43cc173Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7225c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
7226c43cc173Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
7227c43cc173Smrg	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
7228c43cc173Smrg
7229c43cc173Smrg	# Both c and cxx compiler support -rpath directly
7230c43cc173Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7231c43cc173Smrg      fi
7232c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
7233c43cc173Smrg      ;;
7234c43cc173Smrg
7235c43cc173Smrg    solaris*)
7236c43cc173Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
7237c43cc173Smrg      if test "$GCC" = yes; then
7238c43cc173Smrg	wlarc='${wl}'
7239c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
7240c43cc173Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
7241c43cc173Smrg	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
7242c43cc173Smrg      else
7243c43cc173Smrg	wlarc=''
7244c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
7245c43cc173Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
7246c43cc173Smrg  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
7247c43cc173Smrg      fi
7248c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7249c43cc173Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7250c43cc173Smrg      case $host_os in
7251c43cc173Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7252c43cc173Smrg      *)
7253c43cc173Smrg 	# The compiler driver will combine linker options so we
7254c43cc173Smrg 	# cannot just pass the convience library names through
7255c43cc173Smrg 	# without $wl, iff we do not link with $LD.
7256c43cc173Smrg 	# Luckily, gcc supports the same syntax we need for Sun Studio.
7257c43cc173Smrg 	# Supported since Solaris 2.6 (maybe 2.5.1?)
7258c43cc173Smrg 	case $wlarc in
7259c43cc173Smrg 	'')
7260c43cc173Smrg 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
7261c43cc173Smrg 	*)
7262c43cc173Smrg 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
7263c43cc173Smrg 	esac ;;
7264c43cc173Smrg      esac
7265c43cc173Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
7266c43cc173Smrg      ;;
7267c43cc173Smrg
7268c43cc173Smrg    sunos4*)
7269c43cc173Smrg      if test "x$host_vendor" = xsequent; then
7270c43cc173Smrg	# Use $CC to link under sequent, because it throws in some extra .o
7271c43cc173Smrg	# files that make .init and .fini sections work.
7272c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
7273c43cc173Smrg      else
7274c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
7275c43cc173Smrg      fi
7276c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7277c43cc173Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
7278c43cc173Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
7279c43cc173Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7280c43cc173Smrg      ;;
7281c43cc173Smrg
7282c43cc173Smrg    sysv4)
7283c43cc173Smrg      case $host_vendor in
7284c43cc173Smrg	sni)
7285c43cc173Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7286c43cc173Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
7287c43cc173Smrg	;;
7288c43cc173Smrg	siemens)
7289c43cc173Smrg	  ## LD is ld it makes a PLAMLIB
7290c43cc173Smrg	  ## CC just makes a GrossModule.
7291c43cc173Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
7292c43cc173Smrg	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
7293c43cc173Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
7294c43cc173Smrg        ;;
7295c43cc173Smrg	motorola)
7296c43cc173Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7297c43cc173Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
7298c43cc173Smrg	;;
7299c43cc173Smrg      esac
7300c43cc173Smrg      runpath_var='LD_RUN_PATH'
7301c43cc173Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7302c43cc173Smrg      ;;
7303c43cc173Smrg
7304c43cc173Smrg    sysv4.3*)
7305c43cc173Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7306c43cc173Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7307c43cc173Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
7308c43cc173Smrg      ;;
7309c43cc173Smrg
7310c43cc173Smrg    sysv4*MP*)
7311c43cc173Smrg      if test -d /usr/nec; then
7312c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7313c43cc173Smrg	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7314c43cc173Smrg	runpath_var=LD_RUN_PATH
7315c43cc173Smrg	hardcode_runpath_var=yes
7316c43cc173Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
7317c43cc173Smrg      fi
7318c43cc173Smrg      ;;
7319c43cc173Smrg
7320c43cc173Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*)
7321c43cc173Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7322c43cc173Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
7323c43cc173Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7324c43cc173Smrg      runpath_var='LD_RUN_PATH'
7325c43cc173Smrg
7326c43cc173Smrg      if test "$GCC" = yes; then
7327c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7328c43cc173Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7329c43cc173Smrg      else
7330c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7331c43cc173Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7332c43cc173Smrg      fi
7333c43cc173Smrg      ;;
7334c43cc173Smrg
7335c43cc173Smrg    sysv5* | sco3.2v5* | sco5v6*)
7336c43cc173Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
7337c43cc173Smrg      # link with -lc, and that would cause any symbols used from libc to
7338c43cc173Smrg      # always be unresolved, which means just about no library would
7339c43cc173Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
7340c43cc173Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
7341c43cc173Smrg      # as -z defs.
7342c43cc173Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7343c43cc173Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
7344c43cc173Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
7345c43cc173Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7346c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
7347c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
7348c43cc173Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
7349c43cc173Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
7350c43cc173Smrg      runpath_var='LD_RUN_PATH'
7351c43cc173Smrg
7352c43cc173Smrg      if test "$GCC" = yes; then
7353c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
7354c43cc173Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
7355c43cc173Smrg      else
7356c43cc173Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
7357c43cc173Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
7358c43cc173Smrg      fi
7359c43cc173Smrg      ;;
7360c43cc173Smrg
7361c43cc173Smrg    uts4*)
7362c43cc173Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7363c43cc173Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7364c43cc173Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7365c43cc173Smrg      ;;
7366c43cc173Smrg
7367c43cc173Smrg    *)
7368c43cc173Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
7369c43cc173Smrg      ;;
7370c43cc173Smrg    esac
7371c43cc173Smrg  fi
7372c43cc173Smrg])
7373c43cc173SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
7374c43cc173Smrgtest "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
7375c43cc173Smrg
7376c43cc173Smrg#
7377c43cc173Smrg# Do we need to explicitly link libc?
7378c43cc173Smrg#
7379c43cc173Smrgcase "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
7380c43cc173Smrgx|xyes)
7381c43cc173Smrg  # Assume -lc should be added
7382c43cc173Smrg  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
7383c43cc173Smrg
7384c43cc173Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
7385c43cc173Smrg    case $_LT_AC_TAGVAR(archive_cmds, $1) in
7386c43cc173Smrg    *'~'*)
7387c43cc173Smrg      # FIXME: we may have to deal with multi-command sequences.
7388c43cc173Smrg      ;;
7389c43cc173Smrg    '$CC '*)
7390c43cc173Smrg      # Test whether the compiler implicitly links with -lc since on some
7391c43cc173Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
7392c43cc173Smrg      # to ld, don't add -lc before -lgcc.
7393c43cc173Smrg      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
7394c43cc173Smrg      $rm conftest*
7395c43cc173Smrg      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
7396c43cc173Smrg
7397c43cc173Smrg      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
7398c43cc173Smrg        soname=conftest
7399c43cc173Smrg        lib=conftest
7400c43cc173Smrg        libobjs=conftest.$ac_objext
7401c43cc173Smrg        deplibs=
7402c43cc173Smrg        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
7403c43cc173Smrg	pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
7404c43cc173Smrg        compiler_flags=-v
7405c43cc173Smrg        linker_flags=-v
7406c43cc173Smrg        verstring=
7407c43cc173Smrg        output_objdir=.
7408c43cc173Smrg        libname=conftest
7409c43cc173Smrg        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
7410c43cc173Smrg        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
7411c43cc173Smrg        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
7412c43cc173Smrg        then
7413c43cc173Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
7414c43cc173Smrg        else
7415c43cc173Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
7416c43cc173Smrg        fi
7417c43cc173Smrg        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
7418c43cc173Smrg      else
7419c43cc173Smrg        cat conftest.err 1>&5
7420c43cc173Smrg      fi
7421c43cc173Smrg      $rm conftest*
7422c43cc173Smrg      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
7423c43cc173Smrg      ;;
7424c43cc173Smrg    esac
7425c43cc173Smrg  fi
7426c43cc173Smrg  ;;
7427c43cc173Smrgesac
7428c43cc173Smrg])# AC_LIBTOOL_PROG_LD_SHLIBS
7429c43cc173Smrg
7430c43cc173Smrg
7431c43cc173Smrg# _LT_AC_FILE_LTDLL_C
7432c43cc173Smrg# -------------------
7433c43cc173Smrg# Be careful that the start marker always follows a newline.
7434c43cc173SmrgAC_DEFUN([_LT_AC_FILE_LTDLL_C], [
7435c43cc173Smrg# /* ltdll.c starts here */
7436c43cc173Smrg# #define WIN32_LEAN_AND_MEAN
7437c43cc173Smrg# #include <windows.h>
7438c43cc173Smrg# #undef WIN32_LEAN_AND_MEAN
7439c43cc173Smrg# #include <stdio.h>
7440c43cc173Smrg#
7441c43cc173Smrg# #ifndef __CYGWIN__
7442c43cc173Smrg# #  ifdef __CYGWIN32__
7443c43cc173Smrg# #    define __CYGWIN__ __CYGWIN32__
7444c43cc173Smrg# #  endif
7445c43cc173Smrg# #endif
7446c43cc173Smrg#
7447c43cc173Smrg# #ifdef __cplusplus
7448c43cc173Smrg# extern "C" {
7449c43cc173Smrg# #endif
7450c43cc173Smrg# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
7451c43cc173Smrg# #ifdef __cplusplus
7452c43cc173Smrg# }
7453c43cc173Smrg# #endif
7454c43cc173Smrg#
7455c43cc173Smrg# #ifdef __CYGWIN__
7456c43cc173Smrg# #include <cygwin/cygwin_dll.h>
7457c43cc173Smrg# DECLARE_CYGWIN_DLL( DllMain );
7458c43cc173Smrg# #endif
7459c43cc173Smrg# HINSTANCE __hDllInstance_base;
7460c43cc173Smrg#
7461c43cc173Smrg# BOOL APIENTRY
7462c43cc173Smrg# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
7463c43cc173Smrg# {
7464c43cc173Smrg#   __hDllInstance_base = hInst;
7465c43cc173Smrg#   return TRUE;
7466c43cc173Smrg# }
7467c43cc173Smrg# /* ltdll.c ends here */
7468c43cc173Smrg])# _LT_AC_FILE_LTDLL_C
7469c43cc173Smrg
7470c43cc173Smrg
7471c43cc173Smrg# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
7472c43cc173Smrg# ---------------------------------
7473c43cc173SmrgAC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
7474c43cc173Smrg
7475c43cc173Smrg
7476c43cc173Smrg# old names
7477c43cc173SmrgAC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
7478c43cc173SmrgAC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
7479c43cc173SmrgAC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
7480c43cc173SmrgAC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
7481c43cc173SmrgAC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
7482c43cc173SmrgAC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
7483c43cc173SmrgAC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
7484c43cc173Smrg
7485c43cc173Smrg# This is just to silence aclocal about the macro not being used
7486c43cc173Smrgifelse([AC_DISABLE_FAST_INSTALL])
7487c43cc173Smrg
7488c43cc173SmrgAC_DEFUN([LT_AC_PROG_GCJ],
7489c43cc173Smrg[AC_CHECK_TOOL(GCJ, gcj, no)
7490c43cc173Smrg  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
7491c43cc173Smrg  AC_SUBST(GCJFLAGS)
7492c43cc173Smrg])
7493c43cc173Smrg
7494c43cc173SmrgAC_DEFUN([LT_AC_PROG_RC],
7495c43cc173Smrg[AC_CHECK_TOOL(RC, windres, no)
7496c43cc173Smrg])
7497c43cc173Smrg
7498c43cc173Smrg# NOTE: This macro has been submitted for inclusion into   #
7499c43cc173Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
7500c43cc173Smrg#  a released version of Autoconf we should remove this    #
7501c43cc173Smrg#  macro and use it instead.                               #
7502c43cc173Smrg# LT_AC_PROG_SED
7503c43cc173Smrg# --------------
7504c43cc173Smrg# Check for a fully-functional sed program, that truncates
7505c43cc173Smrg# as few characters as possible.  Prefer GNU sed if found.
7506c43cc173SmrgAC_DEFUN([LT_AC_PROG_SED],
7507c43cc173Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
7508c43cc173SmrgAC_CACHE_VAL(lt_cv_path_SED,
7509c43cc173Smrg[# Loop through the user's path and test for sed and gsed.
7510c43cc173Smrg# Then use that list of sed's as ones to test for truncation.
7511c43cc173Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7512c43cc173Smrgfor as_dir in $PATH
7513c43cc173Smrgdo
7514c43cc173Smrg  IFS=$as_save_IFS
7515c43cc173Smrg  test -z "$as_dir" && as_dir=.
7516c43cc173Smrg  for lt_ac_prog in sed gsed; do
7517c43cc173Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
7518c43cc173Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
7519c43cc173Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
7520c43cc173Smrg      fi
7521c43cc173Smrg    done
7522c43cc173Smrg  done
7523c43cc173Smrgdone
7524c43cc173Smrglt_ac_max=0
7525c43cc173Smrglt_ac_count=0
7526c43cc173Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
7527c43cc173Smrg# along with /bin/sed that truncates output.
7528c43cc173Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
7529c43cc173Smrg  test ! -f $lt_ac_sed && continue
7530c43cc173Smrg  cat /dev/null > conftest.in
7531c43cc173Smrg  lt_ac_count=0
7532c43cc173Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
7533c43cc173Smrg  # Check for GNU sed and select it if it is found.
7534c43cc173Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
7535c43cc173Smrg    lt_cv_path_SED=$lt_ac_sed
7536c43cc173Smrg    break
7537c43cc173Smrg  fi
7538c43cc173Smrg  while true; do
7539c43cc173Smrg    cat conftest.in conftest.in >conftest.tmp
7540c43cc173Smrg    mv conftest.tmp conftest.in
7541c43cc173Smrg    cp conftest.in conftest.nl
7542c43cc173Smrg    echo >>conftest.nl
7543c43cc173Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
7544c43cc173Smrg    cmp -s conftest.out conftest.nl || break
7545c43cc173Smrg    # 10000 chars as input seems more than enough
7546c43cc173Smrg    test $lt_ac_count -gt 10 && break
7547c43cc173Smrg    lt_ac_count=`expr $lt_ac_count + 1`
7548c43cc173Smrg    if test $lt_ac_count -gt $lt_ac_max; then
7549c43cc173Smrg      lt_ac_max=$lt_ac_count
7550c43cc173Smrg      lt_cv_path_SED=$lt_ac_sed
7551c43cc173Smrg    fi
7552c43cc173Smrg  done
7553c43cc173Smrgdone
7554c43cc173Smrg])
7555c43cc173SmrgSED=$lt_cv_path_SED
7556c43cc173SmrgAC_MSG_RESULT([$SED])
7557c43cc173Smrg])
7558c43cc173Smrg
7559c43cc173Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
7560c43cc173Smrg# From Jim Meyering
7561c43cc173Smrg
7562c43cc173Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
7563c43cc173Smrg# Free Software Foundation, Inc.
7564c43cc173Smrg#
7565c43cc173Smrg# This file is free software; the Free Software Foundation
7566c43cc173Smrg# gives unlimited permission to copy and/or distribute it,
7567c43cc173Smrg# with or without modifications, as long as this notice is preserved.
7568c43cc173Smrg
7569c43cc173Smrg# serial 4
7570c43cc173Smrg
7571c43cc173SmrgAC_DEFUN([AM_MAINTAINER_MODE],
7572c43cc173Smrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
7573c43cc173Smrg  dnl maintainer-mode is disabled by default
7574c43cc173Smrg  AC_ARG_ENABLE(maintainer-mode,
7575c43cc173Smrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
7576c43cc173Smrg			  (and sometimes confusing) to the casual installer],
7577c43cc173Smrg      USE_MAINTAINER_MODE=$enableval,
7578c43cc173Smrg      USE_MAINTAINER_MODE=no)
7579c43cc173Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
7580c43cc173Smrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
7581c43cc173Smrg  MAINT=$MAINTAINER_MODE_TRUE
7582c43cc173Smrg  AC_SUBST(MAINT)dnl
7583c43cc173Smrg]
7584c43cc173Smrg)
7585c43cc173Smrg
7586c43cc173SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
7587c43cc173Smrg
7588c43cc173Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
7589c43cc173Smrg
7590c43cc173Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
7591c43cc173Smrg#
7592c43cc173Smrg# This file is free software; the Free Software Foundation
7593c43cc173Smrg# gives unlimited permission to copy and/or distribute it,
7594c43cc173Smrg# with or without modifications, as long as this notice is preserved.
7595c43cc173Smrg
7596c43cc173Smrg# serial 3
7597c43cc173Smrg
7598c43cc173Smrg# AM_MAKE_INCLUDE()
7599c43cc173Smrg# -----------------
7600c43cc173Smrg# Check to see how make treats includes.
7601c43cc173SmrgAC_DEFUN([AM_MAKE_INCLUDE],
7602c43cc173Smrg[am_make=${MAKE-make}
7603c43cc173Smrgcat > confinc << 'END'
7604c43cc173Smrgam__doit:
7605c43cc173Smrg	@echo done
7606c43cc173Smrg.PHONY: am__doit
7607c43cc173SmrgEND
7608c43cc173Smrg# If we don't find an include directive, just comment out the code.
7609c43cc173SmrgAC_MSG_CHECKING([for style of include used by $am_make])
7610c43cc173Smrgam__include="#"
7611c43cc173Smrgam__quote=
7612c43cc173Smrg_am_result=none
7613c43cc173Smrg# First try GNU make style include.
7614c43cc173Smrgecho "include confinc" > confmf
7615c43cc173Smrg# We grep out `Entering directory' and `Leaving directory'
7616c43cc173Smrg# messages which can occur if `w' ends up in MAKEFLAGS.
7617c43cc173Smrg# In particular we don't look at `^make:' because GNU make might
7618c43cc173Smrg# be invoked under some other name (usually "gmake"), in which
7619c43cc173Smrg# case it prints its new name instead of `make'.
7620c43cc173Smrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
7621c43cc173Smrg   am__include=include
7622c43cc173Smrg   am__quote=
7623c43cc173Smrg   _am_result=GNU
7624c43cc173Smrgfi
7625c43cc173Smrg# Now try BSD make style include.
7626c43cc173Smrgif test "$am__include" = "#"; then
7627c43cc173Smrg   echo '.include "confinc"' > confmf
7628c43cc173Smrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
7629c43cc173Smrg      am__include=.include
7630c43cc173Smrg      am__quote="\""
7631c43cc173Smrg      _am_result=BSD
7632c43cc173Smrg   fi
7633c43cc173Smrgfi
7634c43cc173SmrgAC_SUBST([am__include])
7635c43cc173SmrgAC_SUBST([am__quote])
7636c43cc173SmrgAC_MSG_RESULT([$_am_result])
7637c43cc173Smrgrm -f confinc confmf
7638c43cc173Smrg])
7639c43cc173Smrg
7640c43cc173Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
7641c43cc173Smrg
7642c43cc173Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
7643c43cc173Smrg# Free Software Foundation, Inc.
7644c43cc173Smrg#
7645c43cc173Smrg# This file is free software; the Free Software Foundation
7646c43cc173Smrg# gives unlimited permission to copy and/or distribute it,
7647c43cc173Smrg# with or without modifications, as long as this notice is preserved.
7648c43cc173Smrg
7649c43cc173Smrg# serial 5
7650c43cc173Smrg
7651c43cc173Smrg# AM_MISSING_PROG(NAME, PROGRAM)
7652c43cc173Smrg# ------------------------------
7653c43cc173SmrgAC_DEFUN([AM_MISSING_PROG],
7654c43cc173Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
7655c43cc173Smrg$1=${$1-"${am_missing_run}$2"}
7656c43cc173SmrgAC_SUBST($1)])
7657c43cc173Smrg
7658c43cc173Smrg
7659c43cc173Smrg# AM_MISSING_HAS_RUN
7660c43cc173Smrg# ------------------
7661c43cc173Smrg# Define MISSING if not defined so far and test if it supports --run.
7662c43cc173Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
7663c43cc173SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
7664c43cc173Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7665c43cc173SmrgAC_REQUIRE_AUX_FILE([missing])dnl
7666c43cc173Smrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
7667c43cc173Smrg# Use eval to expand $SHELL
7668c43cc173Smrgif eval "$MISSING --run true"; then
7669c43cc173Smrg  am_missing_run="$MISSING --run "
7670c43cc173Smrgelse
7671c43cc173Smrg  am_missing_run=
7672c43cc173Smrg  AC_MSG_WARN([`missing' script is too old or missing])
7673c43cc173Smrgfi
7674c43cc173Smrg])
7675c43cc173Smrg
7676c43cc173Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
7677c43cc173Smrg#
7678c43cc173Smrg# This file is free software; the Free Software Foundation
7679c43cc173Smrg# gives unlimited permission to copy and/or distribute it,
7680c43cc173Smrg# with or without modifications, as long as this notice is preserved.
7681c43cc173Smrg
7682c43cc173Smrg# AM_PROG_MKDIR_P
7683c43cc173Smrg# ---------------
7684c43cc173Smrg# Check for `mkdir -p'.
7685c43cc173SmrgAC_DEFUN([AM_PROG_MKDIR_P],
7686c43cc173Smrg[AC_PREREQ([2.60])dnl
7687c43cc173SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
7688c43cc173Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
7689c43cc173Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
7690c43cc173Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
7691c43cc173Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
7692c43cc173Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
7693c43cc173Smrgdnl adjustment using top_builddir (which is defined more often than
7694c43cc173Smrgdnl MKDIR_P).
7695c43cc173SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
7696c43cc173Smrgcase $mkdir_p in
7697c43cc173Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
7698c43cc173Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
7699c43cc173Smrgesac
7700c43cc173Smrg])
7701c43cc173Smrg
7702c43cc173Smrg# Helper functions for option handling.                     -*- Autoconf -*-
7703c43cc173Smrg
7704c43cc173Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
7705c43cc173Smrg#
7706c43cc173Smrg# This file is free software; the Free Software Foundation
7707c43cc173Smrg# gives unlimited permission to copy and/or distribute it,
7708c43cc173Smrg# with or without modifications, as long as this notice is preserved.
7709c43cc173Smrg
7710c43cc173Smrg# serial 3
7711c43cc173Smrg
7712c43cc173Smrg# _AM_MANGLE_OPTION(NAME)
7713c43cc173Smrg# -----------------------
7714c43cc173SmrgAC_DEFUN([_AM_MANGLE_OPTION],
7715c43cc173Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
7716c43cc173Smrg
7717c43cc173Smrg# _AM_SET_OPTION(NAME)
7718c43cc173Smrg# ------------------------------
7719c43cc173Smrg# Set option NAME.  Presently that only means defining a flag for this option.
7720c43cc173SmrgAC_DEFUN([_AM_SET_OPTION],
7721c43cc173Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
7722c43cc173Smrg
7723c43cc173Smrg# _AM_SET_OPTIONS(OPTIONS)
7724c43cc173Smrg# ----------------------------------
7725c43cc173Smrg# OPTIONS is a space-separated list of Automake options.
7726c43cc173SmrgAC_DEFUN([_AM_SET_OPTIONS],
7727c43cc173Smrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
7728c43cc173Smrg
7729c43cc173Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
7730c43cc173Smrg# -------------------------------------------
7731c43cc173Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7732c43cc173SmrgAC_DEFUN([_AM_IF_OPTION],
7733c43cc173Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
7734c43cc173Smrg
7735c43cc173Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
7736c43cc173Smrg
7737c43cc173Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
7738c43cc173Smrg# Free Software Foundation, Inc.
7739c43cc173Smrg#
7740c43cc173Smrg# This file is free software; the Free Software Foundation
7741c43cc173Smrg# gives unlimited permission to copy and/or distribute it,
7742c43cc173Smrg# with or without modifications, as long as this notice is preserved.
7743c43cc173Smrg
7744c43cc173Smrg# serial 4
7745c43cc173Smrg
7746c43cc173Smrg# AM_SANITY_CHECK
7747c43cc173Smrg# ---------------
7748c43cc173SmrgAC_DEFUN([AM_SANITY_CHECK],
7749c43cc173Smrg[AC_MSG_CHECKING([whether build environment is sane])
7750c43cc173Smrg# Just in case
7751c43cc173Smrgsleep 1
7752c43cc173Smrgecho timestamp > conftest.file
7753c43cc173Smrg# Do `set' in a subshell so we don't clobber the current shell's
7754c43cc173Smrg# arguments.  Must try -L first in case configure is actually a
7755c43cc173Smrg# symlink; some systems play weird games with the mod time of symlinks
7756c43cc173Smrg# (eg FreeBSD returns the mod time of the symlink's containing
7757c43cc173Smrg# directory).
7758c43cc173Smrgif (
7759c43cc173Smrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
7760c43cc173Smrg   if test "$[*]" = "X"; then
7761c43cc173Smrg      # -L didn't work.
7762c43cc173Smrg      set X `ls -t $srcdir/configure conftest.file`
7763c43cc173Smrg   fi
7764c43cc173Smrg   rm -f conftest.file
7765c43cc173Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
7766c43cc173Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
7767c43cc173Smrg
7768c43cc173Smrg      # If neither matched, then we have a broken ls.  This can happen
7769c43cc173Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
7770c43cc173Smrg      # broken ls alias from the environment.  This has actually
7771c43cc173Smrg      # happened.  Such a system could not be considered "sane".
7772c43cc173Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
7773c43cc173Smrgalias in your environment])
7774c43cc173Smrg   fi
7775c43cc173Smrg
7776c43cc173Smrg   test "$[2]" = conftest.file
7777c43cc173Smrg   )
7778c43cc173Smrgthen
7779c43cc173Smrg   # Ok.
7780c43cc173Smrg   :
7781c43cc173Smrgelse
7782c43cc173Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
7783c43cc173SmrgCheck your system clock])
7784c43cc173Smrgfi
7785c43cc173SmrgAC_MSG_RESULT(yes)])
7786c43cc173Smrg
7787c43cc173Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
7788c43cc173Smrg#
7789c43cc173Smrg# This file is free software; the Free Software Foundation
7790c43cc173Smrg# gives unlimited permission to copy and/or distribute it,
7791c43cc173Smrg# with or without modifications, as long as this notice is preserved.
7792c43cc173Smrg
7793c43cc173Smrg# AM_PROG_INSTALL_STRIP
7794c43cc173Smrg# ---------------------
7795c43cc173Smrg# One issue with vendor `install' (even GNU) is that you can't
7796c43cc173Smrg# specify the program used to strip binaries.  This is especially
7797c43cc173Smrg# annoying in cross-compiling environments, where the build's strip
7798c43cc173Smrg# is unlikely to handle the host's binaries.
7799c43cc173Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
7800c43cc173Smrg# always use install-sh in `make install-strip', and initialize
7801c43cc173Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
7802c43cc173SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
7803c43cc173Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
7804c43cc173Smrg# Installed binaries are usually stripped using `strip' when the user
7805c43cc173Smrg# run `make install-strip'.  However `strip' might not be the right
7806c43cc173Smrg# tool to use in cross-compilation environments, therefore Automake
7807c43cc173Smrg# will honor the `STRIP' environment variable to overrule this program.
7808c43cc173Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
7809c43cc173Smrgif test "$cross_compiling" != no; then
7810c43cc173Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
7811c43cc173Smrgfi
7812c43cc173SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
7813c43cc173SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
7814c43cc173Smrg
7815c43cc173Smrg# Copyright (C) 2006  Free Software Foundation, Inc.
7816c43cc173Smrg#
7817c43cc173Smrg# This file is free software; the Free Software Foundation
7818c43cc173Smrg# gives unlimited permission to copy and/or distribute it,
7819c43cc173Smrg# with or without modifications, as long as this notice is preserved.
7820c43cc173Smrg
7821c43cc173Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
7822c43cc173Smrg# ---------------------------
7823c43cc173Smrg# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
7824c43cc173Smrg# This macro is traced by Automake.
7825c43cc173SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
7826c43cc173Smrg
7827c43cc173Smrg# Check how to create a tarball.                            -*- Autoconf -*-
7828c43cc173Smrg
7829c43cc173Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
7830c43cc173Smrg#
7831c43cc173Smrg# This file is free software; the Free Software Foundation
7832c43cc173Smrg# gives unlimited permission to copy and/or distribute it,
7833c43cc173Smrg# with or without modifications, as long as this notice is preserved.
7834c43cc173Smrg
7835c43cc173Smrg# serial 2
7836c43cc173Smrg
7837c43cc173Smrg# _AM_PROG_TAR(FORMAT)
7838c43cc173Smrg# --------------------
7839c43cc173Smrg# Check how to create a tarball in format FORMAT.
7840c43cc173Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
7841c43cc173Smrg#
7842c43cc173Smrg# Substitute a variable $(am__tar) that is a command
7843c43cc173Smrg# writing to stdout a FORMAT-tarball containing the directory
7844c43cc173Smrg# $tardir.
7845c43cc173Smrg#     tardir=directory && $(am__tar) > result.tar
7846c43cc173Smrg#
7847c43cc173Smrg# Substitute a variable $(am__untar) that extract such
7848c43cc173Smrg# a tarball read from stdin.
7849c43cc173Smrg#     $(am__untar) < result.tar
7850c43cc173SmrgAC_DEFUN([_AM_PROG_TAR],
7851c43cc173Smrg[# Always define AMTAR for backward compatibility.
7852c43cc173SmrgAM_MISSING_PROG([AMTAR], [tar])
7853c43cc173Smrgm4_if([$1], [v7],
7854c43cc173Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
7855c43cc173Smrg     [m4_case([$1], [ustar],, [pax],,
7856c43cc173Smrg              [m4_fatal([Unknown tar format])])
7857c43cc173SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
7858c43cc173Smrg# Loop over all known methods to create a tar archive until one works.
7859c43cc173Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
7860c43cc173Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
7861c43cc173Smrg# Do not fold the above two line into one, because Tru64 sh and
7862c43cc173Smrg# Solaris sh will not grok spaces in the rhs of `-'.
7863c43cc173Smrgfor _am_tool in $_am_tools
7864c43cc173Smrgdo
7865c43cc173Smrg  case $_am_tool in
7866c43cc173Smrg  gnutar)
7867c43cc173Smrg    for _am_tar in tar gnutar gtar;
7868c43cc173Smrg    do
7869c43cc173Smrg      AM_RUN_LOG([$_am_tar --version]) && break
7870c43cc173Smrg    done
7871c43cc173Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
7872c43cc173Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
7873c43cc173Smrg    am__untar="$_am_tar -xf -"
7874c43cc173Smrg    ;;
7875c43cc173Smrg  plaintar)
7876c43cc173Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
7877c43cc173Smrg    # ustar tarball either.
7878c43cc173Smrg    (tar --version) >/dev/null 2>&1 && continue
7879c43cc173Smrg    am__tar='tar chf - "$$tardir"'
7880c43cc173Smrg    am__tar_='tar chf - "$tardir"'
7881c43cc173Smrg    am__untar='tar xf -'
7882c43cc173Smrg    ;;
7883c43cc173Smrg  pax)
7884c43cc173Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
7885c43cc173Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
7886c43cc173Smrg    am__untar='pax -r'
7887c43cc173Smrg    ;;
7888c43cc173Smrg  cpio)
7889c43cc173Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
7890c43cc173Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
7891c43cc173Smrg    am__untar='cpio -i -H $1 -d'
7892c43cc173Smrg    ;;
7893c43cc173Smrg  none)
7894c43cc173Smrg    am__tar=false
7895c43cc173Smrg    am__tar_=false
7896c43cc173Smrg    am__untar=false
7897c43cc173Smrg    ;;
7898c43cc173Smrg  esac
7899c43cc173Smrg
7900c43cc173Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
7901c43cc173Smrg  # and am__untar set.
7902c43cc173Smrg  test -n "${am_cv_prog_tar_$1}" && break
7903c43cc173Smrg
7904c43cc173Smrg  # tar/untar a dummy directory, and stop if the command works
7905c43cc173Smrg  rm -rf conftest.dir
7906c43cc173Smrg  mkdir conftest.dir
7907c43cc173Smrg  echo GrepMe > conftest.dir/file
7908c43cc173Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
7909c43cc173Smrg  rm -rf conftest.dir
7910c43cc173Smrg  if test -s conftest.tar; then
7911c43cc173Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
7912c43cc173Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
7913c43cc173Smrg  fi
7914c43cc173Smrgdone
7915c43cc173Smrgrm -rf conftest.dir
7916c43cc173Smrg
7917c43cc173SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
7918c43cc173SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
7919c43cc173SmrgAC_SUBST([am__tar])
7920c43cc173SmrgAC_SUBST([am__untar])
7921c43cc173Smrg]) # _AM_PROG_TAR
7922c43cc173Smrg
7923