aclocal.m4 revision d31dbc53
1d31dbc53Smrg# generated automatically by aclocal 1.10 -*- Autoconf -*-
232b578d3Smrg
332b578d3Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4d31dbc53Smrg# 2005, 2006  Free Software Foundation, Inc.
532b578d3Smrg# This file is free software; the Free Software Foundation
632b578d3Smrg# gives unlimited permission to copy and/or distribute it,
732b578d3Smrg# with or without modifications, as long as this notice is preserved.
832b578d3Smrg
932b578d3Smrg# This program is distributed in the hope that it will be useful,
1032b578d3Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1132b578d3Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1232b578d3Smrg# PARTICULAR PURPOSE.
1332b578d3Smrg
14d31dbc53Smrgm4_if(m4_PACKAGE_VERSION, [2.61],,
15d31dbc53Smrg[m4_fatal([this file was generated for autoconf 2.61.
16d31dbc53SmrgYou have another version of autoconf.  If you want to use that,
17d31dbc53Smrgyou should regenerate the build system entirely.], [63])])
1832b578d3Smrg
19d31dbc53Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
20d31dbc53Smrgdnl
21d31dbc53Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
22d31dbc53Smrgdnl 
23d31dbc53Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
24d31dbc53Smrgdnl copy of this software and associated documentation files (the
25d31dbc53Smrgdnl "Software"), to deal in the Software without restriction, including
26d31dbc53Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
27d31dbc53Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
28d31dbc53Smrgdnl to whom the Software is furnished to do so, provided that the above
29d31dbc53Smrgdnl copyright notice(s) and this permission notice appear in all copies of
30d31dbc53Smrgdnl the Software and that both the above copyright notice(s) and this
31d31dbc53Smrgdnl permission notice appear in supporting documentation.
32d31dbc53Smrgdnl
33d31dbc53Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
34d31dbc53Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
35d31dbc53Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
36d31dbc53Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
37d31dbc53Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
38d31dbc53Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
39d31dbc53Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
40d31dbc53Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
41d31dbc53Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
42d31dbc53Smrgdnl
43d31dbc53Smrgdnl Except as contained in this notice, the name of a copyright holder
44d31dbc53Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
45d31dbc53Smrgdnl or other dealings in this Software without prior written authorization
46d31dbc53Smrgdnl of the copyright holder.
4732b578d3Smrg
48d31dbc53Smrg# XORG_MACROS_VERSION(required-version)
49d31dbc53Smrg# -------------------------------------
50d31dbc53Smrg# Minimum version: 1.1.0
51d31dbc53Smrg#
52d31dbc53Smrg# If you're using a macro added in Version 1.1 or newer, include this in
53d31dbc53Smrg# your configure.ac with the minimum required version, such as:
54d31dbc53Smrg# XORG_MACROS_VERSION(1.1)
55d31dbc53Smrg#
56d31dbc53Smrg# To force at least a version with this macro defined, also add:
57d31dbc53Smrg# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
58d31dbc53Smrg#
59d31dbc53Smrg#
60d31dbc53Smrg# See the "minimum version" comment for each macro you use to see what 
61d31dbc53Smrg# version you require.
62d31dbc53SmrgAC_DEFUN([XORG_MACROS_VERSION],[
63d31dbc53Smrg	[XORG_MACROS_needed_version=$1
64d31dbc53Smrg	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
65d31dbc53Smrg	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
66d31dbc53Smrg	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
67d31dbc53Smrg	[XORG_MACROS_version=1.2.1
68d31dbc53Smrg	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
69d31dbc53Smrg	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
70d31dbc53Smrg	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
71d31dbc53Smrg		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
72d31dbc53Smrg	fi
73d31dbc53Smrg	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
74d31dbc53Smrg		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])
75d31dbc53Smrg	fi
76d31dbc53Smrg	AC_MSG_RESULT([yes, $XORG_MACROS_version])
77d31dbc53Smrg]) # XORG_MACROS_VERSION
7832b578d3Smrg
79d31dbc53Smrg# XORG_PROG_RAWCPP()
80d31dbc53Smrg# ------------------
81d31dbc53Smrg# Minimum version: 1.0.0
82d31dbc53Smrg#
83d31dbc53Smrg# Find cpp program and necessary flags for use in pre-processing text files
84d31dbc53Smrg# such as man pages and config files
85d31dbc53SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
86d31dbc53SmrgAC_REQUIRE([AC_PROG_CPP])
87d31dbc53SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
88d31dbc53Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
8932b578d3Smrg
90d31dbc53Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
91d31dbc53Smrg# which is not the best choice for supporting other OS'es, but covers most
92d31dbc53Smrg# of the ones we need for now.
93d31dbc53SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
94d31dbc53SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
95d31dbc53Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
96d31dbc53Smrg	AC_MSG_RESULT([no])
97d31dbc53Smrgelse
98d31dbc53Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
99d31dbc53Smrg		RAWCPPFLAGS=-undef
100d31dbc53Smrg		AC_MSG_RESULT([yes])
101d31dbc53Smrg	# under Cygwin unix is still defined even with -undef
102d31dbc53Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
103d31dbc53Smrg		RAWCPPFLAGS="-undef -ansi"
104d31dbc53Smrg		AC_MSG_RESULT([yes, with -ansi])
105d31dbc53Smrg	else
106d31dbc53Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
107d31dbc53Smrg	fi
108d31dbc53Smrgfi
109d31dbc53Smrgrm -f conftest.$ac_ext
11032b578d3Smrg
111d31dbc53SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
112d31dbc53SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
113d31dbc53Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
114d31dbc53Smrg	AC_MSG_RESULT([no])
115d31dbc53Smrgelse
116d31dbc53Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
117d31dbc53Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
118d31dbc53Smrg		AC_MSG_RESULT([yes])
119d31dbc53Smrg	else
120d31dbc53Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
121d31dbc53Smrg	fi
122d31dbc53Smrgfi
123d31dbc53Smrgrm -f conftest.$ac_ext
124d31dbc53SmrgAC_SUBST(RAWCPPFLAGS)
125d31dbc53Smrg]) # XORG_PROG_RAWCPP
12632b578d3Smrg
127d31dbc53Smrg# XORG_MANPAGE_SECTIONS()
128d31dbc53Smrg# -----------------------
129d31dbc53Smrg# Minimum version: 1.0.0
130d31dbc53Smrg#
131d31dbc53Smrg# Determine which sections man pages go in for the different man page types
132d31dbc53Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
133d31dbc53Smrg# Not sure if there's any better way than just hardcoding by OS name.
134d31dbc53Smrg# Override default settings by setting environment variables
13532b578d3Smrg
136d31dbc53SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
137d31dbc53SmrgAC_REQUIRE([AC_CANONICAL_HOST])
13832b578d3Smrg
139d31dbc53Smrgif test x$APP_MAN_SUFFIX = x    ; then
140d31dbc53Smrg    APP_MAN_SUFFIX=1
141d31dbc53Smrgfi
142d31dbc53Smrgif test x$APP_MAN_DIR = x    ; then
143d31dbc53Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
144d31dbc53Smrgfi
14532b578d3Smrg
146d31dbc53Smrgif test x$LIB_MAN_SUFFIX = x    ; then
147d31dbc53Smrg    LIB_MAN_SUFFIX=3
148d31dbc53Smrgfi
149d31dbc53Smrgif test x$LIB_MAN_DIR = x    ; then
150d31dbc53Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
151d31dbc53Smrgfi
15232b578d3Smrg
153d31dbc53Smrgif test x$FILE_MAN_SUFFIX = x    ; then
154d31dbc53Smrg    case $host_os in
155d31dbc53Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
156d31dbc53Smrg	*)		FILE_MAN_SUFFIX=5  ;;
157d31dbc53Smrg    esac
158d31dbc53Smrgfi
159d31dbc53Smrgif test x$FILE_MAN_DIR = x    ; then
160d31dbc53Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
161d31dbc53Smrgfi
16232b578d3Smrg
163d31dbc53Smrgif test x$MISC_MAN_SUFFIX = x    ; then
164d31dbc53Smrg    case $host_os in
165d31dbc53Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
166d31dbc53Smrg	*)		MISC_MAN_SUFFIX=7  ;;
167d31dbc53Smrg    esac
168d31dbc53Smrgfi
169d31dbc53Smrgif test x$MISC_MAN_DIR = x    ; then
170d31dbc53Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
171d31dbc53Smrgfi
17232b578d3Smrg
173d31dbc53Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
174d31dbc53Smrg    case $host_os in
175d31dbc53Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
176d31dbc53Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
177d31dbc53Smrg    esac
178d31dbc53Smrgfi
179d31dbc53Smrgif test x$DRIVER_MAN_DIR = x    ; then
180d31dbc53Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
181d31dbc53Smrgfi
18232b578d3Smrg
183d31dbc53Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
184d31dbc53Smrg    case $host_os in
185d31dbc53Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
186d31dbc53Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
187d31dbc53Smrg    esac
188d31dbc53Smrgfi
189d31dbc53Smrgif test x$ADMIN_MAN_DIR = x    ; then
190d31dbc53Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
191d31dbc53Smrgfi
19232b578d3Smrg
19332b578d3Smrg
194d31dbc53SmrgAC_SUBST([APP_MAN_SUFFIX])
195d31dbc53SmrgAC_SUBST([LIB_MAN_SUFFIX])
196d31dbc53SmrgAC_SUBST([FILE_MAN_SUFFIX])
197d31dbc53SmrgAC_SUBST([MISC_MAN_SUFFIX])
198d31dbc53SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
199d31dbc53SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
200d31dbc53SmrgAC_SUBST([APP_MAN_DIR])
201d31dbc53SmrgAC_SUBST([LIB_MAN_DIR])
202d31dbc53SmrgAC_SUBST([FILE_MAN_DIR])
203d31dbc53SmrgAC_SUBST([MISC_MAN_DIR])
204d31dbc53SmrgAC_SUBST([DRIVER_MAN_DIR])
205d31dbc53SmrgAC_SUBST([ADMIN_MAN_DIR])
206d31dbc53Smrg]) # XORG_MANPAGE_SECTIONS
20732b578d3Smrg
208d31dbc53Smrg# XORG_CHECK_LINUXDOC
209d31dbc53Smrg# -------------------
210d31dbc53Smrg# Minimum version: 1.0.0
211d31dbc53Smrg#
212d31dbc53Smrg# Defines the variable MAKE_TEXT if the necessary tools and
213d31dbc53Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
214d31dbc53Smrg# Whether or not the necessary tools and files are found can be checked
215d31dbc53Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
216d31dbc53SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
217d31dbc53Smrgif test x$XORG_SGML_PATH = x ; then
218d31dbc53Smrg    XORG_SGML_PATH=$prefix/share/sgml
219d31dbc53Smrgfi
220d31dbc53SmrgHAVE_DEFS_ENT=
22132b578d3Smrg
222d31dbc53Smrgif test x"$cross_compiling" = x"yes" ; then
223d31dbc53Smrg  HAVE_DEFS_ENT=no
224d31dbc53Smrgelse
225d31dbc53Smrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
226d31dbc53Smrgfi
22732b578d3Smrg
228d31dbc53SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
229d31dbc53SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
23032b578d3Smrg
231d31dbc53SmrgAC_MSG_CHECKING([Whether to build documentation])
23232b578d3Smrg
233d31dbc53Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
234d31dbc53Smrg   BUILDDOC=yes
235d31dbc53Smrgelse
236d31dbc53Smrg   BUILDDOC=no
237d31dbc53Smrgfi
23832b578d3Smrg
239d31dbc53SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
24032b578d3Smrg
241d31dbc53SmrgAC_MSG_RESULT([$BUILDDOC])
24232b578d3Smrg
243d31dbc53SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
24432b578d3Smrg
245d31dbc53Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
246d31dbc53Smrg   BUILDPDFDOC=yes
247d31dbc53Smrgelse
248d31dbc53Smrg   BUILDPDFDOC=no
24932b578d3Smrgfi
25032b578d3Smrg
251d31dbc53SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
25232b578d3Smrg
253d31dbc53SmrgAC_MSG_RESULT([$BUILDPDFDOC])
25432b578d3Smrg
255d31dbc53SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
256d31dbc53SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
257d31dbc53SmrgMAKE_PDF="$PS2PDF"
258d31dbc53SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
25932b578d3Smrg
260d31dbc53SmrgAC_SUBST(MAKE_TEXT)
261d31dbc53SmrgAC_SUBST(MAKE_PS)
262d31dbc53SmrgAC_SUBST(MAKE_PDF)
263d31dbc53SmrgAC_SUBST(MAKE_HTML)
264d31dbc53Smrg]) # XORG_CHECK_LINUXDOC
26532b578d3Smrg
266d31dbc53Smrg# XORG_CHECK_DOCBOOK
26732b578d3Smrg# -------------------
268d31dbc53Smrg# Minimum version: 1.0.0
269d31dbc53Smrg#
270d31dbc53Smrg# Checks for the ability to build output formats from SGML DocBook source.
271d31dbc53Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
272d31dbc53Smrg# indicates whether the necessary tools and files are found and, if set,
273d31dbc53Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
274d31dbc53SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
275d31dbc53Smrgif test x$XORG_SGML_PATH = x ; then
276d31dbc53Smrg    XORG_SGML_PATH=$prefix/share/sgml
277d31dbc53Smrgfi
278d31dbc53SmrgHAVE_DEFS_ENT=
279d31dbc53SmrgBUILDTXTDOC=no
280d31dbc53SmrgBUILDPDFDOC=no
281d31dbc53SmrgBUILDPSDOC=no
282d31dbc53SmrgBUILDHTMLDOC=no
28332b578d3Smrg
284d31dbc53SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
28532b578d3Smrg
286d31dbc53SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
287d31dbc53SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
288d31dbc53SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
289d31dbc53SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
29032b578d3Smrg
291d31dbc53SmrgAC_MSG_CHECKING([Whether to build text documentation])
292d31dbc53Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
293d31dbc53Smrg   test x$BUILD_TXTDOC != xno; then
294d31dbc53Smrg	BUILDTXTDOC=yes
295d31dbc53Smrgfi
296d31dbc53SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
297d31dbc53SmrgAC_MSG_RESULT([$BUILDTXTDOC])
29832b578d3Smrg
299d31dbc53SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
300d31dbc53Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
301d31dbc53Smrg   test x$BUILD_PDFDOC != xno; then
302d31dbc53Smrg	BUILDPDFDOC=yes
303d31dbc53Smrgfi
304d31dbc53SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
305d31dbc53SmrgAC_MSG_RESULT([$BUILDPDFDOC])
30632b578d3Smrg
307d31dbc53SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
308d31dbc53Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
309d31dbc53Smrg   test x$BUILD_PSDOC != xno; then
310d31dbc53Smrg	BUILDPSDOC=yes
311d31dbc53Smrgfi
312d31dbc53SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
313d31dbc53SmrgAC_MSG_RESULT([$BUILDPSDOC])
31432b578d3Smrg
315d31dbc53SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
316d31dbc53Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
317d31dbc53Smrg   test x$BUILD_HTMLDOC != xno; then
318d31dbc53Smrg	BUILDHTMLDOC=yes
319d31dbc53Smrgfi
320d31dbc53SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
321d31dbc53SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
32232b578d3Smrg
323d31dbc53SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
324d31dbc53SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
325d31dbc53SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
326d31dbc53SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
32732b578d3Smrg
328d31dbc53SmrgAC_SUBST(MAKE_TEXT)
329d31dbc53SmrgAC_SUBST(MAKE_PS)
330d31dbc53SmrgAC_SUBST(MAKE_PDF)
331d31dbc53SmrgAC_SUBST(MAKE_HTML)
332d31dbc53Smrg]) # XORG_CHECK_DOCBOOK
33332b578d3Smrg
334d31dbc53Smrg# XORG_CHECK_MALLOC_ZERO
33532b578d3Smrg# ----------------------
336d31dbc53Smrg# Minimum version: 1.0.0
337d31dbc53Smrg#
338d31dbc53Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
339d31dbc53Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
340d31dbc53Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
341d31dbc53SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
342d31dbc53SmrgAC_ARG_ENABLE(malloc0returnsnull,
343d31dbc53Smrg	AC_HELP_STRING([--enable-malloc0returnsnull],
344d31dbc53Smrg		       [malloc(0) returns NULL (default: auto)]),
345d31dbc53Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
346d31dbc53Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
34732b578d3Smrg
348d31dbc53SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
349d31dbc53Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
350d31dbc53Smrg	AC_RUN_IFELSE([
351d31dbc53Smrgchar *malloc();
352d31dbc53Smrgchar *realloc();
353d31dbc53Smrgchar *calloc();
354d31dbc53Smrgmain() {
355d31dbc53Smrg    char *m0, *r0, *c0, *p;
356d31dbc53Smrg    m0 = malloc(0);
357d31dbc53Smrg    p = malloc(10);
358d31dbc53Smrg    r0 = realloc(p,0);
359d31dbc53Smrg    c0 = calloc(0);
360d31dbc53Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
361d31dbc53Smrg}],
362d31dbc53Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
363d31dbc53Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
36432b578d3Smrgfi
365d31dbc53SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
36632b578d3Smrg
367d31dbc53Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
368d31dbc53Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
369d31dbc53Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
370d31dbc53Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
371d31dbc53Smrgelse
372d31dbc53Smrg	MALLOC_ZERO_CFLAGS=""
373d31dbc53Smrg	XMALLOC_ZERO_CFLAGS=""
374d31dbc53Smrg	XTMALLOC_ZERO_CFLAGS=""
37532b578d3Smrgfi
37632b578d3Smrg
377d31dbc53SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
378d31dbc53SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
379d31dbc53SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
380d31dbc53Smrg]) # XORG_CHECK_MALLOC_ZERO
38132b578d3Smrg
382d31dbc53Smrg# XORG_WITH_LINT()
383d31dbc53Smrg# ----------------
384d31dbc53Smrg# Minimum version: 1.1.0
385d31dbc53Smrg#
386d31dbc53Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
387d31dbc53Smrg# is specified.   (Use --with-lint=sparse for sparse.)
388d31dbc53Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
389d31dbc53Smrg# Sets $LINT_FLAGS to flags to pass to source checker
390d31dbc53Smrg# Sets LINT automake conditional if enabled (default: disabled)
391d31dbc53Smrg#
392d31dbc53SmrgAC_DEFUN([XORG_WITH_LINT],[
39332b578d3Smrg
394d31dbc53Smrg# Allow checking code with lint, sparse, etc.
395d31dbc53SmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
396d31dbc53Smrg		[Use a lint-style source code checker (default: disabled)])],
397d31dbc53Smrg		[use_lint=$withval], [use_lint=no])
398d31dbc53Smrgif test "x$use_lint" = "xyes" ; then
399d31dbc53Smrg	LINT="lint"
40032b578d3Smrgelse
401d31dbc53Smrg	LINT="$use_lint"
402d31dbc53Smrgfi
403d31dbc53Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
404d31dbc53Smrg    case $LINT in
405d31dbc53Smrg	lint|*/lint)
406d31dbc53Smrg	    case $host_os in
407d31dbc53Smrg		solaris*)
408d31dbc53Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
409d31dbc53Smrg			;;
410d31dbc53Smrg	    esac
411d31dbc53Smrg	    ;;
412d31dbc53Smrg    esac
413d31dbc53Smrgfi
41432b578d3Smrg
415d31dbc53SmrgAC_SUBST(LINT)
416d31dbc53SmrgAC_SUBST(LINT_FLAGS)
417d31dbc53SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
41832b578d3Smrg
419d31dbc53Smrg]) # XORG_WITH_LINT
42032b578d3Smrg
421d31dbc53Smrg# XORG_LINT_LIBRARY(LIBNAME)
422d31dbc53Smrg# --------------------------
423d31dbc53Smrg# Minimum version: 1.1.0
424d31dbc53Smrg#
425d31dbc53Smrg# Sets up flags for building lint libraries for checking programs that call
426d31dbc53Smrg# functions in the library.
427d31dbc53Smrg# Disabled by default, enable with --enable-lint-library
428d31dbc53Smrg# Sets: 
429d31dbc53Smrg#	@LINTLIB@		- name of lint library file to make
430d31dbc53Smrg#	MAKE_LINT_LIB		- automake conditional
431d31dbc53Smrg#
43232b578d3Smrg
433d31dbc53SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
434d31dbc53SmrgAC_REQUIRE([XORG_WITH_LINT])
435d31dbc53Smrg# Build lint "library" for more indepth checks of programs calling this library
436d31dbc53SmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
437d31dbc53Smrg	[Create lint library (default: disabled)])],
438d31dbc53Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
439d31dbc53Smrgif test "x$make_lint_lib" != "xno" ; then
440d31dbc53Smrg	if test "x$LINT" = "xno" ; then
441d31dbc53Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
442d31dbc53Smrg	fi
443d31dbc53Smrg	if test "x$make_lint_lib" = "xyes" ; then
444d31dbc53Smrg		LINTLIB=llib-l$1.ln
44532b578d3Smrg	else
446d31dbc53Smrg		LINTLIB=$make_lint_lib
44732b578d3Smrg	fi
44832b578d3Smrgfi
449d31dbc53SmrgAC_SUBST(LINTLIB)
450d31dbc53SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
45132b578d3Smrg
452d31dbc53Smrg]) # XORG_LINT_LIBRARY
45332b578d3Smrg
454d31dbc53Smrg# XORG_CWARNFLAGS
455d31dbc53Smrg# ---------------
456d31dbc53Smrg# Minimum version: 1.2.0
457d31dbc53Smrg#
458d31dbc53Smrg# Defines CWARNFLAGS to enable C compiler warnings.
459d31dbc53Smrg#
460d31dbc53SmrgAC_DEFUN([XORG_CWARNFLAGS], [
461d31dbc53SmrgAC_REQUIRE([AC_PROG_CC])
462d31dbc53Smrgif  test "x$GCC" = xyes ; then
463d31dbc53Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
464d31dbc53Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
465d31dbc53Smrg-Wbad-function-cast"
466d31dbc53Smrg    case `gcc -dumpversion` in
467d31dbc53Smrg    3.4.* | 4.*)
468d31dbc53Smrg	CWARNFLAGS+=" -Wold-style-definition -Wdeclaration-after-statement"
469d31dbc53Smrg	;;
47032b578d3Smrg    esac
471d31dbc53Smrgelse
472d31dbc53Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
473d31dbc53Smrg    if test "x$SUNCC" = "xyes"; then
474d31dbc53Smrg	CWARNFLAGS="-v"
475d31dbc53Smrg    fi
476d31dbc53Smrgfi
477d31dbc53SmrgAC_SUBST(CWARNFLAGS)
478d31dbc53Smrg]) # XORG_CWARNFLAGS
479d31dbc53Smrgdnl Copyright 2005 Red Hat, Inc
480d31dbc53Smrgdnl
481d31dbc53Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
482d31dbc53Smrgdnl documentation for any purpose is hereby granted without fee, provided that
483d31dbc53Smrgdnl the above copyright notice appear in all copies and that both that
484d31dbc53Smrgdnl copyright notice and this permission notice appear in supporting
485d31dbc53Smrgdnl documentation.
486d31dbc53Smrgdnl
487d31dbc53Smrgdnl The above copyright notice and this permission notice shall be included
488d31dbc53Smrgdnl in all copies or substantial portions of the Software.
489d31dbc53Smrgdnl
490d31dbc53Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
491d31dbc53Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
492d31dbc53Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
493d31dbc53Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
494d31dbc53Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
495d31dbc53Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
496d31dbc53Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
497d31dbc53Smrgdnl
498d31dbc53Smrgdnl Except as contained in this notice, the name of the copyright holders shall
499d31dbc53Smrgdnl not be used in advertising or otherwise to promote the sale, use or
500d31dbc53Smrgdnl other dealings in this Software without prior written authorization
501d31dbc53Smrgdnl from the copyright holders.
502d31dbc53Smrgdnl
50332b578d3Smrg
504d31dbc53Smrg# XORG_RELEASE_VERSION
505d31dbc53Smrg# --------------------
506d31dbc53Smrg# Adds --with/without-release-string and changes the PACKAGE and
507d31dbc53Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
508d31dbc53Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
509d31dbc53Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
510d31dbc53Smrg 
511d31dbc53SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
512d31dbc53Smrg	AC_ARG_WITH(release-version,
513d31dbc53Smrg			AC_HELP_STRING([--with-release-version=STRING],
514d31dbc53Smrg				[Use release version string in package name]),
515d31dbc53Smrg			[RELEASE_VERSION="$withval"],
516d31dbc53Smrg			[RELEASE_VERSION=""])
517d31dbc53Smrg	if test "x$RELEASE_VERSION" != "x"; then
518d31dbc53Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
519d31dbc53Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
520d31dbc53Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
521d31dbc53Smrg	fi
522d31dbc53Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
523d31dbc53Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
524d31dbc53Smrg		[Major version of this package])
525d31dbc53Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
526d31dbc53Smrg	if test "x$PVM" = "x"; then
527d31dbc53Smrg		PVM="0"
528d31dbc53Smrg	fi
529d31dbc53Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
530d31dbc53Smrg		[$PVM],
531d31dbc53Smrg		[Minor version of this package])
532d31dbc53Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
533d31dbc53Smrg	if test "x$PVP" = "x"; then
534d31dbc53Smrg		PVP="0"
535d31dbc53Smrg	fi
536d31dbc53Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
537d31dbc53Smrg		[$PVP],
538d31dbc53Smrg		[Patch version of this package])
539d31dbc53Smrg])
54032b578d3Smrg
541d31dbc53Smrg# XORG_CHANGELOG()
542d31dbc53Smrg# ----------------
543d31dbc53Smrg# Minimum version: 1.2.0
544d31dbc53Smrg#
545d31dbc53Smrg# Defines the variable CHANGELOG_CMD as the command to generate
546d31dbc53Smrg# ChangeLog from git.
547d31dbc53Smrg#
548d31dbc53Smrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
549d31dbc53Smrg#
550d31dbc53SmrgAC_DEFUN([XORG_CHANGELOG], [
551d31dbc53SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
552d31dbc53Smrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
553d31dbc53Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
554d31dbc53SmrgAC_SUBST([CHANGELOG_CMD])
555d31dbc53SmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
556d31dbc53Smrg]) # XORG_CHANGELOG
557d31dbc53Smrg
558d31dbc53Smrg# Copyright (C) 2002, 2003, 2005, 2006  Free Software Foundation, Inc.
559d31dbc53Smrg#
560d31dbc53Smrg# This file is free software; the Free Software Foundation
561d31dbc53Smrg# gives unlimited permission to copy and/or distribute it,
562d31dbc53Smrg# with or without modifications, as long as this notice is preserved.
56332b578d3Smrg
564d31dbc53Smrg# AM_AUTOMAKE_VERSION(VERSION)
565d31dbc53Smrg# ----------------------------
566d31dbc53Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
567d31dbc53Smrg# generated from the m4 files accompanying Automake X.Y.
568d31dbc53Smrg# (This private macro should not be called outside this file.)
569d31dbc53SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
570d31dbc53Smrg[am__api_version='1.10'
571d31dbc53Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
572d31dbc53Smrgdnl require some minimum version.  Point them to the right macro.
573d31dbc53Smrgm4_if([$1], [1.10], [],
574d31dbc53Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
575d31dbc53Smrg])
57632b578d3Smrg
577d31dbc53Smrg# _AM_AUTOCONF_VERSION(VERSION)
578d31dbc53Smrg# -----------------------------
579d31dbc53Smrg# aclocal traces this macro to find the Autoconf version.
580d31dbc53Smrg# This is a private macro too.  Using m4_define simplifies
581d31dbc53Smrg# the logic in aclocal, which can simply ignore this definition.
582d31dbc53Smrgm4_define([_AM_AUTOCONF_VERSION], [])
58332b578d3Smrg
584d31dbc53Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
585d31dbc53Smrg# -------------------------------
586d31dbc53Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
587d31dbc53Smrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
588d31dbc53SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
589d31dbc53Smrg[AM_AUTOMAKE_VERSION([1.10])dnl
590d31dbc53Smrg_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
59132b578d3Smrg
592d31dbc53Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59332b578d3Smrg
594d31dbc53Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
595d31dbc53Smrg#
596d31dbc53Smrg# This file is free software; the Free Software Foundation
597d31dbc53Smrg# gives unlimited permission to copy and/or distribute it,
598d31dbc53Smrg# with or without modifications, as long as this notice is preserved.
599d31dbc53Smrg
600d31dbc53Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
601d31dbc53Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
602d31dbc53Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
603d31dbc53Smrg#
604d31dbc53Smrg# Of course, Automake must honor this variable whenever it calls a
605d31dbc53Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
606d31dbc53Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
607d31dbc53Smrg# depending on how configure is run.  This is pretty annoying, since
608d31dbc53Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
609d31dbc53Smrg# source directory, any form will work fine, but in subdirectories a
610d31dbc53Smrg# relative path needs to be adjusted first.
611d31dbc53Smrg#
612d31dbc53Smrg# $ac_aux_dir/missing
613d31dbc53Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
614d31dbc53Smrg# $top_srcdir/$ac_aux_dir/missing
615d31dbc53Smrg#    fails if $ac_aux_dir is absolute,
616d31dbc53Smrg#    fails when called from a subdirectory in a VPATH build with
617d31dbc53Smrg#          a relative $ac_aux_dir
618d31dbc53Smrg#
619d31dbc53Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
620d31dbc53Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
621d31dbc53Smrg# harmless because $srcdir is `.', but things will broke when you
622d31dbc53Smrg# start a VPATH build or use an absolute $srcdir.
623d31dbc53Smrg#
624d31dbc53Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
625d31dbc53Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
626d31dbc53Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
627d31dbc53Smrg# and then we would define $MISSING as
628d31dbc53Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
629d31dbc53Smrg# This will work as long as MISSING is not called from configure, because
630d31dbc53Smrg# unfortunately $(top_srcdir) has no meaning in configure.
631d31dbc53Smrg# However there are other variables, like CC, which are often used in
632d31dbc53Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
633d31dbc53Smrg#
634d31dbc53Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
635d31dbc53Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
636d31dbc53Smrg# configured tree to be moved without reconfiguration.
637d31dbc53Smrg
638d31dbc53SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
639d31dbc53Smrg[dnl Rely on autoconf to set up CDPATH properly.
640d31dbc53SmrgAC_PREREQ([2.50])dnl
641d31dbc53Smrg# expand $ac_aux_dir to an absolute path
642d31dbc53Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
64332b578d3Smrg])
64432b578d3Smrg
645d31dbc53Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
64632b578d3Smrg
647d31dbc53Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
648d31dbc53Smrg# Free Software Foundation, Inc.
649d31dbc53Smrg#
650d31dbc53Smrg# This file is free software; the Free Software Foundation
651d31dbc53Smrg# gives unlimited permission to copy and/or distribute it,
652d31dbc53Smrg# with or without modifications, as long as this notice is preserved.
65332b578d3Smrg
654d31dbc53Smrg# serial 8
65532b578d3Smrg
656d31dbc53Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
657d31dbc53Smrg# -------------------------------------
658d31dbc53Smrg# Define a conditional.
659d31dbc53SmrgAC_DEFUN([AM_CONDITIONAL],
660d31dbc53Smrg[AC_PREREQ(2.52)dnl
661d31dbc53Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
662d31dbc53Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
663d31dbc53SmrgAC_SUBST([$1_TRUE])dnl
664d31dbc53SmrgAC_SUBST([$1_FALSE])dnl
665d31dbc53Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
666d31dbc53Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
667d31dbc53Smrgif $2; then
668d31dbc53Smrg  $1_TRUE=
669d31dbc53Smrg  $1_FALSE='#'
67032b578d3Smrgelse
671d31dbc53Smrg  $1_TRUE='#'
672d31dbc53Smrg  $1_FALSE=
67332b578d3Smrgfi
674d31dbc53SmrgAC_CONFIG_COMMANDS_PRE(
675d31dbc53Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
676d31dbc53Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
677d31dbc53SmrgUsually this means the macro was only invoked conditionally.]])
678d31dbc53Smrgfi])])
67932b578d3Smrg
680d31dbc53Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
681d31dbc53Smrg# Free Software Foundation, Inc.
682d31dbc53Smrg#
683d31dbc53Smrg# This file is free software; the Free Software Foundation
684d31dbc53Smrg# gives unlimited permission to copy and/or distribute it,
685d31dbc53Smrg# with or without modifications, as long as this notice is preserved.
68632b578d3Smrg
687d31dbc53Smrg# serial 9
68832b578d3Smrg
689d31dbc53Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
690d31dbc53Smrg# written in clear, in which case automake, when reading aclocal.m4,
691d31dbc53Smrg# will think it sees a *use*, and therefore will trigger all it's
692d31dbc53Smrg# C support machinery.  Also note that it means that autoscan, seeing
693d31dbc53Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
69432b578d3Smrg
69532b578d3Smrg
696d31dbc53Smrg# _AM_DEPENDENCIES(NAME)
697d31dbc53Smrg# ----------------------
698d31dbc53Smrg# See how the compiler implements dependency checking.
699d31dbc53Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
700d31dbc53Smrg# We try a few techniques and use that to set a single cache variable.
701d31dbc53Smrg#
702d31dbc53Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
703d31dbc53Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
704d31dbc53Smrg# dependency, and given that the user is not expected to run this macro,
705d31dbc53Smrg# just rely on AC_PROG_CC.
706d31dbc53SmrgAC_DEFUN([_AM_DEPENDENCIES],
707d31dbc53Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
708d31dbc53SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
709d31dbc53SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
710d31dbc53SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
71132b578d3Smrg
712d31dbc53Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
713d31dbc53Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
714d31dbc53Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
715d31dbc53Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
716d31dbc53Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
717d31dbc53Smrg                   [depcc="$$1"   am_compiler_list=])
71832b578d3Smrg
719d31dbc53SmrgAC_CACHE_CHECK([dependency style of $depcc],
720d31dbc53Smrg               [am_cv_$1_dependencies_compiler_type],
721d31dbc53Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
722d31dbc53Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
723d31dbc53Smrg  # making bogus files that we don't know about and never remove.  For
724d31dbc53Smrg  # instance it was reported that on HP-UX the gcc test will end up
725d31dbc53Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
726d31dbc53Smrg  # in D'.
727d31dbc53Smrg  mkdir conftest.dir
728d31dbc53Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
729d31dbc53Smrg  # using a relative directory.
730d31dbc53Smrg  cp "$am_depcomp" conftest.dir
731d31dbc53Smrg  cd conftest.dir
732d31dbc53Smrg  # We will build objects and dependencies in a subdirectory because
733d31dbc53Smrg  # it helps to detect inapplicable dependency modes.  For instance
734d31dbc53Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
735d31dbc53Smrg  # side effect of compilation, but ICC will put the dependencies in
736d31dbc53Smrg  # the current directory while Tru64 will put them in the object
737d31dbc53Smrg  # directory.
738d31dbc53Smrg  mkdir sub
73932b578d3Smrg
740d31dbc53Smrg  am_cv_$1_dependencies_compiler_type=none
741d31dbc53Smrg  if test "$am_compiler_list" = ""; then
742d31dbc53Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
743d31dbc53Smrg  fi
744d31dbc53Smrg  for depmode in $am_compiler_list; do
745d31dbc53Smrg    # Setup a source with many dependencies, because some compilers
746d31dbc53Smrg    # like to wrap large dependency lists on column 80 (with \), and
747d31dbc53Smrg    # we should not choose a depcomp mode which is confused by this.
74832b578d3Smrg    #
749d31dbc53Smrg    # We need to recreate these files for each test, as the compiler may
750d31dbc53Smrg    # overwrite some of them when testing with obscure command lines.
751d31dbc53Smrg    # This happens at least with the AIX C compiler.
752d31dbc53Smrg    : > sub/conftest.c
753d31dbc53Smrg    for i in 1 2 3 4 5 6; do
754d31dbc53Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
755d31dbc53Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
756d31dbc53Smrg      # Solaris 8's {/usr,}/bin/sh.
757d31dbc53Smrg      touch sub/conftst$i.h
758d31dbc53Smrg    done
759d31dbc53Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
760d31dbc53Smrg
761d31dbc53Smrg    case $depmode in
762d31dbc53Smrg    nosideeffect)
763d31dbc53Smrg      # after this tag, mechanisms are not by side-effect, so they'll
764d31dbc53Smrg      # only be used when explicitly requested
765d31dbc53Smrg      if test "x$enable_dependency_tracking" = xyes; then
766d31dbc53Smrg	continue
767d31dbc53Smrg      else
768d31dbc53Smrg	break
769d31dbc53Smrg      fi
770d31dbc53Smrg      ;;
771d31dbc53Smrg    none) break ;;
772d31dbc53Smrg    esac
773d31dbc53Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
774d31dbc53Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
775d31dbc53Smrg    # handle `-M -o', and we need to detect this.
776d31dbc53Smrg    if depmode=$depmode \
777d31dbc53Smrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
778d31dbc53Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
779d31dbc53Smrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
780d31dbc53Smrg         >/dev/null 2>conftest.err &&
781d31dbc53Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
782d31dbc53Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
783d31dbc53Smrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
784d31dbc53Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
785d31dbc53Smrg      # icc doesn't choke on unknown options, it will just issue warnings
786d31dbc53Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
787d31dbc53Smrg      # that says an option was ignored or not supported.
788d31dbc53Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
789d31dbc53Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
790d31dbc53Smrg      # The diagnosis changed in icc 8.0:
791d31dbc53Smrg      #   icc: Command line remark: option '-MP' not supported
792d31dbc53Smrg      if (grep 'ignoring option' conftest.err ||
793d31dbc53Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
794d31dbc53Smrg        am_cv_$1_dependencies_compiler_type=$depmode
795d31dbc53Smrg        break
796d31dbc53Smrg      fi
79732b578d3Smrg    fi
798d31dbc53Smrg  done
799d31dbc53Smrg
800d31dbc53Smrg  cd ..
801d31dbc53Smrg  rm -rf conftest.dir
80232b578d3Smrgelse
803d31dbc53Smrg  am_cv_$1_dependencies_compiler_type=none
80432b578d3Smrgfi
805d31dbc53Smrg])
806d31dbc53SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
807d31dbc53SmrgAM_CONDITIONAL([am__fastdep$1], [
808d31dbc53Smrg  test "x$enable_dependency_tracking" != xno \
809d31dbc53Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
810d31dbc53Smrg])
81132b578d3Smrg
81232b578d3Smrg
813d31dbc53Smrg# AM_SET_DEPDIR
814d31dbc53Smrg# -------------
815d31dbc53Smrg# Choose a directory name for dependency files.
816d31dbc53Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
817d31dbc53SmrgAC_DEFUN([AM_SET_DEPDIR],
818d31dbc53Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
819d31dbc53SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
820d31dbc53Smrg])
82132b578d3Smrg
82232b578d3Smrg
823d31dbc53Smrg# AM_DEP_TRACK
824d31dbc53Smrg# ------------
825d31dbc53SmrgAC_DEFUN([AM_DEP_TRACK],
826d31dbc53Smrg[AC_ARG_ENABLE(dependency-tracking,
827d31dbc53Smrg[  --disable-dependency-tracking  speeds up one-time build
828d31dbc53Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
829d31dbc53Smrgif test "x$enable_dependency_tracking" != xno; then
830d31dbc53Smrg  am_depcomp="$ac_aux_dir/depcomp"
831d31dbc53Smrg  AMDEPBACKSLASH='\'
832d31dbc53Smrgfi
833d31dbc53SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
834d31dbc53SmrgAC_SUBST([AMDEPBACKSLASH])dnl
835d31dbc53Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
836d31dbc53Smrg])
83732b578d3Smrg
838d31dbc53Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
83932b578d3Smrg
840d31dbc53Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
841d31dbc53Smrg# Free Software Foundation, Inc.
842d31dbc53Smrg#
843d31dbc53Smrg# This file is free software; the Free Software Foundation
844d31dbc53Smrg# gives unlimited permission to copy and/or distribute it,
845d31dbc53Smrg# with or without modifications, as long as this notice is preserved.
84632b578d3Smrg
847d31dbc53Smrg#serial 3
84832b578d3Smrg
849d31dbc53Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
850d31dbc53Smrg# ------------------------------
851d31dbc53SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
852d31dbc53Smrg[for mf in $CONFIG_FILES; do
853d31dbc53Smrg  # Strip MF so we end up with the name of the file.
854d31dbc53Smrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
855d31dbc53Smrg  # Check whether this is an Automake generated Makefile or not.
856d31dbc53Smrg  # We used to match only the files named `Makefile.in', but
857d31dbc53Smrg  # some people rename them; so instead we look at the file content.
858d31dbc53Smrg  # Grep'ing the first line is not enough: some people post-process
859d31dbc53Smrg  # each Makefile.in and add a new line on top of each file to say so.
860d31dbc53Smrg  # Grep'ing the whole file is not good either: AIX grep has a line
861d31dbc53Smrg  # limit of 2048, but all sed's we know have understand at least 4000.
862d31dbc53Smrg  if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
863d31dbc53Smrg    dirpart=`AS_DIRNAME("$mf")`
864d31dbc53Smrg  else
865d31dbc53Smrg    continue
866d31dbc53Smrg  fi
867d31dbc53Smrg  # Extract the definition of DEPDIR, am__include, and am__quote
868d31dbc53Smrg  # from the Makefile without running `make'.
869d31dbc53Smrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
870d31dbc53Smrg  test -z "$DEPDIR" && continue
871d31dbc53Smrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
872d31dbc53Smrg  test -z "am__include" && continue
873d31dbc53Smrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
874d31dbc53Smrg  # When using ansi2knr, U may be empty or an underscore; expand it
875d31dbc53Smrg  U=`sed -n 's/^U = //p' < "$mf"`
876d31dbc53Smrg  # Find all dependency output files, they are included files with
877d31dbc53Smrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
878d31dbc53Smrg  # simplest approach to changing $(DEPDIR) to its actual value in the
879d31dbc53Smrg  # expansion.
880d31dbc53Smrg  for file in `sed -n "
881d31dbc53Smrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
882d31dbc53Smrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
883d31dbc53Smrg    # Make sure the directory exists.
884d31dbc53Smrg    test -f "$dirpart/$file" && continue
885d31dbc53Smrg    fdir=`AS_DIRNAME(["$file"])`
886d31dbc53Smrg    AS_MKDIR_P([$dirpart/$fdir])
887d31dbc53Smrg    # echo "creating $dirpart/$file"
888d31dbc53Smrg    echo '# dummy' > "$dirpart/$file"
889d31dbc53Smrg  done
890d31dbc53Smrgdone
891d31dbc53Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
89232b578d3Smrg
89332b578d3Smrg
894d31dbc53Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
895d31dbc53Smrg# -----------------------------
896d31dbc53Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
897d31dbc53Smrg#
898d31dbc53Smrg# This code is only required when automatic dependency tracking
899d31dbc53Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
900d31dbc53Smrg# need in order to bootstrap the dependency handling code.
901d31dbc53SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
902d31dbc53Smrg[AC_CONFIG_COMMANDS([depfiles],
903d31dbc53Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
904d31dbc53Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
905d31dbc53Smrg])
90632b578d3Smrg
907d31dbc53Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
908d31dbc53Smrg# Free Software Foundation, Inc.
909d31dbc53Smrg#
910d31dbc53Smrg# This file is free software; the Free Software Foundation
911d31dbc53Smrg# gives unlimited permission to copy and/or distribute it,
912d31dbc53Smrg# with or without modifications, as long as this notice is preserved.
91332b578d3Smrg
914d31dbc53Smrg# serial 8
91532b578d3Smrg
916d31dbc53Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
917d31dbc53SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
91832b578d3Smrg
919d31dbc53Smrg# Do all the work for Automake.                             -*- Autoconf -*-
92032b578d3Smrg
921d31dbc53Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
922d31dbc53Smrg# 2005, 2006 Free Software Foundation, Inc.
923d31dbc53Smrg#
924d31dbc53Smrg# This file is free software; the Free Software Foundation
925d31dbc53Smrg# gives unlimited permission to copy and/or distribute it,
926d31dbc53Smrg# with or without modifications, as long as this notice is preserved.
92732b578d3Smrg
928d31dbc53Smrg# serial 12
92932b578d3Smrg
930d31dbc53Smrg# This macro actually does too much.  Some checks are only needed if
931d31dbc53Smrg# your package does certain things.  But this isn't really a big deal.
93232b578d3Smrg
933d31dbc53Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
934d31dbc53Smrg# AM_INIT_AUTOMAKE([OPTIONS])
935d31dbc53Smrg# -----------------------------------------------
936d31dbc53Smrg# The call with PACKAGE and VERSION arguments is the old style
937d31dbc53Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
938d31dbc53Smrg# and VERSION should now be passed to AC_INIT and removed from
939d31dbc53Smrg# the call to AM_INIT_AUTOMAKE.
940d31dbc53Smrg# We support both call styles for the transition.  After
941d31dbc53Smrg# the next Automake release, Autoconf can make the AC_INIT
942d31dbc53Smrg# arguments mandatory, and then we can depend on a new Autoconf
943d31dbc53Smrg# release and drop the old call support.
944d31dbc53SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
945d31dbc53Smrg[AC_PREREQ([2.60])dnl
946d31dbc53Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
947d31dbc53Smrgdnl the ones we care about.
948d31dbc53Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
949d31dbc53SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
950d31dbc53SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
951d31dbc53Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
952d31dbc53Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
953d31dbc53Smrg  # is not polluted with repeated "-I."
954d31dbc53Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
955d31dbc53Smrg  # test to see if srcdir already configured
956d31dbc53Smrg  if test -f $srcdir/config.status; then
957d31dbc53Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
958d31dbc53Smrg  fi
959d31dbc53Smrgfi
96032b578d3Smrg
961d31dbc53Smrg# test whether we have cygpath
962d31dbc53Smrgif test -z "$CYGPATH_W"; then
963d31dbc53Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
964d31dbc53Smrg    CYGPATH_W='cygpath -w'
96532b578d3Smrg  else
966d31dbc53Smrg    CYGPATH_W=echo
96732b578d3Smrg  fi
968d31dbc53Smrgfi
969d31dbc53SmrgAC_SUBST([CYGPATH_W])
97032b578d3Smrg
971d31dbc53Smrg# Define the identity of the package.
972d31dbc53Smrgdnl Distinguish between old-style and new-style calls.
973d31dbc53Smrgm4_ifval([$2],
974d31dbc53Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
975d31dbc53Smrg AC_SUBST([PACKAGE], [$1])dnl
976d31dbc53Smrg AC_SUBST([VERSION], [$2])],
977d31dbc53Smrg[_AM_SET_OPTIONS([$1])dnl
978d31dbc53Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
979d31dbc53Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
980d31dbc53Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
981d31dbc53Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
982d31dbc53Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
98332b578d3Smrg
984d31dbc53Smrg_AM_IF_OPTION([no-define],,
985d31dbc53Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
986d31dbc53Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
98732b578d3Smrg
988d31dbc53Smrg# Some tools Automake needs.
989d31dbc53SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
990d31dbc53SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
991d31dbc53SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
992d31dbc53SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
993d31dbc53SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
994d31dbc53SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
995d31dbc53SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
996d31dbc53SmrgAM_PROG_INSTALL_SH
997d31dbc53SmrgAM_PROG_INSTALL_STRIP
998d31dbc53SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
999d31dbc53Smrg# We need awk for the "check" target.  The system "awk" is bad on
1000d31dbc53Smrg# some platforms.
1001d31dbc53SmrgAC_REQUIRE([AC_PROG_AWK])dnl
1002d31dbc53SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
1003d31dbc53SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
1004d31dbc53Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1005d31dbc53Smrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1006d31dbc53Smrg	      		     [_AM_PROG_TAR([v7])])])
1007d31dbc53Smrg_AM_IF_OPTION([no-dependencies],,
1008d31dbc53Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
1009d31dbc53Smrg                  [_AM_DEPENDENCIES(CC)],
1010d31dbc53Smrg                  [define([AC_PROG_CC],
1011d31dbc53Smrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
1012d31dbc53SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
1013d31dbc53Smrg                  [_AM_DEPENDENCIES(CXX)],
1014d31dbc53Smrg                  [define([AC_PROG_CXX],
1015d31dbc53Smrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
1016d31dbc53SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
1017d31dbc53Smrg                  [_AM_DEPENDENCIES(OBJC)],
1018d31dbc53Smrg                  [define([AC_PROG_OBJC],
1019d31dbc53Smrg                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
1020d31dbc53Smrg])
1021d31dbc53Smrg])
102232b578d3Smrg
102332b578d3Smrg
1024d31dbc53Smrg# When config.status generates a header, we must update the stamp-h file.
1025d31dbc53Smrg# This file resides in the same directory as the config header
1026d31dbc53Smrg# that is generated.  The stamp files are numbered to have different names.
102732b578d3Smrg
1028d31dbc53Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1029d31dbc53Smrg# loop where config.status creates the headers, so we can generate
1030d31dbc53Smrg# our stamp files there.
1031d31dbc53SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1032d31dbc53Smrg[# Compute $1's index in $config_headers.
1033d31dbc53Smrg_am_stamp_count=1
1034d31dbc53Smrgfor _am_header in $config_headers :; do
1035d31dbc53Smrg  case $_am_header in
1036d31dbc53Smrg    $1 | $1:* )
1037d31dbc53Smrg      break ;;
1038d31dbc53Smrg    * )
1039d31dbc53Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
104032b578d3Smrg  esac
1041d31dbc53Smrgdone
1042d31dbc53Smrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
104332b578d3Smrg
1044d31dbc53Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
1045d31dbc53Smrg#
1046d31dbc53Smrg# This file is free software; the Free Software Foundation
1047d31dbc53Smrg# gives unlimited permission to copy and/or distribute it,
1048d31dbc53Smrg# with or without modifications, as long as this notice is preserved.
104932b578d3Smrg
1050d31dbc53Smrg# AM_PROG_INSTALL_SH
1051d31dbc53Smrg# ------------------
1052d31dbc53Smrg# Define $install_sh.
1053d31dbc53SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
1054d31dbc53Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1055d31dbc53Smrginstall_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
1056d31dbc53SmrgAC_SUBST(install_sh)])
1057d31dbc53Smrg
1058d31dbc53Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
1059d31dbc53Smrg#
1060d31dbc53Smrg# This file is free software; the Free Software Foundation
1061d31dbc53Smrg# gives unlimited permission to copy and/or distribute it,
1062d31dbc53Smrg# with or without modifications, as long as this notice is preserved.
1063d31dbc53Smrg
1064d31dbc53Smrg# serial 2
1065d31dbc53Smrg
1066d31dbc53Smrg# Check whether the underlying file-system supports filenames
1067d31dbc53Smrg# with a leading dot.  For instance MS-DOS doesn't.
1068d31dbc53SmrgAC_DEFUN([AM_SET_LEADING_DOT],
1069d31dbc53Smrg[rm -rf .tst 2>/dev/null
1070d31dbc53Smrgmkdir .tst 2>/dev/null
1071d31dbc53Smrgif test -d .tst; then
1072d31dbc53Smrg  am__leading_dot=.
1073d31dbc53Smrgelse
1074d31dbc53Smrg  am__leading_dot=_
107532b578d3Smrgfi
1076d31dbc53Smrgrmdir .tst 2>/dev/null
1077d31dbc53SmrgAC_SUBST([am__leading_dot])])
107832b578d3Smrg
1079d31dbc53Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
1080d31dbc53Smrg# From Jim Meyering
108132b578d3Smrg
1082d31dbc53Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
1083d31dbc53Smrg# Free Software Foundation, Inc.
1084d31dbc53Smrg#
1085d31dbc53Smrg# This file is free software; the Free Software Foundation
1086d31dbc53Smrg# gives unlimited permission to copy and/or distribute it,
1087d31dbc53Smrg# with or without modifications, as long as this notice is preserved.
108832b578d3Smrg
1089d31dbc53Smrg# serial 4
109032b578d3Smrg
1091d31dbc53SmrgAC_DEFUN([AM_MAINTAINER_MODE],
1092d31dbc53Smrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1093d31dbc53Smrg  dnl maintainer-mode is disabled by default
1094d31dbc53Smrg  AC_ARG_ENABLE(maintainer-mode,
1095d31dbc53Smrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
1096d31dbc53Smrg			  (and sometimes confusing) to the casual installer],
1097d31dbc53Smrg      USE_MAINTAINER_MODE=$enableval,
1098d31dbc53Smrg      USE_MAINTAINER_MODE=no)
1099d31dbc53Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
1100d31dbc53Smrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
1101d31dbc53Smrg  MAINT=$MAINTAINER_MODE_TRUE
1102d31dbc53Smrg  AC_SUBST(MAINT)dnl
1103d31dbc53Smrg]
1104d31dbc53Smrg)
110532b578d3Smrg
1106d31dbc53SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
110732b578d3Smrg
1108d31dbc53Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
1109d31dbc53Smrg
1110d31dbc53Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
1111d31dbc53Smrg#
1112d31dbc53Smrg# This file is free software; the Free Software Foundation
1113d31dbc53Smrg# gives unlimited permission to copy and/or distribute it,
1114d31dbc53Smrg# with or without modifications, as long as this notice is preserved.
111532b578d3Smrg
1116d31dbc53Smrg# serial 3
111732b578d3Smrg
1118d31dbc53Smrg# AM_MAKE_INCLUDE()
111932b578d3Smrg# -----------------
1120d31dbc53Smrg# Check to see how make treats includes.
1121d31dbc53SmrgAC_DEFUN([AM_MAKE_INCLUDE],
1122d31dbc53Smrg[am_make=${MAKE-make}
1123d31dbc53Smrgcat > confinc << 'END'
1124d31dbc53Smrgam__doit:
1125d31dbc53Smrg	@echo done
1126d31dbc53Smrg.PHONY: am__doit
1127d31dbc53SmrgEND
1128d31dbc53Smrg# If we don't find an include directive, just comment out the code.
1129d31dbc53SmrgAC_MSG_CHECKING([for style of include used by $am_make])
1130d31dbc53Smrgam__include="#"
1131d31dbc53Smrgam__quote=
1132d31dbc53Smrg_am_result=none
1133d31dbc53Smrg# First try GNU make style include.
1134d31dbc53Smrgecho "include confinc" > confmf
1135d31dbc53Smrg# We grep out `Entering directory' and `Leaving directory'
1136d31dbc53Smrg# messages which can occur if `w' ends up in MAKEFLAGS.
1137d31dbc53Smrg# In particular we don't look at `^make:' because GNU make might
1138d31dbc53Smrg# be invoked under some other name (usually "gmake"), in which
1139d31dbc53Smrg# case it prints its new name instead of `make'.
1140d31dbc53Smrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
1141d31dbc53Smrg   am__include=include
1142d31dbc53Smrg   am__quote=
1143d31dbc53Smrg   _am_result=GNU
114432b578d3Smrgfi
1145d31dbc53Smrg# Now try BSD make style include.
1146d31dbc53Smrgif test "$am__include" = "#"; then
1147d31dbc53Smrg   echo '.include "confinc"' > confmf
1148d31dbc53Smrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
1149d31dbc53Smrg      am__include=.include
1150d31dbc53Smrg      am__quote="\""
1151d31dbc53Smrg      _am_result=BSD
1152d31dbc53Smrg   fi
1153d31dbc53Smrgfi
1154d31dbc53SmrgAC_SUBST([am__include])
1155d31dbc53SmrgAC_SUBST([am__quote])
1156d31dbc53SmrgAC_MSG_RESULT([$_am_result])
1157d31dbc53Smrgrm -f confinc confmf
1158d31dbc53Smrg])
115932b578d3Smrg
1160d31dbc53Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
116132b578d3Smrg
1162d31dbc53Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
1163d31dbc53Smrg# Free Software Foundation, Inc.
1164d31dbc53Smrg#
1165d31dbc53Smrg# This file is free software; the Free Software Foundation
1166d31dbc53Smrg# gives unlimited permission to copy and/or distribute it,
1167d31dbc53Smrg# with or without modifications, as long as this notice is preserved.
116832b578d3Smrg
1169d31dbc53Smrg# serial 5
117032b578d3Smrg
1171d31dbc53Smrg# AM_MISSING_PROG(NAME, PROGRAM)
1172d31dbc53Smrg# ------------------------------
1173d31dbc53SmrgAC_DEFUN([AM_MISSING_PROG],
1174d31dbc53Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
1175d31dbc53Smrg$1=${$1-"${am_missing_run}$2"}
1176d31dbc53SmrgAC_SUBST($1)])
117732b578d3Smrg
117832b578d3Smrg
1179d31dbc53Smrg# AM_MISSING_HAS_RUN
1180d31dbc53Smrg# ------------------
1181d31dbc53Smrg# Define MISSING if not defined so far and test if it supports --run.
1182d31dbc53Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
1183d31dbc53SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
1184d31dbc53Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1185d31dbc53SmrgAC_REQUIRE_AUX_FILE([missing])dnl
1186d31dbc53Smrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
1187d31dbc53Smrg# Use eval to expand $SHELL
1188d31dbc53Smrgif eval "$MISSING --run true"; then
1189d31dbc53Smrg  am_missing_run="$MISSING --run "
119032b578d3Smrgelse
1191d31dbc53Smrg  am_missing_run=
1192d31dbc53Smrg  AC_MSG_WARN([`missing' script is too old or missing])
119332b578d3Smrgfi
1194d31dbc53Smrg])
119532b578d3Smrg
1196d31dbc53Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
1197d31dbc53Smrg#
1198d31dbc53Smrg# This file is free software; the Free Software Foundation
1199d31dbc53Smrg# gives unlimited permission to copy and/or distribute it,
1200d31dbc53Smrg# with or without modifications, as long as this notice is preserved.
120132b578d3Smrg
1202d31dbc53Smrg# AM_PROG_MKDIR_P
1203d31dbc53Smrg# ---------------
1204d31dbc53Smrg# Check for `mkdir -p'.
1205d31dbc53SmrgAC_DEFUN([AM_PROG_MKDIR_P],
1206d31dbc53Smrg[AC_PREREQ([2.60])dnl
1207d31dbc53SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
1208d31dbc53Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
1209d31dbc53Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
1210d31dbc53Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
1211d31dbc53Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
1212d31dbc53Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
1213d31dbc53Smrgdnl adjustment using top_builddir (which is defined more often than
1214d31dbc53Smrgdnl MKDIR_P).
1215d31dbc53SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
1216d31dbc53Smrgcase $mkdir_p in
1217d31dbc53Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
1218d31dbc53Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
1219d31dbc53Smrgesac
1220d31dbc53Smrg])
122132b578d3Smrg
1222d31dbc53Smrg# Helper functions for option handling.                     -*- Autoconf -*-
122332b578d3Smrg
1224d31dbc53Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
1225d31dbc53Smrg#
1226d31dbc53Smrg# This file is free software; the Free Software Foundation
1227d31dbc53Smrg# gives unlimited permission to copy and/or distribute it,
1228d31dbc53Smrg# with or without modifications, as long as this notice is preserved.
122932b578d3Smrg
1230d31dbc53Smrg# serial 3
123132b578d3Smrg
1232d31dbc53Smrg# _AM_MANGLE_OPTION(NAME)
1233d31dbc53Smrg# -----------------------
1234d31dbc53SmrgAC_DEFUN([_AM_MANGLE_OPTION],
1235d31dbc53Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
123632b578d3Smrg
1237d31dbc53Smrg# _AM_SET_OPTION(NAME)
1238d31dbc53Smrg# ------------------------------
1239d31dbc53Smrg# Set option NAME.  Presently that only means defining a flag for this option.
1240d31dbc53SmrgAC_DEFUN([_AM_SET_OPTION],
1241d31dbc53Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
124232b578d3Smrg
1243d31dbc53Smrg# _AM_SET_OPTIONS(OPTIONS)
1244d31dbc53Smrg# ----------------------------------
1245d31dbc53Smrg# OPTIONS is a space-separated list of Automake options.
1246d31dbc53SmrgAC_DEFUN([_AM_SET_OPTIONS],
1247d31dbc53Smrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
124832b578d3Smrg
1249d31dbc53Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
1250d31dbc53Smrg# -------------------------------------------
1251d31dbc53Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
1252d31dbc53SmrgAC_DEFUN([_AM_IF_OPTION],
1253d31dbc53Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
125432b578d3Smrg
1255d31dbc53Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
125632b578d3Smrg
1257d31dbc53Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
1258d31dbc53Smrg# Free Software Foundation, Inc.
1259d31dbc53Smrg#
1260d31dbc53Smrg# This file is free software; the Free Software Foundation
1261d31dbc53Smrg# gives unlimited permission to copy and/or distribute it,
1262d31dbc53Smrg# with or without modifications, as long as this notice is preserved.
126332b578d3Smrg
1264d31dbc53Smrg# serial 4
126532b578d3Smrg
1266d31dbc53Smrg# AM_SANITY_CHECK
1267d31dbc53Smrg# ---------------
1268d31dbc53SmrgAC_DEFUN([AM_SANITY_CHECK],
1269d31dbc53Smrg[AC_MSG_CHECKING([whether build environment is sane])
1270d31dbc53Smrg# Just in case
1271d31dbc53Smrgsleep 1
1272d31dbc53Smrgecho timestamp > conftest.file
1273d31dbc53Smrg# Do `set' in a subshell so we don't clobber the current shell's
1274d31dbc53Smrg# arguments.  Must try -L first in case configure is actually a
1275d31dbc53Smrg# symlink; some systems play weird games with the mod time of symlinks
1276d31dbc53Smrg# (eg FreeBSD returns the mod time of the symlink's containing
1277d31dbc53Smrg# directory).
1278d31dbc53Smrgif (
1279d31dbc53Smrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
1280d31dbc53Smrg   if test "$[*]" = "X"; then
1281d31dbc53Smrg      # -L didn't work.
1282d31dbc53Smrg      set X `ls -t $srcdir/configure conftest.file`
1283d31dbc53Smrg   fi
1284d31dbc53Smrg   rm -f conftest.file
1285d31dbc53Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
1286d31dbc53Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
128732b578d3Smrg
1288d31dbc53Smrg      # If neither matched, then we have a broken ls.  This can happen
1289d31dbc53Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
1290d31dbc53Smrg      # broken ls alias from the environment.  This has actually
1291d31dbc53Smrg      # happened.  Such a system could not be considered "sane".
1292d31dbc53Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
1293d31dbc53Smrgalias in your environment])
1294d31dbc53Smrg   fi
129532b578d3Smrg
1296d31dbc53Smrg   test "$[2]" = conftest.file
1297d31dbc53Smrg   )
1298d31dbc53Smrgthen
1299d31dbc53Smrg   # Ok.
1300d31dbc53Smrg   :
1301d31dbc53Smrgelse
1302d31dbc53Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
1303d31dbc53SmrgCheck your system clock])
1304d31dbc53Smrgfi
1305d31dbc53SmrgAC_MSG_RESULT(yes)])
130632b578d3Smrg
1307d31dbc53Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
1308d31dbc53Smrg#
1309d31dbc53Smrg# This file is free software; the Free Software Foundation
1310d31dbc53Smrg# gives unlimited permission to copy and/or distribute it,
1311d31dbc53Smrg# with or without modifications, as long as this notice is preserved.
131232b578d3Smrg
1313d31dbc53Smrg# AM_PROG_INSTALL_STRIP
1314d31dbc53Smrg# ---------------------
1315d31dbc53Smrg# One issue with vendor `install' (even GNU) is that you can't
1316d31dbc53Smrg# specify the program used to strip binaries.  This is especially
1317d31dbc53Smrg# annoying in cross-compiling environments, where the build's strip
1318d31dbc53Smrg# is unlikely to handle the host's binaries.
1319d31dbc53Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
1320d31dbc53Smrg# always use install-sh in `make install-strip', and initialize
1321d31dbc53Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
1322d31dbc53SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
1323d31dbc53Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1324d31dbc53Smrg# Installed binaries are usually stripped using `strip' when the user
1325d31dbc53Smrg# run `make install-strip'.  However `strip' might not be the right
1326d31dbc53Smrg# tool to use in cross-compilation environments, therefore Automake
1327d31dbc53Smrg# will honor the `STRIP' environment variable to overrule this program.
1328d31dbc53Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
1329d31dbc53Smrgif test "$cross_compiling" != no; then
1330d31dbc53Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
1331d31dbc53Smrgfi
1332d31dbc53SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1333d31dbc53SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
133432b578d3Smrg
1335d31dbc53Smrg# Copyright (C) 2006  Free Software Foundation, Inc.
1336d31dbc53Smrg#
1337d31dbc53Smrg# This file is free software; the Free Software Foundation
1338d31dbc53Smrg# gives unlimited permission to copy and/or distribute it,
1339d31dbc53Smrg# with or without modifications, as long as this notice is preserved.
134032b578d3Smrg
1341d31dbc53Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
1342d31dbc53Smrg# ---------------------------
1343d31dbc53Smrg# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
1344d31dbc53Smrg# This macro is traced by Automake.
1345d31dbc53SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
134632b578d3Smrg
1347d31dbc53Smrg# Check how to create a tarball.                            -*- Autoconf -*-
134832b578d3Smrg
1349d31dbc53Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
1350d31dbc53Smrg#
1351d31dbc53Smrg# This file is free software; the Free Software Foundation
1352d31dbc53Smrg# gives unlimited permission to copy and/or distribute it,
1353d31dbc53Smrg# with or without modifications, as long as this notice is preserved.
1354d31dbc53Smrg
1355d31dbc53Smrg# serial 2
1356d31dbc53Smrg
1357d31dbc53Smrg# _AM_PROG_TAR(FORMAT)
1358d31dbc53Smrg# --------------------
1359d31dbc53Smrg# Check how to create a tarball in format FORMAT.
1360d31dbc53Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
1361d31dbc53Smrg#
1362d31dbc53Smrg# Substitute a variable $(am__tar) that is a command
1363d31dbc53Smrg# writing to stdout a FORMAT-tarball containing the directory
1364d31dbc53Smrg# $tardir.
1365d31dbc53Smrg#     tardir=directory && $(am__tar) > result.tar
1366d31dbc53Smrg#
1367d31dbc53Smrg# Substitute a variable $(am__untar) that extract such
1368d31dbc53Smrg# a tarball read from stdin.
1369d31dbc53Smrg#     $(am__untar) < result.tar
1370d31dbc53SmrgAC_DEFUN([_AM_PROG_TAR],
1371d31dbc53Smrg[# Always define AMTAR for backward compatibility.
1372d31dbc53SmrgAM_MISSING_PROG([AMTAR], [tar])
1373d31dbc53Smrgm4_if([$1], [v7],
1374d31dbc53Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
1375d31dbc53Smrg     [m4_case([$1], [ustar],, [pax],,
1376d31dbc53Smrg              [m4_fatal([Unknown tar format])])
1377d31dbc53SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
1378d31dbc53Smrg# Loop over all known methods to create a tar archive until one works.
1379d31dbc53Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1380d31dbc53Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
1381d31dbc53Smrg# Do not fold the above two line into one, because Tru64 sh and
1382d31dbc53Smrg# Solaris sh will not grok spaces in the rhs of `-'.
1383d31dbc53Smrgfor _am_tool in $_am_tools
1384d31dbc53Smrgdo
1385d31dbc53Smrg  case $_am_tool in
1386d31dbc53Smrg  gnutar)
1387d31dbc53Smrg    for _am_tar in tar gnutar gtar;
1388d31dbc53Smrg    do
1389d31dbc53Smrg      AM_RUN_LOG([$_am_tar --version]) && break
1390d31dbc53Smrg    done
1391d31dbc53Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1392d31dbc53Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1393d31dbc53Smrg    am__untar="$_am_tar -xf -"
139432b578d3Smrg    ;;
1395d31dbc53Smrg  plaintar)
1396d31dbc53Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
1397d31dbc53Smrg    # ustar tarball either.
1398d31dbc53Smrg    (tar --version) >/dev/null 2>&1 && continue
1399d31dbc53Smrg    am__tar='tar chf - "$$tardir"'
1400d31dbc53Smrg    am__tar_='tar chf - "$tardir"'
1401d31dbc53Smrg    am__untar='tar xf -'
1402d31dbc53Smrg    ;;
1403d31dbc53Smrg  pax)
1404d31dbc53Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
1405d31dbc53Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
1406d31dbc53Smrg    am__untar='pax -r'
1407d31dbc53Smrg    ;;
1408d31dbc53Smrg  cpio)
1409d31dbc53Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1410d31dbc53Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1411d31dbc53Smrg    am__untar='cpio -i -H $1 -d'
1412d31dbc53Smrg    ;;
1413d31dbc53Smrg  none)
1414d31dbc53Smrg    am__tar=false
1415d31dbc53Smrg    am__tar_=false
1416d31dbc53Smrg    am__untar=false
141732b578d3Smrg    ;;
141832b578d3Smrg  esac
141932b578d3Smrg
1420d31dbc53Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
1421d31dbc53Smrg  # and am__untar set.
1422d31dbc53Smrg  test -n "${am_cv_prog_tar_$1}" && break
142332b578d3Smrg
1424d31dbc53Smrg  # tar/untar a dummy directory, and stop if the command works
1425d31dbc53Smrg  rm -rf conftest.dir
1426d31dbc53Smrg  mkdir conftest.dir
1427d31dbc53Smrg  echo GrepMe > conftest.dir/file
1428d31dbc53Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1429d31dbc53Smrg  rm -rf conftest.dir
1430d31dbc53Smrg  if test -s conftest.tar; then
1431d31dbc53Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
1432d31dbc53Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
143332b578d3Smrg  fi
1434d31dbc53Smrgdone
1435d31dbc53Smrgrm -rf conftest.dir
143632b578d3Smrg
1437d31dbc53SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1438d31dbc53SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
1439d31dbc53SmrgAC_SUBST([am__tar])
1440d31dbc53SmrgAC_SUBST([am__untar])
1441d31dbc53Smrg]) # _AM_PROG_TAR
144232b578d3Smrg
1443d31dbc53Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1444d31dbc53Smrgdnl
1445d31dbc53Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
1446d31dbc53Smrgdnl 
1447d31dbc53Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1448d31dbc53Smrgdnl copy of this software and associated documentation files (the
1449d31dbc53Smrgdnl "Software"), to deal in the Software without restriction, including
1450d31dbc53Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
1451d31dbc53Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
1452d31dbc53Smrgdnl to whom the Software is furnished to do so, provided that the above
1453d31dbc53Smrgdnl copyright notice(s) and this permission notice appear in all copies of
1454d31dbc53Smrgdnl the Software and that both the above copyright notice(s) and this
1455d31dbc53Smrgdnl permission notice appear in supporting documentation.
1456d31dbc53Smrgdnl
1457d31dbc53Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1458d31dbc53Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1459d31dbc53Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
1460d31dbc53Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
1461d31dbc53Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
1462d31dbc53Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
1463d31dbc53Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
1464d31dbc53Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
1465d31dbc53Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1466d31dbc53Smrgdnl
1467d31dbc53Smrgdnl Except as contained in this notice, the name of a copyright holder
1468d31dbc53Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
1469d31dbc53Smrgdnl or other dealings in this Software without prior written authorization
1470d31dbc53Smrgdnl of the copyright holder.
147132b578d3Smrg
1472d31dbc53Smrg# XORG_MACROS_VERSION(required-version)
1473d31dbc53Smrg# -------------------------------------
1474d31dbc53Smrg# Minimum version: 1.1.0
1475d31dbc53Smrg#
1476d31dbc53Smrg# If you're using a macro added in Version 1.1 or newer, include this in
1477d31dbc53Smrg# your configure.ac with the minimum required version, such as:
1478d31dbc53Smrg# XORG_MACROS_VERSION(1.1)
1479d31dbc53Smrg#
1480d31dbc53Smrg# To ensure that this macro is defined, also add:
1481d31dbc53Smrg# m4_ifndef([XORG_MACROS_VERSION],
1482d31dbc53Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1483d31dbc53Smrg#
1484d31dbc53Smrg#
1485d31dbc53Smrg# See the "minimum version" comment for each macro you use to see what 
1486d31dbc53Smrg# version you require.
1487d31dbc53Smrgm4_defun([XORG_MACROS_VERSION],[
1488d31dbc53Smrgm4_define([vers_have], [1.2.1])
1489d31dbc53Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1490d31dbc53Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1491d31dbc53Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1492d31dbc53Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1493d31dbc53Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1494d31dbc53Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1495d31dbc53Smrgm4_undefine([vers_have])
1496d31dbc53Smrgm4_undefine([maj_have])
1497d31dbc53Smrgm4_undefine([maj_needed])
1498d31dbc53Smrg]) # XORG_MACROS_VERSION
149932b578d3Smrg
1500d31dbc53Smrg# XORG_PROG_RAWCPP()
1501d31dbc53Smrg# ------------------
1502d31dbc53Smrg# Minimum version: 1.0.0
1503d31dbc53Smrg#
1504d31dbc53Smrg# Find cpp program and necessary flags for use in pre-processing text files
1505d31dbc53Smrg# such as man pages and config files
1506d31dbc53SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1507d31dbc53SmrgAC_REQUIRE([AC_PROG_CPP])
1508d31dbc53SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
1509d31dbc53Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
151032b578d3Smrg
1511d31dbc53Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1512d31dbc53Smrg# which is not the best choice for supporting other OS'es, but covers most
1513d31dbc53Smrg# of the ones we need for now.
1514d31dbc53SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1515d31dbc53SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
1516d31dbc53Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1517d31dbc53Smrg	AC_MSG_RESULT([no])
1518d31dbc53Smrgelse
1519d31dbc53Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1520d31dbc53Smrg		RAWCPPFLAGS=-undef
1521d31dbc53Smrg		AC_MSG_RESULT([yes])
1522d31dbc53Smrg	# under Cygwin unix is still defined even with -undef
1523d31dbc53Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1524d31dbc53Smrg		RAWCPPFLAGS="-undef -ansi"
1525d31dbc53Smrg		AC_MSG_RESULT([yes, with -ansi])
1526d31dbc53Smrg	else
1527d31dbc53Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1528d31dbc53Smrg	fi
1529d31dbc53Smrgfi
1530d31dbc53Smrgrm -f conftest.$ac_ext
153132b578d3Smrg
1532d31dbc53SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1533d31dbc53SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
1534d31dbc53Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1535d31dbc53Smrg	AC_MSG_RESULT([no])
1536d31dbc53Smrgelse
1537d31dbc53Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1538d31dbc53Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1539d31dbc53Smrg		AC_MSG_RESULT([yes])
1540d31dbc53Smrg	else
1541d31dbc53Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1542d31dbc53Smrg	fi
1543d31dbc53Smrgfi
1544d31dbc53Smrgrm -f conftest.$ac_ext
1545d31dbc53SmrgAC_SUBST(RAWCPPFLAGS)
1546d31dbc53Smrg]) # XORG_PROG_RAWCPP
154732b578d3Smrg
1548d31dbc53Smrg# XORG_MANPAGE_SECTIONS()
1549d31dbc53Smrg# -----------------------
1550d31dbc53Smrg# Minimum version: 1.0.0
1551d31dbc53Smrg#
1552d31dbc53Smrg# Determine which sections man pages go in for the different man page types
1553d31dbc53Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1554d31dbc53Smrg# Not sure if there's any better way than just hardcoding by OS name.
1555d31dbc53Smrg# Override default settings by setting environment variables
155632b578d3Smrg
1557d31dbc53SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1558d31dbc53SmrgAC_REQUIRE([AC_CANONICAL_HOST])
155932b578d3Smrg
1560d31dbc53Smrgif test x$APP_MAN_SUFFIX = x    ; then
1561d31dbc53Smrg    APP_MAN_SUFFIX=1
1562d31dbc53Smrgfi
1563d31dbc53Smrgif test x$APP_MAN_DIR = x    ; then
1564d31dbc53Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1565d31dbc53Smrgfi
156632b578d3Smrg
1567d31dbc53Smrgif test x$LIB_MAN_SUFFIX = x    ; then
1568d31dbc53Smrg    LIB_MAN_SUFFIX=3
1569d31dbc53Smrgfi
1570d31dbc53Smrgif test x$LIB_MAN_DIR = x    ; then
1571d31dbc53Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1572d31dbc53Smrgfi
157332b578d3Smrg
1574d31dbc53Smrgif test x$FILE_MAN_SUFFIX = x    ; then
157532b578d3Smrg    case $host_os in
1576d31dbc53Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
1577d31dbc53Smrg	*)		FILE_MAN_SUFFIX=5  ;;
157832b578d3Smrg    esac
1579d31dbc53Smrgfi
1580d31dbc53Smrgif test x$FILE_MAN_DIR = x    ; then
1581d31dbc53Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1582d31dbc53Smrgfi
158332b578d3Smrg
1584d31dbc53Smrgif test x$MISC_MAN_SUFFIX = x    ; then
1585d31dbc53Smrg    case $host_os in
1586d31dbc53Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
1587d31dbc53Smrg	*)		MISC_MAN_SUFFIX=7  ;;
1588d31dbc53Smrg    esac
1589d31dbc53Smrgfi
1590d31dbc53Smrgif test x$MISC_MAN_DIR = x    ; then
1591d31dbc53Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1592d31dbc53Smrgfi
159332b578d3Smrg
1594d31dbc53Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1595d31dbc53Smrg    case $host_os in
1596d31dbc53Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
1597d31dbc53Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
1598d31dbc53Smrg    esac
1599d31dbc53Smrgfi
1600d31dbc53Smrgif test x$DRIVER_MAN_DIR = x    ; then
1601d31dbc53Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1602d31dbc53Smrgfi
160332b578d3Smrg
1604d31dbc53Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1605d31dbc53Smrg    case $host_os in
1606d31dbc53Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
1607d31dbc53Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
1608d31dbc53Smrg    esac
1609d31dbc53Smrgfi
1610d31dbc53Smrgif test x$ADMIN_MAN_DIR = x    ; then
1611d31dbc53Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
161232b578d3Smrgfi
161332b578d3Smrg
161432b578d3Smrg
1615d31dbc53SmrgAC_SUBST([APP_MAN_SUFFIX])
1616d31dbc53SmrgAC_SUBST([LIB_MAN_SUFFIX])
1617d31dbc53SmrgAC_SUBST([FILE_MAN_SUFFIX])
1618d31dbc53SmrgAC_SUBST([MISC_MAN_SUFFIX])
1619d31dbc53SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1620d31dbc53SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1621d31dbc53SmrgAC_SUBST([APP_MAN_DIR])
1622d31dbc53SmrgAC_SUBST([LIB_MAN_DIR])
1623d31dbc53SmrgAC_SUBST([FILE_MAN_DIR])
1624d31dbc53SmrgAC_SUBST([MISC_MAN_DIR])
1625d31dbc53SmrgAC_SUBST([DRIVER_MAN_DIR])
1626d31dbc53SmrgAC_SUBST([ADMIN_MAN_DIR])
1627d31dbc53Smrg]) # XORG_MANPAGE_SECTIONS
162832b578d3Smrg
1629d31dbc53Smrg# XORG_CHECK_LINUXDOC
1630d31dbc53Smrg# -------------------
1631d31dbc53Smrg# Minimum version: 1.0.0
1632d31dbc53Smrg#
1633d31dbc53Smrg# Defines the variable MAKE_TEXT if the necessary tools and
1634d31dbc53Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1635d31dbc53Smrg# Whether or not the necessary tools and files are found can be checked
1636d31dbc53Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1637d31dbc53SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1638d31dbc53Smrgif test x$XORG_SGML_PATH = x ; then
1639d31dbc53Smrg    XORG_SGML_PATH=$prefix/share/sgml
1640d31dbc53Smrgfi
1641d31dbc53SmrgHAVE_DEFS_ENT=
164232b578d3Smrg
1643d31dbc53Smrgif test x"$cross_compiling" = x"yes" ; then
1644d31dbc53Smrg  HAVE_DEFS_ENT=no
1645d31dbc53Smrgelse
1646d31dbc53Smrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1647d31dbc53Smrgfi
164832b578d3Smrg
1649d31dbc53SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1650d31dbc53SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
165132b578d3Smrg
1652d31dbc53SmrgAC_MSG_CHECKING([Whether to build documentation])
165332b578d3Smrg
1654d31dbc53Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
1655d31dbc53Smrg   BUILDDOC=yes
1656d31dbc53Smrgelse
1657d31dbc53Smrg   BUILDDOC=no
1658d31dbc53Smrgfi
165932b578d3Smrg
1660d31dbc53SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
166132b578d3Smrg
1662d31dbc53SmrgAC_MSG_RESULT([$BUILDDOC])
166332b578d3Smrg
1664d31dbc53SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
166532b578d3Smrg
1666d31dbc53Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
1667d31dbc53Smrg   BUILDPDFDOC=yes
1668d31dbc53Smrgelse
1669d31dbc53Smrg   BUILDPDFDOC=no
1670d31dbc53Smrgfi
167132b578d3Smrg
1672d31dbc53SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
167332b578d3Smrg
1674d31dbc53SmrgAC_MSG_RESULT([$BUILDPDFDOC])
167532b578d3Smrg
1676d31dbc53SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
1677d31dbc53SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1678d31dbc53SmrgMAKE_PDF="$PS2PDF"
1679d31dbc53SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
168032b578d3Smrg
1681d31dbc53SmrgAC_SUBST(MAKE_TEXT)
1682d31dbc53SmrgAC_SUBST(MAKE_PS)
1683d31dbc53SmrgAC_SUBST(MAKE_PDF)
1684d31dbc53SmrgAC_SUBST(MAKE_HTML)
1685d31dbc53Smrg]) # XORG_CHECK_LINUXDOC
1686d31dbc53Smrg
1687d31dbc53Smrg# XORG_CHECK_DOCBOOK
1688d31dbc53Smrg# -------------------
1689d31dbc53Smrg# Minimum version: 1.0.0
1690d31dbc53Smrg#
1691d31dbc53Smrg# Checks for the ability to build output formats from SGML DocBook source.
1692d31dbc53Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1693d31dbc53Smrg# indicates whether the necessary tools and files are found and, if set,
1694d31dbc53Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1695d31dbc53SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1696d31dbc53Smrgif test x$XORG_SGML_PATH = x ; then
1697d31dbc53Smrg    XORG_SGML_PATH=$prefix/share/sgml
169832b578d3Smrgfi
1699d31dbc53SmrgHAVE_DEFS_ENT=
1700d31dbc53SmrgBUILDTXTDOC=no
1701d31dbc53SmrgBUILDPDFDOC=no
1702d31dbc53SmrgBUILDPSDOC=no
1703d31dbc53SmrgBUILDHTMLDOC=no
170432b578d3Smrg
1705d31dbc53SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
170632b578d3Smrg
1707d31dbc53SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1708d31dbc53SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1709d31dbc53SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1710d31dbc53SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
171132b578d3Smrg
1712d31dbc53SmrgAC_MSG_CHECKING([Whether to build text documentation])
1713d31dbc53Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
1714d31dbc53Smrg   test x$BUILD_TXTDOC != xno; then
1715d31dbc53Smrg	BUILDTXTDOC=yes
1716d31dbc53Smrgfi
1717d31dbc53SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1718d31dbc53SmrgAC_MSG_RESULT([$BUILDTXTDOC])
171932b578d3Smrg
1720d31dbc53SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
1721d31dbc53Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
1722d31dbc53Smrg   test x$BUILD_PDFDOC != xno; then
1723d31dbc53Smrg	BUILDPDFDOC=yes
1724d31dbc53Smrgfi
1725d31dbc53SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1726d31dbc53SmrgAC_MSG_RESULT([$BUILDPDFDOC])
172732b578d3Smrg
1728d31dbc53SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
1729d31dbc53Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
1730d31dbc53Smrg   test x$BUILD_PSDOC != xno; then
1731d31dbc53Smrg	BUILDPSDOC=yes
1732d31dbc53Smrgfi
1733d31dbc53SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1734d31dbc53SmrgAC_MSG_RESULT([$BUILDPSDOC])
173532b578d3Smrg
1736d31dbc53SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
1737d31dbc53Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
1738d31dbc53Smrg   test x$BUILD_HTMLDOC != xno; then
1739d31dbc53Smrg	BUILDHTMLDOC=yes
1740d31dbc53Smrgfi
1741d31dbc53SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1742d31dbc53SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
174332b578d3Smrg
1744d31dbc53SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1745d31dbc53SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1746d31dbc53SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1747d31dbc53SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
174832b578d3Smrg
1749d31dbc53SmrgAC_SUBST(MAKE_TEXT)
1750d31dbc53SmrgAC_SUBST(MAKE_PS)
1751d31dbc53SmrgAC_SUBST(MAKE_PDF)
1752d31dbc53SmrgAC_SUBST(MAKE_HTML)
1753d31dbc53Smrg]) # XORG_CHECK_DOCBOOK
175432b578d3Smrg
1755d31dbc53Smrg# XORG_CHECK_MALLOC_ZERO
1756d31dbc53Smrg# ----------------------
1757d31dbc53Smrg# Minimum version: 1.0.0
1758d31dbc53Smrg#
1759d31dbc53Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1760d31dbc53Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1761d31dbc53Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1762d31dbc53SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1763d31dbc53SmrgAC_ARG_ENABLE(malloc0returnsnull,
1764d31dbc53Smrg	AC_HELP_STRING([--enable-malloc0returnsnull],
1765d31dbc53Smrg		       [malloc(0) returns NULL (default: auto)]),
1766d31dbc53Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1767d31dbc53Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
176832b578d3Smrg
1769d31dbc53SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1770d31dbc53Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1771d31dbc53Smrg	AC_RUN_IFELSE([
1772d31dbc53Smrgchar *malloc();
1773d31dbc53Smrgchar *realloc();
1774d31dbc53Smrgchar *calloc();
1775d31dbc53Smrgmain() {
1776d31dbc53Smrg    char *m0, *r0, *c0, *p;
1777d31dbc53Smrg    m0 = malloc(0);
1778d31dbc53Smrg    p = malloc(10);
1779d31dbc53Smrg    r0 = realloc(p,0);
1780d31dbc53Smrg    c0 = calloc(0);
1781d31dbc53Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1782d31dbc53Smrg}],
1783d31dbc53Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
1784d31dbc53Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
1785d31dbc53Smrgfi
1786d31dbc53SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
178732b578d3Smrg
1788d31dbc53Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1789d31dbc53Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1790d31dbc53Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1791d31dbc53Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1792d31dbc53Smrgelse
1793d31dbc53Smrg	MALLOC_ZERO_CFLAGS=""
1794d31dbc53Smrg	XMALLOC_ZERO_CFLAGS=""
1795d31dbc53Smrg	XTMALLOC_ZERO_CFLAGS=""
1796d31dbc53Smrgfi
179732b578d3Smrg
1798d31dbc53SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1799d31dbc53SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1800d31dbc53SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1801d31dbc53Smrg]) # XORG_CHECK_MALLOC_ZERO
180232b578d3Smrg
1803d31dbc53Smrg# XORG_WITH_LINT()
1804d31dbc53Smrg# ----------------
1805d31dbc53Smrg# Minimum version: 1.1.0
1806d31dbc53Smrg#
1807d31dbc53Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
1808d31dbc53Smrg# is specified.   (Use --with-lint=sparse for sparse.)
1809d31dbc53Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
1810d31dbc53Smrg# Sets $LINT_FLAGS to flags to pass to source checker
1811d31dbc53Smrg# Sets LINT automake conditional if enabled (default: disabled)
1812d31dbc53Smrg#
1813d31dbc53SmrgAC_DEFUN([XORG_WITH_LINT],[
181432b578d3Smrg
1815d31dbc53Smrg# Allow checking code with lint, sparse, etc.
1816d31dbc53SmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
1817d31dbc53Smrg		[Use a lint-style source code checker (default: disabled)])],
1818d31dbc53Smrg		[use_lint=$withval], [use_lint=no])
1819d31dbc53Smrgif test "x$use_lint" = "xyes" ; then
1820d31dbc53Smrg	LINT="lint"
1821d31dbc53Smrgelse
1822d31dbc53Smrg	LINT="$use_lint"
1823d31dbc53Smrgfi
1824d31dbc53Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
1825d31dbc53Smrg    case $LINT in
1826d31dbc53Smrg	lint|*/lint)
1827d31dbc53Smrg	    case $host_os in
1828d31dbc53Smrg		solaris*)
1829d31dbc53Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1830d31dbc53Smrg			;;
1831d31dbc53Smrg	    esac
1832d31dbc53Smrg	    ;;
1833d31dbc53Smrg    esac
1834d31dbc53Smrgfi
183532b578d3Smrg
1836d31dbc53SmrgAC_SUBST(LINT)
1837d31dbc53SmrgAC_SUBST(LINT_FLAGS)
1838d31dbc53SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
183932b578d3Smrg
1840d31dbc53Smrg]) # XORG_WITH_LINT
184132b578d3Smrg
1842d31dbc53Smrg# XORG_LINT_LIBRARY(LIBNAME)
184332b578d3Smrg# --------------------------
1844d31dbc53Smrg# Minimum version: 1.1.0
1845d31dbc53Smrg#
1846d31dbc53Smrg# Sets up flags for building lint libraries for checking programs that call
1847d31dbc53Smrg# functions in the library.
1848d31dbc53Smrg# Disabled by default, enable with --enable-lint-library
1849d31dbc53Smrg# Sets: 
1850d31dbc53Smrg#	@LINTLIB@		- name of lint library file to make
1851d31dbc53Smrg#	MAKE_LINT_LIB		- automake conditional
1852d31dbc53Smrg#
185332b578d3Smrg
1854d31dbc53SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
1855d31dbc53SmrgAC_REQUIRE([XORG_WITH_LINT])
1856d31dbc53Smrg# Build lint "library" for more indepth checks of programs calling this library
1857d31dbc53SmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
1858d31dbc53Smrg	[Create lint library (default: disabled)])],
1859d31dbc53Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
1860d31dbc53Smrgif test "x$make_lint_lib" != "xno" ; then
1861d31dbc53Smrg	if test "x$LINT" = "xno" ; then
1862d31dbc53Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
1863d31dbc53Smrg	fi
1864d31dbc53Smrg	if test "x$make_lint_lib" = "xyes" ; then
1865d31dbc53Smrg		LINTLIB=llib-l$1.ln
1866d31dbc53Smrg	else
1867d31dbc53Smrg		LINTLIB=$make_lint_lib
1868d31dbc53Smrg	fi
1869d31dbc53Smrgfi
1870d31dbc53SmrgAC_SUBST(LINTLIB)
1871d31dbc53SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
187232b578d3Smrg
1873d31dbc53Smrg]) # XORG_LINT_LIBRARY
187432b578d3Smrg
1875d31dbc53Smrg# XORG_CWARNFLAGS
1876d31dbc53Smrg# ---------------
1877d31dbc53Smrg# Minimum version: 1.2.0
1878d31dbc53Smrg#
1879d31dbc53Smrg# Defines CWARNFLAGS to enable C compiler warnings.
1880d31dbc53Smrg#
1881d31dbc53SmrgAC_DEFUN([XORG_CWARNFLAGS], [
1882d31dbc53SmrgAC_REQUIRE([AC_PROG_CC])
1883d31dbc53Smrgif  test "x$GCC" = xyes ; then
1884d31dbc53Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
1885d31dbc53Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
1886d31dbc53Smrg-Wbad-function-cast"
1887d31dbc53Smrg    case `gcc -dumpversion` in
1888d31dbc53Smrg    3.4.* | 4.*)
1889d31dbc53Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
1890d31dbc53Smrg	;;
1891d31dbc53Smrg    esac
1892d31dbc53Smrgelse
1893d31dbc53Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1894d31dbc53Smrg    if test "x$SUNCC" = "xyes"; then
1895d31dbc53Smrg	CWARNFLAGS="-v"
1896d31dbc53Smrg    fi
1897d31dbc53Smrgfi
1898d31dbc53SmrgAC_SUBST(CWARNFLAGS)
1899d31dbc53Smrg]) # XORG_CWARNFLAGS
1900d31dbc53Smrgdnl Copyright 2005 Red Hat, Inc
1901d31dbc53Smrgdnl
1902d31dbc53Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1903d31dbc53Smrgdnl documentation for any purpose is hereby granted without fee, provided that
1904d31dbc53Smrgdnl the above copyright notice appear in all copies and that both that
1905d31dbc53Smrgdnl copyright notice and this permission notice appear in supporting
1906d31dbc53Smrgdnl documentation.
1907d31dbc53Smrgdnl
1908d31dbc53Smrgdnl The above copyright notice and this permission notice shall be included
1909d31dbc53Smrgdnl in all copies or substantial portions of the Software.
1910d31dbc53Smrgdnl
1911d31dbc53Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1912d31dbc53Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1913d31dbc53Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1914d31dbc53Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1915d31dbc53Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1916d31dbc53Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1917d31dbc53Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
1918d31dbc53Smrgdnl
1919d31dbc53Smrgdnl Except as contained in this notice, the name of the copyright holders shall
1920d31dbc53Smrgdnl not be used in advertising or otherwise to promote the sale, use or
1921d31dbc53Smrgdnl other dealings in this Software without prior written authorization
1922d31dbc53Smrgdnl from the copyright holders.
1923d31dbc53Smrgdnl
192432b578d3Smrg
1925d31dbc53Smrg# XORG_RELEASE_VERSION
1926d31dbc53Smrg# --------------------
1927d31dbc53Smrg# Adds --with/without-release-string and changes the PACKAGE and
1928d31dbc53Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
1929d31dbc53Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
1930d31dbc53Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1931d31dbc53Smrg 
1932d31dbc53SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1933d31dbc53Smrg	AC_ARG_WITH(release-version,
1934d31dbc53Smrg			AC_HELP_STRING([--with-release-version=STRING],
1935d31dbc53Smrg				[Use release version string in package name]),
1936d31dbc53Smrg			[RELEASE_VERSION="$withval"],
1937d31dbc53Smrg			[RELEASE_VERSION=""])
1938d31dbc53Smrg	if test "x$RELEASE_VERSION" != "x"; then
1939d31dbc53Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
1940d31dbc53Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
1941d31dbc53Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
1942d31dbc53Smrg	fi
1943d31dbc53Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1944d31dbc53Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1945d31dbc53Smrg		[Major version of this package])
1946d31dbc53Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1947d31dbc53Smrg	if test "x$PVM" = "x"; then
1948d31dbc53Smrg		PVM="0"
1949d31dbc53Smrg	fi
1950d31dbc53Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1951d31dbc53Smrg		[$PVM],
1952d31dbc53Smrg		[Minor version of this package])
1953d31dbc53Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1954d31dbc53Smrg	if test "x$PVP" = "x"; then
1955d31dbc53Smrg		PVP="0"
1956d31dbc53Smrg	fi
1957d31dbc53Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1958d31dbc53Smrg		[$PVP],
1959d31dbc53Smrg		[Patch version of this package])
1960d31dbc53Smrg])
196132b578d3Smrg
1962d31dbc53Smrg# XORG_CHANGELOG()
1963d31dbc53Smrg# ----------------
1964d31dbc53Smrg# Minimum version: 1.2.0
1965d31dbc53Smrg#
1966d31dbc53Smrg# Defines the variable CHANGELOG_CMD as the command to generate
1967d31dbc53Smrg# ChangeLog from git.
1968d31dbc53Smrg#
1969d31dbc53Smrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
1970d31dbc53Smrg#
1971d31dbc53SmrgAC_DEFUN([XORG_CHANGELOG], [
1972d31dbc53SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
1973d31dbc53Smrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
1974d31dbc53Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
1975d31dbc53SmrgAC_SUBST([CHANGELOG_CMD])
1976d31dbc53SmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
1977d31dbc53Smrg]) # XORG_CHANGELOG
197832b578d3Smrg
1979d31dbc53Smrgdnl Copyright 2005 Red Hat, Inc
1980d31dbc53Smrgdnl 
1981d31dbc53Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1982d31dbc53Smrgdnl documentation for any purpose is hereby granted without fee, provided that
1983d31dbc53Smrgdnl the above copyright notice appear in all copies and that both that
1984d31dbc53Smrgdnl copyright notice and this permission notice appear in supporting
1985d31dbc53Smrgdnl documentation.
1986d31dbc53Smrgdnl 
1987d31dbc53Smrgdnl The above copyright notice and this permission notice shall be included
1988d31dbc53Smrgdnl in all copies or substantial portions of the Software.
1989d31dbc53Smrgdnl 
1990d31dbc53Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1991d31dbc53Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1992d31dbc53Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1993d31dbc53Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1994d31dbc53Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1995d31dbc53Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1996d31dbc53Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
1997d31dbc53Smrgdnl 
1998d31dbc53Smrgdnl Except as contained in this notice, the name of the copyright holders shall
1999d31dbc53Smrgdnl not be used in advertising or otherwise to promote the sale, use or
2000d31dbc53Smrgdnl other dealings in this Software without prior written authorization
2001d31dbc53Smrgdnl from the copyright holders.
2002d31dbc53Smrgdnl 
200332b578d3Smrg
2004d31dbc53Smrg# XORG_DRIVER_CHECK_EXT()
2005d31dbc53Smrg# --------------------------
2006d31dbc53Smrg# Checks for the $1 define in xorg-server.h (from the sdk).  If it
2007d31dbc53Smrg# is defined, then add $1 to $REQUIRED_MODULES.
200832b578d3Smrg
2009d31dbc53SmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
2010d31dbc53Smrg	SAVE_CFLAGS="$CFLAGS"
2011d31dbc53Smrg	CFLAGS="$CFLAGS -I`pkg-config --variable=sdkdir xorg-server`"
2012d31dbc53Smrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2013d31dbc53Smrg#include "xorg-server.h"
2014d31dbc53Smrg#if !defined $1
2015d31dbc53Smrg#error $1 not defined
2016d31dbc53Smrg#endif
2017d31dbc53Smrg		]])],
2018d31dbc53Smrg		[_EXT_CHECK=yes],
2019d31dbc53Smrg		[_EXT_CHECK=no])
2020d31dbc53Smrg	CFLAGS="$SAVE_CFLAGS"
2021d31dbc53Smrg	AC_MSG_CHECKING([if $1 is defined])
2022d31dbc53Smrg	AC_MSG_RESULT([$_EXT_CHECK])
2023d31dbc53Smrg	if test "$_EXT_CHECK" != no; then
2024d31dbc53Smrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
2025d31dbc53Smrg	fi
2026d31dbc53Smrg])
202732b578d3Smrg
2028d31dbc53Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
202932b578d3Smrg
2030d31dbc53Smrg# serial 48 AC_PROG_LIBTOOL
203132b578d3Smrg
203232b578d3Smrg
2033d31dbc53Smrg# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
2034d31dbc53Smrg# -----------------------------------------------------------
2035d31dbc53Smrg# If this macro is not defined by Autoconf, define it here.
2036d31dbc53Smrgm4_ifdef([AC_PROVIDE_IFELSE],
2037d31dbc53Smrg         [],
2038d31dbc53Smrg         [m4_define([AC_PROVIDE_IFELSE],
2039d31dbc53Smrg	         [m4_ifdef([AC_PROVIDE_$1],
2040d31dbc53Smrg		           [$2], [$3])])])
204132b578d3Smrg
204232b578d3Smrg
2043d31dbc53Smrg# AC_PROG_LIBTOOL
2044d31dbc53Smrg# ---------------
2045d31dbc53SmrgAC_DEFUN([AC_PROG_LIBTOOL],
2046d31dbc53Smrg[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
2047d31dbc53Smrgdnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
2048d31dbc53Smrgdnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
2049d31dbc53Smrg  AC_PROVIDE_IFELSE([AC_PROG_CXX],
2050d31dbc53Smrg    [AC_LIBTOOL_CXX],
2051d31dbc53Smrg    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
2052d31dbc53Smrg  ])])
2053d31dbc53Smrgdnl And a similar setup for Fortran 77 support
2054d31dbc53Smrg  AC_PROVIDE_IFELSE([AC_PROG_F77],
2055d31dbc53Smrg    [AC_LIBTOOL_F77],
2056d31dbc53Smrg    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
2057d31dbc53Smrg])])
205832b578d3Smrg
2059d31dbc53Smrgdnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
2060d31dbc53Smrgdnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
2061d31dbc53Smrgdnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
2062d31dbc53Smrg  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
2063d31dbc53Smrg    [AC_LIBTOOL_GCJ],
2064d31dbc53Smrg    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
2065d31dbc53Smrg      [AC_LIBTOOL_GCJ],
2066d31dbc53Smrg      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
2067d31dbc53Smrg	[AC_LIBTOOL_GCJ],
2068d31dbc53Smrg      [ifdef([AC_PROG_GCJ],
2069d31dbc53Smrg	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
2070d31dbc53Smrg       ifdef([A][M_PROG_GCJ],
2071d31dbc53Smrg	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
2072d31dbc53Smrg       ifdef([LT_AC_PROG_GCJ],
2073d31dbc53Smrg	     [define([LT_AC_PROG_GCJ],
2074d31dbc53Smrg		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
2075d31dbc53Smrg])])# AC_PROG_LIBTOOL
207632b578d3Smrg
207732b578d3Smrg
2078d31dbc53Smrg# _AC_PROG_LIBTOOL
2079d31dbc53Smrg# ----------------
2080d31dbc53SmrgAC_DEFUN([_AC_PROG_LIBTOOL],
2081d31dbc53Smrg[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
2082d31dbc53SmrgAC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
2083d31dbc53SmrgAC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
2084d31dbc53SmrgAC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
208532b578d3Smrg
2086d31dbc53Smrg# This can be used to rebuild libtool when needed
2087d31dbc53SmrgLIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
208832b578d3Smrg
2089d31dbc53Smrg# Always use our own libtool.
2090d31dbc53SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
2091d31dbc53SmrgAC_SUBST(LIBTOOL)dnl
209232b578d3Smrg
2093d31dbc53Smrg# Prevent multiple expansion
2094d31dbc53Smrgdefine([AC_PROG_LIBTOOL], [])
2095d31dbc53Smrg])# _AC_PROG_LIBTOOL
209632b578d3Smrg
209732b578d3Smrg
2098d31dbc53Smrg# AC_LIBTOOL_SETUP
2099d31dbc53Smrg# ----------------
2100d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_SETUP],
2101d31dbc53Smrg[AC_PREREQ(2.50)dnl
2102d31dbc53SmrgAC_REQUIRE([AC_ENABLE_SHARED])dnl
2103d31dbc53SmrgAC_REQUIRE([AC_ENABLE_STATIC])dnl
2104d31dbc53SmrgAC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
2105d31dbc53SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
2106d31dbc53SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
2107d31dbc53SmrgAC_REQUIRE([AC_PROG_CC])dnl
2108d31dbc53SmrgAC_REQUIRE([AC_PROG_LD])dnl
2109d31dbc53SmrgAC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
2110d31dbc53SmrgAC_REQUIRE([AC_PROG_NM])dnl
211132b578d3Smrg
2112d31dbc53SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
2113d31dbc53SmrgAC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
2114d31dbc53Smrg# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
2115d31dbc53SmrgAC_REQUIRE([AC_OBJEXT])dnl
2116d31dbc53SmrgAC_REQUIRE([AC_EXEEXT])dnl
2117d31dbc53Smrgdnl
211832b578d3Smrg
2119d31dbc53SmrgAC_LIBTOOL_SYS_MAX_CMD_LEN
2120d31dbc53SmrgAC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
2121d31dbc53SmrgAC_LIBTOOL_OBJDIR
212232b578d3Smrg
2123d31dbc53SmrgAC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
2124d31dbc53Smrg_LT_AC_PROG_ECHO_BACKSLASH
212532b578d3Smrg
2126d31dbc53Smrgcase $host_os in
2127d31dbc53Smrgaix3*)
2128d31dbc53Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
2129d31dbc53Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
2130d31dbc53Smrg  # vanish in a puff of smoke.
2131d31dbc53Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
2132d31dbc53Smrg    COLLECT_NAMES=
2133d31dbc53Smrg    export COLLECT_NAMES
2134d31dbc53Smrg  fi
213532b578d3Smrg  ;;
2136d31dbc53Smrgesac
213732b578d3Smrg
2138d31dbc53Smrg# Sed substitution that helps us do robust quoting.  It backslashifies
2139d31dbc53Smrg# metacharacters that are still active within double-quoted strings.
2140d31dbc53SmrgXsed='sed -e 1s/^X//'
2141d31dbc53Smrg[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
214232b578d3Smrg
2143d31dbc53Smrg# Same as above, but do not quote variable references.
2144d31dbc53Smrg[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
214532b578d3Smrg
2146d31dbc53Smrg# Sed substitution to delay expansion of an escaped shell variable in a
2147d31dbc53Smrg# double_quote_subst'ed string.
2148d31dbc53Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
214932b578d3Smrg
2150d31dbc53Smrg# Sed substitution to avoid accidental globbing in evaled expressions
2151d31dbc53Smrgno_glob_subst='s/\*/\\\*/g'
215232b578d3Smrg
2153d31dbc53Smrg# Constants:
2154d31dbc53Smrgrm="rm -f"
215532b578d3Smrg
2156d31dbc53Smrg# Global variables:
2157d31dbc53Smrgdefault_ofile=libtool
2158d31dbc53Smrgcan_build_shared=yes
215932b578d3Smrg
2160d31dbc53Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
2161d31dbc53Smrg# which needs '.lib').
2162d31dbc53Smrglibext=a
2163d31dbc53Smrgltmain="$ac_aux_dir/ltmain.sh"
2164d31dbc53Smrgofile="$default_ofile"
2165d31dbc53Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
216632b578d3Smrg
2167d31dbc53SmrgAC_CHECK_TOOL(AR, ar, false)
2168d31dbc53SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
2169d31dbc53SmrgAC_CHECK_TOOL(STRIP, strip, :)
217032b578d3Smrg
2171d31dbc53Smrgold_CC="$CC"
2172d31dbc53Smrgold_CFLAGS="$CFLAGS"
217332b578d3Smrg
2174d31dbc53Smrg# Set sane defaults for various variables
2175d31dbc53Smrgtest -z "$AR" && AR=ar
2176d31dbc53Smrgtest -z "$AR_FLAGS" && AR_FLAGS=cru
2177d31dbc53Smrgtest -z "$AS" && AS=as
2178d31dbc53Smrgtest -z "$CC" && CC=cc
2179d31dbc53Smrgtest -z "$LTCC" && LTCC=$CC
2180d31dbc53Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
2181d31dbc53Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
2182d31dbc53Smrgtest -z "$LD" && LD=ld
2183d31dbc53Smrgtest -z "$LN_S" && LN_S="ln -s"
2184d31dbc53Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
2185d31dbc53Smrgtest -z "$NM" && NM=nm
2186d31dbc53Smrgtest -z "$SED" && SED=sed
2187d31dbc53Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
2188d31dbc53Smrgtest -z "$RANLIB" && RANLIB=:
2189d31dbc53Smrgtest -z "$STRIP" && STRIP=:
2190d31dbc53Smrgtest -z "$ac_objext" && ac_objext=o
2191d31dbc53Smrg
2192d31dbc53Smrg# Determine commands to create old-style static archives.
2193d31dbc53Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
2194d31dbc53Smrgold_postinstall_cmds='chmod 644 $oldlib'
2195d31dbc53Smrgold_postuninstall_cmds=
2196d31dbc53Smrg
2197d31dbc53Smrgif test -n "$RANLIB"; then
2198d31dbc53Smrg  case $host_os in
2199d31dbc53Smrg  openbsd*)
2200d31dbc53Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
220132b578d3Smrg    ;;
2202d31dbc53Smrg  *)
2203d31dbc53Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
220432b578d3Smrg    ;;
220532b578d3Smrg  esac
2206d31dbc53Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
2207d31dbc53Smrgfi
220832b578d3Smrg
2209d31dbc53Smrg_LT_CC_BASENAME([$compiler])
2210d31dbc53Smrg
2211d31dbc53Smrg# Only perform the check for file, if the check method requires it
2212d31dbc53Smrgcase $deplibs_check_method in
2213d31dbc53Smrgfile_magic*)
2214d31dbc53Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
2215d31dbc53Smrg    AC_PATH_MAGIC
2216d31dbc53Smrg  fi
221732b578d3Smrg  ;;
221832b578d3Smrgesac
221932b578d3Smrg
2220d31dbc53SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
2221d31dbc53SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
2222d31dbc53Smrgenable_win32_dll=yes, enable_win32_dll=no)
222332b578d3Smrg
2224d31dbc53SmrgAC_ARG_ENABLE([libtool-lock],
2225d31dbc53Smrg    [AC_HELP_STRING([--disable-libtool-lock],
2226d31dbc53Smrg	[avoid locking (might break parallel builds)])])
2227d31dbc53Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
222832b578d3Smrg
2229d31dbc53SmrgAC_ARG_WITH([pic],
2230d31dbc53Smrg    [AC_HELP_STRING([--with-pic],
2231d31dbc53Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
2232d31dbc53Smrg    [pic_mode="$withval"],
2233d31dbc53Smrg    [pic_mode=default])
2234d31dbc53Smrgtest -z "$pic_mode" && pic_mode=default
223532b578d3Smrg
2236d31dbc53Smrg# Use C for the default configuration in the libtool script
2237d31dbc53Smrgtagname=
2238d31dbc53SmrgAC_LIBTOOL_LANG_C_CONFIG
2239d31dbc53Smrg_LT_AC_TAGCONFIG
2240d31dbc53Smrg])# AC_LIBTOOL_SETUP
224132b578d3Smrg
224232b578d3Smrg
2243d31dbc53Smrg# _LT_AC_SYS_COMPILER
2244d31dbc53Smrg# -------------------
2245d31dbc53SmrgAC_DEFUN([_LT_AC_SYS_COMPILER],
2246d31dbc53Smrg[AC_REQUIRE([AC_PROG_CC])dnl
2247d31dbc53Smrg
2248d31dbc53Smrg# If no C compiler was specified, use CC.
2249d31dbc53SmrgLTCC=${LTCC-"$CC"}
2250d31dbc53Smrg
2251d31dbc53Smrg# If no C compiler flags were specified, use CFLAGS.
2252d31dbc53SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
2253d31dbc53Smrg
2254d31dbc53Smrg# Allow CC to be a program name with arguments.
2255d31dbc53Smrgcompiler=$CC
2256d31dbc53Smrg])# _LT_AC_SYS_COMPILER
2257d31dbc53Smrg
2258d31dbc53Smrg
2259d31dbc53Smrg# _LT_CC_BASENAME(CC)
2260d31dbc53Smrg# -------------------
2261d31dbc53Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
2262d31dbc53SmrgAC_DEFUN([_LT_CC_BASENAME],
2263d31dbc53Smrg[for cc_temp in $1""; do
2264d31dbc53Smrg  case $cc_temp in
2265d31dbc53Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
2266d31dbc53Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
2267d31dbc53Smrg    \-*) ;;
2268d31dbc53Smrg    *) break;;
226932b578d3Smrg  esac
2270d31dbc53Smrgdone
2271d31dbc53Smrgcc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
2272d31dbc53Smrg])
227332b578d3Smrg
227432b578d3Smrg
2275d31dbc53Smrg# _LT_COMPILER_BOILERPLATE
227632b578d3Smrg# ------------------------
2277d31dbc53Smrg# Check for compiler boilerplate output or warnings with
2278d31dbc53Smrg# the simple compiler test code.
2279d31dbc53SmrgAC_DEFUN([_LT_COMPILER_BOILERPLATE],
2280d31dbc53Smrg[ac_outfile=conftest.$ac_objext
2281d31dbc53Smrgprintf "$lt_simple_compile_test_code" >conftest.$ac_ext
2282d31dbc53Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
2283d31dbc53Smrg_lt_compiler_boilerplate=`cat conftest.err`
2284d31dbc53Smrg$rm conftest*
2285d31dbc53Smrg])# _LT_COMPILER_BOILERPLATE
228632b578d3Smrg
228732b578d3Smrg
2288d31dbc53Smrg# _LT_LINKER_BOILERPLATE
2289d31dbc53Smrg# ----------------------
2290d31dbc53Smrg# Check for linker boilerplate output or warnings with
2291d31dbc53Smrg# the simple link test code.
2292d31dbc53SmrgAC_DEFUN([_LT_LINKER_BOILERPLATE],
2293d31dbc53Smrg[ac_outfile=conftest.$ac_objext
2294d31dbc53Smrgprintf "$lt_simple_link_test_code" >conftest.$ac_ext
2295d31dbc53Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
2296d31dbc53Smrg_lt_linker_boilerplate=`cat conftest.err`
2297d31dbc53Smrg$rm conftest*
2298d31dbc53Smrg])# _LT_LINKER_BOILERPLATE
229932b578d3Smrg
230032b578d3Smrg
2301d31dbc53Smrg# _LT_AC_SYS_LIBPATH_AIX
2302d31dbc53Smrg# ----------------------
2303d31dbc53Smrg# Links a minimal program and checks the executable
2304d31dbc53Smrg# for the system default hardcoded library path. In most cases,
2305d31dbc53Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
2306d31dbc53Smrg# the location of the communication and MPI libs are included too.
2307d31dbc53Smrg# If we don't find anything, use the default library path according
2308d31dbc53Smrg# to the aix ld manual.
2309d31dbc53SmrgAC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
2310d31dbc53Smrg[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
2311d31dbc53Smrgaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
2312d31dbc53Smrg}'`
2313d31dbc53Smrg# Check for a 64-bit object if we didn't find anything.
2314d31dbc53Smrgif 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; }
2315d31dbc53Smrg}'`; fi],[])
2316d31dbc53Smrgif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
2317d31dbc53Smrg])# _LT_AC_SYS_LIBPATH_AIX
231832b578d3Smrg
231932b578d3Smrg
2320d31dbc53Smrg# _LT_AC_SHELL_INIT(ARG)
2321d31dbc53Smrg# ----------------------
2322d31dbc53SmrgAC_DEFUN([_LT_AC_SHELL_INIT],
2323d31dbc53Smrg[ifdef([AC_DIVERSION_NOTICE],
2324d31dbc53Smrg	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
2325d31dbc53Smrg	 [AC_DIVERT_PUSH(NOTICE)])
2326d31dbc53Smrg$1
2327d31dbc53SmrgAC_DIVERT_POP
2328d31dbc53Smrg])# _LT_AC_SHELL_INIT
232932b578d3Smrg
233032b578d3Smrg
2331d31dbc53Smrg# _LT_AC_PROG_ECHO_BACKSLASH
2332d31dbc53Smrg# --------------------------
2333d31dbc53Smrg# Add some code to the start of the generated configure script which
2334d31dbc53Smrg# will find an echo command which doesn't interpret backslashes.
2335d31dbc53SmrgAC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
2336d31dbc53Smrg[_LT_AC_SHELL_INIT([
2337d31dbc53Smrg# Check that we are running under the correct shell.
2338d31dbc53SmrgSHELL=${CONFIG_SHELL-/bin/sh}
233932b578d3Smrg
2340d31dbc53Smrgcase X$ECHO in
2341d31dbc53SmrgX*--fallback-echo)
2342d31dbc53Smrg  # Remove one level of quotation (which was required for Make).
2343d31dbc53Smrg  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
234432b578d3Smrg  ;;
234532b578d3Smrgesac
234632b578d3Smrg
2347d31dbc53Smrgecho=${ECHO-echo}
2348d31dbc53Smrgif test "X[$]1" = X--no-reexec; then
2349d31dbc53Smrg  # Discard the --no-reexec flag, and continue.
2350d31dbc53Smrg  shift
2351d31dbc53Smrgelif test "X[$]1" = X--fallback-echo; then
2352d31dbc53Smrg  # Avoid inline document here, it may be left over
2353d31dbc53Smrg  :
2354d31dbc53Smrgelif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
2355d31dbc53Smrg  # Yippee, $echo works!
2356d31dbc53Smrg  :
2357d31dbc53Smrgelse
2358d31dbc53Smrg  # Restart under the correct shell.
2359d31dbc53Smrg  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
2360d31dbc53Smrgfi
236132b578d3Smrg
2362d31dbc53Smrgif test "X[$]1" = X--fallback-echo; then
2363d31dbc53Smrg  # used as fallback echo
2364d31dbc53Smrg  shift
2365d31dbc53Smrg  cat <<EOF
2366d31dbc53Smrg[$]*
2367d31dbc53SmrgEOF
2368d31dbc53Smrg  exit 0
2369d31dbc53Smrgfi
237032b578d3Smrg
2371d31dbc53Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
2372d31dbc53Smrg# if CDPATH is set.
2373d31dbc53Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
237432b578d3Smrg
2375d31dbc53Smrgif test -z "$ECHO"; then
2376d31dbc53Smrgif test "X${echo_test_string+set}" != Xset; then
2377d31dbc53Smrg# find a string as large as possible, as long as the shell can cope with it
2378d31dbc53Smrg  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
2379d31dbc53Smrg    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
2380d31dbc53Smrg    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
2381d31dbc53Smrg       echo_test_string=`eval $cmd` &&
2382d31dbc53Smrg       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
2383d31dbc53Smrg    then
2384d31dbc53Smrg      break
2385d31dbc53Smrg    fi
2386d31dbc53Smrg  done
2387d31dbc53Smrgfi
238832b578d3Smrg
2389d31dbc53Smrgif test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
2390d31dbc53Smrg   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
2391d31dbc53Smrg   test "X$echo_testing_string" = "X$echo_test_string"; then
2392d31dbc53Smrg  :
2393d31dbc53Smrgelse
2394d31dbc53Smrg  # The Solaris, AIX, and Digital Unix default echo programs unquote
2395d31dbc53Smrg  # backslashes.  This makes it impossible to quote backslashes using
2396d31dbc53Smrg  #   echo "$something" | sed 's/\\/\\\\/g'
2397d31dbc53Smrg  #
2398d31dbc53Smrg  # So, first we look for a working echo in the user's PATH.
239932b578d3Smrg
2400d31dbc53Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2401d31dbc53Smrg  for dir in $PATH /usr/ucb; do
2402d31dbc53Smrg    IFS="$lt_save_ifs"
2403d31dbc53Smrg    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
2404d31dbc53Smrg       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
2405d31dbc53Smrg       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
2406d31dbc53Smrg       test "X$echo_testing_string" = "X$echo_test_string"; then
2407d31dbc53Smrg      echo="$dir/echo"
2408d31dbc53Smrg      break
2409d31dbc53Smrg    fi
2410d31dbc53Smrg  done
2411d31dbc53Smrg  IFS="$lt_save_ifs"
241232b578d3Smrg
2413d31dbc53Smrg  if test "X$echo" = Xecho; then
2414d31dbc53Smrg    # We didn't find a better echo, so look for alternatives.
2415d31dbc53Smrg    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
2416d31dbc53Smrg       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
2417d31dbc53Smrg       test "X$echo_testing_string" = "X$echo_test_string"; then
2418d31dbc53Smrg      # This shell has a builtin print -r that does the trick.
2419d31dbc53Smrg      echo='print -r'
2420d31dbc53Smrg    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
2421d31dbc53Smrg	 test "X$CONFIG_SHELL" != X/bin/ksh; then
2422d31dbc53Smrg      # If we have ksh, try running configure again with it.
2423d31dbc53Smrg      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
2424d31dbc53Smrg      export ORIGINAL_CONFIG_SHELL
2425d31dbc53Smrg      CONFIG_SHELL=/bin/ksh
2426d31dbc53Smrg      export CONFIG_SHELL
2427d31dbc53Smrg      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
2428d31dbc53Smrg    else
2429d31dbc53Smrg      # Try using printf.
2430d31dbc53Smrg      echo='printf %s\n'
2431d31dbc53Smrg      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
2432d31dbc53Smrg	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
2433d31dbc53Smrg	 test "X$echo_testing_string" = "X$echo_test_string"; then
2434d31dbc53Smrg	# Cool, printf works
2435d31dbc53Smrg	:
2436d31dbc53Smrg      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
2437d31dbc53Smrg	   test "X$echo_testing_string" = 'X\t' &&
2438d31dbc53Smrg	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
2439d31dbc53Smrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
2440d31dbc53Smrg	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
2441d31dbc53Smrg	export CONFIG_SHELL
2442d31dbc53Smrg	SHELL="$CONFIG_SHELL"
2443d31dbc53Smrg	export SHELL
2444d31dbc53Smrg	echo="$CONFIG_SHELL [$]0 --fallback-echo"
2445d31dbc53Smrg      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
2446d31dbc53Smrg	   test "X$echo_testing_string" = 'X\t' &&
2447d31dbc53Smrg	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
2448d31dbc53Smrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
2449d31dbc53Smrg	echo="$CONFIG_SHELL [$]0 --fallback-echo"
2450d31dbc53Smrg      else
2451d31dbc53Smrg	# maybe with a smaller string...
2452d31dbc53Smrg	prev=:
245332b578d3Smrg
2454d31dbc53Smrg	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
2455d31dbc53Smrg	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
2456d31dbc53Smrg	  then
2457d31dbc53Smrg	    break
2458d31dbc53Smrg	  fi
2459d31dbc53Smrg	  prev="$cmd"
2460d31dbc53Smrg	done
246132b578d3Smrg
2462d31dbc53Smrg	if test "$prev" != 'sed 50q "[$]0"'; then
2463d31dbc53Smrg	  echo_test_string=`eval $prev`
2464d31dbc53Smrg	  export echo_test_string
2465d31dbc53Smrg	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
2466d31dbc53Smrg	else
2467d31dbc53Smrg	  # Oops.  We lost completely, so just stick with echo.
2468d31dbc53Smrg	  echo=echo
2469d31dbc53Smrg	fi
2470d31dbc53Smrg      fi
2471d31dbc53Smrg    fi
2472d31dbc53Smrg  fi
247332b578d3Smrgfi
247432b578d3Smrgfi
247532b578d3Smrg
2476d31dbc53Smrg# Copy echo and quote the copy suitably for passing to libtool from
2477d31dbc53Smrg# the Makefile, instead of quoting the original, which is used later.
2478d31dbc53SmrgECHO=$echo
2479d31dbc53Smrgif test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
2480d31dbc53Smrg   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
248132b578d3Smrgfi
248232b578d3Smrg
2483d31dbc53SmrgAC_SUBST(ECHO)
2484d31dbc53Smrg])])# _LT_AC_PROG_ECHO_BACKSLASH
248532b578d3Smrg
248632b578d3Smrg
2487d31dbc53Smrg# _LT_AC_LOCK
2488d31dbc53Smrg# -----------
2489d31dbc53SmrgAC_DEFUN([_LT_AC_LOCK],
2490d31dbc53Smrg[AC_ARG_ENABLE([libtool-lock],
2491d31dbc53Smrg    [AC_HELP_STRING([--disable-libtool-lock],
2492d31dbc53Smrg	[avoid locking (might break parallel builds)])])
2493d31dbc53Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
249432b578d3Smrg
2495d31dbc53Smrg# Some flags need to be propagated to the compiler or linker for good
2496d31dbc53Smrg# libtool support.
2497d31dbc53Smrgcase $host in
2498d31dbc53Smrgia64-*-hpux*)
2499d31dbc53Smrg  # Find out which ABI we are using.
2500d31dbc53Smrg  echo 'int i;' > conftest.$ac_ext
2501d31dbc53Smrg  if AC_TRY_EVAL(ac_compile); then
2502d31dbc53Smrg    case `/usr/bin/file conftest.$ac_objext` in
2503d31dbc53Smrg    *ELF-32*)
2504d31dbc53Smrg      HPUX_IA64_MODE="32"
2505d31dbc53Smrg      ;;
2506d31dbc53Smrg    *ELF-64*)
2507d31dbc53Smrg      HPUX_IA64_MODE="64"
2508d31dbc53Smrg      ;;
2509d31dbc53Smrg    esac
2510d31dbc53Smrg  fi
2511d31dbc53Smrg  rm -rf conftest*
2512d31dbc53Smrg  ;;
2513d31dbc53Smrg*-*-irix6*)
2514d31dbc53Smrg  # Find out which ABI we are using.
2515d31dbc53Smrg  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
2516d31dbc53Smrg  if AC_TRY_EVAL(ac_compile); then
2517d31dbc53Smrg   if test "$lt_cv_prog_gnu_ld" = yes; then
2518d31dbc53Smrg    case `/usr/bin/file conftest.$ac_objext` in
2519d31dbc53Smrg    *32-bit*)
2520d31dbc53Smrg      LD="${LD-ld} -melf32bsmip"
2521d31dbc53Smrg      ;;
2522d31dbc53Smrg    *N32*)
2523d31dbc53Smrg      LD="${LD-ld} -melf32bmipn32"
2524d31dbc53Smrg      ;;
2525d31dbc53Smrg    *64-bit*)
2526d31dbc53Smrg      LD="${LD-ld} -melf64bmip"
2527d31dbc53Smrg      ;;
2528d31dbc53Smrg    esac
2529d31dbc53Smrg   else
2530d31dbc53Smrg    case `/usr/bin/file conftest.$ac_objext` in
2531d31dbc53Smrg    *32-bit*)
2532d31dbc53Smrg      LD="${LD-ld} -32"
2533d31dbc53Smrg      ;;
2534d31dbc53Smrg    *N32*)
2535d31dbc53Smrg      LD="${LD-ld} -n32"
2536d31dbc53Smrg      ;;
2537d31dbc53Smrg    *64-bit*)
2538d31dbc53Smrg      LD="${LD-ld} -64"
2539d31dbc53Smrg      ;;
2540d31dbc53Smrg    esac
2541d31dbc53Smrg   fi
254232b578d3Smrg  fi
2543d31dbc53Smrg  rm -rf conftest*
2544d31dbc53Smrg  ;;
254532b578d3Smrg
2546d31dbc53Smrgx86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
2547d31dbc53Smrg  # Find out which ABI we are using.
2548d31dbc53Smrg  echo 'int i;' > conftest.$ac_ext
2549d31dbc53Smrg  if AC_TRY_EVAL(ac_compile); then
2550d31dbc53Smrg    case `/usr/bin/file conftest.o` in
2551d31dbc53Smrg    *32-bit*)
2552d31dbc53Smrg      case $host in
2553d31dbc53Smrg        x86_64-*linux*)
2554d31dbc53Smrg          LD="${LD-ld} -m elf_i386"
2555d31dbc53Smrg          ;;
2556d31dbc53Smrg        ppc64-*linux*|powerpc64-*linux*)
2557d31dbc53Smrg          LD="${LD-ld} -m elf32ppclinux"
2558d31dbc53Smrg          ;;
2559d31dbc53Smrg        s390x-*linux*)
2560d31dbc53Smrg          LD="${LD-ld} -m elf_s390"
2561d31dbc53Smrg          ;;
2562d31dbc53Smrg        sparc64-*linux*)
2563d31dbc53Smrg          LD="${LD-ld} -m elf32_sparc"
2564d31dbc53Smrg          ;;
2565d31dbc53Smrg      esac
2566d31dbc53Smrg      ;;
2567d31dbc53Smrg    *64-bit*)
2568d31dbc53Smrg      case $host in
2569d31dbc53Smrg        x86_64-*linux*)
2570d31dbc53Smrg          LD="${LD-ld} -m elf_x86_64"
2571d31dbc53Smrg          ;;
2572d31dbc53Smrg        ppc*-*linux*|powerpc*-*linux*)
2573d31dbc53Smrg          LD="${LD-ld} -m elf64ppc"
2574d31dbc53Smrg          ;;
2575d31dbc53Smrg        s390*-*linux*)
2576d31dbc53Smrg          LD="${LD-ld} -m elf64_s390"
2577d31dbc53Smrg          ;;
2578d31dbc53Smrg        sparc*-*linux*)
2579d31dbc53Smrg          LD="${LD-ld} -m elf64_sparc"
2580d31dbc53Smrg          ;;
2581d31dbc53Smrg      esac
2582d31dbc53Smrg      ;;
2583d31dbc53Smrg    esac
2584d31dbc53Smrg  fi
2585d31dbc53Smrg  rm -rf conftest*
2586d31dbc53Smrg  ;;
258732b578d3Smrg
2588d31dbc53Smrg*-*-sco3.2v5*)
2589d31dbc53Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2590d31dbc53Smrg  SAVE_CFLAGS="$CFLAGS"
2591d31dbc53Smrg  CFLAGS="$CFLAGS -belf"
2592d31dbc53Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
2593d31dbc53Smrg    [AC_LANG_PUSH(C)
2594d31dbc53Smrg     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
2595d31dbc53Smrg     AC_LANG_POP])
2596d31dbc53Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2597d31dbc53Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2598d31dbc53Smrg    CFLAGS="$SAVE_CFLAGS"
2599d31dbc53Smrg  fi
2600d31dbc53Smrg  ;;
2601d31dbc53Smrgsparc*-*solaris*)
2602d31dbc53Smrg  # Find out which ABI we are using.
2603d31dbc53Smrg  echo 'int i;' > conftest.$ac_ext
2604d31dbc53Smrg  if AC_TRY_EVAL(ac_compile); then
2605d31dbc53Smrg    case `/usr/bin/file conftest.o` in
2606d31dbc53Smrg    *64-bit*)
2607d31dbc53Smrg      case $lt_cv_prog_gnu_ld in
2608d31dbc53Smrg      yes*) LD="${LD-ld} -m elf64_sparc" ;;
2609d31dbc53Smrg      *)    LD="${LD-ld} -64" ;;
261032b578d3Smrg      esac
2611d31dbc53Smrg      ;;
2612d31dbc53Smrg    esac
2613d31dbc53Smrg  fi
2614d31dbc53Smrg  rm -rf conftest*
2615d31dbc53Smrg  ;;
261632b578d3Smrg
2617d31dbc53SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
2618d31dbc53Smrg[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
2619d31dbc53Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
2620d31dbc53Smrg  AC_CHECK_TOOL(AS, as, false)
2621d31dbc53Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
2622d31dbc53Smrg  ;;
2623d31dbc53Smrg  ])
2624d31dbc53Smrgesac
262532b578d3Smrg
2626d31dbc53Smrgneed_locks="$enable_libtool_lock"
262732b578d3Smrg
2628d31dbc53Smrg])# _LT_AC_LOCK
262932b578d3Smrg
263032b578d3Smrg
2631d31dbc53Smrg# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
2632d31dbc53Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
2633d31dbc53Smrg# ----------------------------------------------------------------
2634d31dbc53Smrg# Check whether the given compiler option works
2635d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
2636d31dbc53Smrg[AC_REQUIRE([LT_AC_PROG_SED])
2637d31dbc53SmrgAC_CACHE_CHECK([$1], [$2],
2638d31dbc53Smrg  [$2=no
2639d31dbc53Smrg  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
2640d31dbc53Smrg   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
2641d31dbc53Smrg   lt_compiler_flag="$3"
2642d31dbc53Smrg   # Insert the option either (1) after the last *FLAGS variable, or
2643d31dbc53Smrg   # (2) before a word containing "conftest.", or (3) at the end.
2644d31dbc53Smrg   # Note that $ac_compile itself does not contain backslashes and begins
2645d31dbc53Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
2646d31dbc53Smrg   # The option is referenced via a variable to avoid confusing sed.
2647d31dbc53Smrg   lt_compile=`echo "$ac_compile" | $SED \
2648d31dbc53Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2649d31dbc53Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2650d31dbc53Smrg   -e 's:$: $lt_compiler_flag:'`
2651d31dbc53Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2652d31dbc53Smrg   (eval "$lt_compile" 2>conftest.err)
2653d31dbc53Smrg   ac_status=$?
2654d31dbc53Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
2655d31dbc53Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2656d31dbc53Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
2657d31dbc53Smrg     # The compiler can only warn and ignore the option if not recognized
2658d31dbc53Smrg     # So say no if there are warnings other than the usual output.
2659d31dbc53Smrg     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
2660d31dbc53Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
2661d31dbc53Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
2662d31dbc53Smrg       $2=yes
2663d31dbc53Smrg     fi
2664d31dbc53Smrg   fi
2665d31dbc53Smrg   $rm conftest*
2666d31dbc53Smrg])
266732b578d3Smrg
2668d31dbc53Smrgif test x"[$]$2" = xyes; then
2669d31dbc53Smrg    ifelse([$5], , :, [$5])
2670d31dbc53Smrgelse
2671d31dbc53Smrg    ifelse([$6], , :, [$6])
2672d31dbc53Smrgfi
2673d31dbc53Smrg])# AC_LIBTOOL_COMPILER_OPTION
267432b578d3Smrg
267532b578d3Smrg
2676d31dbc53Smrg# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
2677d31dbc53Smrg#                          [ACTION-SUCCESS], [ACTION-FAILURE])
2678d31dbc53Smrg# ------------------------------------------------------------
2679d31dbc53Smrg# Check whether the given compiler option works
2680d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
2681d31dbc53Smrg[AC_CACHE_CHECK([$1], [$2],
2682d31dbc53Smrg  [$2=no
2683d31dbc53Smrg   save_LDFLAGS="$LDFLAGS"
2684d31dbc53Smrg   LDFLAGS="$LDFLAGS $3"
2685d31dbc53Smrg   printf "$lt_simple_link_test_code" > conftest.$ac_ext
2686d31dbc53Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
2687d31dbc53Smrg     # The linker can only warn and ignore the option if not recognized
2688d31dbc53Smrg     # So say no if there are warnings
2689d31dbc53Smrg     if test -s conftest.err; then
2690d31dbc53Smrg       # Append any errors to the config.log.
2691d31dbc53Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
2692d31dbc53Smrg       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
2693d31dbc53Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
2694d31dbc53Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
2695d31dbc53Smrg         $2=yes
2696d31dbc53Smrg       fi
2697d31dbc53Smrg     else
2698d31dbc53Smrg       $2=yes
2699d31dbc53Smrg     fi
2700d31dbc53Smrg   fi
2701d31dbc53Smrg   $rm conftest*
2702d31dbc53Smrg   LDFLAGS="$save_LDFLAGS"
2703d31dbc53Smrg])
270432b578d3Smrg
2705d31dbc53Smrgif test x"[$]$2" = xyes; then
2706d31dbc53Smrg    ifelse([$4], , :, [$4])
2707d31dbc53Smrgelse
2708d31dbc53Smrg    ifelse([$5], , :, [$5])
2709d31dbc53Smrgfi
2710d31dbc53Smrg])# AC_LIBTOOL_LINKER_OPTION
271132b578d3Smrg
271232b578d3Smrg
2713d31dbc53Smrg# AC_LIBTOOL_SYS_MAX_CMD_LEN
2714d31dbc53Smrg# --------------------------
2715d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
2716d31dbc53Smrg[# find the maximum length of command line arguments
2717d31dbc53SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
2718d31dbc53SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
2719d31dbc53Smrg  i=0
2720d31dbc53Smrg  teststring="ABCD"
272132b578d3Smrg
2722d31dbc53Smrg  case $build_os in
2723d31dbc53Smrg  msdosdjgpp*)
2724d31dbc53Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
2725d31dbc53Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
2726d31dbc53Smrg    # during glob expansion).  Even if it were fixed, the result of this
2727d31dbc53Smrg    # check would be larger than it should be.
2728d31dbc53Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
272932b578d3Smrg    ;;
2730d31dbc53Smrg
2731d31dbc53Smrg  gnu*)
2732d31dbc53Smrg    # Under GNU Hurd, this test is not required because there is
2733d31dbc53Smrg    # no limit to the length of command line arguments.
2734d31dbc53Smrg    # Libtool will interpret -1 as no limit whatsoever
2735d31dbc53Smrg    lt_cv_sys_max_cmd_len=-1;
273632b578d3Smrg    ;;
2737d31dbc53Smrg
2738d31dbc53Smrg  cygwin* | mingw*)
2739d31dbc53Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
2740d31dbc53Smrg    # about 5 minutes as the teststring grows exponentially.
2741d31dbc53Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
2742d31dbc53Smrg    # you end up with a "frozen" computer, even though with patience
2743d31dbc53Smrg    # the test eventually succeeds (with a max line length of 256k).
2744d31dbc53Smrg    # Instead, let's just punt: use the minimum linelength reported by
2745d31dbc53Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
2746d31dbc53Smrg    lt_cv_sys_max_cmd_len=8192;
274732b578d3Smrg    ;;
2748d31dbc53Smrg
2749d31dbc53Smrg  amigaos*)
2750d31dbc53Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
2751d31dbc53Smrg    # So we just punt and use a minimum line length of 8192.
2752d31dbc53Smrg    lt_cv_sys_max_cmd_len=8192;
275332b578d3Smrg    ;;
2754d31dbc53Smrg
2755d31dbc53Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
2756d31dbc53Smrg    # This has been around since 386BSD, at least.  Likely further.
2757d31dbc53Smrg    if test -x /sbin/sysctl; then
2758d31dbc53Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
2759d31dbc53Smrg    elif test -x /usr/sbin/sysctl; then
2760d31dbc53Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
2761d31dbc53Smrg    else
2762d31dbc53Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
2763d31dbc53Smrg    fi
2764d31dbc53Smrg    # And add a safety zone
2765d31dbc53Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
2766d31dbc53Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
276732b578d3Smrg    ;;
276832b578d3Smrg
2769d31dbc53Smrg  interix*)
2770d31dbc53Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
2771d31dbc53Smrg    lt_cv_sys_max_cmd_len=196608
277232b578d3Smrg    ;;
277332b578d3Smrg
2774d31dbc53Smrg  osf*)
2775d31dbc53Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
2776d31dbc53Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
2777d31dbc53Smrg    # nice to cause kernel panics so lets avoid the loop below.
2778d31dbc53Smrg    # First set a reasonable default.
2779d31dbc53Smrg    lt_cv_sys_max_cmd_len=16384
2780d31dbc53Smrg    #
2781d31dbc53Smrg    if test -x /sbin/sysconfig; then
2782d31dbc53Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
2783d31dbc53Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
278432b578d3Smrg      esac
278532b578d3Smrg    fi
278632b578d3Smrg    ;;
2787d31dbc53Smrg  sco3.2v5*)
2788d31dbc53Smrg    lt_cv_sys_max_cmd_len=102400
278932b578d3Smrg    ;;
2790d31dbc53Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
2791d31dbc53Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
2792d31dbc53Smrg    if test -n "$kargmax"; then
2793d31dbc53Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ 	]]//'`
279432b578d3Smrg    else
2795d31dbc53Smrg      lt_cv_sys_max_cmd_len=32768
279632b578d3Smrg    fi
279732b578d3Smrg    ;;
2798d31dbc53Smrg  *)
2799d31dbc53Smrg    # If test is not a shell built-in, we'll probably end up computing a
2800d31dbc53Smrg    # maximum length that is only half of the actual maximum length, but
2801d31dbc53Smrg    # we can't tell.
2802d31dbc53Smrg    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
2803d31dbc53Smrg    while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
2804d31dbc53Smrg	       = "XX$teststring") >/dev/null 2>&1 &&
2805d31dbc53Smrg	    new_result=`expr "X$teststring" : ".*" 2>&1` &&
2806d31dbc53Smrg	    lt_cv_sys_max_cmd_len=$new_result &&
2807d31dbc53Smrg	    test $i != 17 # 1/2 MB should be enough
2808d31dbc53Smrg    do
2809d31dbc53Smrg      i=`expr $i + 1`
2810d31dbc53Smrg      teststring=$teststring$teststring
2811d31dbc53Smrg    done
2812d31dbc53Smrg    teststring=
2813d31dbc53Smrg    # Add a significant safety factor because C++ compilers can tack on massive
2814d31dbc53Smrg    # amounts of additional arguments before passing them to the linker.
2815d31dbc53Smrg    # It appears as though 1/2 is a usable value.
2816d31dbc53Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
2817d31dbc53Smrg    ;;
2818d31dbc53Smrg  esac
2819d31dbc53Smrg])
2820d31dbc53Smrgif test -n $lt_cv_sys_max_cmd_len ; then
2821d31dbc53Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
2822d31dbc53Smrgelse
2823d31dbc53Smrg  AC_MSG_RESULT(none)
2824d31dbc53Smrgfi
2825d31dbc53Smrg])# AC_LIBTOOL_SYS_MAX_CMD_LEN
282632b578d3Smrg
282732b578d3Smrg
2828d31dbc53Smrg# _LT_AC_CHECK_DLFCN
2829d31dbc53Smrg# ------------------
2830d31dbc53SmrgAC_DEFUN([_LT_AC_CHECK_DLFCN],
2831d31dbc53Smrg[AC_CHECK_HEADERS(dlfcn.h)dnl
2832d31dbc53Smrg])# _LT_AC_CHECK_DLFCN
283332b578d3Smrg
283432b578d3Smrg
2835d31dbc53Smrg# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
2836d31dbc53Smrg#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
2837d31dbc53Smrg# ---------------------------------------------------------------------
2838d31dbc53SmrgAC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
2839d31dbc53Smrg[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
2840d31dbc53Smrgif test "$cross_compiling" = yes; then :
2841d31dbc53Smrg  [$4]
2842d31dbc53Smrgelse
2843d31dbc53Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
2844d31dbc53Smrg  lt_status=$lt_dlunknown
2845d31dbc53Smrg  cat > conftest.$ac_ext <<EOF
2846d31dbc53Smrg[#line __oline__ "configure"
2847d31dbc53Smrg#include "confdefs.h"
284832b578d3Smrg
2849d31dbc53Smrg#if HAVE_DLFCN_H
2850d31dbc53Smrg#include <dlfcn.h>
2851d31dbc53Smrg#endif
285232b578d3Smrg
2853d31dbc53Smrg#include <stdio.h>
285432b578d3Smrg
2855d31dbc53Smrg#ifdef RTLD_GLOBAL
2856d31dbc53Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
2857d31dbc53Smrg#else
2858d31dbc53Smrg#  ifdef DL_GLOBAL
2859d31dbc53Smrg#    define LT_DLGLOBAL		DL_GLOBAL
2860d31dbc53Smrg#  else
2861d31dbc53Smrg#    define LT_DLGLOBAL		0
2862d31dbc53Smrg#  endif
2863d31dbc53Smrg#endif
286432b578d3Smrg
2865d31dbc53Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
2866d31dbc53Smrg   find out it does not work in some platform. */
2867d31dbc53Smrg#ifndef LT_DLLAZY_OR_NOW
2868d31dbc53Smrg#  ifdef RTLD_LAZY
2869d31dbc53Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
2870d31dbc53Smrg#  else
2871d31dbc53Smrg#    ifdef DL_LAZY
2872d31dbc53Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
2873d31dbc53Smrg#    else
2874d31dbc53Smrg#      ifdef RTLD_NOW
2875d31dbc53Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
2876d31dbc53Smrg#      else
2877d31dbc53Smrg#        ifdef DL_NOW
2878d31dbc53Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
2879d31dbc53Smrg#        else
2880d31dbc53Smrg#          define LT_DLLAZY_OR_NOW	0
2881d31dbc53Smrg#        endif
2882d31dbc53Smrg#      endif
2883d31dbc53Smrg#    endif
2884d31dbc53Smrg#  endif
2885d31dbc53Smrg#endif
288632b578d3Smrg
2887d31dbc53Smrg#ifdef __cplusplus
2888d31dbc53Smrgextern "C" void exit (int);
2889d31dbc53Smrg#endif
289032b578d3Smrg
2891d31dbc53Smrgvoid fnord() { int i=42;}
2892d31dbc53Smrgint main ()
2893d31dbc53Smrg{
2894d31dbc53Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
2895d31dbc53Smrg  int status = $lt_dlunknown;
289632b578d3Smrg
2897d31dbc53Smrg  if (self)
2898d31dbc53Smrg    {
2899d31dbc53Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
2900d31dbc53Smrg      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
2901d31dbc53Smrg      /* dlclose (self); */
2902d31dbc53Smrg    }
2903d31dbc53Smrg  else
2904d31dbc53Smrg    puts (dlerror ());
290532b578d3Smrg
2906d31dbc53Smrg    exit (status);
2907d31dbc53Smrg}]
2908d31dbc53SmrgEOF
2909d31dbc53Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
2910d31dbc53Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
2911d31dbc53Smrg    lt_status=$?
2912d31dbc53Smrg    case x$lt_status in
2913d31dbc53Smrg      x$lt_dlno_uscore) $1 ;;
2914d31dbc53Smrg      x$lt_dlneed_uscore) $2 ;;
2915d31dbc53Smrg      x$lt_dlunknown|x*) $3 ;;
2916d31dbc53Smrg    esac
2917d31dbc53Smrg  else :
2918d31dbc53Smrg    # compilation failed
2919d31dbc53Smrg    $3
2920d31dbc53Smrg  fi
2921d31dbc53Smrgfi
2922d31dbc53Smrgrm -fr conftest*
2923d31dbc53Smrg])# _LT_AC_TRY_DLOPEN_SELF
292432b578d3Smrg
292532b578d3Smrg
2926d31dbc53Smrg# AC_LIBTOOL_DLOPEN_SELF
2927d31dbc53Smrg# ----------------------
2928d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
2929d31dbc53Smrg[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
2930d31dbc53Smrgif test "x$enable_dlopen" != xyes; then
2931d31dbc53Smrg  enable_dlopen=unknown
2932d31dbc53Smrg  enable_dlopen_self=unknown
2933d31dbc53Smrg  enable_dlopen_self_static=unknown
2934d31dbc53Smrgelse
2935d31dbc53Smrg  lt_cv_dlopen=no
2936d31dbc53Smrg  lt_cv_dlopen_libs=
293732b578d3Smrg
2938d31dbc53Smrg  case $host_os in
2939d31dbc53Smrg  beos*)
2940d31dbc53Smrg    lt_cv_dlopen="load_add_on"
2941d31dbc53Smrg    lt_cv_dlopen_libs=
2942d31dbc53Smrg    lt_cv_dlopen_self=yes
294332b578d3Smrg    ;;
294432b578d3Smrg
2945d31dbc53Smrg  mingw* | pw32*)
2946d31dbc53Smrg    lt_cv_dlopen="LoadLibrary"
2947d31dbc53Smrg    lt_cv_dlopen_libs=
2948d31dbc53Smrg   ;;
294932b578d3Smrg
2950d31dbc53Smrg  cygwin*)
2951d31dbc53Smrg    lt_cv_dlopen="dlopen"
2952d31dbc53Smrg    lt_cv_dlopen_libs=
2953d31dbc53Smrg   ;;
295432b578d3Smrg
2955d31dbc53Smrg  darwin*)
2956d31dbc53Smrg  # if libdl is installed we need to link against it
2957d31dbc53Smrg    AC_CHECK_LIB([dl], [dlopen],
2958d31dbc53Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
2959d31dbc53Smrg    lt_cv_dlopen="dyld"
2960d31dbc53Smrg    lt_cv_dlopen_libs=
2961d31dbc53Smrg    lt_cv_dlopen_self=yes
2962d31dbc53Smrg    ])
2963d31dbc53Smrg   ;;
296432b578d3Smrg
2965d31dbc53Smrg  *)
2966d31dbc53Smrg    AC_CHECK_FUNC([shl_load],
2967d31dbc53Smrg	  [lt_cv_dlopen="shl_load"],
2968d31dbc53Smrg      [AC_CHECK_LIB([dld], [shl_load],
2969d31dbc53Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
2970d31dbc53Smrg	[AC_CHECK_FUNC([dlopen],
2971d31dbc53Smrg	      [lt_cv_dlopen="dlopen"],
2972d31dbc53Smrg	  [AC_CHECK_LIB([dl], [dlopen],
2973d31dbc53Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
2974d31dbc53Smrg	    [AC_CHECK_LIB([svld], [dlopen],
2975d31dbc53Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
2976d31dbc53Smrg	      [AC_CHECK_LIB([dld], [dld_link],
2977d31dbc53Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
2978d31dbc53Smrg	      ])
2979d31dbc53Smrg	    ])
2980d31dbc53Smrg	  ])
2981d31dbc53Smrg	])
2982d31dbc53Smrg      ])
298332b578d3Smrg    ;;
2984d31dbc53Smrg  esac
298532b578d3Smrg
2986d31dbc53Smrg  if test "x$lt_cv_dlopen" != xno; then
2987d31dbc53Smrg    enable_dlopen=yes
2988d31dbc53Smrg  else
2989d31dbc53Smrg    enable_dlopen=no
2990d31dbc53Smrg  fi
299132b578d3Smrg
2992d31dbc53Smrg  case $lt_cv_dlopen in
2993d31dbc53Smrg  dlopen)
2994d31dbc53Smrg    save_CPPFLAGS="$CPPFLAGS"
2995d31dbc53Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
299632b578d3Smrg
2997d31dbc53Smrg    save_LDFLAGS="$LDFLAGS"
2998d31dbc53Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
299932b578d3Smrg
3000d31dbc53Smrg    save_LIBS="$LIBS"
3001d31dbc53Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
300232b578d3Smrg
3003d31dbc53Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
3004d31dbc53Smrg	  lt_cv_dlopen_self, [dnl
3005d31dbc53Smrg	  _LT_AC_TRY_DLOPEN_SELF(
3006d31dbc53Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
3007d31dbc53Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
3008d31dbc53Smrg    ])
300932b578d3Smrg
3010d31dbc53Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
3011d31dbc53Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
3012d31dbc53Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
3013d31dbc53Smrg    	  lt_cv_dlopen_self_static, [dnl
3014d31dbc53Smrg	  _LT_AC_TRY_DLOPEN_SELF(
3015d31dbc53Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
3016d31dbc53Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
3017d31dbc53Smrg      ])
3018d31dbc53Smrg    fi
301932b578d3Smrg
3020d31dbc53Smrg    CPPFLAGS="$save_CPPFLAGS"
3021d31dbc53Smrg    LDFLAGS="$save_LDFLAGS"
3022d31dbc53Smrg    LIBS="$save_LIBS"
3023d31dbc53Smrg    ;;
3024d31dbc53Smrg  esac
302532b578d3Smrg
3026d31dbc53Smrg  case $lt_cv_dlopen_self in
3027d31dbc53Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
3028d31dbc53Smrg  *) enable_dlopen_self=unknown ;;
3029d31dbc53Smrg  esac
303032b578d3Smrg
3031d31dbc53Smrg  case $lt_cv_dlopen_self_static in
3032d31dbc53Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
3033d31dbc53Smrg  *) enable_dlopen_self_static=unknown ;;
3034d31dbc53Smrg  esac
3035d31dbc53Smrgfi
3036d31dbc53Smrg])# AC_LIBTOOL_DLOPEN_SELF
303732b578d3Smrg
303832b578d3Smrg
3039d31dbc53Smrg# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
3040d31dbc53Smrg# ---------------------------------
3041d31dbc53Smrg# Check to see if options -c and -o are simultaneously supported by compiler
3042d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
3043d31dbc53Smrg[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
3044d31dbc53SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
3045d31dbc53Smrg  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
3046d31dbc53Smrg  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
3047d31dbc53Smrg   $rm -r conftest 2>/dev/null
3048d31dbc53Smrg   mkdir conftest
3049d31dbc53Smrg   cd conftest
3050d31dbc53Smrg   mkdir out
3051d31dbc53Smrg   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
305232b578d3Smrg
3053d31dbc53Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
3054d31dbc53Smrg   # Insert the option either (1) after the last *FLAGS variable, or
3055d31dbc53Smrg   # (2) before a word containing "conftest.", or (3) at the end.
3056d31dbc53Smrg   # Note that $ac_compile itself does not contain backslashes and begins
3057d31dbc53Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
3058d31dbc53Smrg   lt_compile=`echo "$ac_compile" | $SED \
3059d31dbc53Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
3060d31dbc53Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
3061d31dbc53Smrg   -e 's:$: $lt_compiler_flag:'`
3062d31dbc53Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
3063d31dbc53Smrg   (eval "$lt_compile" 2>out/conftest.err)
3064d31dbc53Smrg   ac_status=$?
3065d31dbc53Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
3066d31dbc53Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
3067d31dbc53Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
3068d31dbc53Smrg   then
3069d31dbc53Smrg     # The compiler can only warn and ignore the option if not recognized
3070d31dbc53Smrg     # So say no if there are warnings
3071d31dbc53Smrg     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
3072d31dbc53Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
3073d31dbc53Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
3074d31dbc53Smrg       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
3075d31dbc53Smrg     fi
3076d31dbc53Smrg   fi
3077d31dbc53Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
3078d31dbc53Smrg   $rm conftest*
3079d31dbc53Smrg   # SGI C++ compiler will create directory out/ii_files/ for
3080d31dbc53Smrg   # template instantiation
3081d31dbc53Smrg   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
3082d31dbc53Smrg   $rm out/* && rmdir out
3083d31dbc53Smrg   cd ..
3084d31dbc53Smrg   rmdir conftest
3085d31dbc53Smrg   $rm conftest*
3086d31dbc53Smrg])
3087d31dbc53Smrg])# AC_LIBTOOL_PROG_CC_C_O
308832b578d3Smrg
308932b578d3Smrg
3090d31dbc53Smrg# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
3091d31dbc53Smrg# -----------------------------------------
3092d31dbc53Smrg# Check to see if we can do hard links to lock some files if needed
3093d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
3094d31dbc53Smrg[AC_REQUIRE([_LT_AC_LOCK])dnl
309532b578d3Smrg
3096d31dbc53Smrghard_links="nottested"
3097d31dbc53Smrgif test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
3098d31dbc53Smrg  # do not overwrite the value of need_locks provided by the user
3099d31dbc53Smrg  AC_MSG_CHECKING([if we can lock with hard links])
3100d31dbc53Smrg  hard_links=yes
3101d31dbc53Smrg  $rm conftest*
3102d31dbc53Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
3103d31dbc53Smrg  touch conftest.a
3104d31dbc53Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
3105d31dbc53Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
3106d31dbc53Smrg  AC_MSG_RESULT([$hard_links])
3107d31dbc53Smrg  if test "$hard_links" = no; then
3108d31dbc53Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
3109d31dbc53Smrg    need_locks=warn
3110d31dbc53Smrg  fi
3111d31dbc53Smrgelse
3112d31dbc53Smrg  need_locks=no
3113d31dbc53Smrgfi
3114d31dbc53Smrg])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
311532b578d3Smrg
311632b578d3Smrg
3117d31dbc53Smrg# AC_LIBTOOL_OBJDIR
3118d31dbc53Smrg# -----------------
3119d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_OBJDIR],
3120d31dbc53Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
3121d31dbc53Smrg[rm -f .libs 2>/dev/null
3122d31dbc53Smrgmkdir .libs 2>/dev/null
3123d31dbc53Smrgif test -d .libs; then
3124d31dbc53Smrg  lt_cv_objdir=.libs
312532b578d3Smrgelse
3126d31dbc53Smrg  # MS-DOS does not allow filenames that begin with a dot.
3127d31dbc53Smrg  lt_cv_objdir=_libs
312832b578d3Smrgfi
3129d31dbc53Smrgrmdir .libs 2>/dev/null])
3130d31dbc53Smrgobjdir=$lt_cv_objdir
3131d31dbc53Smrg])# AC_LIBTOOL_OBJDIR
313232b578d3Smrg
313332b578d3Smrg
3134d31dbc53Smrg# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
3135d31dbc53Smrg# ----------------------------------------------
3136d31dbc53Smrg# Check hardcoding attributes.
3137d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
3138d31dbc53Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
3139d31dbc53Smrg_LT_AC_TAGVAR(hardcode_action, $1)=
3140d31dbc53Smrgif test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
3141d31dbc53Smrg   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
3142d31dbc53Smrg   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
314332b578d3Smrg
3144d31dbc53Smrg  # We can hardcode non-existant directories.
3145d31dbc53Smrg  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
3146d31dbc53Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
3147d31dbc53Smrg     # have to relink, otherwise we might link with an installed library
3148d31dbc53Smrg     # when we should be linking with a yet-to-be-installed one
3149d31dbc53Smrg     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
3150d31dbc53Smrg     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
3151d31dbc53Smrg    # Linking always hardcodes the temporary library directory.
3152d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_action, $1)=relink
3153d31dbc53Smrg  else
3154d31dbc53Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
3155d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
3156d31dbc53Smrg  fi
3157d31dbc53Smrgelse
3158d31dbc53Smrg  # We cannot hardcode anything, or else we can only hardcode existing
3159d31dbc53Smrg  # directories.
3160d31dbc53Smrg  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
3161d31dbc53Smrgfi
3162d31dbc53SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
316332b578d3Smrg
3164d31dbc53Smrgif test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
3165d31dbc53Smrg  # Fast installation is not supported
3166d31dbc53Smrg  enable_fast_install=no
3167d31dbc53Smrgelif test "$shlibpath_overrides_runpath" = yes ||
3168d31dbc53Smrg     test "$enable_shared" = no; then
3169d31dbc53Smrg  # Fast installation is not necessary
3170d31dbc53Smrg  enable_fast_install=needless
3171d31dbc53Smrgfi
3172d31dbc53Smrg])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
317332b578d3Smrg
3174d31dbc53Smrg
3175d31dbc53Smrg# AC_LIBTOOL_SYS_LIB_STRIP
3176d31dbc53Smrg# ------------------------
3177d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
3178d31dbc53Smrg[striplib=
3179d31dbc53Smrgold_striplib=
3180d31dbc53SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
3181d31dbc53Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
3182d31dbc53Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
3183d31dbc53Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
3184d31dbc53Smrg  AC_MSG_RESULT([yes])
3185d31dbc53Smrgelse
3186d31dbc53Smrg# FIXME - insert some real tests, host_os isn't really good enough
3187d31dbc53Smrg  case $host_os in
3188d31dbc53Smrg   darwin*)
3189d31dbc53Smrg       if test -n "$STRIP" ; then
3190d31dbc53Smrg         striplib="$STRIP -x"
3191d31dbc53Smrg         AC_MSG_RESULT([yes])
3192d31dbc53Smrg       else
3193d31dbc53Smrg  AC_MSG_RESULT([no])
3194d31dbc53Smrgfi
3195d31dbc53Smrg       ;;
3196d31dbc53Smrg   *)
3197d31dbc53Smrg  AC_MSG_RESULT([no])
319832b578d3Smrg    ;;
319932b578d3Smrg  esac
3200d31dbc53Smrgfi
3201d31dbc53Smrg])# AC_LIBTOOL_SYS_LIB_STRIP
320232b578d3Smrg
320332b578d3Smrg
3204d31dbc53Smrg# AC_LIBTOOL_SYS_DYNAMIC_LINKER
3205d31dbc53Smrg# -----------------------------
3206d31dbc53Smrg# PORTME Fill in your ld.so characteristics
3207d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
3208d31dbc53Smrg[AC_MSG_CHECKING([dynamic linker characteristics])
3209d31dbc53Smrglibrary_names_spec=
3210d31dbc53Smrglibname_spec='lib$name'
3211d31dbc53Smrgsoname_spec=
3212d31dbc53Smrgshrext_cmds=".so"
3213d31dbc53Smrgpostinstall_cmds=
3214d31dbc53Smrgpostuninstall_cmds=
3215d31dbc53Smrgfinish_cmds=
3216d31dbc53Smrgfinish_eval=
3217d31dbc53Smrgshlibpath_var=
3218d31dbc53Smrgshlibpath_overrides_runpath=unknown
3219d31dbc53Smrgversion_type=none
3220d31dbc53Smrgdynamic_linker="$host_os ld.so"
3221d31dbc53Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
3222d31dbc53Smrgif test "$GCC" = yes; then
3223d31dbc53Smrg  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
3224d31dbc53Smrg  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
3225d31dbc53Smrg    # if the path contains ";" then we assume it to be the separator
3226d31dbc53Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
3227d31dbc53Smrg    # assumed that no part of a normal pathname contains ";" but that should
3228d31dbc53Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
3229d31dbc53Smrg    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
3230d31dbc53Smrg  else
3231d31dbc53Smrg    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
3232d31dbc53Smrg  fi
3233d31dbc53Smrgelse
3234d31dbc53Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
3235d31dbc53Smrgfi
3236d31dbc53Smrgneed_lib_prefix=unknown
3237d31dbc53Smrghardcode_into_libs=no
323832b578d3Smrg
3239d31dbc53Smrg# when you set need_version to no, make sure it does not cause -set_version
3240d31dbc53Smrg# flags to be left without arguments
3241d31dbc53Smrgneed_version=unknown
324232b578d3Smrg
324332b578d3Smrgcase $host_os in
324432b578d3Smrgaix3*)
3245d31dbc53Smrg  version_type=linux
3246d31dbc53Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
3247d31dbc53Smrg  shlibpath_var=LIBPATH
3248d31dbc53Smrg
3249d31dbc53Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
3250d31dbc53Smrg  soname_spec='${libname}${release}${shared_ext}$major'
325132b578d3Smrg  ;;
3252d31dbc53Smrg
325332b578d3Smrgaix4* | aix5*)
3254d31dbc53Smrg  version_type=linux
3255d31dbc53Smrg  need_lib_prefix=no
3256d31dbc53Smrg  need_version=no
3257d31dbc53Smrg  hardcode_into_libs=yes
3258d31dbc53Smrg  if test "$host_cpu" = ia64; then
3259d31dbc53Smrg    # AIX 5 supports IA64
3260d31dbc53Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
3261d31dbc53Smrg    shlibpath_var=LD_LIBRARY_PATH
3262d31dbc53Smrg  else
3263d31dbc53Smrg    # With GCC up to 2.95.x, collect2 would create an import file
3264d31dbc53Smrg    # for dependence libraries.  The import file would start with
3265d31dbc53Smrg    # the line `#! .'.  This would cause the generated library to
3266d31dbc53Smrg    # depend on `.', always an invalid library.  This was fixed in
3267d31dbc53Smrg    # development snapshots of GCC prior to 3.0.
3268d31dbc53Smrg    case $host_os in
3269d31dbc53Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
3270d31dbc53Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
3271d31dbc53Smrg	   echo ' yes '
3272d31dbc53Smrg	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
3273d31dbc53Smrg	:
3274d31dbc53Smrg      else
3275d31dbc53Smrg	can_build_shared=no
3276d31dbc53Smrg      fi
3277d31dbc53Smrg      ;;
3278d31dbc53Smrg    esac
3279d31dbc53Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
3280d31dbc53Smrg    # soname into executable. Probably we can add versioning support to
3281d31dbc53Smrg    # collect2, so additional links can be useful in future.
3282d31dbc53Smrg    if test "$aix_use_runtimelinking" = yes; then
3283d31dbc53Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
3284d31dbc53Smrg      # instead of lib<name>.a to let people know that these are not
3285d31dbc53Smrg      # typical AIX shared libraries.
3286d31dbc53Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3287d31dbc53Smrg    else
3288d31dbc53Smrg      # We preserve .a as extension for shared libraries through AIX4.2
3289d31dbc53Smrg      # and later when we are not doing run time linking.
3290d31dbc53Smrg      library_names_spec='${libname}${release}.a $libname.a'
3291d31dbc53Smrg      soname_spec='${libname}${release}${shared_ext}$major'
3292d31dbc53Smrg    fi
3293d31dbc53Smrg    shlibpath_var=LIBPATH
329432b578d3Smrg  fi
329532b578d3Smrg  ;;
329632b578d3Smrg
3297d31dbc53Smrgamigaos*)
3298d31dbc53Smrg  library_names_spec='$libname.ixlibrary $libname.a'
3299d31dbc53Smrg  # Create ${libname}_ixlibrary.a entries in /sys/libs.
3300d31dbc53Smrg  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'
3301d31dbc53Smrg  ;;
330232b578d3Smrg
3303d31dbc53Smrgbeos*)
3304d31dbc53Smrg  library_names_spec='${libname}${shared_ext}'
3305d31dbc53Smrg  dynamic_linker="$host_os ld.so"
3306d31dbc53Smrg  shlibpath_var=LIBRARY_PATH
3307d31dbc53Smrg  ;;
330832b578d3Smrg
3309d31dbc53Smrgbsdi[[45]]*)
3310d31dbc53Smrg  version_type=linux
3311d31dbc53Smrg  need_version=no
3312d31dbc53Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3313d31dbc53Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3314d31dbc53Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
3315d31dbc53Smrg  shlibpath_var=LD_LIBRARY_PATH
3316d31dbc53Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
3317d31dbc53Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
3318d31dbc53Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
3319d31dbc53Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
3320d31dbc53Smrg  # libtool to hard-code these into programs
3321d31dbc53Smrg  ;;
332232b578d3Smrg
3323d31dbc53Smrgcygwin* | mingw* | pw32*)
3324d31dbc53Smrg  version_type=windows
3325d31dbc53Smrg  shrext_cmds=".dll"
3326d31dbc53Smrg  need_version=no
3327d31dbc53Smrg  need_lib_prefix=no
332832b578d3Smrg
3329d31dbc53Smrg  case $GCC,$host_os in
3330d31dbc53Smrg  yes,cygwin* | yes,mingw* | yes,pw32*)
3331d31dbc53Smrg    library_names_spec='$libname.dll.a'
3332d31dbc53Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
3333d31dbc53Smrg    postinstall_cmds='base_file=`basename \${file}`~
3334d31dbc53Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
3335d31dbc53Smrg      dldir=$destdir/`dirname \$dlpath`~
3336d31dbc53Smrg      test -d \$dldir || mkdir -p \$dldir~
3337d31dbc53Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
3338d31dbc53Smrg      chmod a+x \$dldir/$dlname'
3339d31dbc53Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
3340d31dbc53Smrg      dlpath=$dir/\$dldll~
3341d31dbc53Smrg       $rm \$dlpath'
3342d31dbc53Smrg    shlibpath_overrides_runpath=yes
334332b578d3Smrg
3344d31dbc53Smrg    case $host_os in
3345d31dbc53Smrg    cygwin*)
3346d31dbc53Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
3347d31dbc53Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3348d31dbc53Smrg      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
3349d31dbc53Smrg      ;;
3350d31dbc53Smrg    mingw*)
3351d31dbc53Smrg      # MinGW DLLs use traditional 'lib' prefix
3352d31dbc53Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3353d31dbc53Smrg      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
3354d31dbc53Smrg      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
3355d31dbc53Smrg        # It is most probably a Windows format PATH printed by
3356d31dbc53Smrg        # mingw gcc, but we are running on Cygwin. Gcc prints its search
3357d31dbc53Smrg        # path with ; separators, and with drive letters. We can handle the
3358d31dbc53Smrg        # drive letters (cygwin fileutils understands them), so leave them,
3359d31dbc53Smrg        # especially as we might pass files found there to a mingw objdump,
3360d31dbc53Smrg        # which wouldn't understand a cygwinified path. Ahh.
3361d31dbc53Smrg        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
3362d31dbc53Smrg      else
3363d31dbc53Smrg        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
3364d31dbc53Smrg      fi
3365d31dbc53Smrg      ;;
3366d31dbc53Smrg    pw32*)
3367d31dbc53Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
3368d31dbc53Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3369d31dbc53Smrg      ;;
3370d31dbc53Smrg    esac
3371d31dbc53Smrg    ;;
337232b578d3Smrg
3373d31dbc53Smrg  *)
3374d31dbc53Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
3375d31dbc53Smrg    ;;
3376d31dbc53Smrg  esac
3377d31dbc53Smrg  dynamic_linker='Win32 ld.exe'
3378d31dbc53Smrg  # FIXME: first we should search . and the directory the executable is in
3379d31dbc53Smrg  shlibpath_var=PATH
3380d31dbc53Smrg  ;;
338132b578d3Smrg
3382d31dbc53Smrgdarwin* | rhapsody*)
3383d31dbc53Smrg  dynamic_linker="$host_os dyld"
3384d31dbc53Smrg  version_type=darwin
3385d31dbc53Smrg  need_lib_prefix=no
3386d31dbc53Smrg  need_version=no
3387d31dbc53Smrg  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
3388d31dbc53Smrg  soname_spec='${libname}${release}${major}$shared_ext'
3389d31dbc53Smrg  shlibpath_overrides_runpath=yes
3390d31dbc53Smrg  shlibpath_var=DYLD_LIBRARY_PATH
3391d31dbc53Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
3392d31dbc53Smrg  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
3393d31dbc53Smrg  if test "$GCC" = yes; then
3394d31dbc53Smrg    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"`
3395d31dbc53Smrg  else
3396d31dbc53Smrg    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
3397d31dbc53Smrg  fi
3398d31dbc53Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
3399d31dbc53Smrg  ;;
340032b578d3Smrg
3401d31dbc53Smrgdgux*)
3402d31dbc53Smrg  version_type=linux
3403d31dbc53Smrg  need_lib_prefix=no
3404d31dbc53Smrg  need_version=no
3405d31dbc53Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
3406d31dbc53Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3407d31dbc53Smrg  shlibpath_var=LD_LIBRARY_PATH
3408d31dbc53Smrg  ;;
340932b578d3Smrg
3410d31dbc53Smrgfreebsd1*)
3411d31dbc53Smrg  dynamic_linker=no
3412d31dbc53Smrg  ;;
341332b578d3Smrg
3414d31dbc53Smrgkfreebsd*-gnu)
3415d31dbc53Smrg  version_type=linux
3416d31dbc53Smrg  need_lib_prefix=no
3417d31dbc53Smrg  need_version=no
3418d31dbc53Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3419d31dbc53Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3420d31dbc53Smrg  shlibpath_var=LD_LIBRARY_PATH
3421d31dbc53Smrg  shlibpath_overrides_runpath=no
3422d31dbc53Smrg  hardcode_into_libs=yes
3423d31dbc53Smrg  dynamic_linker='GNU ld.so'
3424d31dbc53Smrg  ;;
342532b578d3Smrg
3426d31dbc53Smrgfreebsd* | dragonfly*)
3427d31dbc53Smrg  # DragonFly does not have aout.  When/if they implement a new
3428d31dbc53Smrg  # versioning mechanism, adjust this.
3429d31dbc53Smrg  if test -x /usr/bin/objformat; then
3430d31dbc53Smrg    objformat=`/usr/bin/objformat`
3431d31dbc53Smrg  else
3432d31dbc53Smrg    case $host_os in
3433d31dbc53Smrg    freebsd[[123]]*) objformat=aout ;;
3434d31dbc53Smrg    *) objformat=elf ;;
3435d31dbc53Smrg    esac
3436d31dbc53Smrg  fi
3437d31dbc53Smrg  version_type=freebsd-$objformat
3438d31dbc53Smrg  case $version_type in
3439d31dbc53Smrg    freebsd-elf*)
3440d31dbc53Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
3441d31dbc53Smrg      need_version=no
3442d31dbc53Smrg      need_lib_prefix=no
3443d31dbc53Smrg      ;;
3444d31dbc53Smrg    freebsd-*)
3445d31dbc53Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
3446d31dbc53Smrg      need_version=yes
3447d31dbc53Smrg      ;;
3448d31dbc53Smrg  esac
3449d31dbc53Smrg  shlibpath_var=LD_LIBRARY_PATH
3450d31dbc53Smrg  case $host_os in
3451d31dbc53Smrg  freebsd2*)
3452d31dbc53Smrg    shlibpath_overrides_runpath=yes
3453d31dbc53Smrg    ;;
3454d31dbc53Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
3455d31dbc53Smrg    shlibpath_overrides_runpath=yes
3456d31dbc53Smrg    hardcode_into_libs=yes
3457d31dbc53Smrg    ;;
3458d31dbc53Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
3459d31dbc53Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
3460d31dbc53Smrg    shlibpath_overrides_runpath=no
3461d31dbc53Smrg    hardcode_into_libs=yes
3462d31dbc53Smrg    ;;
3463d31dbc53Smrg  freebsd*) # from 4.6 on
3464d31dbc53Smrg    shlibpath_overrides_runpath=yes
3465d31dbc53Smrg    hardcode_into_libs=yes
3466d31dbc53Smrg    ;;
3467d31dbc53Smrg  esac
3468d31dbc53Smrg  ;;
346932b578d3Smrg
3470d31dbc53Smrggnu*)
3471d31dbc53Smrg  version_type=linux
3472d31dbc53Smrg  need_lib_prefix=no
3473d31dbc53Smrg  need_version=no
3474d31dbc53Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
3475d31dbc53Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3476d31dbc53Smrg  shlibpath_var=LD_LIBRARY_PATH
3477d31dbc53Smrg  hardcode_into_libs=yes
3478d31dbc53Smrg  ;;
347932b578d3Smrg
3480d31dbc53Smrghpux9* | hpux10* | hpux11*)
3481d31dbc53Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
3482d31dbc53Smrg  # link against other versions.
3483d31dbc53Smrg  version_type=sunos
3484d31dbc53Smrg  need_lib_prefix=no
3485d31dbc53Smrg  need_version=no
3486d31dbc53Smrg  case $host_cpu in
3487d31dbc53Smrg  ia64*)
3488d31dbc53Smrg    shrext_cmds='.so'
3489d31dbc53Smrg    hardcode_into_libs=yes
3490d31dbc53Smrg    dynamic_linker="$host_os dld.so"
3491d31dbc53Smrg    shlibpath_var=LD_LIBRARY_PATH
3492d31dbc53Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
3493d31dbc53Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3494d31dbc53Smrg    soname_spec='${libname}${release}${shared_ext}$major'
3495d31dbc53Smrg    if test "X$HPUX_IA64_MODE" = X32; then
3496d31dbc53Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
3497d31dbc53Smrg    else
3498d31dbc53Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
3499d31dbc53Smrg    fi
3500d31dbc53Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3501d31dbc53Smrg    ;;
3502d31dbc53Smrg   hppa*64*)
3503d31dbc53Smrg     shrext_cmds='.sl'
3504d31dbc53Smrg     hardcode_into_libs=yes
3505d31dbc53Smrg     dynamic_linker="$host_os dld.sl"
3506d31dbc53Smrg     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
3507d31dbc53Smrg     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
3508d31dbc53Smrg     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3509d31dbc53Smrg     soname_spec='${libname}${release}${shared_ext}$major'
3510d31dbc53Smrg     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
3511d31dbc53Smrg     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3512d31dbc53Smrg     ;;
3513d31dbc53Smrg   *)
3514d31dbc53Smrg    shrext_cmds='.sl'
3515d31dbc53Smrg    dynamic_linker="$host_os dld.sl"
3516d31dbc53Smrg    shlibpath_var=SHLIB_PATH
3517d31dbc53Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
3518d31dbc53Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3519d31dbc53Smrg    soname_spec='${libname}${release}${shared_ext}$major'
3520d31dbc53Smrg    ;;
3521d31dbc53Smrg  esac
3522d31dbc53Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555.
3523d31dbc53Smrg  postinstall_cmds='chmod 555 $lib'
3524d31dbc53Smrg  ;;
352532b578d3Smrg
3526d31dbc53Smrginterix3*)
3527d31dbc53Smrg  version_type=linux
3528d31dbc53Smrg  need_lib_prefix=no
3529d31dbc53Smrg  need_version=no
3530d31dbc53Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3531d31dbc53Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3532d31dbc53Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
3533d31dbc53Smrg  shlibpath_var=LD_LIBRARY_PATH
3534d31dbc53Smrg  shlibpath_overrides_runpath=no
3535d31dbc53Smrg  hardcode_into_libs=yes
3536d31dbc53Smrg  ;;
353732b578d3Smrg
3538d31dbc53Smrgirix5* | irix6* | nonstopux*)
3539d31dbc53Smrg  case $host_os in
3540d31dbc53Smrg    nonstopux*) version_type=nonstopux ;;
3541d31dbc53Smrg    *)
3542d31dbc53Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
3543d31dbc53Smrg		version_type=linux
3544d31dbc53Smrg	else
3545d31dbc53Smrg		version_type=irix
3546d31dbc53Smrg	fi ;;
3547d31dbc53Smrg  esac
3548d31dbc53Smrg  need_lib_prefix=no
3549d31dbc53Smrg  need_version=no
3550d31dbc53Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3551d31dbc53Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
3552d31dbc53Smrg  case $host_os in
3553d31dbc53Smrg  irix5* | nonstopux*)
3554d31dbc53Smrg    libsuff= shlibsuff=
3555d31dbc53Smrg    ;;
3556d31dbc53Smrg  *)
3557d31dbc53Smrg    case $LD in # libtool.m4 will add one of these switches to LD
3558d31dbc53Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
3559d31dbc53Smrg      libsuff= shlibsuff= libmagic=32-bit;;
3560d31dbc53Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
3561d31dbc53Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
3562d31dbc53Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
3563d31dbc53Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
3564d31dbc53Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
3565d31dbc53Smrg    esac
3566d31dbc53Smrg    ;;
3567d31dbc53Smrg  esac
3568d31dbc53Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
3569d31dbc53Smrg  shlibpath_overrides_runpath=no
3570d31dbc53Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
3571d31dbc53Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
3572d31dbc53Smrg  hardcode_into_libs=yes
3573d31dbc53Smrg  ;;
357432b578d3Smrg
3575d31dbc53Smrg# No shared lib support for Linux oldld, aout, or coff.
3576d31dbc53Smrglinux*oldld* | linux*aout* | linux*coff*)
3577d31dbc53Smrg  dynamic_linker=no
3578d31dbc53Smrg  ;;
357932b578d3Smrg
3580d31dbc53Smrg# This must be Linux ELF.
3581d31dbc53Smrglinux*)
3582d31dbc53Smrg  version_type=linux
3583d31dbc53Smrg  need_lib_prefix=no
3584d31dbc53Smrg  need_version=no
3585d31dbc53Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3586d31dbc53Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3587d31dbc53Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
3588d31dbc53Smrg  shlibpath_var=LD_LIBRARY_PATH
3589d31dbc53Smrg  shlibpath_overrides_runpath=no
3590d31dbc53Smrg  # This implies no fast_install, which is unacceptable.
3591d31dbc53Smrg  # Some rework will be needed to allow for fast_install
3592d31dbc53Smrg  # before this can be enabled.
3593d31dbc53Smrg  hardcode_into_libs=yes
359432b578d3Smrg
3595d31dbc53Smrg  # Append ld.so.conf contents to the search path
3596d31dbc53Smrg  if test -f /etc/ld.so.conf; then
3597d31dbc53Smrg    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' ' '`
3598d31dbc53Smrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
3599d31dbc53Smrg  fi
360032b578d3Smrg
3601d31dbc53Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
3602d31dbc53Smrg  # powerpc, because MkLinux only supported shared libraries with the
3603d31dbc53Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
3604d31dbc53Smrg  # most powerpc-linux boxes support dynamic linking these days and
3605d31dbc53Smrg  # people can always --disable-shared, the test was removed, and we
3606d31dbc53Smrg  # assume the GNU/Linux dynamic linker is in use.
3607d31dbc53Smrg  dynamic_linker='GNU/Linux ld.so'
3608d31dbc53Smrg  ;;
360932b578d3Smrg
3610d31dbc53Smrgknetbsd*-gnu)
3611d31dbc53Smrg  version_type=linux
3612d31dbc53Smrg  need_lib_prefix=no
3613d31dbc53Smrg  need_version=no
3614d31dbc53Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3615d31dbc53Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3616d31dbc53Smrg  shlibpath_var=LD_LIBRARY_PATH
3617d31dbc53Smrg  shlibpath_overrides_runpath=no
3618d31dbc53Smrg  hardcode_into_libs=yes
3619d31dbc53Smrg  dynamic_linker='GNU ld.so'
3620d31dbc53Smrg  ;;
362132b578d3Smrg
3622d31dbc53Smrgnetbsd*)
3623d31dbc53Smrg  version_type=sunos
3624d31dbc53Smrg  need_lib_prefix=no
3625d31dbc53Smrg  need_version=no
3626d31dbc53Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
3627d31dbc53Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3628d31dbc53Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3629d31dbc53Smrg    dynamic_linker='NetBSD (a.out) ld.so'
3630d31dbc53Smrg  else
3631d31dbc53Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3632d31dbc53Smrg    soname_spec='${libname}${release}${shared_ext}$major'
3633d31dbc53Smrg    dynamic_linker='NetBSD ld.elf_so'
3634d31dbc53Smrg  fi
3635d31dbc53Smrg  shlibpath_var=LD_LIBRARY_PATH
3636d31dbc53Smrg  shlibpath_overrides_runpath=yes
3637d31dbc53Smrg  hardcode_into_libs=yes
3638d31dbc53Smrg  ;;
363932b578d3Smrg
3640d31dbc53Smrgnewsos6)
3641d31dbc53Smrg  version_type=linux
3642d31dbc53Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3643d31dbc53Smrg  shlibpath_var=LD_LIBRARY_PATH
3644d31dbc53Smrg  shlibpath_overrides_runpath=yes
3645d31dbc53Smrg  ;;
364632b578d3Smrg
3647d31dbc53Smrgnto-qnx*)
3648d31dbc53Smrg  version_type=linux
3649d31dbc53Smrg  need_lib_prefix=no
3650d31dbc53Smrg  need_version=no
3651d31dbc53Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3652d31dbc53Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3653d31dbc53Smrg  shlibpath_var=LD_LIBRARY_PATH
3654d31dbc53Smrg  shlibpath_overrides_runpath=yes
3655d31dbc53Smrg  ;;
3656d31dbc53Smrg
3657d31dbc53Smrgopenbsd*)
3658d31dbc53Smrg  version_type=sunos
3659d31dbc53Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
3660d31dbc53Smrg  need_lib_prefix=no
3661d31dbc53Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
3662d31dbc53Smrg  case $host_os in
3663d31dbc53Smrg    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
3664d31dbc53Smrg    *)                         need_version=no  ;;
3665d31dbc53Smrg  esac
3666d31dbc53Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3667d31dbc53Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3668d31dbc53Smrg  shlibpath_var=LD_LIBRARY_PATH
3669d31dbc53Smrg  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3670d31dbc53Smrg    case $host_os in
3671d31dbc53Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
3672d31dbc53Smrg	shlibpath_overrides_runpath=no
3673d31dbc53Smrg	;;
3674d31dbc53Smrg      *)
3675d31dbc53Smrg	shlibpath_overrides_runpath=yes
3676d31dbc53Smrg	;;
3677d31dbc53Smrg      esac
3678d31dbc53Smrg  else
3679d31dbc53Smrg    shlibpath_overrides_runpath=yes
3680d31dbc53Smrg  fi
3681d31dbc53Smrg  ;;
368232b578d3Smrg
3683d31dbc53Smrgos2*)
3684d31dbc53Smrg  libname_spec='$name'
3685d31dbc53Smrg  shrext_cmds=".dll"
3686d31dbc53Smrg  need_lib_prefix=no
3687d31dbc53Smrg  library_names_spec='$libname${shared_ext} $libname.a'
3688d31dbc53Smrg  dynamic_linker='OS/2 ld.exe'
3689d31dbc53Smrg  shlibpath_var=LIBPATH
3690d31dbc53Smrg  ;;
369132b578d3Smrg
3692d31dbc53Smrgosf3* | osf4* | osf5*)
3693d31dbc53Smrg  version_type=osf
3694d31dbc53Smrg  need_lib_prefix=no
3695d31dbc53Smrg  need_version=no
3696d31dbc53Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3697d31dbc53Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3698d31dbc53Smrg  shlibpath_var=LD_LIBRARY_PATH
3699d31dbc53Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
3700d31dbc53Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
3701d31dbc53Smrg  ;;
3702d31dbc53Smrg
3703d31dbc53Smrgsolaris*)
3704d31dbc53Smrg  version_type=linux
3705d31dbc53Smrg  need_lib_prefix=no
3706d31dbc53Smrg  need_version=no
3707d31dbc53Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3708d31dbc53Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3709d31dbc53Smrg  shlibpath_var=LD_LIBRARY_PATH
3710d31dbc53Smrg  shlibpath_overrides_runpath=yes
3711d31dbc53Smrg  hardcode_into_libs=yes
3712d31dbc53Smrg  # ldd complains unless libraries are executable
3713d31dbc53Smrg  postinstall_cmds='chmod +x $lib'
3714d31dbc53Smrg  ;;
3715d31dbc53Smrg
3716d31dbc53Smrgsunos4*)
3717d31dbc53Smrg  version_type=sunos
3718d31dbc53Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3719d31dbc53Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3720d31dbc53Smrg  shlibpath_var=LD_LIBRARY_PATH
3721d31dbc53Smrg  shlibpath_overrides_runpath=yes
3722d31dbc53Smrg  if test "$with_gnu_ld" = yes; then
3723d31dbc53Smrg    need_lib_prefix=no
372432b578d3Smrg  fi
3725d31dbc53Smrg  need_version=yes
3726d31dbc53Smrg  ;;
372732b578d3Smrg
3728d31dbc53Smrgsysv4 | sysv4.3*)
3729d31dbc53Smrg  version_type=linux
3730d31dbc53Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3731d31dbc53Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3732d31dbc53Smrg  shlibpath_var=LD_LIBRARY_PATH
3733d31dbc53Smrg  case $host_vendor in
3734d31dbc53Smrg    sni)
3735d31dbc53Smrg      shlibpath_overrides_runpath=no
3736d31dbc53Smrg      need_lib_prefix=no
3737d31dbc53Smrg      export_dynamic_flag_spec='${wl}-Blargedynsym'
3738d31dbc53Smrg      runpath_var=LD_RUN_PATH
373932b578d3Smrg      ;;
3740d31dbc53Smrg    siemens)
3741d31dbc53Smrg      need_lib_prefix=no
3742d31dbc53Smrg      ;;
3743d31dbc53Smrg    motorola)
3744d31dbc53Smrg      need_lib_prefix=no
3745d31dbc53Smrg      need_version=no
3746d31dbc53Smrg      shlibpath_overrides_runpath=no
3747d31dbc53Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
374832b578d3Smrg      ;;
374932b578d3Smrg  esac
3750d31dbc53Smrg  ;;
375132b578d3Smrg
3752d31dbc53Smrgsysv4*MP*)
3753d31dbc53Smrg  if test -d /usr/nec ;then
3754d31dbc53Smrg    version_type=linux
3755d31dbc53Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
3756d31dbc53Smrg    soname_spec='$libname${shared_ext}.$major'
3757d31dbc53Smrg    shlibpath_var=LD_LIBRARY_PATH
3758d31dbc53Smrg  fi
3759d31dbc53Smrg  ;;
376032b578d3Smrg
3761d31dbc53Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3762d31dbc53Smrg  version_type=freebsd-elf
3763d31dbc53Smrg  need_lib_prefix=no
3764d31dbc53Smrg  need_version=no
3765d31dbc53Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
3766d31dbc53Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3767d31dbc53Smrg  shlibpath_var=LD_LIBRARY_PATH
3768d31dbc53Smrg  hardcode_into_libs=yes
3769d31dbc53Smrg  if test "$with_gnu_ld" = yes; then
3770d31dbc53Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3771d31dbc53Smrg    shlibpath_overrides_runpath=no
3772d31dbc53Smrg  else
3773d31dbc53Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
3774d31dbc53Smrg    shlibpath_overrides_runpath=yes
3775d31dbc53Smrg    case $host_os in
3776d31dbc53Smrg      sco3.2v5*)
3777d31dbc53Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3778d31dbc53Smrg	;;
3779d31dbc53Smrg    esac
3780d31dbc53Smrg  fi
3781d31dbc53Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
3782d31dbc53Smrg  ;;
378332b578d3Smrg
3784d31dbc53Smrguts4*)
3785d31dbc53Smrg  version_type=linux
3786d31dbc53Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3787d31dbc53Smrg  soname_spec='${libname}${release}${shared_ext}$major'
3788d31dbc53Smrg  shlibpath_var=LD_LIBRARY_PATH
3789d31dbc53Smrg  ;;
379032b578d3Smrg
3791d31dbc53Smrg*)
3792d31dbc53Smrg  dynamic_linker=no
3793d31dbc53Smrg  ;;
3794d31dbc53Smrgesac
3795d31dbc53SmrgAC_MSG_RESULT([$dynamic_linker])
3796d31dbc53Smrgtest "$dynamic_linker" = no && can_build_shared=no
379732b578d3Smrg
3798d31dbc53Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3799d31dbc53Smrgif test "$GCC" = yes; then
3800d31dbc53Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3801d31dbc53Smrgfi
3802d31dbc53Smrg])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
380332b578d3Smrg
380432b578d3Smrg
3805d31dbc53Smrg# _LT_AC_TAGCONFIG
3806d31dbc53Smrg# ----------------
3807d31dbc53SmrgAC_DEFUN([_LT_AC_TAGCONFIG],
3808d31dbc53Smrg[AC_ARG_WITH([tags],
3809d31dbc53Smrg    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
3810d31dbc53Smrg        [include additional configurations @<:@automatic@:>@])],
3811d31dbc53Smrg    [tagnames="$withval"])
381232b578d3Smrg
3813d31dbc53Smrgif test -f "$ltmain" && test -n "$tagnames"; then
3814d31dbc53Smrg  if test ! -f "${ofile}"; then
3815d31dbc53Smrg    AC_MSG_WARN([output file `$ofile' does not exist])
3816d31dbc53Smrg  fi
381732b578d3Smrg
3818d31dbc53Smrg  if test -z "$LTCC"; then
3819d31dbc53Smrg    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
3820d31dbc53Smrg    if test -z "$LTCC"; then
3821d31dbc53Smrg      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
3822d31dbc53Smrg    else
3823d31dbc53Smrg      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
3824d31dbc53Smrg    fi
3825d31dbc53Smrg  fi
3826d31dbc53Smrg  if test -z "$LTCFLAGS"; then
3827d31dbc53Smrg    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
3828d31dbc53Smrg  fi
382932b578d3Smrg
3830d31dbc53Smrg  # Extract list of available tagged configurations in $ofile.
3831d31dbc53Smrg  # Note that this assumes the entire list is on one line.
3832d31dbc53Smrg  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
383332b578d3Smrg
3834d31dbc53Smrg  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
3835d31dbc53Smrg  for tagname in $tagnames; do
3836d31dbc53Smrg    IFS="$lt_save_ifs"
3837d31dbc53Smrg    # Check whether tagname contains only valid characters
3838d31dbc53Smrg    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
3839d31dbc53Smrg    "") ;;
3840d31dbc53Smrg    *)  AC_MSG_ERROR([invalid tag name: $tagname])
3841d31dbc53Smrg	;;
3842d31dbc53Smrg    esac
384332b578d3Smrg
3844d31dbc53Smrg    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
3845d31dbc53Smrg    then
3846d31dbc53Smrg      AC_MSG_ERROR([tag name \"$tagname\" already exists])
3847d31dbc53Smrg    fi
384832b578d3Smrg
3849d31dbc53Smrg    # Update the list of available tags.
3850d31dbc53Smrg    if test -n "$tagname"; then
3851d31dbc53Smrg      echo appending configuration tag \"$tagname\" to $ofile
385232b578d3Smrg
3853d31dbc53Smrg      case $tagname in
3854d31dbc53Smrg      CXX)
3855d31dbc53Smrg	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
3856d31dbc53Smrg	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
3857d31dbc53Smrg	    (test "X$CXX" != "Xg++"))) ; then
3858d31dbc53Smrg	  AC_LIBTOOL_LANG_CXX_CONFIG
3859d31dbc53Smrg	else
3860d31dbc53Smrg	  tagname=""
3861d31dbc53Smrg	fi
3862d31dbc53Smrg	;;
386332b578d3Smrg
3864d31dbc53Smrg      F77)
3865d31dbc53Smrg	if test -n "$F77" && test "X$F77" != "Xno"; then
3866d31dbc53Smrg	  AC_LIBTOOL_LANG_F77_CONFIG
3867d31dbc53Smrg	else
3868d31dbc53Smrg	  tagname=""
3869d31dbc53Smrg	fi
3870d31dbc53Smrg	;;
387132b578d3Smrg
3872d31dbc53Smrg      GCJ)
3873d31dbc53Smrg	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
3874d31dbc53Smrg	  AC_LIBTOOL_LANG_GCJ_CONFIG
3875d31dbc53Smrg	else
3876d31dbc53Smrg	  tagname=""
3877d31dbc53Smrg	fi
3878d31dbc53Smrg	;;
387932b578d3Smrg
3880d31dbc53Smrg      RC)
3881d31dbc53Smrg	AC_LIBTOOL_LANG_RC_CONFIG
3882d31dbc53Smrg	;;
388332b578d3Smrg
3884d31dbc53Smrg      *)
3885d31dbc53Smrg	AC_MSG_ERROR([Unsupported tag name: $tagname])
3886d31dbc53Smrg	;;
3887d31dbc53Smrg      esac
388832b578d3Smrg
3889d31dbc53Smrg      # Append the new tag name to the list of available tags.
3890d31dbc53Smrg      if test -n "$tagname" ; then
3891d31dbc53Smrg      available_tags="$available_tags $tagname"
3892d31dbc53Smrg    fi
3893d31dbc53Smrg    fi
3894d31dbc53Smrg  done
3895d31dbc53Smrg  IFS="$lt_save_ifs"
389632b578d3Smrg
3897d31dbc53Smrg  # Now substitute the updated list of available tags.
3898d31dbc53Smrg  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
3899d31dbc53Smrg    mv "${ofile}T" "$ofile"
3900d31dbc53Smrg    chmod +x "$ofile"
3901d31dbc53Smrg  else
3902d31dbc53Smrg    rm -f "${ofile}T"
3903d31dbc53Smrg    AC_MSG_ERROR([unable to update list of available tagged configurations.])
3904d31dbc53Smrg  fi
3905d31dbc53Smrgfi
3906d31dbc53Smrg])# _LT_AC_TAGCONFIG
390732b578d3Smrg
390832b578d3Smrg
3909d31dbc53Smrg# AC_LIBTOOL_DLOPEN
3910d31dbc53Smrg# -----------------
3911d31dbc53Smrg# enable checks for dlopen support
3912d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_DLOPEN],
3913d31dbc53Smrg [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
3914d31dbc53Smrg])# AC_LIBTOOL_DLOPEN
391532b578d3Smrg
391632b578d3Smrg
3917d31dbc53Smrg# AC_LIBTOOL_WIN32_DLL
3918d31dbc53Smrg# --------------------
3919d31dbc53Smrg# declare package support for building win32 DLLs
3920d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_WIN32_DLL],
3921d31dbc53Smrg[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
3922d31dbc53Smrg])# AC_LIBTOOL_WIN32_DLL
392332b578d3Smrg
392432b578d3Smrg
3925d31dbc53Smrg# AC_ENABLE_SHARED([DEFAULT])
3926d31dbc53Smrg# ---------------------------
3927d31dbc53Smrg# implement the --enable-shared flag
3928d31dbc53Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
3929d31dbc53SmrgAC_DEFUN([AC_ENABLE_SHARED],
3930d31dbc53Smrg[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
3931d31dbc53SmrgAC_ARG_ENABLE([shared],
3932d31dbc53Smrg    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
3933d31dbc53Smrg	[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
3934d31dbc53Smrg    [p=${PACKAGE-default}
3935d31dbc53Smrg    case $enableval in
3936d31dbc53Smrg    yes) enable_shared=yes ;;
3937d31dbc53Smrg    no) enable_shared=no ;;
3938d31dbc53Smrg    *)
3939d31dbc53Smrg      enable_shared=no
3940d31dbc53Smrg      # Look at the argument we got.  We use all the common list separators.
3941d31dbc53Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
3942d31dbc53Smrg      for pkg in $enableval; do
3943d31dbc53Smrg	IFS="$lt_save_ifs"
3944d31dbc53Smrg	if test "X$pkg" = "X$p"; then
3945d31dbc53Smrg	  enable_shared=yes
3946d31dbc53Smrg	fi
3947d31dbc53Smrg      done
3948d31dbc53Smrg      IFS="$lt_save_ifs"
3949d31dbc53Smrg      ;;
3950d31dbc53Smrg    esac],
3951d31dbc53Smrg    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
3952d31dbc53Smrg])# AC_ENABLE_SHARED
395332b578d3Smrg
395432b578d3Smrg
3955d31dbc53Smrg# AC_DISABLE_SHARED
3956d31dbc53Smrg# -----------------
3957d31dbc53Smrg# set the default shared flag to --disable-shared
3958d31dbc53SmrgAC_DEFUN([AC_DISABLE_SHARED],
3959d31dbc53Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3960d31dbc53SmrgAC_ENABLE_SHARED(no)
3961d31dbc53Smrg])# AC_DISABLE_SHARED
396232b578d3Smrg
396332b578d3Smrg
3964d31dbc53Smrg# AC_ENABLE_STATIC([DEFAULT])
3965d31dbc53Smrg# ---------------------------
3966d31dbc53Smrg# implement the --enable-static flag
3967d31dbc53Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
3968d31dbc53SmrgAC_DEFUN([AC_ENABLE_STATIC],
3969d31dbc53Smrg[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
3970d31dbc53SmrgAC_ARG_ENABLE([static],
3971d31dbc53Smrg    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
3972d31dbc53Smrg	[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
3973d31dbc53Smrg    [p=${PACKAGE-default}
3974d31dbc53Smrg    case $enableval in
3975d31dbc53Smrg    yes) enable_static=yes ;;
3976d31dbc53Smrg    no) enable_static=no ;;
3977d31dbc53Smrg    *)
3978d31dbc53Smrg     enable_static=no
3979d31dbc53Smrg      # Look at the argument we got.  We use all the common list separators.
3980d31dbc53Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
3981d31dbc53Smrg      for pkg in $enableval; do
3982d31dbc53Smrg	IFS="$lt_save_ifs"
3983d31dbc53Smrg	if test "X$pkg" = "X$p"; then
3984d31dbc53Smrg	  enable_static=yes
3985d31dbc53Smrg	fi
3986d31dbc53Smrg      done
3987d31dbc53Smrg      IFS="$lt_save_ifs"
3988d31dbc53Smrg      ;;
3989d31dbc53Smrg    esac],
3990d31dbc53Smrg    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
3991d31dbc53Smrg])# AC_ENABLE_STATIC
399232b578d3Smrg
399332b578d3Smrg
3994d31dbc53Smrg# AC_DISABLE_STATIC
3995d31dbc53Smrg# -----------------
3996d31dbc53Smrg# set the default static flag to --disable-static
3997d31dbc53SmrgAC_DEFUN([AC_DISABLE_STATIC],
3998d31dbc53Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
3999d31dbc53SmrgAC_ENABLE_STATIC(no)
4000d31dbc53Smrg])# AC_DISABLE_STATIC
400132b578d3Smrg
400232b578d3Smrg
4003d31dbc53Smrg# AC_ENABLE_FAST_INSTALL([DEFAULT])
4004d31dbc53Smrg# ---------------------------------
4005d31dbc53Smrg# implement the --enable-fast-install flag
4006d31dbc53Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
4007d31dbc53SmrgAC_DEFUN([AC_ENABLE_FAST_INSTALL],
4008d31dbc53Smrg[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
4009d31dbc53SmrgAC_ARG_ENABLE([fast-install],
4010d31dbc53Smrg    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
4011d31dbc53Smrg    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
4012d31dbc53Smrg    [p=${PACKAGE-default}
4013d31dbc53Smrg    case $enableval in
4014d31dbc53Smrg    yes) enable_fast_install=yes ;;
4015d31dbc53Smrg    no) enable_fast_install=no ;;
4016d31dbc53Smrg    *)
4017d31dbc53Smrg      enable_fast_install=no
4018d31dbc53Smrg      # Look at the argument we got.  We use all the common list separators.
4019d31dbc53Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
4020d31dbc53Smrg      for pkg in $enableval; do
4021d31dbc53Smrg	IFS="$lt_save_ifs"
4022d31dbc53Smrg	if test "X$pkg" = "X$p"; then
4023d31dbc53Smrg	  enable_fast_install=yes
4024d31dbc53Smrg	fi
4025d31dbc53Smrg      done
4026d31dbc53Smrg      IFS="$lt_save_ifs"
4027d31dbc53Smrg      ;;
4028d31dbc53Smrg    esac],
4029d31dbc53Smrg    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
4030d31dbc53Smrg])# AC_ENABLE_FAST_INSTALL
403132b578d3Smrg
403232b578d3Smrg
4033d31dbc53Smrg# AC_DISABLE_FAST_INSTALL
4034d31dbc53Smrg# -----------------------
4035d31dbc53Smrg# set the default to --disable-fast-install
4036d31dbc53SmrgAC_DEFUN([AC_DISABLE_FAST_INSTALL],
4037d31dbc53Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4038d31dbc53SmrgAC_ENABLE_FAST_INSTALL(no)
4039d31dbc53Smrg])# AC_DISABLE_FAST_INSTALL
404032b578d3Smrg
404132b578d3Smrg
4042d31dbc53Smrg# AC_LIBTOOL_PICMODE([MODE])
4043d31dbc53Smrg# --------------------------
4044d31dbc53Smrg# implement the --with-pic flag
4045d31dbc53Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
4046d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_PICMODE],
4047d31dbc53Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4048d31dbc53Smrgpic_mode=ifelse($#,1,$1,default)
4049d31dbc53Smrg])# AC_LIBTOOL_PICMODE
405032b578d3Smrg
405132b578d3Smrg
4052d31dbc53Smrg# AC_PROG_EGREP
4053d31dbc53Smrg# -------------
4054d31dbc53Smrg# This is predefined starting with Autoconf 2.54, so this conditional
4055d31dbc53Smrg# definition can be removed once we require Autoconf 2.54 or later.
4056d31dbc53Smrgm4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
4057d31dbc53Smrg[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
4058d31dbc53Smrg   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
4059d31dbc53Smrg    then ac_cv_prog_egrep='grep -E'
4060d31dbc53Smrg    else ac_cv_prog_egrep='egrep'
4061d31dbc53Smrg    fi])
4062d31dbc53Smrg EGREP=$ac_cv_prog_egrep
4063d31dbc53Smrg AC_SUBST([EGREP])
4064d31dbc53Smrg])])
406532b578d3Smrg
406632b578d3Smrg
4067d31dbc53Smrg# AC_PATH_TOOL_PREFIX
4068d31dbc53Smrg# -------------------
4069d31dbc53Smrg# find a file program which can recognise shared library
4070d31dbc53SmrgAC_DEFUN([AC_PATH_TOOL_PREFIX],
4071d31dbc53Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
4072d31dbc53SmrgAC_MSG_CHECKING([for $1])
4073d31dbc53SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
4074d31dbc53Smrg[case $MAGIC_CMD in
4075d31dbc53Smrg[[\\/*] |  ?:[\\/]*])
4076d31dbc53Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
4077d31dbc53Smrg  ;;
4078d31dbc53Smrg*)
4079d31dbc53Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
4080d31dbc53Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4081d31dbc53Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
4082d31dbc53Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
4083d31dbc53Smrgdnl not every word.  This closes a longstanding sh security hole.
4084d31dbc53Smrg  ac_dummy="ifelse([$2], , $PATH, [$2])"
4085d31dbc53Smrg  for ac_dir in $ac_dummy; do
4086d31dbc53Smrg    IFS="$lt_save_ifs"
4087d31dbc53Smrg    test -z "$ac_dir" && ac_dir=.
4088d31dbc53Smrg    if test -f $ac_dir/$1; then
4089d31dbc53Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
4090d31dbc53Smrg      if test -n "$file_magic_test_file"; then
4091d31dbc53Smrg	case $deplibs_check_method in
4092d31dbc53Smrg	"file_magic "*)
4093d31dbc53Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
4094d31dbc53Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4095d31dbc53Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
4096d31dbc53Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
4097d31dbc53Smrg	    :
4098d31dbc53Smrg	  else
4099d31dbc53Smrg	    cat <<EOF 1>&2
410032b578d3Smrg
4101d31dbc53Smrg*** Warning: the command libtool uses to detect shared libraries,
4102d31dbc53Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
4103d31dbc53Smrg*** The result is that libtool may fail to recognize shared libraries
4104d31dbc53Smrg*** as such.  This will affect the creation of libtool libraries that
4105d31dbc53Smrg*** depend on shared libraries, but programs linked with such libtool
4106d31dbc53Smrg*** libraries will work regardless of this problem.  Nevertheless, you
4107d31dbc53Smrg*** may want to report the problem to your system manager and/or to
4108d31dbc53Smrg*** bug-libtool@gnu.org
410932b578d3Smrg
4110d31dbc53SmrgEOF
4111d31dbc53Smrg	  fi ;;
4112d31dbc53Smrg	esac
4113d31dbc53Smrg      fi
4114d31dbc53Smrg      break
4115d31dbc53Smrg    fi
4116d31dbc53Smrg  done
4117d31dbc53Smrg  IFS="$lt_save_ifs"
4118d31dbc53Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
4119d31dbc53Smrg  ;;
4120d31dbc53Smrgesac])
4121d31dbc53SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
4122d31dbc53Smrgif test -n "$MAGIC_CMD"; then
4123d31dbc53Smrg  AC_MSG_RESULT($MAGIC_CMD)
4124d31dbc53Smrgelse
4125d31dbc53Smrg  AC_MSG_RESULT(no)
4126d31dbc53Smrgfi
4127d31dbc53Smrg])# AC_PATH_TOOL_PREFIX
412832b578d3Smrg
412932b578d3Smrg
4130d31dbc53Smrg# AC_PATH_MAGIC
4131d31dbc53Smrg# -------------
4132d31dbc53Smrg# find a file program which can recognise a shared library
4133d31dbc53SmrgAC_DEFUN([AC_PATH_MAGIC],
4134d31dbc53Smrg[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
4135d31dbc53Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
4136d31dbc53Smrg  if test -n "$ac_tool_prefix"; then
4137d31dbc53Smrg    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
4138d31dbc53Smrg  else
4139d31dbc53Smrg    MAGIC_CMD=:
4140d31dbc53Smrg  fi
4141d31dbc53Smrgfi
4142d31dbc53Smrg])# AC_PATH_MAGIC
414332b578d3Smrg
414432b578d3Smrg
4145d31dbc53Smrg# AC_PROG_LD
4146d31dbc53Smrg# ----------
4147d31dbc53Smrg# find the pathname to the GNU or non-GNU linker
4148d31dbc53SmrgAC_DEFUN([AC_PROG_LD],
4149d31dbc53Smrg[AC_ARG_WITH([gnu-ld],
4150d31dbc53Smrg    [AC_HELP_STRING([--with-gnu-ld],
4151d31dbc53Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
4152d31dbc53Smrg    [test "$withval" = no || with_gnu_ld=yes],
4153d31dbc53Smrg    [with_gnu_ld=no])
4154d31dbc53SmrgAC_REQUIRE([LT_AC_PROG_SED])dnl
4155d31dbc53SmrgAC_REQUIRE([AC_PROG_CC])dnl
4156d31dbc53SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
4157d31dbc53SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
4158d31dbc53Smrgac_prog=ld
4159d31dbc53Smrgif test "$GCC" = yes; then
4160d31dbc53Smrg  # Check if gcc -print-prog-name=ld gives a path.
4161d31dbc53Smrg  AC_MSG_CHECKING([for ld used by $CC])
4162d31dbc53Smrg  case $host in
4163d31dbc53Smrg  *-*-mingw*)
4164d31dbc53Smrg    # gcc leaves a trailing carriage return which upsets mingw
4165d31dbc53Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4166d31dbc53Smrg  *)
4167d31dbc53Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4168d31dbc53Smrg  esac
4169d31dbc53Smrg  case $ac_prog in
4170d31dbc53Smrg    # Accept absolute paths.
4171d31dbc53Smrg    [[\\/]]* | ?:[[\\/]]*)
4172d31dbc53Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
4173d31dbc53Smrg      # Canonicalize the pathname of ld
4174d31dbc53Smrg      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
4175d31dbc53Smrg      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
4176d31dbc53Smrg	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
4177d31dbc53Smrg      done
4178d31dbc53Smrg      test -z "$LD" && LD="$ac_prog"
4179d31dbc53Smrg      ;;
4180d31dbc53Smrg  "")
4181d31dbc53Smrg    # If it fails, then pretend we aren't using GCC.
4182d31dbc53Smrg    ac_prog=ld
4183d31dbc53Smrg    ;;
4184d31dbc53Smrg  *)
4185d31dbc53Smrg    # If it is relative, then search for the first ld in PATH.
4186d31dbc53Smrg    with_gnu_ld=unknown
4187d31dbc53Smrg    ;;
4188d31dbc53Smrg  esac
4189d31dbc53Smrgelif test "$with_gnu_ld" = yes; then
4190d31dbc53Smrg  AC_MSG_CHECKING([for GNU ld])
4191d31dbc53Smrgelse
4192d31dbc53Smrg  AC_MSG_CHECKING([for non-GNU ld])
4193d31dbc53Smrgfi
4194d31dbc53SmrgAC_CACHE_VAL(lt_cv_path_LD,
4195d31dbc53Smrg[if test -z "$LD"; then
4196d31dbc53Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4197d31dbc53Smrg  for ac_dir in $PATH; do
4198d31dbc53Smrg    IFS="$lt_save_ifs"
4199d31dbc53Smrg    test -z "$ac_dir" && ac_dir=.
4200d31dbc53Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4201d31dbc53Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
4202d31dbc53Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
4203d31dbc53Smrg      # but apparently some variants of GNU ld only accept -v.
4204d31dbc53Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
4205d31dbc53Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
4206d31dbc53Smrg      *GNU* | *'with BFD'*)
4207d31dbc53Smrg	test "$with_gnu_ld" != no && break
4208d31dbc53Smrg	;;
4209d31dbc53Smrg      *)
4210d31dbc53Smrg	test "$with_gnu_ld" != yes && break
4211d31dbc53Smrg	;;
4212d31dbc53Smrg      esac
4213d31dbc53Smrg    fi
4214d31dbc53Smrg  done
4215d31dbc53Smrg  IFS="$lt_save_ifs"
4216d31dbc53Smrgelse
4217d31dbc53Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
4218d31dbc53Smrgfi])
4219d31dbc53SmrgLD="$lt_cv_path_LD"
4220d31dbc53Smrgif test -n "$LD"; then
4221d31dbc53Smrg  AC_MSG_RESULT($LD)
4222d31dbc53Smrgelse
4223d31dbc53Smrg  AC_MSG_RESULT(no)
4224d31dbc53Smrgfi
4225d31dbc53Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
4226d31dbc53SmrgAC_PROG_LD_GNU
4227d31dbc53Smrg])# AC_PROG_LD
422832b578d3Smrg
422932b578d3Smrg
4230d31dbc53Smrg# AC_PROG_LD_GNU
4231d31dbc53Smrg# --------------
4232d31dbc53SmrgAC_DEFUN([AC_PROG_LD_GNU],
4233d31dbc53Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
4234d31dbc53SmrgAC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
4235d31dbc53Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
4236d31dbc53Smrgcase `$LD -v 2>&1 </dev/null` in
4237d31dbc53Smrg*GNU* | *'with BFD'*)
4238d31dbc53Smrg  lt_cv_prog_gnu_ld=yes
4239d31dbc53Smrg  ;;
4240d31dbc53Smrg*)
4241d31dbc53Smrg  lt_cv_prog_gnu_ld=no
4242d31dbc53Smrg  ;;
4243d31dbc53Smrgesac])
4244d31dbc53Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
4245d31dbc53Smrg])# AC_PROG_LD_GNU
424632b578d3Smrg
424732b578d3Smrg
4248d31dbc53Smrg# AC_PROG_LD_RELOAD_FLAG
4249d31dbc53Smrg# ----------------------
4250d31dbc53Smrg# find reload flag for linker
4251d31dbc53Smrg#   -- PORTME Some linkers may need a different reload flag.
4252d31dbc53SmrgAC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
4253d31dbc53Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
4254d31dbc53Smrg  lt_cv_ld_reload_flag,
4255d31dbc53Smrg  [lt_cv_ld_reload_flag='-r'])
4256d31dbc53Smrgreload_flag=$lt_cv_ld_reload_flag
4257d31dbc53Smrgcase $reload_flag in
4258d31dbc53Smrg"" | " "*) ;;
4259d31dbc53Smrg*) reload_flag=" $reload_flag" ;;
4260d31dbc53Smrgesac
4261d31dbc53Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
4262d31dbc53Smrgcase $host_os in
4263d31dbc53Smrg  darwin*)
4264d31dbc53Smrg    if test "$GCC" = yes; then
4265d31dbc53Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
4266d31dbc53Smrg    else
4267d31dbc53Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
4268d31dbc53Smrg    fi
4269d31dbc53Smrg    ;;
4270d31dbc53Smrgesac
4271d31dbc53Smrg])# AC_PROG_LD_RELOAD_FLAG
427232b578d3Smrg
427332b578d3Smrg
4274d31dbc53Smrg# AC_DEPLIBS_CHECK_METHOD
4275d31dbc53Smrg# -----------------------
4276d31dbc53Smrg# how to check for library dependencies
4277d31dbc53Smrg#  -- PORTME fill in with the dynamic library characteristics
4278d31dbc53SmrgAC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
4279d31dbc53Smrg[AC_CACHE_CHECK([how to recognise dependent libraries],
4280d31dbc53Smrglt_cv_deplibs_check_method,
4281d31dbc53Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
4282d31dbc53Smrglt_cv_file_magic_test_file=
4283d31dbc53Smrglt_cv_deplibs_check_method='unknown'
4284d31dbc53Smrg# Need to set the preceding variable on all platforms that support
4285d31dbc53Smrg# interlibrary dependencies.
4286d31dbc53Smrg# 'none' -- dependencies not supported.
4287d31dbc53Smrg# `unknown' -- same as none, but documents that we really don't know.
4288d31dbc53Smrg# 'pass_all' -- all dependencies passed with no checks.
4289d31dbc53Smrg# 'test_compile' -- check by making test program.
4290d31dbc53Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
4291d31dbc53Smrg# which responds to the $file_magic_cmd with a given extended regex.
4292d31dbc53Smrg# If you have `file' or equivalent on your system and you're not sure
4293d31dbc53Smrg# whether `pass_all' will *always* work, you probably want this one.
429432b578d3Smrg
4295d31dbc53Smrgcase $host_os in
4296d31dbc53Smrgaix4* | aix5*)
4297d31dbc53Smrg  lt_cv_deplibs_check_method=pass_all
4298d31dbc53Smrg  ;;
429932b578d3Smrg
4300d31dbc53Smrgbeos*)
4301d31dbc53Smrg  lt_cv_deplibs_check_method=pass_all
4302d31dbc53Smrg  ;;
430332b578d3Smrg
4304d31dbc53Smrgbsdi[[45]]*)
4305d31dbc53Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
4306d31dbc53Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
4307d31dbc53Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
4308d31dbc53Smrg  ;;
430932b578d3Smrg
4310d31dbc53Smrgcygwin*)
4311d31dbc53Smrg  # func_win32_libid is a shell function defined in ltmain.sh
4312d31dbc53Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4313d31dbc53Smrg  lt_cv_file_magic_cmd='func_win32_libid'
4314d31dbc53Smrg  ;;
431532b578d3Smrg
4316d31dbc53Smrgmingw* | pw32*)
4317d31dbc53Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
4318d31dbc53Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
4319d31dbc53Smrg  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
4320d31dbc53Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
4321d31dbc53Smrg  ;;
432232b578d3Smrg
4323d31dbc53Smrgdarwin* | rhapsody*)
4324d31dbc53Smrg  lt_cv_deplibs_check_method=pass_all
4325d31dbc53Smrg  ;;
432632b578d3Smrg
4327d31dbc53Smrgfreebsd* | kfreebsd*-gnu | dragonfly*)
4328d31dbc53Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
4329d31dbc53Smrg    case $host_cpu in
4330d31dbc53Smrg    i*86 )
4331d31dbc53Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
4332d31dbc53Smrg      # Let's accept both of them until this is cleared up.
4333d31dbc53Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
4334d31dbc53Smrg      lt_cv_file_magic_cmd=/usr/bin/file
4335d31dbc53Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
4336d31dbc53Smrg      ;;
4337d31dbc53Smrg    esac
4338d31dbc53Smrg  else
4339d31dbc53Smrg    lt_cv_deplibs_check_method=pass_all
4340d31dbc53Smrg  fi
4341d31dbc53Smrg  ;;
434232b578d3Smrg
4343d31dbc53Smrggnu*)
4344d31dbc53Smrg  lt_cv_deplibs_check_method=pass_all
4345d31dbc53Smrg  ;;
434632b578d3Smrg
4347d31dbc53Smrghpux10.20* | hpux11*)
4348d31dbc53Smrg  lt_cv_file_magic_cmd=/usr/bin/file
4349d31dbc53Smrg  case $host_cpu in
4350d31dbc53Smrg  ia64*)
4351d31dbc53Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
4352d31dbc53Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
4353d31dbc53Smrg    ;;
4354d31dbc53Smrg  hppa*64*)
4355d31dbc53Smrg    [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]']
4356d31dbc53Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
4357d31dbc53Smrg    ;;
4358d31dbc53Smrg  *)
4359d31dbc53Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
4360d31dbc53Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
4361d31dbc53Smrg    ;;
4362d31dbc53Smrg  esac
4363d31dbc53Smrg  ;;
436432b578d3Smrg
4365d31dbc53Smrginterix3*)
4366d31dbc53Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
4367d31dbc53Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
4368d31dbc53Smrg  ;;
436932b578d3Smrg
4370d31dbc53Smrgirix5* | irix6* | nonstopux*)
4371d31dbc53Smrg  case $LD in
4372d31dbc53Smrg  *-32|*"-32 ") libmagic=32-bit;;
4373d31dbc53Smrg  *-n32|*"-n32 ") libmagic=N32;;
4374d31dbc53Smrg  *-64|*"-64 ") libmagic=64-bit;;
4375d31dbc53Smrg  *) libmagic=never-match;;
4376d31dbc53Smrg  esac
4377d31dbc53Smrg  lt_cv_deplibs_check_method=pass_all
4378d31dbc53Smrg  ;;
437932b578d3Smrg
4380d31dbc53Smrg# This must be Linux ELF.
4381d31dbc53Smrglinux*)
4382d31dbc53Smrg  lt_cv_deplibs_check_method=pass_all
4383d31dbc53Smrg  ;;
438432b578d3Smrg
4385d31dbc53Smrgnetbsd*)
4386d31dbc53Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
4387d31dbc53Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4388d31dbc53Smrg  else
4389d31dbc53Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
4390d31dbc53Smrg  fi
4391d31dbc53Smrg  ;;
439232b578d3Smrg
4393d31dbc53Smrgnewos6*)
4394d31dbc53Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
4395d31dbc53Smrg  lt_cv_file_magic_cmd=/usr/bin/file
4396d31dbc53Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
4397d31dbc53Smrg  ;;
439832b578d3Smrg
4399d31dbc53Smrgnto-qnx*)
4400d31dbc53Smrg  lt_cv_deplibs_check_method=unknown
4401d31dbc53Smrg  ;;
440232b578d3Smrg
4403d31dbc53Smrgopenbsd*)
4404d31dbc53Smrg  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4405d31dbc53Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
4406d31dbc53Smrg  else
4407d31dbc53Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4408d31dbc53Smrg  fi
4409d31dbc53Smrg  ;;
441032b578d3Smrg
4411d31dbc53Smrgosf3* | osf4* | osf5*)
4412d31dbc53Smrg  lt_cv_deplibs_check_method=pass_all
4413d31dbc53Smrg  ;;
441432b578d3Smrg
4415d31dbc53Smrgsolaris*)
4416d31dbc53Smrg  lt_cv_deplibs_check_method=pass_all
4417d31dbc53Smrg  ;;
441832b578d3Smrg
4419d31dbc53Smrgsysv4 | sysv4.3*)
4420d31dbc53Smrg  case $host_vendor in
4421d31dbc53Smrg  motorola)
4422d31dbc53Smrg    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]]'
4423d31dbc53Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
4424d31dbc53Smrg    ;;
4425d31dbc53Smrg  ncr)
4426d31dbc53Smrg    lt_cv_deplibs_check_method=pass_all
4427d31dbc53Smrg    ;;
4428d31dbc53Smrg  sequent)
4429d31dbc53Smrg    lt_cv_file_magic_cmd='/bin/file'
4430d31dbc53Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
4431d31dbc53Smrg    ;;
4432d31dbc53Smrg  sni)
4433d31dbc53Smrg    lt_cv_file_magic_cmd='/bin/file'
4434d31dbc53Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
4435d31dbc53Smrg    lt_cv_file_magic_test_file=/lib/libc.so
4436d31dbc53Smrg    ;;
4437d31dbc53Smrg  siemens)
4438d31dbc53Smrg    lt_cv_deplibs_check_method=pass_all
4439d31dbc53Smrg    ;;
4440d31dbc53Smrg  pc)
4441d31dbc53Smrg    lt_cv_deplibs_check_method=pass_all
4442d31dbc53Smrg    ;;
4443d31dbc53Smrg  esac
4444d31dbc53Smrg  ;;
444532b578d3Smrg
4446d31dbc53Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
4447d31dbc53Smrg  lt_cv_deplibs_check_method=pass_all
4448d31dbc53Smrg  ;;
4449d31dbc53Smrgesac
4450d31dbc53Smrg])
4451d31dbc53Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
4452d31dbc53Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
4453d31dbc53Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
4454d31dbc53Smrg])# AC_DEPLIBS_CHECK_METHOD
445532b578d3Smrg
445632b578d3Smrg
4457d31dbc53Smrg# AC_PROG_NM
4458d31dbc53Smrg# ----------
4459d31dbc53Smrg# find the pathname to a BSD-compatible name lister
4460d31dbc53SmrgAC_DEFUN([AC_PROG_NM],
4461d31dbc53Smrg[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
4462d31dbc53Smrg[if test -n "$NM"; then
4463d31dbc53Smrg  # Let the user override the test.
4464d31dbc53Smrg  lt_cv_path_NM="$NM"
4465d31dbc53Smrgelse
4466d31dbc53Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
4467d31dbc53Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then 
4468d31dbc53Smrg    lt_nm_to_check="$lt_nm_to_check nm"
4469d31dbc53Smrg  fi
4470d31dbc53Smrg  for lt_tmp_nm in $lt_nm_to_check; do
4471d31dbc53Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4472d31dbc53Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
4473d31dbc53Smrg      IFS="$lt_save_ifs"
4474d31dbc53Smrg      test -z "$ac_dir" && ac_dir=.
4475d31dbc53Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
4476d31dbc53Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
4477d31dbc53Smrg	# Check to see if the nm accepts a BSD-compat flag.
4478d31dbc53Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
4479d31dbc53Smrg	#   nm: unknown option "B" ignored
4480d31dbc53Smrg	# Tru64's nm complains that /dev/null is an invalid object file
4481d31dbc53Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
4482d31dbc53Smrg	*/dev/null* | *'Invalid file or object type'*)
4483d31dbc53Smrg	  lt_cv_path_NM="$tmp_nm -B"
4484d31dbc53Smrg	  break
4485d31dbc53Smrg	  ;;
4486d31dbc53Smrg	*)
4487d31dbc53Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
4488d31dbc53Smrg	  */dev/null*)
4489d31dbc53Smrg	    lt_cv_path_NM="$tmp_nm -p"
4490d31dbc53Smrg	    break
4491d31dbc53Smrg	    ;;
4492d31dbc53Smrg	  *)
4493d31dbc53Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
4494d31dbc53Smrg	    continue # so that we can try to find one that supports BSD flags
4495d31dbc53Smrg	    ;;
4496d31dbc53Smrg	  esac
4497d31dbc53Smrg	  ;;
4498d31dbc53Smrg	esac
4499d31dbc53Smrg      fi
4500d31dbc53Smrg    done
4501d31dbc53Smrg    IFS="$lt_save_ifs"
4502d31dbc53Smrg  done
4503d31dbc53Smrg  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
4504d31dbc53Smrgfi])
4505d31dbc53SmrgNM="$lt_cv_path_NM"
4506d31dbc53Smrg])# AC_PROG_NM
450732b578d3Smrg
450832b578d3Smrg
4509d31dbc53Smrg# AC_CHECK_LIBM
4510d31dbc53Smrg# -------------
4511d31dbc53Smrg# check for math library
4512d31dbc53SmrgAC_DEFUN([AC_CHECK_LIBM],
4513d31dbc53Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4514d31dbc53SmrgLIBM=
4515d31dbc53Smrgcase $host in
4516d31dbc53Smrg*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
4517d31dbc53Smrg  # These system don't have libm, or don't need it
4518d31dbc53Smrg  ;;
4519d31dbc53Smrg*-ncr-sysv4.3*)
4520d31dbc53Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
4521d31dbc53Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
4522d31dbc53Smrg  ;;
4523d31dbc53Smrg*)
4524d31dbc53Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
4525d31dbc53Smrg  ;;
4526d31dbc53Smrgesac
4527d31dbc53Smrg])# AC_CHECK_LIBM
452832b578d3Smrg
452932b578d3Smrg
4530d31dbc53Smrg# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
4531d31dbc53Smrg# -----------------------------------
4532d31dbc53Smrg# sets LIBLTDL to the link flags for the libltdl convenience library and
4533d31dbc53Smrg# LTDLINCL to the include flags for the libltdl header and adds
4534d31dbc53Smrg# --enable-ltdl-convenience to the configure arguments.  Note that
4535d31dbc53Smrg# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
4536d31dbc53Smrg# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
4537d31dbc53Smrg# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
4538d31dbc53Smrg# (note the single quotes!).  If your package is not flat and you're not
4539d31dbc53Smrg# using automake, define top_builddir and top_srcdir appropriately in
4540d31dbc53Smrg# the Makefiles.
4541d31dbc53SmrgAC_DEFUN([AC_LIBLTDL_CONVENIENCE],
4542d31dbc53Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4543d31dbc53Smrg  case $enable_ltdl_convenience in
4544d31dbc53Smrg  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
4545d31dbc53Smrg  "") enable_ltdl_convenience=yes
4546d31dbc53Smrg      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
454732b578d3Smrg  esac
4548d31dbc53Smrg  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
4549d31dbc53Smrg  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
4550d31dbc53Smrg  # For backwards non-gettext consistent compatibility...
4551d31dbc53Smrg  INCLTDL="$LTDLINCL"
4552d31dbc53Smrg])# AC_LIBLTDL_CONVENIENCE
455332b578d3Smrg
455432b578d3Smrg
4555d31dbc53Smrg# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
4556d31dbc53Smrg# -----------------------------------
4557d31dbc53Smrg# sets LIBLTDL to the link flags for the libltdl installable library and
4558d31dbc53Smrg# LTDLINCL to the include flags for the libltdl header and adds
4559d31dbc53Smrg# --enable-ltdl-install to the configure arguments.  Note that
4560d31dbc53Smrg# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
4561d31dbc53Smrg# and an installed libltdl is not found, it is assumed to be `libltdl'.
4562d31dbc53Smrg# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
4563d31dbc53Smrg# '${top_srcdir}/' (note the single quotes!).  If your package is not
4564d31dbc53Smrg# flat and you're not using automake, define top_builddir and top_srcdir
4565d31dbc53Smrg# appropriately in the Makefiles.
4566d31dbc53Smrg# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
4567d31dbc53SmrgAC_DEFUN([AC_LIBLTDL_INSTALLABLE],
4568d31dbc53Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
4569d31dbc53Smrg  AC_CHECK_LIB(ltdl, lt_dlinit,
4570d31dbc53Smrg  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
4571d31dbc53Smrg  [if test x"$enable_ltdl_install" = xno; then
4572d31dbc53Smrg     AC_MSG_WARN([libltdl not installed, but installation disabled])
4573d31dbc53Smrg   else
4574d31dbc53Smrg     enable_ltdl_install=yes
4575d31dbc53Smrg   fi
4576d31dbc53Smrg  ])
4577d31dbc53Smrg  if test x"$enable_ltdl_install" = x"yes"; then
4578d31dbc53Smrg    ac_configure_args="$ac_configure_args --enable-ltdl-install"
4579d31dbc53Smrg    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
4580d31dbc53Smrg    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
4581d31dbc53Smrg  else
4582d31dbc53Smrg    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
4583d31dbc53Smrg    LIBLTDL="-lltdl"
4584d31dbc53Smrg    LTDLINCL=
458532b578d3Smrg  fi
4586d31dbc53Smrg  # For backwards non-gettext consistent compatibility...
4587d31dbc53Smrg  INCLTDL="$LTDLINCL"
4588d31dbc53Smrg])# AC_LIBLTDL_INSTALLABLE
458932b578d3Smrg
459032b578d3Smrg
4591d31dbc53Smrg# AC_LIBTOOL_CXX
4592d31dbc53Smrg# --------------
4593d31dbc53Smrg# enable support for C++ libraries
4594d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_CXX],
4595d31dbc53Smrg[AC_REQUIRE([_LT_AC_LANG_CXX])
4596d31dbc53Smrg])# AC_LIBTOOL_CXX
459732b578d3Smrg
459832b578d3Smrg
4599d31dbc53Smrg# _LT_AC_LANG_CXX
4600d31dbc53Smrg# ---------------
4601d31dbc53SmrgAC_DEFUN([_LT_AC_LANG_CXX],
4602d31dbc53Smrg[AC_REQUIRE([AC_PROG_CXX])
4603d31dbc53SmrgAC_REQUIRE([_LT_AC_PROG_CXXCPP])
4604d31dbc53Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
4605d31dbc53Smrg])# _LT_AC_LANG_CXX
460632b578d3Smrg
4607d31dbc53Smrg# _LT_AC_PROG_CXXCPP
4608d31dbc53Smrg# ------------------
4609d31dbc53SmrgAC_DEFUN([_LT_AC_PROG_CXXCPP],
461032b578d3Smrg[
4611d31dbc53SmrgAC_REQUIRE([AC_PROG_CXX])
4612d31dbc53Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
4613d31dbc53Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
4614d31dbc53Smrg    (test "X$CXX" != "Xg++"))) ; then
4615d31dbc53Smrg  AC_PROG_CXXCPP
4616d31dbc53Smrgfi
4617d31dbc53Smrg])# _LT_AC_PROG_CXXCPP
461832b578d3Smrg
4619d31dbc53Smrg# AC_LIBTOOL_F77
4620d31dbc53Smrg# --------------
4621d31dbc53Smrg# enable support for Fortran 77 libraries
4622d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_F77],
4623d31dbc53Smrg[AC_REQUIRE([_LT_AC_LANG_F77])
4624d31dbc53Smrg])# AC_LIBTOOL_F77
462532b578d3Smrg
462632b578d3Smrg
4627d31dbc53Smrg# _LT_AC_LANG_F77
4628d31dbc53Smrg# ---------------
4629d31dbc53SmrgAC_DEFUN([_LT_AC_LANG_F77],
4630d31dbc53Smrg[AC_REQUIRE([AC_PROG_F77])
4631d31dbc53Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
4632d31dbc53Smrg])# _LT_AC_LANG_F77
463332b578d3Smrg
463432b578d3Smrg
4635d31dbc53Smrg# AC_LIBTOOL_GCJ
4636d31dbc53Smrg# --------------
4637d31dbc53Smrg# enable support for GCJ libraries
4638d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_GCJ],
4639d31dbc53Smrg[AC_REQUIRE([_LT_AC_LANG_GCJ])
4640d31dbc53Smrg])# AC_LIBTOOL_GCJ
464132b578d3Smrg
464232b578d3Smrg
4643d31dbc53Smrg# _LT_AC_LANG_GCJ
4644d31dbc53Smrg# ---------------
4645d31dbc53SmrgAC_DEFUN([_LT_AC_LANG_GCJ],
4646d31dbc53Smrg[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
4647d31dbc53Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
4648d31dbc53Smrg    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
4649d31dbc53Smrg      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
4650d31dbc53Smrg	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
4651d31dbc53Smrg	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
4652d31dbc53Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
4653d31dbc53Smrg])# _LT_AC_LANG_GCJ
465432b578d3Smrg
465532b578d3Smrg
4656d31dbc53Smrg# AC_LIBTOOL_RC
4657d31dbc53Smrg# -------------
4658d31dbc53Smrg# enable support for Windows resource files
4659d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_RC],
4660d31dbc53Smrg[AC_REQUIRE([LT_AC_PROG_RC])
4661d31dbc53Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
4662d31dbc53Smrg])# AC_LIBTOOL_RC
466332b578d3Smrg
466432b578d3Smrg
4665d31dbc53Smrg# AC_LIBTOOL_LANG_C_CONFIG
4666d31dbc53Smrg# ------------------------
4667d31dbc53Smrg# Ensure that the configuration vars for the C compiler are
4668d31dbc53Smrg# suitably defined.  Those variables are subsequently used by
4669d31dbc53Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
4670d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
4671d31dbc53SmrgAC_DEFUN([_LT_AC_LANG_C_CONFIG],
4672d31dbc53Smrg[lt_save_CC="$CC"
4673d31dbc53SmrgAC_LANG_PUSH(C)
467432b578d3Smrg
4675d31dbc53Smrg# Source file extension for C test sources.
4676d31dbc53Smrgac_ext=c
467732b578d3Smrg
4678d31dbc53Smrg# Object file extension for compiled C test sources.
4679d31dbc53Smrgobjext=o
4680d31dbc53Smrg_LT_AC_TAGVAR(objext, $1)=$objext
468132b578d3Smrg
4682d31dbc53Smrg# Code to be used in simple compile tests
4683d31dbc53Smrglt_simple_compile_test_code="int some_variable = 0;\n"
468432b578d3Smrg
4685d31dbc53Smrg# Code to be used in simple link tests
4686d31dbc53Smrglt_simple_link_test_code='int main(){return(0);}\n'
468732b578d3Smrg
4688d31dbc53Smrg_LT_AC_SYS_COMPILER
468932b578d3Smrg
4690d31dbc53Smrg# save warnings/boilerplate of simple test code
4691d31dbc53Smrg_LT_COMPILER_BOILERPLATE
4692d31dbc53Smrg_LT_LINKER_BOILERPLATE
469332b578d3Smrg
4694d31dbc53SmrgAC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
4695d31dbc53SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
4696d31dbc53SmrgAC_LIBTOOL_PROG_CC_C_O($1)
4697d31dbc53SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
4698d31dbc53SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
4699d31dbc53SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
4700d31dbc53SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
4701d31dbc53SmrgAC_LIBTOOL_SYS_LIB_STRIP
4702d31dbc53SmrgAC_LIBTOOL_DLOPEN_SELF
4703d31dbc53Smrg
4704d31dbc53Smrg# Report which library types will actually be built
4705d31dbc53SmrgAC_MSG_CHECKING([if libtool supports shared libraries])
4706d31dbc53SmrgAC_MSG_RESULT([$can_build_shared])
4707d31dbc53Smrg
4708d31dbc53SmrgAC_MSG_CHECKING([whether to build shared libraries])
4709d31dbc53Smrgtest "$can_build_shared" = "no" && enable_shared=no
4710d31dbc53Smrg
4711d31dbc53Smrg# On AIX, shared libraries and static libraries use the same namespace, and
4712d31dbc53Smrg# are all built from PIC.
4713d31dbc53Smrgcase $host_os in
4714d31dbc53Smrgaix3*)
4715d31dbc53Smrg  test "$enable_shared" = yes && enable_static=no
4716d31dbc53Smrg  if test -n "$RANLIB"; then
4717d31dbc53Smrg    archive_cmds="$archive_cmds~\$RANLIB \$lib"
4718d31dbc53Smrg    postinstall_cmds='$RANLIB $lib'
4719d31dbc53Smrg  fi
4720d31dbc53Smrg  ;;
4721d31dbc53Smrg
4722d31dbc53Smrgaix4* | aix5*)
4723d31dbc53Smrg  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
4724d31dbc53Smrg    test "$enable_shared" = yes && enable_static=no
4725d31dbc53Smrg  fi
4726d31dbc53Smrg    ;;
4727d31dbc53Smrgesac
4728d31dbc53SmrgAC_MSG_RESULT([$enable_shared])
4729d31dbc53Smrg
4730d31dbc53SmrgAC_MSG_CHECKING([whether to build static libraries])
4731d31dbc53Smrg# Make sure either enable_shared or enable_static is yes.
4732d31dbc53Smrgtest "$enable_shared" = yes || enable_static=yes
4733d31dbc53SmrgAC_MSG_RESULT([$enable_static])
4734d31dbc53Smrg
4735d31dbc53SmrgAC_LIBTOOL_CONFIG($1)
4736d31dbc53Smrg
4737d31dbc53SmrgAC_LANG_POP
4738d31dbc53SmrgCC="$lt_save_CC"
4739d31dbc53Smrg])# AC_LIBTOOL_LANG_C_CONFIG
4740d31dbc53Smrg
4741d31dbc53Smrg
4742d31dbc53Smrg# AC_LIBTOOL_LANG_CXX_CONFIG
4743d31dbc53Smrg# --------------------------
4744d31dbc53Smrg# Ensure that the configuration vars for the C compiler are
4745d31dbc53Smrg# suitably defined.  Those variables are subsequently used by
4746d31dbc53Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
4747d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
4748d31dbc53SmrgAC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
4749d31dbc53Smrg[AC_LANG_PUSH(C++)
4750d31dbc53SmrgAC_REQUIRE([AC_PROG_CXX])
4751d31dbc53SmrgAC_REQUIRE([_LT_AC_PROG_CXXCPP])
4752d31dbc53Smrg
4753d31dbc53Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
4754d31dbc53Smrg_LT_AC_TAGVAR(allow_undefined_flag, $1)=
4755d31dbc53Smrg_LT_AC_TAGVAR(always_export_symbols, $1)=no
4756d31dbc53Smrg_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
4757d31dbc53Smrg_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
4758d31dbc53Smrg_LT_AC_TAGVAR(hardcode_direct, $1)=no
4759d31dbc53Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
4760d31dbc53Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
4761d31dbc53Smrg_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
4762d31dbc53Smrg_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
4763d31dbc53Smrg_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4764d31dbc53Smrg_LT_AC_TAGVAR(hardcode_automatic, $1)=no
4765d31dbc53Smrg_LT_AC_TAGVAR(module_cmds, $1)=
4766d31dbc53Smrg_LT_AC_TAGVAR(module_expsym_cmds, $1)=
4767d31dbc53Smrg_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
4768d31dbc53Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
4769d31dbc53Smrg_LT_AC_TAGVAR(no_undefined_flag, $1)=
4770d31dbc53Smrg_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
4771d31dbc53Smrg_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4772d31dbc53Smrg
4773d31dbc53Smrg# Dependencies to place before and after the object being linked:
4774d31dbc53Smrg_LT_AC_TAGVAR(predep_objects, $1)=
4775d31dbc53Smrg_LT_AC_TAGVAR(postdep_objects, $1)=
4776d31dbc53Smrg_LT_AC_TAGVAR(predeps, $1)=
4777d31dbc53Smrg_LT_AC_TAGVAR(postdeps, $1)=
4778d31dbc53Smrg_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
4779d31dbc53Smrg
4780d31dbc53Smrg# Source file extension for C++ test sources.
4781d31dbc53Smrgac_ext=cpp
4782d31dbc53Smrg
4783d31dbc53Smrg# Object file extension for compiled C++ test sources.
4784d31dbc53Smrgobjext=o
4785d31dbc53Smrg_LT_AC_TAGVAR(objext, $1)=$objext
4786d31dbc53Smrg
4787d31dbc53Smrg# Code to be used in simple compile tests
4788d31dbc53Smrglt_simple_compile_test_code="int some_variable = 0;\n"
4789d31dbc53Smrg
4790d31dbc53Smrg# Code to be used in simple link tests
4791d31dbc53Smrglt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n'
4792d31dbc53Smrg
4793d31dbc53Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
4794d31dbc53Smrg_LT_AC_SYS_COMPILER
4795d31dbc53Smrg
4796d31dbc53Smrg# save warnings/boilerplate of simple test code
4797d31dbc53Smrg_LT_COMPILER_BOILERPLATE
4798d31dbc53Smrg_LT_LINKER_BOILERPLATE
4799d31dbc53Smrg
4800d31dbc53Smrg# Allow CC to be a program name with arguments.
4801d31dbc53Smrglt_save_CC=$CC
4802d31dbc53Smrglt_save_LD=$LD
4803d31dbc53Smrglt_save_GCC=$GCC
4804d31dbc53SmrgGCC=$GXX
4805d31dbc53Smrglt_save_with_gnu_ld=$with_gnu_ld
4806d31dbc53Smrglt_save_path_LD=$lt_cv_path_LD
4807d31dbc53Smrgif test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
4808d31dbc53Smrg  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
4809d31dbc53Smrgelse
4810d31dbc53Smrg  $as_unset lt_cv_prog_gnu_ld
481132b578d3Smrgfi
4812d31dbc53Smrgif test -n "${lt_cv_path_LDCXX+set}"; then
4813d31dbc53Smrg  lt_cv_path_LD=$lt_cv_path_LDCXX
481432b578d3Smrgelse
4815d31dbc53Smrg  $as_unset lt_cv_path_LD
481632b578d3Smrgfi
4817d31dbc53Smrgtest -z "${LDCXX+set}" || LD=$LDCXX
4818d31dbc53SmrgCC=${CXX-"c++"}
4819d31dbc53Smrgcompiler=$CC
4820d31dbc53Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
4821d31dbc53Smrg_LT_CC_BASENAME([$compiler])
482232b578d3Smrg
4823d31dbc53Smrg# We don't want -fno-exception wen compiling C++ code, so set the
4824d31dbc53Smrg# no_builtin_flag separately
4825d31dbc53Smrgif test "$GXX" = yes; then
4826d31dbc53Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
4827d31dbc53Smrgelse
4828d31dbc53Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
4829d31dbc53Smrgfi
483032b578d3Smrg
4831d31dbc53Smrgif test "$GXX" = yes; then
4832d31dbc53Smrg  # Set up default GNU C++ configuration
483332b578d3Smrg
4834d31dbc53Smrg  AC_PROG_LD
483532b578d3Smrg
4836d31dbc53Smrg  # Check if GNU C++ uses GNU ld as the underlying linker, since the
4837d31dbc53Smrg  # archiving commands below assume that GNU ld is being used.
4838d31dbc53Smrg  if test "$with_gnu_ld" = yes; then
4839d31dbc53Smrg    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
4840d31dbc53Smrg    _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'
4841d31dbc53Smrg
4842d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
4843d31dbc53Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
4844d31dbc53Smrg
4845d31dbc53Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
4846d31dbc53Smrg    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
4847d31dbc53Smrg    #     investigate it a little bit more. (MM)
4848d31dbc53Smrg    wlarc='${wl}'
4849d31dbc53Smrg
4850d31dbc53Smrg    # ancient GNU ld didn't support --whole-archive et. al.
4851d31dbc53Smrg    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
4852d31dbc53Smrg	grep 'no-whole-archive' > /dev/null; then
4853d31dbc53Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
4854d31dbc53Smrg    else
4855d31dbc53Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
4856d31dbc53Smrg    fi
485732b578d3Smrg  else
4858d31dbc53Smrg    with_gnu_ld=no
4859d31dbc53Smrg    wlarc=
4860d31dbc53Smrg
4861d31dbc53Smrg    # A generic and very simple default shared library creation
4862d31dbc53Smrg    # command for GNU C++ for the case where it uses the native
4863d31dbc53Smrg    # linker, instead of GNU ld.  If possible, this setting should
4864d31dbc53Smrg    # overridden to take advantage of the native linker features on
4865d31dbc53Smrg    # the platform it is being used on.
4866d31dbc53Smrg    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
486732b578d3Smrg  fi
486832b578d3Smrg
4869d31dbc53Smrg  # Commands to make compiler produce verbose output that lists
4870d31dbc53Smrg  # what "hidden" libraries, object files and flags are used when
4871d31dbc53Smrg  # linking a shared library.
4872d31dbc53Smrg  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
487332b578d3Smrg
4874d31dbc53Smrgelse
4875d31dbc53Smrg  GXX=no
4876d31dbc53Smrg  with_gnu_ld=no
4877d31dbc53Smrg  wlarc=
4878d31dbc53Smrgfi
487932b578d3Smrg
4880d31dbc53Smrg# PORTME: fill in a description of your system's C++ link characteristics
4881d31dbc53SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4882d31dbc53Smrg_LT_AC_TAGVAR(ld_shlibs, $1)=yes
4883d31dbc53Smrgcase $host_os in
4884d31dbc53Smrg  aix3*)
4885d31dbc53Smrg    # FIXME: insert proper C++ library support
4886d31dbc53Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
4887d31dbc53Smrg    ;;
4888d31dbc53Smrg  aix4* | aix5*)
4889d31dbc53Smrg    if test "$host_cpu" = ia64; then
4890d31dbc53Smrg      # On IA64, the linker does run time linking by default, so we don't
4891d31dbc53Smrg      # have to do anything special.
4892d31dbc53Smrg      aix_use_runtimelinking=no
4893d31dbc53Smrg      exp_sym_flag='-Bexport'
4894d31dbc53Smrg      no_entry_flag=""
4895d31dbc53Smrg    else
4896d31dbc53Smrg      aix_use_runtimelinking=no
489732b578d3Smrg
4898d31dbc53Smrg      # Test if we are trying to use run time linking or normal
4899d31dbc53Smrg      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
4900d31dbc53Smrg      # need to do runtime linking.
4901d31dbc53Smrg      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
4902d31dbc53Smrg	for ld_flag in $LDFLAGS; do
4903d31dbc53Smrg	  case $ld_flag in
4904d31dbc53Smrg	  *-brtl*)
4905d31dbc53Smrg	    aix_use_runtimelinking=yes
4906d31dbc53Smrg	    break
4907d31dbc53Smrg	    ;;
4908d31dbc53Smrg	  esac
4909d31dbc53Smrg	done
4910d31dbc53Smrg	;;
4911d31dbc53Smrg      esac
491232b578d3Smrg
4913d31dbc53Smrg      exp_sym_flag='-bexport'
4914d31dbc53Smrg      no_entry_flag='-bnoentry'
4915d31dbc53Smrg    fi
491632b578d3Smrg
4917d31dbc53Smrg    # When large executables or shared objects are built, AIX ld can
4918d31dbc53Smrg    # have problems creating the table of contents.  If linking a library
4919d31dbc53Smrg    # or program results in "error TOC overflow" add -mminimal-toc to
4920d31dbc53Smrg    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
4921d31dbc53Smrg    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
492232b578d3Smrg
4923d31dbc53Smrg    _LT_AC_TAGVAR(archive_cmds, $1)=''
4924d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
4925d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
4926d31dbc53Smrg    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
492732b578d3Smrg
4928d31dbc53Smrg    if test "$GXX" = yes; then
4929d31dbc53Smrg      case $host_os in aix4.[[012]]|aix4.[[012]].*)
4930d31dbc53Smrg      # We only want to do this on AIX 4.2 and lower, the check
4931d31dbc53Smrg      # below for broken collect2 doesn't work under 4.3+
4932d31dbc53Smrg	collect2name=`${CC} -print-prog-name=collect2`
4933d31dbc53Smrg	if test -f "$collect2name" && \
4934d31dbc53Smrg	   strings "$collect2name" | grep resolve_lib_name >/dev/null
4935d31dbc53Smrg	then
4936d31dbc53Smrg	  # We have reworked collect2
4937d31dbc53Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
4938d31dbc53Smrg	else
4939d31dbc53Smrg	  # We have old collect2
4940d31dbc53Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
4941d31dbc53Smrg	  # It fails to find uninstalled libraries when the uninstalled
4942d31dbc53Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
4943d31dbc53Smrg	  # to unsupported forces relinking
4944d31dbc53Smrg	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
4945d31dbc53Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4946d31dbc53Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
4947d31dbc53Smrg	fi
494832b578d3Smrg	;;
494932b578d3Smrg      esac
4950d31dbc53Smrg      shared_flag='-shared'
4951d31dbc53Smrg      if test "$aix_use_runtimelinking" = yes; then
4952d31dbc53Smrg	shared_flag="$shared_flag "'${wl}-G'
4953d31dbc53Smrg      fi
4954d31dbc53Smrg    else
4955d31dbc53Smrg      # not using gcc
4956d31dbc53Smrg      if test "$host_cpu" = ia64; then
4957d31dbc53Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
4958d31dbc53Smrg	# chokes on -Wl,-G. The following line is correct:
4959d31dbc53Smrg	shared_flag='-G'
4960d31dbc53Smrg      else
4961d31dbc53Smrg	if test "$aix_use_runtimelinking" = yes; then
4962d31dbc53Smrg	  shared_flag='${wl}-G'
4963d31dbc53Smrg	else
4964d31dbc53Smrg	  shared_flag='${wl}-bM:SRE'
4965d31dbc53Smrg	fi
4966d31dbc53Smrg      fi
4967d31dbc53Smrg    fi
496832b578d3Smrg
4969d31dbc53Smrg    # It seems that -bexpall does not export symbols beginning with
4970d31dbc53Smrg    # underscore (_), so it is better to generate a list of symbols to export.
4971d31dbc53Smrg    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
4972d31dbc53Smrg    if test "$aix_use_runtimelinking" = yes; then
4973d31dbc53Smrg      # Warning - without using the other runtime loading flags (-brtl),
4974d31dbc53Smrg      # -berok will link without error, but may produce a broken library.
4975d31dbc53Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
4976d31dbc53Smrg      # Determine the default libpath from the value encoded in an empty executable.
4977d31dbc53Smrg      _LT_AC_SYS_LIBPATH_AIX
4978d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
4979d31dbc53Smrg
4980d31dbc53Smrg      _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"
4981d31dbc53Smrg     else
498232b578d3Smrg      if test "$host_cpu" = ia64; then
4983d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
4984d31dbc53Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
4985d31dbc53Smrg	_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"
498632b578d3Smrg      else
4987d31dbc53Smrg	# Determine the default libpath from the value encoded in an empty executable.
4988d31dbc53Smrg	_LT_AC_SYS_LIBPATH_AIX
4989d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
4990d31dbc53Smrg	# Warning - without using the other run time loading flags,
4991d31dbc53Smrg	# -berok will link without error, but may produce a broken library.
4992d31dbc53Smrg	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
4993d31dbc53Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
4994d31dbc53Smrg	# Exported symbols can be pulled into shared objects from archives
4995d31dbc53Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
4996d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
4997d31dbc53Smrg	# This is similar to how AIX traditionally builds its shared libraries.
4998d31dbc53Smrg	_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'
499932b578d3Smrg      fi
5000d31dbc53Smrg    fi
5001d31dbc53Smrg    ;;
500232b578d3Smrg
5003d31dbc53Smrg  beos*)
5004d31dbc53Smrg    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5005d31dbc53Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5006d31dbc53Smrg      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5007d31dbc53Smrg      # support --undefined.  This deserves some investigation.  FIXME
5008d31dbc53Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5009d31dbc53Smrg    else
5010d31dbc53Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
5011d31dbc53Smrg    fi
5012d31dbc53Smrg    ;;
501332b578d3Smrg
5014d31dbc53Smrg  chorus*)
5015d31dbc53Smrg    case $cc_basename in
501632b578d3Smrg      *)
5017d31dbc53Smrg	# FIXME: insert proper C++ library support
5018d31dbc53Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
501932b578d3Smrg	;;
5020d31dbc53Smrg    esac
5021d31dbc53Smrg    ;;
502232b578d3Smrg
5023d31dbc53Smrg  cygwin* | mingw* | pw32*)
5024d31dbc53Smrg    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5025d31dbc53Smrg    # as there is no search path for DLLs.
5026d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5027d31dbc53Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5028d31dbc53Smrg    _LT_AC_TAGVAR(always_export_symbols, $1)=no
5029d31dbc53Smrg    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
503032b578d3Smrg
5031d31dbc53Smrg    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
5032d31dbc53Smrg      _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'
5033d31dbc53Smrg      # If the export-symbols file already is a .def file (1st line
5034d31dbc53Smrg      # is EXPORTS), use it as is; otherwise, prepend...
5035d31dbc53Smrg      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5036d31dbc53Smrg	cp $export_symbols $output_objdir/$soname.def;
5037d31dbc53Smrg      else
5038d31dbc53Smrg	echo EXPORTS > $output_objdir/$soname.def;
5039d31dbc53Smrg	cat $export_symbols >> $output_objdir/$soname.def;
5040d31dbc53Smrg      fi~
5041d31dbc53Smrg      $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'
5042d31dbc53Smrg    else
5043d31dbc53Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
5044d31dbc53Smrg    fi
5045d31dbc53Smrg  ;;
5046d31dbc53Smrg      darwin* | rhapsody*)
5047d31dbc53Smrg        case $host_os in
5048d31dbc53Smrg        rhapsody* | darwin1.[[012]])
5049d31dbc53Smrg         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
5050d31dbc53Smrg         ;;
5051d31dbc53Smrg       *) # Darwin 1.3 on
5052d31dbc53Smrg         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
5053d31dbc53Smrg           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
5054d31dbc53Smrg         else
5055d31dbc53Smrg           case ${MACOSX_DEPLOYMENT_TARGET} in
5056d31dbc53Smrg             10.[[012]])
5057d31dbc53Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
5058d31dbc53Smrg               ;;
5059d31dbc53Smrg             10.*)
5060d31dbc53Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
5061d31dbc53Smrg               ;;
5062d31dbc53Smrg           esac
5063d31dbc53Smrg         fi
5064d31dbc53Smrg         ;;
5065d31dbc53Smrg        esac
5066d31dbc53Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
5067d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
5068d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
5069d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5070d31dbc53Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
5071d31dbc53Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
507232b578d3Smrg
5073d31dbc53Smrg    if test "$GXX" = yes ; then
5074d31dbc53Smrg      lt_int_apple_cc_single_mod=no
5075d31dbc53Smrg      output_verbose_link_cmd='echo'
5076d31dbc53Smrg      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
5077d31dbc53Smrg       lt_int_apple_cc_single_mod=yes
5078d31dbc53Smrg      fi
5079d31dbc53Smrg      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
5080d31dbc53Smrg       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
5081d31dbc53Smrg      else
5082d31dbc53Smrg          _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'
5083d31dbc53Smrg        fi
5084d31dbc53Smrg        _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
5085d31dbc53Smrg        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
5086d31dbc53Smrg          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
5087d31dbc53Smrg            _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}'
5088d31dbc53Smrg          else
5089d31dbc53Smrg            _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}'
5090d31dbc53Smrg          fi
5091d31dbc53Smrg            _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}'
5092d31dbc53Smrg      else
509332b578d3Smrg      case $cc_basename in
5094d31dbc53Smrg        xlc*)
5095d31dbc53Smrg         output_verbose_link_cmd='echo'
5096d31dbc53Smrg          _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'
5097d31dbc53Smrg          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
5098d31dbc53Smrg          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
5099d31dbc53Smrg          _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}'
5100d31dbc53Smrg          _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}'
5101d31dbc53Smrg          ;;
5102d31dbc53Smrg       *)
5103d31dbc53Smrg         _LT_AC_TAGVAR(ld_shlibs, $1)=no
5104d31dbc53Smrg          ;;
5105d31dbc53Smrg      esac
5106d31dbc53Smrg      fi
510732b578d3Smrg        ;;
510832b578d3Smrg
5109d31dbc53Smrg  dgux*)
5110d31dbc53Smrg    case $cc_basename in
5111d31dbc53Smrg      ec++*)
5112d31dbc53Smrg	# FIXME: insert proper C++ library support
5113d31dbc53Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5114d31dbc53Smrg	;;
5115d31dbc53Smrg      ghcx*)
5116d31dbc53Smrg	# Green Hills C++ Compiler
5117d31dbc53Smrg	# FIXME: insert proper C++ library support
5118d31dbc53Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5119d31dbc53Smrg	;;
512032b578d3Smrg      *)
5121d31dbc53Smrg	# FIXME: insert proper C++ library support
5122d31dbc53Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5123d31dbc53Smrg	;;
5124d31dbc53Smrg    esac
5125d31dbc53Smrg    ;;
5126d31dbc53Smrg  freebsd[[12]]*)
5127d31dbc53Smrg    # C++ shared libraries reported to be fairly broken before switch to ELF
5128d31dbc53Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
5129d31dbc53Smrg    ;;
5130d31dbc53Smrg  freebsd-elf*)
5131d31dbc53Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
5132d31dbc53Smrg    ;;
5133d31dbc53Smrg  freebsd* | kfreebsd*-gnu | dragonfly*)
5134d31dbc53Smrg    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
5135d31dbc53Smrg    # conventions
5136d31dbc53Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
5137d31dbc53Smrg    ;;
5138d31dbc53Smrg  gnu*)
5139d31dbc53Smrg    ;;
5140d31dbc53Smrg  hpux9*)
5141d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5142d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5143d31dbc53Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5144d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5145d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
5146d31dbc53Smrg				# but as the default
5147d31dbc53Smrg				# location of the library.
514832b578d3Smrg
5149d31dbc53Smrg    case $cc_basename in
5150d31dbc53Smrg    CC*)
5151d31dbc53Smrg      # FIXME: insert proper C++ library support
5152d31dbc53Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
515332b578d3Smrg      ;;
5154d31dbc53Smrg    aCC*)
5155d31dbc53Smrg      _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'
5156d31dbc53Smrg      # Commands to make compiler produce verbose output that lists
5157d31dbc53Smrg      # what "hidden" libraries, object files and flags are used when
5158d31dbc53Smrg      # linking a shared library.
5159d31dbc53Smrg      #
5160d31dbc53Smrg      # There doesn't appear to be a way to prevent this compiler from
5161d31dbc53Smrg      # explicitly linking system object files so we need to strip them
5162d31dbc53Smrg      # from the output so that they don't get included in the library
5163d31dbc53Smrg      # dependencies.
5164d31dbc53Smrg      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'
516532b578d3Smrg      ;;
5166d31dbc53Smrg    *)
5167d31dbc53Smrg      if test "$GXX" = yes; then
5168d31dbc53Smrg        _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'
5169d31dbc53Smrg      else
5170d31dbc53Smrg        # FIXME: insert proper C++ library support
5171d31dbc53Smrg        _LT_AC_TAGVAR(ld_shlibs, $1)=no
517232b578d3Smrg      fi
517332b578d3Smrg      ;;
5174d31dbc53Smrg    esac
5175d31dbc53Smrg    ;;
5176d31dbc53Smrg  hpux10*|hpux11*)
5177d31dbc53Smrg    if test $with_gnu_ld = no; then
5178d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5179d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
518032b578d3Smrg
5181d31dbc53Smrg      case $host_cpu in
5182d31dbc53Smrg      hppa*64*|ia64*)
5183d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
5184d31dbc53Smrg        ;;
5185d31dbc53Smrg      *)
5186d31dbc53Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5187d31dbc53Smrg        ;;
5188d31dbc53Smrg      esac
5189d31dbc53Smrg    fi
5190d31dbc53Smrg    case $host_cpu in
5191d31dbc53Smrg    hppa*64*|ia64*)
5192d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
5193d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
519432b578d3Smrg      ;;
519532b578d3Smrg    *)
5196d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5197d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
5198d31dbc53Smrg					      # but as the default
5199d31dbc53Smrg					      # location of the library.
520032b578d3Smrg      ;;
520132b578d3Smrg    esac
520232b578d3Smrg
5203d31dbc53Smrg    case $cc_basename in
5204d31dbc53Smrg      CC*)
5205d31dbc53Smrg	# FIXME: insert proper C++ library support
5206d31dbc53Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5207d31dbc53Smrg	;;
5208d31dbc53Smrg      aCC*)
5209d31dbc53Smrg	case $host_cpu in
5210d31dbc53Smrg	hppa*64*)
5211d31dbc53Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5212d31dbc53Smrg	  ;;
5213d31dbc53Smrg	ia64*)
5214d31dbc53Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5215d31dbc53Smrg	  ;;
5216d31dbc53Smrg	*)
5217d31dbc53Smrg	  _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'
5218d31dbc53Smrg	  ;;
5219d31dbc53Smrg	esac
5220d31dbc53Smrg	# Commands to make compiler produce verbose output that lists
5221d31dbc53Smrg	# what "hidden" libraries, object files and flags are used when
5222d31dbc53Smrg	# linking a shared library.
5223d31dbc53Smrg	#
5224d31dbc53Smrg	# There doesn't appear to be a way to prevent this compiler from
5225d31dbc53Smrg	# explicitly linking system object files so we need to strip them
5226d31dbc53Smrg	# from the output so that they don't get included in the library
5227d31dbc53Smrg	# dependencies.
5228d31dbc53Smrg	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'
5229d31dbc53Smrg	;;
5230d31dbc53Smrg      *)
5231d31dbc53Smrg	if test "$GXX" = yes; then
5232d31dbc53Smrg	  if test $with_gnu_ld = no; then
5233d31dbc53Smrg	    case $host_cpu in
5234d31dbc53Smrg	    hppa*64*)
5235d31dbc53Smrg	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5236d31dbc53Smrg	      ;;
5237d31dbc53Smrg	    ia64*)
5238d31dbc53Smrg	      _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'
5239d31dbc53Smrg	      ;;
5240d31dbc53Smrg	    *)
5241d31dbc53Smrg	      _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'
5242d31dbc53Smrg	      ;;
5243d31dbc53Smrg	    esac
5244d31dbc53Smrg	  fi
5245d31dbc53Smrg	else
5246d31dbc53Smrg	  # FIXME: insert proper C++ library support
5247d31dbc53Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
5248d31dbc53Smrg	fi
5249d31dbc53Smrg	;;
5250d31dbc53Smrg    esac
525132b578d3Smrg    ;;
5252d31dbc53Smrg  interix3*)
5253d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=no
5254d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5255d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5256d31dbc53Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5257d31dbc53Smrg    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5258d31dbc53Smrg    # Instead, shared libraries are loaded at an image base (0x10000000 by
5259d31dbc53Smrg    # default) and relocated if they conflict, which is a slow very memory
5260d31dbc53Smrg    # consuming and fragmenting process.  To avoid this, we pick a random,
5261d31dbc53Smrg    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5262d31dbc53Smrg    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5263d31dbc53Smrg    _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'
5264d31dbc53Smrg    _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'
526532b578d3Smrg    ;;
5266d31dbc53Smrg  irix5* | irix6*)
5267d31dbc53Smrg    case $cc_basename in
5268d31dbc53Smrg      CC*)
5269d31dbc53Smrg	# SGI C++
5270d31dbc53Smrg	_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'
527132b578d3Smrg
5272d31dbc53Smrg	# Archives containing C++ object files must be created using
5273d31dbc53Smrg	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
5274d31dbc53Smrg	# necessary to make sure instantiated templates are included
5275d31dbc53Smrg	# in the archive.
5276d31dbc53Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
5277d31dbc53Smrg	;;
5278d31dbc53Smrg      *)
5279d31dbc53Smrg	if test "$GXX" = yes; then
5280d31dbc53Smrg	  if test "$with_gnu_ld" = no; then
5281d31dbc53Smrg	    _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'
5282d31dbc53Smrg	  else
5283d31dbc53Smrg	    _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'
5284d31dbc53Smrg	  fi
5285d31dbc53Smrg	fi
5286d31dbc53Smrg	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
5287d31dbc53Smrg	;;
5288d31dbc53Smrg    esac
5289d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5290d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
529132b578d3Smrg    ;;
5292d31dbc53Smrg  linux*)
5293d31dbc53Smrg    case $cc_basename in
5294d31dbc53Smrg      KCC*)
5295d31dbc53Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
5296d31dbc53Smrg
5297d31dbc53Smrg	# KCC will only create a shared library if the output file
5298d31dbc53Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
5299d31dbc53Smrg	# to its proper name (with version) after linking.
5300d31dbc53Smrg	_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'
5301d31dbc53Smrg	_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'
5302d31dbc53Smrg	# Commands to make compiler produce verbose output that lists
5303d31dbc53Smrg	# what "hidden" libraries, object files and flags are used when
5304d31dbc53Smrg	# linking a shared library.
5305d31dbc53Smrg	#
5306d31dbc53Smrg	# There doesn't appear to be a way to prevent this compiler from
5307d31dbc53Smrg	# explicitly linking system object files so we need to strip them
5308d31dbc53Smrg	# from the output so that they don't get included in the library
5309d31dbc53Smrg	# dependencies.
5310d31dbc53Smrg	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'
5311d31dbc53Smrg
5312d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
5313d31dbc53Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5314d31dbc53Smrg
5315d31dbc53Smrg	# Archives containing C++ object files must be created using
5316d31dbc53Smrg	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
5317d31dbc53Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
5318d31dbc53Smrg	;;
5319d31dbc53Smrg      icpc*)
5320d31dbc53Smrg	# Intel C++
5321d31dbc53Smrg	with_gnu_ld=yes
5322d31dbc53Smrg	# version 8.0 and above of icpc choke on multiply defined symbols
5323d31dbc53Smrg	# if we add $predep_objects and $postdep_objects, however 7.1 and
5324d31dbc53Smrg	# earlier do not add the objects themselves.
5325d31dbc53Smrg	case `$CC -V 2>&1` in
5326d31dbc53Smrg	*"Version 7."*)
5327d31dbc53Smrg  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5328d31dbc53Smrg  	  _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'
5329d31dbc53Smrg	  ;;
5330d31dbc53Smrg	*)  # Version 8.0 or newer
5331d31dbc53Smrg	  tmp_idyn=
5332d31dbc53Smrg	  case $host_cpu in
5333d31dbc53Smrg	    ia64*) tmp_idyn=' -i_dynamic';;
5334d31dbc53Smrg	  esac
5335d31dbc53Smrg  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5336d31dbc53Smrg	  _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'
5337d31dbc53Smrg	  ;;
5338d31dbc53Smrg	esac
5339d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
5340d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5341d31dbc53Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5342d31dbc53Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
5343d31dbc53Smrg	;;
5344d31dbc53Smrg      pgCC*)
5345d31dbc53Smrg        # Portland Group C++ compiler
5346d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
5347d31dbc53Smrg  	_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'
5348d31dbc53Smrg
5349d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
5350d31dbc53Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5351d31dbc53Smrg	_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'
5352d31dbc53Smrg        ;;
5353d31dbc53Smrg      cxx*)
5354d31dbc53Smrg	# Compaq C++
5355d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5356d31dbc53Smrg	_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'
5357d31dbc53Smrg
5358d31dbc53Smrg	runpath_var=LD_RUN_PATH
5359d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5360d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
5361d31dbc53Smrg
5362d31dbc53Smrg	# Commands to make compiler produce verbose output that lists
5363d31dbc53Smrg	# what "hidden" libraries, object files and flags are used when
5364d31dbc53Smrg	# linking a shared library.
5365d31dbc53Smrg	#
5366d31dbc53Smrg	# There doesn't appear to be a way to prevent this compiler from
5367d31dbc53Smrg	# explicitly linking system object files so we need to strip them
5368d31dbc53Smrg	# from the output so that they don't get included in the library
5369d31dbc53Smrg	# dependencies.
5370d31dbc53Smrg	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'
5371d31dbc53Smrg	;;
5372d31dbc53Smrg    esac
5373d31dbc53Smrg    ;;
5374d31dbc53Smrg  lynxos*)
5375d31dbc53Smrg    # FIXME: insert proper C++ library support
5376d31dbc53Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
5377d31dbc53Smrg    ;;
5378d31dbc53Smrg  m88k*)
5379d31dbc53Smrg    # FIXME: insert proper C++ library support
5380d31dbc53Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
5381d31dbc53Smrg    ;;
5382d31dbc53Smrg  mvs*)
5383d31dbc53Smrg    case $cc_basename in
5384d31dbc53Smrg      cxx*)
5385d31dbc53Smrg	# FIXME: insert proper C++ library support
5386d31dbc53Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5387d31dbc53Smrg	;;
5388d31dbc53Smrg      *)
5389d31dbc53Smrg	# FIXME: insert proper C++ library support
5390d31dbc53Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5391d31dbc53Smrg	;;
5392d31dbc53Smrg    esac
5393d31dbc53Smrg    ;;
5394d31dbc53Smrg  netbsd*)
5395d31dbc53Smrg    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5396d31dbc53Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
5397d31dbc53Smrg      wlarc=
5398d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5399d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5400d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
540132b578d3Smrg    fi
5402d31dbc53Smrg    # Workaround some broken pre-1.5 toolchains
5403d31dbc53Smrg    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
540432b578d3Smrg    ;;
5405d31dbc53Smrg  openbsd2*)
5406d31dbc53Smrg    # C++ shared libraries are fairly broken
5407d31dbc53Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
540832b578d3Smrg    ;;
540932b578d3Smrg  openbsd*)
5410d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5411d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5412d31dbc53Smrg    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
5413d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5414d31dbc53Smrg    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5415d31dbc53Smrg      _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'
5416d31dbc53Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5417d31dbc53Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5418d31dbc53Smrg    fi
5419d31dbc53Smrg    output_verbose_link_cmd='echo'
542032b578d3Smrg    ;;
5421d31dbc53Smrg  osf3*)
5422d31dbc53Smrg    case $cc_basename in
5423d31dbc53Smrg      KCC*)
5424d31dbc53Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
542532b578d3Smrg
5426d31dbc53Smrg	# KCC will only create a shared library if the output file
5427d31dbc53Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
5428d31dbc53Smrg	# to its proper name (with version) after linking.
5429d31dbc53Smrg	_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'
543032b578d3Smrg
5431d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5432d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
543332b578d3Smrg
5434d31dbc53Smrg	# Archives containing C++ object files must be created using
5435d31dbc53Smrg	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
5436d31dbc53Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
543732b578d3Smrg
5438d31dbc53Smrg	;;
5439d31dbc53Smrg      RCC*)
5440d31dbc53Smrg	# Rational C++ 2.4.1
5441d31dbc53Smrg	# FIXME: insert proper C++ library support
5442d31dbc53Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5443d31dbc53Smrg	;;
5444d31dbc53Smrg      cxx*)
5445d31dbc53Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5446d31dbc53Smrg	_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'
544732b578d3Smrg
5448d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5449d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
545032b578d3Smrg
5451d31dbc53Smrg	# Commands to make compiler produce verbose output that lists
5452d31dbc53Smrg	# what "hidden" libraries, object files and flags are used when
5453d31dbc53Smrg	# linking a shared library.
5454d31dbc53Smrg	#
5455d31dbc53Smrg	# There doesn't appear to be a way to prevent this compiler from
5456d31dbc53Smrg	# explicitly linking system object files so we need to strip them
5457d31dbc53Smrg	# from the output so that they don't get included in the library
5458d31dbc53Smrg	# dependencies.
5459d31dbc53Smrg	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'
5460d31dbc53Smrg	;;
5461d31dbc53Smrg      *)
5462d31dbc53Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
5463d31dbc53Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5464d31dbc53Smrg	  _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'
546532b578d3Smrg
5466d31dbc53Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5467d31dbc53Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
546832b578d3Smrg
5469d31dbc53Smrg	  # Commands to make compiler produce verbose output that lists
5470d31dbc53Smrg	  # what "hidden" libraries, object files and flags are used when
5471d31dbc53Smrg	  # linking a shared library.
5472d31dbc53Smrg	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
547332b578d3Smrg
547432b578d3Smrg	else
5475d31dbc53Smrg	  # FIXME: insert proper C++ library support
5476d31dbc53Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
5477d31dbc53Smrg	fi
5478d31dbc53Smrg	;;
5479d31dbc53Smrg    esac
5480d31dbc53Smrg    ;;
5481d31dbc53Smrg  osf4* | osf5*)
5482d31dbc53Smrg    case $cc_basename in
5483d31dbc53Smrg      KCC*)
5484d31dbc53Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
548532b578d3Smrg
5486d31dbc53Smrg	# KCC will only create a shared library if the output file
5487d31dbc53Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
5488d31dbc53Smrg	# to its proper name (with version) after linking.
5489d31dbc53Smrg	_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'
549032b578d3Smrg
5491d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5492d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
549332b578d3Smrg
5494d31dbc53Smrg	# Archives containing C++ object files must be created using
5495d31dbc53Smrg	# the KAI C++ compiler.
5496d31dbc53Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
5497d31dbc53Smrg	;;
5498d31dbc53Smrg      RCC*)
5499d31dbc53Smrg	# Rational C++ 2.4.1
5500d31dbc53Smrg	# FIXME: insert proper C++ library support
550132b578d3Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5502d31dbc53Smrg	;;
5503d31dbc53Smrg      cxx*)
5504d31dbc53Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5505d31dbc53Smrg	_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'
5506d31dbc53Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
5507d31dbc53Smrg	  echo "-hidden">> $lib.exp~
5508d31dbc53Smrg	  $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~
5509d31dbc53Smrg	  $rm $lib.exp'
551032b578d3Smrg
5511d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5512d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
551332b578d3Smrg
5514d31dbc53Smrg	# Commands to make compiler produce verbose output that lists
5515d31dbc53Smrg	# what "hidden" libraries, object files and flags are used when
5516d31dbc53Smrg	# linking a shared library.
5517d31dbc53Smrg	#
5518d31dbc53Smrg	# There doesn't appear to be a way to prevent this compiler from
5519d31dbc53Smrg	# explicitly linking system object files so we need to strip them
5520d31dbc53Smrg	# from the output so that they don't get included in the library
5521d31dbc53Smrg	# dependencies.
5522d31dbc53Smrg	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'
5523d31dbc53Smrg	;;
5524d31dbc53Smrg      *)
5525d31dbc53Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
5526d31dbc53Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5527d31dbc53Smrg	 _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'
552832b578d3Smrg
5529d31dbc53Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5530d31dbc53Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
553132b578d3Smrg
5532d31dbc53Smrg	  # Commands to make compiler produce verbose output that lists
5533d31dbc53Smrg	  # what "hidden" libraries, object files and flags are used when
5534d31dbc53Smrg	  # linking a shared library.
5535d31dbc53Smrg	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
553632b578d3Smrg
5537d31dbc53Smrg	else
5538d31dbc53Smrg	  # FIXME: insert proper C++ library support
5539d31dbc53Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
5540d31dbc53Smrg	fi
5541d31dbc53Smrg	;;
5542d31dbc53Smrg    esac
5543d31dbc53Smrg    ;;
5544d31dbc53Smrg  psos*)
5545d31dbc53Smrg    # FIXME: insert proper C++ library support
5546d31dbc53Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
5547d31dbc53Smrg    ;;
5548d31dbc53Smrg  sunos4*)
5549d31dbc53Smrg    case $cc_basename in
5550d31dbc53Smrg      CC*)
5551d31dbc53Smrg	# Sun C++ 4.x
5552d31dbc53Smrg	# FIXME: insert proper C++ library support
555332b578d3Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
555432b578d3Smrg	;;
5555d31dbc53Smrg      lcc*)
5556d31dbc53Smrg	# Lucid
5557d31dbc53Smrg	# FIXME: insert proper C++ library support
5558d31dbc53Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
555932b578d3Smrg	;;
5560d31dbc53Smrg      *)
5561d31dbc53Smrg	# FIXME: insert proper C++ library support
556232b578d3Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5563d31dbc53Smrg	;;
556432b578d3Smrg    esac
5565d31dbc53Smrg    ;;
5566d31dbc53Smrg  solaris*)
5567d31dbc53Smrg    case $cc_basename in
5568d31dbc53Smrg      CC*)
5569d31dbc53Smrg	# Sun C++ 4.2, 5.x and Centerline C++
5570d31dbc53Smrg        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
5571d31dbc53Smrg	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
5572d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5573d31dbc53Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
5574d31dbc53Smrg	$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'
557532b578d3Smrg
5576d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5577d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5578d31dbc53Smrg	case $host_os in
5579d31dbc53Smrg	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
5580d31dbc53Smrg	  *)
5581d31dbc53Smrg	    # The C++ compiler is used as linker so we must use $wl
5582d31dbc53Smrg	    # flag to pass the commands to the underlying system
5583d31dbc53Smrg	    # linker. We must also pass each convience library through
5584d31dbc53Smrg	    # to the system linker between allextract/defaultextract.
5585d31dbc53Smrg	    # The C++ compiler will combine linker options so we
5586d31dbc53Smrg	    # cannot just pass the convience library names through
5587d31dbc53Smrg	    # without $wl.
5588d31dbc53Smrg	    # Supported since Solaris 2.6 (maybe 2.5.1?)
5589d31dbc53Smrg	    _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'
5590d31dbc53Smrg	    ;;
559132b578d3Smrg	esac
5592d31dbc53Smrg	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
559332b578d3Smrg
5594d31dbc53Smrg	output_verbose_link_cmd='echo'
559532b578d3Smrg
5596d31dbc53Smrg	# Archives containing C++ object files must be created using
5597d31dbc53Smrg	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
5598d31dbc53Smrg	# necessary to make sure instantiated templates are included
5599d31dbc53Smrg	# in the archive.
5600d31dbc53Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
5601d31dbc53Smrg	;;
5602d31dbc53Smrg      gcx*)
5603d31dbc53Smrg	# Green Hills C++ Compiler
5604d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
560532b578d3Smrg
5606d31dbc53Smrg	# The C++ compiler must be used to create the archive.
5607d31dbc53Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
5608d31dbc53Smrg	;;
5609d31dbc53Smrg      *)
5610d31dbc53Smrg	# GNU C++ compiler with Solaris linker
5611d31dbc53Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
5612d31dbc53Smrg	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
5613d31dbc53Smrg	  if $CC --version | grep -v '^2\.7' > /dev/null; then
5614d31dbc53Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
5615d31dbc53Smrg	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
5616d31dbc53Smrg		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
561732b578d3Smrg
5618d31dbc53Smrg	    # Commands to make compiler produce verbose output that lists
5619d31dbc53Smrg	    # what "hidden" libraries, object files and flags are used when
5620d31dbc53Smrg	    # linking a shared library.
5621d31dbc53Smrg	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
562232b578d3Smrg	  else
5623d31dbc53Smrg	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
5624d31dbc53Smrg	    # platform.
5625d31dbc53Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
5626d31dbc53Smrg	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
5627d31dbc53Smrg		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
5628d31dbc53Smrg
5629d31dbc53Smrg	    # Commands to make compiler produce verbose output that lists
5630d31dbc53Smrg	    # what "hidden" libraries, object files and flags are used when
5631d31dbc53Smrg	    # linking a shared library.
5632d31dbc53Smrg	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
563332b578d3Smrg	  fi
563432b578d3Smrg
5635d31dbc53Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
563632b578d3Smrg	fi
5637d31dbc53Smrg	;;
5638d31dbc53Smrg    esac
5639d31dbc53Smrg    ;;
5640d31dbc53Smrg  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
5641d31dbc53Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5642d31dbc53Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
5643d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5644d31dbc53Smrg    runpath_var='LD_RUN_PATH'
564532b578d3Smrg
5646d31dbc53Smrg    case $cc_basename in
5647d31dbc53Smrg      CC*)
5648d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5649d31dbc53Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5650d31dbc53Smrg	;;
5651d31dbc53Smrg      *)
5652d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5653d31dbc53Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5654d31dbc53Smrg	;;
5655d31dbc53Smrg    esac
5656d31dbc53Smrg    ;;
5657d31dbc53Smrg  sysv5* | sco3.2v5* | sco5v6*)
5658d31dbc53Smrg    # Note: We can NOT use -z defs as we might desire, because we do not
5659d31dbc53Smrg    # link with -lc, and that would cause any symbols used from libc to
5660d31dbc53Smrg    # always be unresolved, which means just about no library would
5661d31dbc53Smrg    # ever link correctly.  If we're not using GNU ld we use -z text
5662d31dbc53Smrg    # though, which does catch some bad symbols but isn't as heavy-handed
5663d31dbc53Smrg    # as -z defs.
5664d31dbc53Smrg    # For security reasons, it is highly recommended that you always
5665d31dbc53Smrg    # use absolute paths for naming shared libraries, and exclude the
5666d31dbc53Smrg    # DT_RUNPATH tag from executables and libraries.  But doing so
5667d31dbc53Smrg    # requires that you compile everything twice, which is a pain.
5668d31dbc53Smrg    # So that behaviour is only enabled if SCOABSPATH is set to a
5669d31dbc53Smrg    # non-empty value in the environment.  Most likely only useful for
5670d31dbc53Smrg    # creating official distributions of packages.
5671d31dbc53Smrg    # This is a hack until libtool officially supports absolute path
5672d31dbc53Smrg    # names for shared libraries.
5673d31dbc53Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5674d31dbc53Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
5675d31dbc53Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
5676d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5677d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
5678d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
5679d31dbc53Smrg    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
5680d31dbc53Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
5681d31dbc53Smrg    runpath_var='LD_RUN_PATH'
568232b578d3Smrg
5683d31dbc53Smrg    case $cc_basename in
5684d31dbc53Smrg      CC*)
5685d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
5686d31dbc53Smrg	_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'
5687d31dbc53Smrg	;;
5688d31dbc53Smrg      *)
5689d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
5690d31dbc53Smrg	_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'
5691d31dbc53Smrg	;;
5692d31dbc53Smrg    esac
5693d31dbc53Smrg    ;;
5694d31dbc53Smrg  tandem*)
5695d31dbc53Smrg    case $cc_basename in
5696d31dbc53Smrg      NCC*)
5697d31dbc53Smrg	# NonStop-UX NCC 3.20
5698d31dbc53Smrg	# FIXME: insert proper C++ library support
5699d31dbc53Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5700d31dbc53Smrg	;;
5701d31dbc53Smrg      *)
5702d31dbc53Smrg	# FIXME: insert proper C++ library support
5703d31dbc53Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5704d31dbc53Smrg	;;
5705d31dbc53Smrg    esac
5706d31dbc53Smrg    ;;
5707d31dbc53Smrg  vxworks*)
5708d31dbc53Smrg    # FIXME: insert proper C++ library support
5709d31dbc53Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
5710d31dbc53Smrg    ;;
5711d31dbc53Smrg  *)
5712d31dbc53Smrg    # FIXME: insert proper C++ library support
5713d31dbc53Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
5714d31dbc53Smrg    ;;
5715d31dbc53Smrgesac
5716d31dbc53SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
5717d31dbc53Smrgtest "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
571832b578d3Smrg
5719d31dbc53Smrg_LT_AC_TAGVAR(GCC, $1)="$GXX"
5720d31dbc53Smrg_LT_AC_TAGVAR(LD, $1)="$LD"
572132b578d3Smrg
5722d31dbc53SmrgAC_LIBTOOL_POSTDEP_PREDEP($1)
5723d31dbc53SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
5724d31dbc53SmrgAC_LIBTOOL_PROG_CC_C_O($1)
5725d31dbc53SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
5726d31dbc53SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
5727d31dbc53SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
5728d31dbc53SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
572932b578d3Smrg
5730d31dbc53SmrgAC_LIBTOOL_CONFIG($1)
573132b578d3Smrg
5732d31dbc53SmrgAC_LANG_POP
5733d31dbc53SmrgCC=$lt_save_CC
5734d31dbc53SmrgLDCXX=$LD
5735d31dbc53SmrgLD=$lt_save_LD
5736d31dbc53SmrgGCC=$lt_save_GCC
5737d31dbc53Smrgwith_gnu_ldcxx=$with_gnu_ld
5738d31dbc53Smrgwith_gnu_ld=$lt_save_with_gnu_ld
5739d31dbc53Smrglt_cv_path_LDCXX=$lt_cv_path_LD
5740d31dbc53Smrglt_cv_path_LD=$lt_save_path_LD
5741d31dbc53Smrglt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
5742d31dbc53Smrglt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
5743d31dbc53Smrg])# AC_LIBTOOL_LANG_CXX_CONFIG
574432b578d3Smrg
5745d31dbc53Smrg# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
5746d31dbc53Smrg# ------------------------------------
5747d31dbc53Smrg# Figure out "hidden" library dependencies from verbose
5748d31dbc53Smrg# compiler output when linking a shared library.
5749d31dbc53Smrg# Parse the compiler output and extract the necessary
5750d31dbc53Smrg# objects, libraries and library flags.
5751d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
5752d31dbc53Smrgdnl we can't use the lt_simple_compile_test_code here,
5753d31dbc53Smrgdnl because it contains code intended for an executable,
5754d31dbc53Smrgdnl not a library.  It's possible we should let each
5755d31dbc53Smrgdnl tag define a new lt_????_link_test_code variable,
5756d31dbc53Smrgdnl but it's only used here...
5757d31dbc53Smrgifelse([$1],[],[cat > conftest.$ac_ext <<EOF
5758d31dbc53Smrgint a;
5759d31dbc53Smrgvoid foo (void) { a = 0; }
5760d31dbc53SmrgEOF
5761d31dbc53Smrg],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
5762d31dbc53Smrgclass Foo
5763d31dbc53Smrg{
5764d31dbc53Smrgpublic:
5765d31dbc53Smrg  Foo (void) { a = 0; }
5766d31dbc53Smrgprivate:
5767d31dbc53Smrg  int a;
5768d31dbc53Smrg};
5769d31dbc53SmrgEOF
5770d31dbc53Smrg],[$1],[F77],[cat > conftest.$ac_ext <<EOF
5771d31dbc53Smrg      subroutine foo
5772d31dbc53Smrg      implicit none
5773d31dbc53Smrg      integer*4 a
5774d31dbc53Smrg      a=0
5775d31dbc53Smrg      return
5776d31dbc53Smrg      end
5777d31dbc53SmrgEOF
5778d31dbc53Smrg],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
5779d31dbc53Smrgpublic class foo {
5780d31dbc53Smrg  private int a;
5781d31dbc53Smrg  public void bar (void) {
5782d31dbc53Smrg    a = 0;
5783d31dbc53Smrg  }
5784d31dbc53Smrg};
5785d31dbc53SmrgEOF
5786d31dbc53Smrg])
5787d31dbc53Smrgdnl Parse the compiler output and extract the necessary
5788d31dbc53Smrgdnl objects, libraries and library flags.
5789d31dbc53Smrgif AC_TRY_EVAL(ac_compile); then
5790d31dbc53Smrg  # Parse the compiler output and extract the necessary
5791d31dbc53Smrg  # objects, libraries and library flags.
579232b578d3Smrg
5793d31dbc53Smrg  # Sentinel used to keep track of whether or not we are before
5794d31dbc53Smrg  # the conftest object file.
5795d31dbc53Smrg  pre_test_object_deps_done=no
579632b578d3Smrg
5797d31dbc53Smrg  # The `*' in the case matches for architectures that use `case' in
5798d31dbc53Smrg  # $output_verbose_cmd can trigger glob expansion during the loop
5799d31dbc53Smrg  # eval without this substitution.
5800d31dbc53Smrg  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
580132b578d3Smrg
5802d31dbc53Smrg  for p in `eval $output_verbose_link_cmd`; do
5803d31dbc53Smrg    case $p in
580432b578d3Smrg
5805d31dbc53Smrg    -L* | -R* | -l*)
5806d31dbc53Smrg       # Some compilers place space between "-{L,R}" and the path.
5807d31dbc53Smrg       # Remove the space.
5808d31dbc53Smrg       if test $p = "-L" \
5809d31dbc53Smrg	  || test $p = "-R"; then
5810d31dbc53Smrg	 prev=$p
5811d31dbc53Smrg	 continue
5812d31dbc53Smrg       else
5813d31dbc53Smrg	 prev=
5814d31dbc53Smrg       fi
581532b578d3Smrg
5816d31dbc53Smrg       if test "$pre_test_object_deps_done" = no; then
5817d31dbc53Smrg	 case $p in
5818d31dbc53Smrg	 -L* | -R*)
5819d31dbc53Smrg	   # Internal compiler library paths should come after those
5820d31dbc53Smrg	   # provided the user.  The postdeps already come after the
5821d31dbc53Smrg	   # user supplied libs so there is no need to process them.
5822d31dbc53Smrg	   if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
5823d31dbc53Smrg	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
5824d31dbc53Smrg	   else
5825d31dbc53Smrg	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
5826d31dbc53Smrg	   fi
5827d31dbc53Smrg	   ;;
5828d31dbc53Smrg	 # The "-l" case would never come before the object being
5829d31dbc53Smrg	 # linked, so don't bother handling this case.
5830d31dbc53Smrg	 esac
5831d31dbc53Smrg       else
5832d31dbc53Smrg	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
5833d31dbc53Smrg	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
5834d31dbc53Smrg	 else
5835d31dbc53Smrg	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
5836d31dbc53Smrg	 fi
5837d31dbc53Smrg       fi
5838d31dbc53Smrg       ;;
583932b578d3Smrg
5840d31dbc53Smrg    *.$objext)
5841d31dbc53Smrg       # This assumes that the test object file only shows up
5842d31dbc53Smrg       # once in the compiler output.
5843d31dbc53Smrg       if test "$p" = "conftest.$objext"; then
5844d31dbc53Smrg	 pre_test_object_deps_done=yes
5845d31dbc53Smrg	 continue
5846d31dbc53Smrg       fi
584732b578d3Smrg
5848d31dbc53Smrg       if test "$pre_test_object_deps_done" = no; then
5849d31dbc53Smrg	 if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
5850d31dbc53Smrg	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
5851d31dbc53Smrg	 else
5852d31dbc53Smrg	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
5853d31dbc53Smrg	 fi
5854d31dbc53Smrg       else
5855d31dbc53Smrg	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
5856d31dbc53Smrg	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
5857d31dbc53Smrg	 else
5858d31dbc53Smrg	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
5859d31dbc53Smrg	 fi
5860d31dbc53Smrg       fi
5861d31dbc53Smrg       ;;
586232b578d3Smrg
5863d31dbc53Smrg    *) ;; # Ignore the rest.
586432b578d3Smrg
5865d31dbc53Smrg    esac
5866d31dbc53Smrg  done
586732b578d3Smrg
5868d31dbc53Smrg  # Clean up.
5869d31dbc53Smrg  rm -f a.out a.exe
5870d31dbc53Smrgelse
5871d31dbc53Smrg  echo "libtool.m4: error: problem compiling $1 test program"
5872d31dbc53Smrgfi
587332b578d3Smrg
5874d31dbc53Smrg$rm -f confest.$objext
587532b578d3Smrg
5876d31dbc53Smrg# PORTME: override above test on systems where it is broken
5877d31dbc53Smrgifelse([$1],[CXX],
5878d31dbc53Smrg[case $host_os in
5879d31dbc53Smrginterix3*)
5880d31dbc53Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
5881d31dbc53Smrg  # hack all around it, let's just trust "g++" to DTRT.
5882d31dbc53Smrg  _LT_AC_TAGVAR(predep_objects,$1)=
5883d31dbc53Smrg  _LT_AC_TAGVAR(postdep_objects,$1)=
5884d31dbc53Smrg  _LT_AC_TAGVAR(postdeps,$1)=
5885d31dbc53Smrg  ;;
588632b578d3Smrg
5887d31dbc53Smrgsolaris*)
5888d31dbc53Smrg  case $cc_basename in
5889d31dbc53Smrg  CC*)
5890d31dbc53Smrg    # Adding this requires a known-good setup of shared libraries for
5891d31dbc53Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
5892d31dbc53Smrg    # archive will be linked into the output, leading to subtle bugs.
5893d31dbc53Smrg    _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
5894d31dbc53Smrg    ;;
5895d31dbc53Smrg  esac
5896d31dbc53Smrg  ;;
5897d31dbc53Smrgesac
5898d31dbc53Smrg])
589932b578d3Smrg
5900d31dbc53Smrgcase " $_LT_AC_TAGVAR(postdeps, $1) " in
5901d31dbc53Smrg*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
5902d31dbc53Smrgesac
5903d31dbc53Smrg])# AC_LIBTOOL_POSTDEP_PREDEP
590432b578d3Smrg
5905d31dbc53Smrg# AC_LIBTOOL_LANG_F77_CONFIG
5906d31dbc53Smrg# --------------------------
5907d31dbc53Smrg# Ensure that the configuration vars for the C compiler are
5908d31dbc53Smrg# suitably defined.  Those variables are subsequently used by
5909d31dbc53Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
5910d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
5911d31dbc53SmrgAC_DEFUN([_LT_AC_LANG_F77_CONFIG],
5912d31dbc53Smrg[AC_REQUIRE([AC_PROG_F77])
5913d31dbc53SmrgAC_LANG_PUSH(Fortran 77)
591432b578d3Smrg
5915d31dbc53Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
5916d31dbc53Smrg_LT_AC_TAGVAR(allow_undefined_flag, $1)=
5917d31dbc53Smrg_LT_AC_TAGVAR(always_export_symbols, $1)=no
5918d31dbc53Smrg_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
5919d31dbc53Smrg_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
5920d31dbc53Smrg_LT_AC_TAGVAR(hardcode_direct, $1)=no
5921d31dbc53Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
5922d31dbc53Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
5923d31dbc53Smrg_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
5924d31dbc53Smrg_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
5925d31dbc53Smrg_LT_AC_TAGVAR(hardcode_automatic, $1)=no
5926d31dbc53Smrg_LT_AC_TAGVAR(module_cmds, $1)=
5927d31dbc53Smrg_LT_AC_TAGVAR(module_expsym_cmds, $1)=
5928d31dbc53Smrg_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
5929d31dbc53Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
5930d31dbc53Smrg_LT_AC_TAGVAR(no_undefined_flag, $1)=
5931d31dbc53Smrg_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
5932d31dbc53Smrg_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
593332b578d3Smrg
5934d31dbc53Smrg# Source file extension for f77 test sources.
5935d31dbc53Smrgac_ext=f
593632b578d3Smrg
5937d31dbc53Smrg# Object file extension for compiled f77 test sources.
5938d31dbc53Smrgobjext=o
5939d31dbc53Smrg_LT_AC_TAGVAR(objext, $1)=$objext
594032b578d3Smrg
5941d31dbc53Smrg# Code to be used in simple compile tests
5942d31dbc53Smrglt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
594332b578d3Smrg
5944d31dbc53Smrg# Code to be used in simple link tests
5945d31dbc53Smrglt_simple_link_test_code="      program t\n      end\n"
594632b578d3Smrg
5947d31dbc53Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
5948d31dbc53Smrg_LT_AC_SYS_COMPILER
594932b578d3Smrg
5950d31dbc53Smrg# save warnings/boilerplate of simple test code
5951d31dbc53Smrg_LT_COMPILER_BOILERPLATE
5952d31dbc53Smrg_LT_LINKER_BOILERPLATE
595332b578d3Smrg
5954d31dbc53Smrg# Allow CC to be a program name with arguments.
5955d31dbc53Smrglt_save_CC="$CC"
5956d31dbc53SmrgCC=${F77-"f77"}
5957d31dbc53Smrgcompiler=$CC
5958d31dbc53Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
5959d31dbc53Smrg_LT_CC_BASENAME([$compiler])
596032b578d3Smrg
5961d31dbc53SmrgAC_MSG_CHECKING([if libtool supports shared libraries])
5962d31dbc53SmrgAC_MSG_RESULT([$can_build_shared])
596332b578d3Smrg
5964d31dbc53SmrgAC_MSG_CHECKING([whether to build shared libraries])
5965d31dbc53Smrgtest "$can_build_shared" = "no" && enable_shared=no
596632b578d3Smrg
5967d31dbc53Smrg# On AIX, shared libraries and static libraries use the same namespace, and
5968d31dbc53Smrg# are all built from PIC.
5969d31dbc53Smrgcase $host_os in
5970d31dbc53Smrgaix3*)
5971d31dbc53Smrg  test "$enable_shared" = yes && enable_static=no
5972d31dbc53Smrg  if test -n "$RANLIB"; then
5973d31dbc53Smrg    archive_cmds="$archive_cmds~\$RANLIB \$lib"
5974d31dbc53Smrg    postinstall_cmds='$RANLIB $lib'
597532b578d3Smrg  fi
5976d31dbc53Smrg  ;;
5977d31dbc53Smrgaix4* | aix5*)
5978d31dbc53Smrg  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
5979d31dbc53Smrg    test "$enable_shared" = yes && enable_static=no
598032b578d3Smrg  fi
598132b578d3Smrg  ;;
598232b578d3Smrgesac
5983d31dbc53SmrgAC_MSG_RESULT([$enable_shared])
598432b578d3Smrg
5985d31dbc53SmrgAC_MSG_CHECKING([whether to build static libraries])
5986d31dbc53Smrg# Make sure either enable_shared or enable_static is yes.
5987d31dbc53Smrgtest "$enable_shared" = yes || enable_static=yes
5988d31dbc53SmrgAC_MSG_RESULT([$enable_static])
598932b578d3Smrg
5990d31dbc53Smrg_LT_AC_TAGVAR(GCC, $1)="$G77"
5991d31dbc53Smrg_LT_AC_TAGVAR(LD, $1)="$LD"
599232b578d3Smrg
5993d31dbc53SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
5994d31dbc53SmrgAC_LIBTOOL_PROG_CC_C_O($1)
5995d31dbc53SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
5996d31dbc53SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
5997d31dbc53SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
5998d31dbc53SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
599932b578d3Smrg
6000d31dbc53SmrgAC_LIBTOOL_CONFIG($1)
600132b578d3Smrg
6002d31dbc53SmrgAC_LANG_POP
6003d31dbc53SmrgCC="$lt_save_CC"
6004d31dbc53Smrg])# AC_LIBTOOL_LANG_F77_CONFIG
600532b578d3Smrg
600632b578d3Smrg
6007d31dbc53Smrg# AC_LIBTOOL_LANG_GCJ_CONFIG
6008d31dbc53Smrg# --------------------------
6009d31dbc53Smrg# Ensure that the configuration vars for the C compiler are
6010d31dbc53Smrg# suitably defined.  Those variables are subsequently used by
6011d31dbc53Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
6012d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
6013d31dbc53SmrgAC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
6014d31dbc53Smrg[AC_LANG_SAVE
601532b578d3Smrg
6016d31dbc53Smrg# Source file extension for Java test sources.
6017d31dbc53Smrgac_ext=java
601832b578d3Smrg
6019d31dbc53Smrg# Object file extension for compiled Java test sources.
6020d31dbc53Smrgobjext=o
6021d31dbc53Smrg_LT_AC_TAGVAR(objext, $1)=$objext
602232b578d3Smrg
6023d31dbc53Smrg# Code to be used in simple compile tests
6024d31dbc53Smrglt_simple_compile_test_code="class foo {}\n"
602532b578d3Smrg
6026d31dbc53Smrg# Code to be used in simple link tests
6027d31dbc53Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
602832b578d3Smrg
6029d31dbc53Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
6030d31dbc53Smrg_LT_AC_SYS_COMPILER
603132b578d3Smrg
6032d31dbc53Smrg# save warnings/boilerplate of simple test code
6033d31dbc53Smrg_LT_COMPILER_BOILERPLATE
6034d31dbc53Smrg_LT_LINKER_BOILERPLATE
603532b578d3Smrg
6036d31dbc53Smrg# Allow CC to be a program name with arguments.
6037d31dbc53Smrglt_save_CC="$CC"
6038d31dbc53SmrgCC=${GCJ-"gcj"}
6039d31dbc53Smrgcompiler=$CC
6040d31dbc53Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
6041d31dbc53Smrg_LT_CC_BASENAME([$compiler])
6042d31dbc53Smrg
6043d31dbc53Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
6044d31dbc53Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6045d31dbc53Smrg
6046d31dbc53Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6047d31dbc53Smrg
6048d31dbc53SmrgAC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
6049d31dbc53SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
6050d31dbc53SmrgAC_LIBTOOL_PROG_CC_C_O($1)
6051d31dbc53SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
6052d31dbc53SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
6053d31dbc53SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
6054d31dbc53SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
6055d31dbc53Smrg
6056d31dbc53SmrgAC_LIBTOOL_CONFIG($1)
6057d31dbc53Smrg
6058d31dbc53SmrgAC_LANG_RESTORE
6059d31dbc53SmrgCC="$lt_save_CC"
6060d31dbc53Smrg])# AC_LIBTOOL_LANG_GCJ_CONFIG
6061d31dbc53Smrg
6062d31dbc53Smrg
6063d31dbc53Smrg# AC_LIBTOOL_LANG_RC_CONFIG
6064d31dbc53Smrg# -------------------------
6065d31dbc53Smrg# Ensure that the configuration vars for the Windows resource compiler are
6066d31dbc53Smrg# suitably defined.  Those variables are subsequently used by
6067d31dbc53Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
6068d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
6069d31dbc53SmrgAC_DEFUN([_LT_AC_LANG_RC_CONFIG],
6070d31dbc53Smrg[AC_LANG_SAVE
6071d31dbc53Smrg
6072d31dbc53Smrg# Source file extension for RC test sources.
6073d31dbc53Smrgac_ext=rc
6074d31dbc53Smrg
6075d31dbc53Smrg# Object file extension for compiled RC test sources.
6076d31dbc53Smrgobjext=o
6077d31dbc53Smrg_LT_AC_TAGVAR(objext, $1)=$objext
6078d31dbc53Smrg
6079d31dbc53Smrg# Code to be used in simple compile tests
6080d31dbc53Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
6081d31dbc53Smrg
6082d31dbc53Smrg# Code to be used in simple link tests
6083d31dbc53Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
6084d31dbc53Smrg
6085d31dbc53Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
6086d31dbc53Smrg_LT_AC_SYS_COMPILER
6087d31dbc53Smrg
6088d31dbc53Smrg# save warnings/boilerplate of simple test code
6089d31dbc53Smrg_LT_COMPILER_BOILERPLATE
6090d31dbc53Smrg_LT_LINKER_BOILERPLATE
6091d31dbc53Smrg
6092d31dbc53Smrg# Allow CC to be a program name with arguments.
6093d31dbc53Smrglt_save_CC="$CC"
6094d31dbc53SmrgCC=${RC-"windres"}
6095d31dbc53Smrgcompiler=$CC
6096d31dbc53Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
6097d31dbc53Smrg_LT_CC_BASENAME([$compiler])
6098d31dbc53Smrg_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
6099d31dbc53Smrg
6100d31dbc53SmrgAC_LIBTOOL_CONFIG($1)
6101d31dbc53Smrg
6102d31dbc53SmrgAC_LANG_RESTORE
6103d31dbc53SmrgCC="$lt_save_CC"
6104d31dbc53Smrg])# AC_LIBTOOL_LANG_RC_CONFIG
6105d31dbc53Smrg
6106d31dbc53Smrg
6107d31dbc53Smrg# AC_LIBTOOL_CONFIG([TAGNAME])
6108d31dbc53Smrg# ----------------------------
6109d31dbc53Smrg# If TAGNAME is not passed, then create an initial libtool script
6110d31dbc53Smrg# with a default configuration from the untagged config vars.  Otherwise
6111d31dbc53Smrg# add code to config.status for appending the configuration named by
6112d31dbc53Smrg# TAGNAME from the matching tagged config vars.
6113d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_CONFIG],
6114d31dbc53Smrg[# The else clause should only fire when bootstrapping the
6115d31dbc53Smrg# libtool distribution, otherwise you forgot to ship ltmain.sh
6116d31dbc53Smrg# with your package, and you will get complaints that there are
6117d31dbc53Smrg# no rules to generate ltmain.sh.
6118d31dbc53Smrgif test -f "$ltmain"; then
6119d31dbc53Smrg  # See if we are running on zsh, and set the options which allow our commands through
6120d31dbc53Smrg  # without removal of \ escapes.
6121d31dbc53Smrg  if test -n "${ZSH_VERSION+set}" ; then
6122d31dbc53Smrg    setopt NO_GLOB_SUBST
612332b578d3Smrg  fi
6124d31dbc53Smrg  # Now quote all the things that may contain metacharacters while being
6125d31dbc53Smrg  # careful not to overquote the AC_SUBSTed values.  We take copies of the
6126d31dbc53Smrg  # variables and quote the copies for generation of the libtool script.
6127d31dbc53Smrg  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
6128d31dbc53Smrg    SED SHELL STRIP \
6129d31dbc53Smrg    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
6130d31dbc53Smrg    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
6131d31dbc53Smrg    deplibs_check_method reload_flag reload_cmds need_locks \
6132d31dbc53Smrg    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
6133d31dbc53Smrg    lt_cv_sys_global_symbol_to_c_name_address \
6134d31dbc53Smrg    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
6135d31dbc53Smrg    old_postinstall_cmds old_postuninstall_cmds \
6136d31dbc53Smrg    _LT_AC_TAGVAR(compiler, $1) \
6137d31dbc53Smrg    _LT_AC_TAGVAR(CC, $1) \
6138d31dbc53Smrg    _LT_AC_TAGVAR(LD, $1) \
6139d31dbc53Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
6140d31dbc53Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
6141d31dbc53Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
6142d31dbc53Smrg    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
6143d31dbc53Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
6144d31dbc53Smrg    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
6145d31dbc53Smrg    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
6146d31dbc53Smrg    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
6147d31dbc53Smrg    _LT_AC_TAGVAR(old_archive_cmds, $1) \
6148d31dbc53Smrg    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
6149d31dbc53Smrg    _LT_AC_TAGVAR(predep_objects, $1) \
6150d31dbc53Smrg    _LT_AC_TAGVAR(postdep_objects, $1) \
6151d31dbc53Smrg    _LT_AC_TAGVAR(predeps, $1) \
6152d31dbc53Smrg    _LT_AC_TAGVAR(postdeps, $1) \
6153d31dbc53Smrg    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
6154d31dbc53Smrg    _LT_AC_TAGVAR(archive_cmds, $1) \
6155d31dbc53Smrg    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
6156d31dbc53Smrg    _LT_AC_TAGVAR(postinstall_cmds, $1) \
6157d31dbc53Smrg    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
6158d31dbc53Smrg    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
6159d31dbc53Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
6160d31dbc53Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1) \
6161d31dbc53Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
6162d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
6163d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
6164d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
6165d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_automatic, $1) \
6166d31dbc53Smrg    _LT_AC_TAGVAR(module_cmds, $1) \
6167d31dbc53Smrg    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
6168d31dbc53Smrg    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
6169d31dbc53Smrg    _LT_AC_TAGVAR(exclude_expsyms, $1) \
6170d31dbc53Smrg    _LT_AC_TAGVAR(include_expsyms, $1); do
6171d31dbc53Smrg
6172d31dbc53Smrg    case $var in
6173d31dbc53Smrg    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
6174d31dbc53Smrg    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
6175d31dbc53Smrg    _LT_AC_TAGVAR(archive_cmds, $1) | \
6176d31dbc53Smrg    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
6177d31dbc53Smrg    _LT_AC_TAGVAR(module_cmds, $1) | \
6178d31dbc53Smrg    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
6179d31dbc53Smrg    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
6180d31dbc53Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
6181d31dbc53Smrg    extract_expsyms_cmds | reload_cmds | finish_cmds | \
6182d31dbc53Smrg    postinstall_cmds | postuninstall_cmds | \
6183d31dbc53Smrg    old_postinstall_cmds | old_postuninstall_cmds | \
6184d31dbc53Smrg    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
6185d31dbc53Smrg      # Double-quote double-evaled strings.
6186d31dbc53Smrg      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
6187d31dbc53Smrg      ;;
6188d31dbc53Smrg    *)
6189d31dbc53Smrg      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
6190d31dbc53Smrg      ;;
6191d31dbc53Smrg    esac
619232b578d3Smrg  done
619332b578d3Smrg
6194d31dbc53Smrg  case $lt_echo in
6195d31dbc53Smrg  *'\[$]0 --fallback-echo"')
6196d31dbc53Smrg    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
6197d31dbc53Smrg    ;;
6198d31dbc53Smrg  esac
6199d31dbc53Smrg
6200d31dbc53Smrgifelse([$1], [],
6201d31dbc53Smrg  [cfgfile="${ofile}T"
6202d31dbc53Smrg  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
6203d31dbc53Smrg  $rm -f "$cfgfile"
6204d31dbc53Smrg  AC_MSG_NOTICE([creating $ofile])],
6205d31dbc53Smrg  [cfgfile="$ofile"])
6206d31dbc53Smrg
6207d31dbc53Smrg  cat <<__EOF__ >> "$cfgfile"
6208d31dbc53Smrgifelse([$1], [],
6209d31dbc53Smrg[#! $SHELL
6210d31dbc53Smrg
6211d31dbc53Smrg# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
6212d31dbc53Smrg# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
6213d31dbc53Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
6214d31dbc53Smrg#
6215d31dbc53Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
6216d31dbc53Smrg# Free Software Foundation, Inc.
6217d31dbc53Smrg#
6218d31dbc53Smrg# This file is part of GNU Libtool:
6219d31dbc53Smrg# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
622032b578d3Smrg#
622132b578d3Smrg# This program is free software; you can redistribute it and/or modify
622232b578d3Smrg# it under the terms of the GNU General Public License as published by
622332b578d3Smrg# the Free Software Foundation; either version 2 of the License, or
622432b578d3Smrg# (at your option) any later version.
622532b578d3Smrg#
622632b578d3Smrg# This program is distributed in the hope that it will be useful, but
622732b578d3Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
622832b578d3Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
622932b578d3Smrg# General Public License for more details.
623032b578d3Smrg#
623132b578d3Smrg# You should have received a copy of the GNU General Public License
623232b578d3Smrg# along with this program; if not, write to the Free Software
6233d31dbc53Smrg# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
623432b578d3Smrg#
623532b578d3Smrg# As a special exception to the GNU General Public License, if you
623632b578d3Smrg# distribute this file as part of a program that contains a
623732b578d3Smrg# configuration script generated by Autoconf, you may include it under
623832b578d3Smrg# the same distribution terms that you use for the rest of that program.
623932b578d3Smrg
6240d31dbc53Smrg# A sed program that does not truncate output.
6241d31dbc53SmrgSED=$lt_SED
624232b578d3Smrg
6243d31dbc53Smrg# Sed that helps us avoid accidentally triggering echo(1) options like -n.
6244d31dbc53SmrgXsed="$SED -e 1s/^X//"
624532b578d3Smrg
6246d31dbc53Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
6247d31dbc53Smrg# if CDPATH is set.
6248d31dbc53Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
624932b578d3Smrg
6250d31dbc53Smrg# The names of the tagged configurations supported by this script.
6251d31dbc53Smrgavailable_tags=
625232b578d3Smrg
6253d31dbc53Smrg# ### BEGIN LIBTOOL CONFIG],
6254d31dbc53Smrg[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
625532b578d3Smrg
6256d31dbc53Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
625732b578d3Smrg
6258d31dbc53Smrg# Shell to use when invoking shell scripts.
6259d31dbc53SmrgSHELL=$lt_SHELL
626032b578d3Smrg
6261d31dbc53Smrg# Whether or not to build shared libraries.
6262d31dbc53Smrgbuild_libtool_libs=$enable_shared
626332b578d3Smrg
6264d31dbc53Smrg# Whether or not to build static libraries.
6265d31dbc53Smrgbuild_old_libs=$enable_static
626632b578d3Smrg
6267d31dbc53Smrg# Whether or not to add -lc for building shared libraries.
6268d31dbc53Smrgbuild_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
626932b578d3Smrg
6270d31dbc53Smrg# Whether or not to disallow shared libs when runtime libs are static
6271d31dbc53Smrgallow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
627232b578d3Smrg
6273d31dbc53Smrg# Whether or not to optimize for fast installation.
6274d31dbc53Smrgfast_install=$enable_fast_install
627532b578d3Smrg
6276d31dbc53Smrg# The host system.
6277d31dbc53Smrghost_alias=$host_alias
6278d31dbc53Smrghost=$host
6279d31dbc53Smrghost_os=$host_os
628032b578d3Smrg
6281d31dbc53Smrg# The build system.
6282d31dbc53Smrgbuild_alias=$build_alias
6283d31dbc53Smrgbuild=$build
6284d31dbc53Smrgbuild_os=$build_os
628532b578d3Smrg
6286d31dbc53Smrg# An echo program that does not interpret backslashes.
6287d31dbc53Smrgecho=$lt_echo
628832b578d3Smrg
6289d31dbc53Smrg# The archiver.
6290d31dbc53SmrgAR=$lt_AR
6291d31dbc53SmrgAR_FLAGS=$lt_AR_FLAGS
629232b578d3Smrg
6293d31dbc53Smrg# A C compiler.
6294d31dbc53SmrgLTCC=$lt_LTCC
629532b578d3Smrg
6296d31dbc53Smrg# LTCC compiler flags.
6297d31dbc53SmrgLTCFLAGS=$lt_LTCFLAGS
629832b578d3Smrg
6299d31dbc53Smrg# A language-specific compiler.
6300d31dbc53SmrgCC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
630132b578d3Smrg
6302d31dbc53Smrg# Is the compiler the GNU C compiler?
6303d31dbc53Smrgwith_gcc=$_LT_AC_TAGVAR(GCC, $1)
630432b578d3Smrg
6305d31dbc53Smrg# An ERE matcher.
6306d31dbc53SmrgEGREP=$lt_EGREP
630732b578d3Smrg
6308d31dbc53Smrg# The linker used to build libraries.
6309d31dbc53SmrgLD=$lt_[]_LT_AC_TAGVAR(LD, $1)
631032b578d3Smrg
6311d31dbc53Smrg# Whether we need hard or soft links.
6312d31dbc53SmrgLN_S=$lt_LN_S
631332b578d3Smrg
6314d31dbc53Smrg# A BSD-compatible nm program.
6315d31dbc53SmrgNM=$lt_NM
631632b578d3Smrg
6317d31dbc53Smrg# A symbol stripping program
6318d31dbc53SmrgSTRIP=$lt_STRIP
631932b578d3Smrg
6320d31dbc53Smrg# Used to examine libraries when file_magic_cmd begins "file"
6321d31dbc53SmrgMAGIC_CMD=$MAGIC_CMD
632232b578d3Smrg
6323d31dbc53Smrg# Used on cygwin: DLL creation program.
6324d31dbc53SmrgDLLTOOL="$DLLTOOL"
632532b578d3Smrg
6326d31dbc53Smrg# Used on cygwin: object dumper.
6327d31dbc53SmrgOBJDUMP="$OBJDUMP"
632832b578d3Smrg
6329d31dbc53Smrg# Used on cygwin: assembler.
6330d31dbc53SmrgAS="$AS"
633132b578d3Smrg
6332d31dbc53Smrg# The name of the directory that contains temporary libtool files.
6333d31dbc53Smrgobjdir=$objdir
633432b578d3Smrg
6335d31dbc53Smrg# How to create reloadable object files.
6336d31dbc53Smrgreload_flag=$lt_reload_flag
6337d31dbc53Smrgreload_cmds=$lt_reload_cmds
633832b578d3Smrg
6339d31dbc53Smrg# How to pass a linker flag through the compiler.
6340d31dbc53Smrgwl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
634132b578d3Smrg
6342d31dbc53Smrg# Object file suffix (normally "o").
6343d31dbc53Smrgobjext="$ac_objext"
634432b578d3Smrg
6345d31dbc53Smrg# Old archive suffix (normally "a").
6346d31dbc53Smrglibext="$libext"
634732b578d3Smrg
6348d31dbc53Smrg# Shared library suffix (normally ".so").
6349d31dbc53Smrgshrext_cmds='$shrext_cmds'
635032b578d3Smrg
6351d31dbc53Smrg# Executable file suffix (normally "").
6352d31dbc53Smrgexeext="$exeext"
635332b578d3Smrg
6354d31dbc53Smrg# Additional compiler flags for building library objects.
6355d31dbc53Smrgpic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
6356d31dbc53Smrgpic_mode=$pic_mode
635732b578d3Smrg
6358d31dbc53Smrg# What is the maximum length of a command?
6359d31dbc53Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
636032b578d3Smrg
6361d31dbc53Smrg# Does compiler simultaneously support -c and -o options?
6362d31dbc53Smrgcompiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
6363d31dbc53Smrg
6364d31dbc53Smrg# Must we lock files when doing compilation?
6365d31dbc53Smrgneed_locks=$lt_need_locks
6366d31dbc53Smrg
6367d31dbc53Smrg# Do we need the lib prefix for modules?
6368d31dbc53Smrgneed_lib_prefix=$need_lib_prefix
6369d31dbc53Smrg
6370d31dbc53Smrg# Do we need a version for libraries?
6371d31dbc53Smrgneed_version=$need_version
6372d31dbc53Smrg
6373d31dbc53Smrg# Whether dlopen is supported.
6374d31dbc53Smrgdlopen_support=$enable_dlopen
6375d31dbc53Smrg
6376d31dbc53Smrg# Whether dlopen of programs is supported.
6377d31dbc53Smrgdlopen_self=$enable_dlopen_self
6378d31dbc53Smrg
6379d31dbc53Smrg# Whether dlopen of statically linked programs is supported.
6380d31dbc53Smrgdlopen_self_static=$enable_dlopen_self_static
6381d31dbc53Smrg
6382d31dbc53Smrg# Compiler flag to prevent dynamic linking.
6383d31dbc53Smrglink_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
6384d31dbc53Smrg
6385d31dbc53Smrg# Compiler flag to turn off builtin functions.
6386d31dbc53Smrgno_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
6387d31dbc53Smrg
6388d31dbc53Smrg# Compiler flag to allow reflexive dlopens.
6389d31dbc53Smrgexport_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
6390d31dbc53Smrg
6391d31dbc53Smrg# Compiler flag to generate shared objects directly from archives.
6392d31dbc53Smrgwhole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
6393d31dbc53Smrg
6394d31dbc53Smrg# Compiler flag to generate thread-safe objects.
6395d31dbc53Smrgthread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
6396d31dbc53Smrg
6397d31dbc53Smrg# Library versioning type.
6398d31dbc53Smrgversion_type=$version_type
6399d31dbc53Smrg
6400d31dbc53Smrg# Format of library name prefix.
6401d31dbc53Smrglibname_spec=$lt_libname_spec
6402d31dbc53Smrg
6403d31dbc53Smrg# List of archive names.  First name is the real one, the rest are links.
6404d31dbc53Smrg# The last name is the one that the linker finds with -lNAME.
6405d31dbc53Smrglibrary_names_spec=$lt_library_names_spec
6406d31dbc53Smrg
6407d31dbc53Smrg# The coded name of the library, if different from the real name.
6408d31dbc53Smrgsoname_spec=$lt_soname_spec
6409d31dbc53Smrg
6410d31dbc53Smrg# Commands used to build and install an old-style archive.
6411d31dbc53SmrgRANLIB=$lt_RANLIB
6412d31dbc53Smrgold_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
6413d31dbc53Smrgold_postinstall_cmds=$lt_old_postinstall_cmds
6414d31dbc53Smrgold_postuninstall_cmds=$lt_old_postuninstall_cmds
6415d31dbc53Smrg
6416d31dbc53Smrg# Create an old-style archive from a shared archive.
6417d31dbc53Smrgold_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
6418d31dbc53Smrg
6419d31dbc53Smrg# Create a temporary old-style archive to link instead of a shared archive.
6420d31dbc53Smrgold_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
6421d31dbc53Smrg
6422d31dbc53Smrg# Commands used to build and install a shared archive.
6423d31dbc53Smrgarchive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
6424d31dbc53Smrgarchive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
6425d31dbc53Smrgpostinstall_cmds=$lt_postinstall_cmds
6426d31dbc53Smrgpostuninstall_cmds=$lt_postuninstall_cmds
6427d31dbc53Smrg
6428d31dbc53Smrg# Commands used to build a loadable module (assumed same as above if empty)
6429d31dbc53Smrgmodule_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
6430d31dbc53Smrgmodule_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
6431d31dbc53Smrg
6432d31dbc53Smrg# Commands to strip libraries.
6433d31dbc53Smrgold_striplib=$lt_old_striplib
6434d31dbc53Smrgstriplib=$lt_striplib
6435d31dbc53Smrg
6436d31dbc53Smrg# Dependencies to place before the objects being linked to create a
6437d31dbc53Smrg# shared library.
6438d31dbc53Smrgpredep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
6439d31dbc53Smrg
6440d31dbc53Smrg# Dependencies to place after the objects being linked to create a
6441d31dbc53Smrg# shared library.
6442d31dbc53Smrgpostdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
6443d31dbc53Smrg
6444d31dbc53Smrg# Dependencies to place before the objects being linked to create a
6445d31dbc53Smrg# shared library.
6446d31dbc53Smrgpredeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
6447d31dbc53Smrg
6448d31dbc53Smrg# Dependencies to place after the objects being linked to create a
6449d31dbc53Smrg# shared library.
6450d31dbc53Smrgpostdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
6451d31dbc53Smrg
6452d31dbc53Smrg# The library search path used internally by the compiler when linking
6453d31dbc53Smrg# a shared library.
6454d31dbc53Smrgcompiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
6455d31dbc53Smrg
6456d31dbc53Smrg# Method to check whether dependent libraries are shared objects.
6457d31dbc53Smrgdeplibs_check_method=$lt_deplibs_check_method
6458d31dbc53Smrg
6459d31dbc53Smrg# Command to use when deplibs_check_method == file_magic.
6460d31dbc53Smrgfile_magic_cmd=$lt_file_magic_cmd
6461d31dbc53Smrg
6462d31dbc53Smrg# Flag that allows shared libraries with undefined symbols to be built.
6463d31dbc53Smrgallow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
6464d31dbc53Smrg
6465d31dbc53Smrg# Flag that forces no undefined symbols.
6466d31dbc53Smrgno_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
6467d31dbc53Smrg
6468d31dbc53Smrg# Commands used to finish a libtool library installation in a directory.
6469d31dbc53Smrgfinish_cmds=$lt_finish_cmds
6470d31dbc53Smrg
6471d31dbc53Smrg# Same as above, but a single script fragment to be evaled but not shown.
6472d31dbc53Smrgfinish_eval=$lt_finish_eval
6473d31dbc53Smrg
6474d31dbc53Smrg# Take the output of nm and produce a listing of raw symbols and C names.
6475d31dbc53Smrgglobal_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
6476d31dbc53Smrg
6477d31dbc53Smrg# Transform the output of nm in a proper C declaration
6478d31dbc53Smrgglobal_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
6479d31dbc53Smrg
6480d31dbc53Smrg# Transform the output of nm in a C name address pair
6481d31dbc53Smrgglobal_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
6482d31dbc53Smrg
6483d31dbc53Smrg# This is the shared library runtime path variable.
6484d31dbc53Smrgrunpath_var=$runpath_var
6485d31dbc53Smrg
6486d31dbc53Smrg# This is the shared library path variable.
6487d31dbc53Smrgshlibpath_var=$shlibpath_var
6488d31dbc53Smrg
6489d31dbc53Smrg# Is shlibpath searched before the hard-coded library search path?
6490d31dbc53Smrgshlibpath_overrides_runpath=$shlibpath_overrides_runpath
6491d31dbc53Smrg
6492d31dbc53Smrg# How to hardcode a shared library path into an executable.
6493d31dbc53Smrghardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
6494d31dbc53Smrg
6495d31dbc53Smrg# Whether we should hardcode library paths into libraries.
6496d31dbc53Smrghardcode_into_libs=$hardcode_into_libs
6497d31dbc53Smrg
6498d31dbc53Smrg# Flag to hardcode \$libdir into a binary during linking.
6499d31dbc53Smrg# This must work even if \$libdir does not exist.
6500d31dbc53Smrghardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
6501d31dbc53Smrg
6502d31dbc53Smrg# If ld is used when linking, flag to hardcode \$libdir into
6503d31dbc53Smrg# a binary during linking. This must work even if \$libdir does
6504d31dbc53Smrg# not exist.
6505d31dbc53Smrghardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
6506d31dbc53Smrg
6507d31dbc53Smrg# Whether we need a single -rpath flag with a separated argument.
6508d31dbc53Smrghardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
6509d31dbc53Smrg
6510d31dbc53Smrg# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
6511d31dbc53Smrg# resulting binary.
6512d31dbc53Smrghardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
6513d31dbc53Smrg
6514d31dbc53Smrg# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
6515d31dbc53Smrg# resulting binary.
6516d31dbc53Smrghardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
6517d31dbc53Smrg
6518d31dbc53Smrg# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
6519d31dbc53Smrg# the resulting binary.
6520d31dbc53Smrghardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
6521d31dbc53Smrg
6522d31dbc53Smrg# Set to yes if building a shared library automatically hardcodes DIR into the library
6523d31dbc53Smrg# and all subsequent libraries and executables linked against it.
6524d31dbc53Smrghardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
6525d31dbc53Smrg
6526d31dbc53Smrg# Variables whose values should be saved in libtool wrapper scripts and
6527d31dbc53Smrg# restored at relink time.
6528d31dbc53Smrgvariables_saved_for_relink="$variables_saved_for_relink"
6529d31dbc53Smrg
6530d31dbc53Smrg# Whether libtool must link a program against all its dependency libraries.
6531d31dbc53Smrglink_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
6532d31dbc53Smrg
6533d31dbc53Smrg# Compile-time system search path for libraries
6534d31dbc53Smrgsys_lib_search_path_spec=$lt_sys_lib_search_path_spec
6535d31dbc53Smrg
6536d31dbc53Smrg# Run-time system search path for libraries
6537d31dbc53Smrgsys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
6538d31dbc53Smrg
6539d31dbc53Smrg# Fix the shell variable \$srcfile for the compiler.
6540d31dbc53Smrgfix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
6541d31dbc53Smrg
6542d31dbc53Smrg# Set to yes if exported symbols are required.
6543d31dbc53Smrgalways_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
6544d31dbc53Smrg
6545d31dbc53Smrg# The commands to list exported symbols.
6546d31dbc53Smrgexport_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
6547d31dbc53Smrg
6548d31dbc53Smrg# The commands to extract the exported symbol list from a shared archive.
6549d31dbc53Smrgextract_expsyms_cmds=$lt_extract_expsyms_cmds
6550d31dbc53Smrg
6551d31dbc53Smrg# Symbols that should not be listed in the preloaded symbols.
6552d31dbc53Smrgexclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
6553d31dbc53Smrg
6554d31dbc53Smrg# Symbols that must always be exported.
6555d31dbc53Smrginclude_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
6556d31dbc53Smrg
6557d31dbc53Smrgifelse([$1],[],
6558d31dbc53Smrg[# ### END LIBTOOL CONFIG],
6559d31dbc53Smrg[# ### END LIBTOOL TAG CONFIG: $tagname])
6560d31dbc53Smrg
6561d31dbc53Smrg__EOF__
6562d31dbc53Smrg
6563d31dbc53Smrgifelse([$1],[], [
6564d31dbc53Smrg  case $host_os in
6565d31dbc53Smrg  aix3*)
6566d31dbc53Smrg    cat <<\EOF >> "$cfgfile"
6567d31dbc53Smrg
6568d31dbc53Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
6569d31dbc53Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
6570d31dbc53Smrg# vanish in a puff of smoke.
6571d31dbc53Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
6572d31dbc53Smrg  COLLECT_NAMES=
6573d31dbc53Smrg  export COLLECT_NAMES
6574d31dbc53Smrgfi
6575d31dbc53SmrgEOF
6576d31dbc53Smrg    ;;
6577d31dbc53Smrg  esac
6578d31dbc53Smrg
6579d31dbc53Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
6580d31dbc53Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
6581d31dbc53Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
6582d31dbc53Smrg  # is reportedly fixed, but why not run on old versions too?
6583d31dbc53Smrg  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
6584d31dbc53Smrg
6585d31dbc53Smrg  mv -f "$cfgfile" "$ofile" || \
6586d31dbc53Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
6587d31dbc53Smrg  chmod +x "$ofile"
6588d31dbc53Smrg])
6589d31dbc53Smrgelse
6590d31dbc53Smrg  # If there is no Makefile yet, we rely on a make rule to execute
6591d31dbc53Smrg  # `config.status --recheck' to rerun these tests and create the
6592d31dbc53Smrg  # libtool script then.
6593d31dbc53Smrg  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
6594d31dbc53Smrg  if test -f "$ltmain_in"; then
6595d31dbc53Smrg    test -f Makefile && make "$ltmain"
6596d31dbc53Smrg  fi
6597d31dbc53Smrgfi
6598d31dbc53Smrg])# AC_LIBTOOL_CONFIG
6599d31dbc53Smrg
6600d31dbc53Smrg
6601d31dbc53Smrg# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
6602d31dbc53Smrg# -------------------------------------------
6603d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
6604d31dbc53Smrg[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
6605d31dbc53Smrg
6606d31dbc53Smrg_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
6607d31dbc53Smrg
6608d31dbc53Smrgif test "$GCC" = yes; then
6609d31dbc53Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
6610d31dbc53Smrg
6611d31dbc53Smrg  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
6612d31dbc53Smrg    lt_cv_prog_compiler_rtti_exceptions,
6613d31dbc53Smrg    [-fno-rtti -fno-exceptions], [],
6614d31dbc53Smrg    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
6615d31dbc53Smrgfi
6616d31dbc53Smrg])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
6617d31dbc53Smrg
6618d31dbc53Smrg
6619d31dbc53Smrg# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
6620d31dbc53Smrg# ---------------------------------
6621d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
6622d31dbc53Smrg[AC_REQUIRE([AC_CANONICAL_HOST])
6623d31dbc53SmrgAC_REQUIRE([AC_PROG_NM])
6624d31dbc53SmrgAC_REQUIRE([AC_OBJEXT])
6625d31dbc53Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
6626d31dbc53SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
6627d31dbc53SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
6628d31dbc53Smrg[
6629d31dbc53Smrg# These are sane defaults that work on at least a few old systems.
6630d31dbc53Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
6631d31dbc53Smrg
6632d31dbc53Smrg# Character class describing NM global symbol codes.
6633d31dbc53Smrgsymcode='[[BCDEGRST]]'
6634d31dbc53Smrg
6635d31dbc53Smrg# Regexp to match symbols that can be accessed directly from C.
6636d31dbc53Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
6637d31dbc53Smrg
6638d31dbc53Smrg# Transform an extracted symbol line into a proper C declaration
6639d31dbc53Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
6640d31dbc53Smrg
6641d31dbc53Smrg# Transform an extracted symbol line into symbol name and symbol address
6642d31dbc53Smrglt_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'"
6643d31dbc53Smrg
6644d31dbc53Smrg# Define system-specific variables.
6645d31dbc53Smrgcase $host_os in
6646d31dbc53Smrgaix*)
6647d31dbc53Smrg  symcode='[[BCDT]]'
6648d31dbc53Smrg  ;;
6649d31dbc53Smrgcygwin* | mingw* | pw32*)
6650d31dbc53Smrg  symcode='[[ABCDGISTW]]'
6651d31dbc53Smrg  ;;
6652d31dbc53Smrghpux*) # Its linker distinguishes data from code symbols
6653d31dbc53Smrg  if test "$host_cpu" = ia64; then
6654d31dbc53Smrg    symcode='[[ABCDEGRST]]'
6655d31dbc53Smrg  fi
6656d31dbc53Smrg  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
6657d31dbc53Smrg  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'"
6658d31dbc53Smrg  ;;
6659d31dbc53Smrglinux*)
6660d31dbc53Smrg  if test "$host_cpu" = ia64; then
6661d31dbc53Smrg    symcode='[[ABCDGIRSTW]]'
6662d31dbc53Smrg    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
6663d31dbc53Smrg    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'"
6664d31dbc53Smrg  fi
6665d31dbc53Smrg  ;;
6666d31dbc53Smrgirix* | nonstopux*)
6667d31dbc53Smrg  symcode='[[BCDEGRST]]'
6668d31dbc53Smrg  ;;
6669d31dbc53Smrgosf*)
6670d31dbc53Smrg  symcode='[[BCDEGQRST]]'
6671d31dbc53Smrg  ;;
6672d31dbc53Smrgsolaris*)
6673d31dbc53Smrg  symcode='[[BDRT]]'
6674d31dbc53Smrg  ;;
6675d31dbc53Smrgsco3.2v5*)
6676d31dbc53Smrg  symcode='[[DT]]'
6677d31dbc53Smrg  ;;
6678d31dbc53Smrgsysv4.2uw2*)
6679d31dbc53Smrg  symcode='[[DT]]'
6680d31dbc53Smrg  ;;
6681d31dbc53Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
6682d31dbc53Smrg  symcode='[[ABDT]]'
6683d31dbc53Smrg  ;;
6684d31dbc53Smrgsysv4)
6685d31dbc53Smrg  symcode='[[DFNSTU]]'
6686d31dbc53Smrg  ;;
6687d31dbc53Smrgesac
6688d31dbc53Smrg
6689d31dbc53Smrg# Handle CRLF in mingw tool chain
6690d31dbc53Smrgopt_cr=
6691d31dbc53Smrgcase $build_os in
6692d31dbc53Smrgmingw*)
6693d31dbc53Smrg  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
6694d31dbc53Smrg  ;;
6695d31dbc53Smrgesac
6696d31dbc53Smrg
6697d31dbc53Smrg# If we're using GNU nm, then use its standard symbol codes.
6698d31dbc53Smrgcase `$NM -V 2>&1` in
6699d31dbc53Smrg*GNU* | *'with BFD'*)
6700d31dbc53Smrg  symcode='[[ABCDGIRSTW]]' ;;
6701d31dbc53Smrgesac
6702d31dbc53Smrg
6703d31dbc53Smrg# Try without a prefix undercore, then with it.
6704d31dbc53Smrgfor ac_symprfx in "" "_"; do
6705d31dbc53Smrg
6706d31dbc53Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
6707d31dbc53Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
6708d31dbc53Smrg
6709d31dbc53Smrg  # Write the raw and C identifiers.
6710d31dbc53Smrg  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
6711d31dbc53Smrg
6712d31dbc53Smrg  # Check to see that the pipe works correctly.
6713d31dbc53Smrg  pipe_works=no
6714d31dbc53Smrg
6715d31dbc53Smrg  rm -f conftest*
6716d31dbc53Smrg  cat > conftest.$ac_ext <<EOF
6717d31dbc53Smrg#ifdef __cplusplus
6718d31dbc53Smrgextern "C" {
6719d31dbc53Smrg#endif
6720d31dbc53Smrgchar nm_test_var;
6721d31dbc53Smrgvoid nm_test_func(){}
6722d31dbc53Smrg#ifdef __cplusplus
6723d31dbc53Smrg}
6724d31dbc53Smrg#endif
6725d31dbc53Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
6726d31dbc53SmrgEOF
6727d31dbc53Smrg
6728d31dbc53Smrg  if AC_TRY_EVAL(ac_compile); then
6729d31dbc53Smrg    # Now try to grab the symbols.
6730d31dbc53Smrg    nlist=conftest.nm
6731d31dbc53Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
6732d31dbc53Smrg      # Try sorting and uniquifying the output.
6733d31dbc53Smrg      if sort "$nlist" | uniq > "$nlist"T; then
6734d31dbc53Smrg	mv -f "$nlist"T "$nlist"
6735d31dbc53Smrg      else
6736d31dbc53Smrg	rm -f "$nlist"T
6737d31dbc53Smrg      fi
6738d31dbc53Smrg
6739d31dbc53Smrg      # Make sure that we snagged all the symbols we need.
6740d31dbc53Smrg      if grep ' nm_test_var$' "$nlist" >/dev/null; then
6741d31dbc53Smrg	if grep ' nm_test_func$' "$nlist" >/dev/null; then
6742d31dbc53Smrg	  cat <<EOF > conftest.$ac_ext
6743d31dbc53Smrg#ifdef __cplusplus
6744d31dbc53Smrgextern "C" {
6745d31dbc53Smrg#endif
6746d31dbc53Smrg
6747d31dbc53SmrgEOF
6748d31dbc53Smrg	  # Now generate the symbol file.
6749d31dbc53Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
6750d31dbc53Smrg
6751d31dbc53Smrg	  cat <<EOF >> conftest.$ac_ext
6752d31dbc53Smrg#if defined (__STDC__) && __STDC__
6753d31dbc53Smrg# define lt_ptr_t void *
6754d31dbc53Smrg#else
6755d31dbc53Smrg# define lt_ptr_t char *
6756d31dbc53Smrg# define const
6757d31dbc53Smrg#endif
6758d31dbc53Smrg
6759d31dbc53Smrg/* The mapping between symbol names and symbols. */
6760d31dbc53Smrgconst struct {
6761d31dbc53Smrg  const char *name;
6762d31dbc53Smrg  lt_ptr_t address;
6763d31dbc53Smrg}
6764d31dbc53Smrglt_preloaded_symbols[[]] =
6765d31dbc53Smrg{
6766d31dbc53SmrgEOF
6767d31dbc53Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
6768d31dbc53Smrg	  cat <<\EOF >> conftest.$ac_ext
6769d31dbc53Smrg  {0, (lt_ptr_t) 0}
6770d31dbc53Smrg};
6771d31dbc53Smrg
6772d31dbc53Smrg#ifdef __cplusplus
6773d31dbc53Smrg}
6774d31dbc53Smrg#endif
6775d31dbc53SmrgEOF
6776d31dbc53Smrg	  # Now try linking the two files.
6777d31dbc53Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
6778d31dbc53Smrg	  lt_save_LIBS="$LIBS"
6779d31dbc53Smrg	  lt_save_CFLAGS="$CFLAGS"
6780d31dbc53Smrg	  LIBS="conftstm.$ac_objext"
6781d31dbc53Smrg	  CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
6782d31dbc53Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
6783d31dbc53Smrg	    pipe_works=yes
6784d31dbc53Smrg	  fi
6785d31dbc53Smrg	  LIBS="$lt_save_LIBS"
6786d31dbc53Smrg	  CFLAGS="$lt_save_CFLAGS"
6787d31dbc53Smrg	else
6788d31dbc53Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
6789d31dbc53Smrg	fi
6790d31dbc53Smrg      else
6791d31dbc53Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
6792d31dbc53Smrg      fi
6793d31dbc53Smrg    else
6794d31dbc53Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
6795d31dbc53Smrg    fi
6796d31dbc53Smrg  else
6797d31dbc53Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
6798d31dbc53Smrg    cat conftest.$ac_ext >&5
6799d31dbc53Smrg  fi
6800d31dbc53Smrg  rm -f conftest* conftst*
6801d31dbc53Smrg
6802d31dbc53Smrg  # Do not use the global_symbol_pipe unless it works.
6803d31dbc53Smrg  if test "$pipe_works" = yes; then
6804d31dbc53Smrg    break
6805d31dbc53Smrg  else
6806d31dbc53Smrg    lt_cv_sys_global_symbol_pipe=
6807d31dbc53Smrg  fi
6808d31dbc53Smrgdone
6809d31dbc53Smrg])
6810d31dbc53Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
6811d31dbc53Smrg  lt_cv_sys_global_symbol_to_cdecl=
6812d31dbc53Smrgfi
6813d31dbc53Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
6814d31dbc53Smrg  AC_MSG_RESULT(failed)
6815d31dbc53Smrgelse
6816d31dbc53Smrg  AC_MSG_RESULT(ok)
6817d31dbc53Smrgfi
6818d31dbc53Smrg]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
6819d31dbc53Smrg
6820d31dbc53Smrg
6821d31dbc53Smrg# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
6822d31dbc53Smrg# ---------------------------------------
6823d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
6824d31dbc53Smrg[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
6825d31dbc53Smrg_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
6826d31dbc53Smrg_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
6827d31dbc53Smrg
6828d31dbc53SmrgAC_MSG_CHECKING([for $compiler option to produce PIC])
6829d31dbc53Smrg ifelse([$1],[CXX],[
6830d31dbc53Smrg  # C++ specific cases for pic, static, wl, etc.
6831d31dbc53Smrg  if test "$GXX" = yes; then
6832d31dbc53Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6833d31dbc53Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
6834d31dbc53Smrg
6835d31dbc53Smrg    case $host_os in
6836d31dbc53Smrg    aix*)
6837d31dbc53Smrg      # All AIX code is PIC.
6838d31dbc53Smrg      if test "$host_cpu" = ia64; then
6839d31dbc53Smrg	# AIX 5 now supports IA64 processor
6840d31dbc53Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6841d31dbc53Smrg      fi
6842d31dbc53Smrg      ;;
6843d31dbc53Smrg    amigaos*)
6844d31dbc53Smrg      # FIXME: we need at least 68020 code to build shared libraries, but
6845d31dbc53Smrg      # adding the `-m68020' flag to GCC prevents building anything better,
6846d31dbc53Smrg      # like `-m68040'.
6847d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
6848d31dbc53Smrg      ;;
6849d31dbc53Smrg    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
6850d31dbc53Smrg      # PIC is the default for these OSes.
6851d31dbc53Smrg      ;;
6852d31dbc53Smrg    mingw* | os2* | pw32*)
6853d31dbc53Smrg      # This hack is so that the source file can tell whether it is being
6854d31dbc53Smrg      # built for inclusion in a dll (and should export symbols for example).
6855d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
6856d31dbc53Smrg      ;;
6857d31dbc53Smrg    darwin* | rhapsody*)
6858d31dbc53Smrg      # PIC is the default on this platform
6859d31dbc53Smrg      # Common symbols not allowed in MH_DYLIB files
6860d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
6861d31dbc53Smrg      ;;
6862d31dbc53Smrg    *djgpp*)
6863d31dbc53Smrg      # DJGPP does not support shared libraries at all
6864d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
6865d31dbc53Smrg      ;;
6866d31dbc53Smrg    interix3*)
6867d31dbc53Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
6868d31dbc53Smrg      # Instead, we relocate shared libraries at runtime.
6869d31dbc53Smrg      ;;
6870d31dbc53Smrg    sysv4*MP*)
6871d31dbc53Smrg      if test -d /usr/nec; then
6872d31dbc53Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
6873d31dbc53Smrg      fi
6874d31dbc53Smrg      ;;
6875d31dbc53Smrg    hpux*)
6876d31dbc53Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
6877d31dbc53Smrg      # not for PA HP-UX.
6878d31dbc53Smrg      case $host_cpu in
6879d31dbc53Smrg      hppa*64*|ia64*)
6880d31dbc53Smrg	;;
6881d31dbc53Smrg      *)
6882d31dbc53Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
6883d31dbc53Smrg	;;
6884d31dbc53Smrg      esac
6885d31dbc53Smrg      ;;
6886d31dbc53Smrg    *)
6887d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
6888d31dbc53Smrg      ;;
6889d31dbc53Smrg    esac
6890d31dbc53Smrg  else
6891d31dbc53Smrg    case $host_os in
6892d31dbc53Smrg      aix4* | aix5*)
6893d31dbc53Smrg	# All AIX code is PIC.
6894d31dbc53Smrg	if test "$host_cpu" = ia64; then
6895d31dbc53Smrg	  # AIX 5 now supports IA64 processor
6896d31dbc53Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6897d31dbc53Smrg	else
6898d31dbc53Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
6899d31dbc53Smrg	fi
6900d31dbc53Smrg	;;
6901d31dbc53Smrg      chorus*)
6902d31dbc53Smrg	case $cc_basename in
6903d31dbc53Smrg	cxch68*)
6904d31dbc53Smrg	  # Green Hills C++ Compiler
6905d31dbc53Smrg	  # _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"
6906d31dbc53Smrg	  ;;
6907d31dbc53Smrg	esac
6908d31dbc53Smrg	;;
6909d31dbc53Smrg       darwin*)
6910d31dbc53Smrg         # PIC is the default on this platform
6911d31dbc53Smrg         # Common symbols not allowed in MH_DYLIB files
6912d31dbc53Smrg         case $cc_basename in
6913d31dbc53Smrg           xlc*)
6914d31dbc53Smrg           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
6915d31dbc53Smrg           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6916d31dbc53Smrg           ;;
6917d31dbc53Smrg         esac
6918d31dbc53Smrg       ;;
6919d31dbc53Smrg      dgux*)
6920d31dbc53Smrg	case $cc_basename in
6921d31dbc53Smrg	  ec++*)
6922d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6923d31dbc53Smrg	    ;;
6924d31dbc53Smrg	  ghcx*)
6925d31dbc53Smrg	    # Green Hills C++ Compiler
6926d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
6927d31dbc53Smrg	    ;;
6928d31dbc53Smrg	  *)
6929d31dbc53Smrg	    ;;
6930d31dbc53Smrg	esac
6931d31dbc53Smrg	;;
6932d31dbc53Smrg      freebsd* | kfreebsd*-gnu | dragonfly*)
6933d31dbc53Smrg	# FreeBSD uses GNU C++
6934d31dbc53Smrg	;;
6935d31dbc53Smrg      hpux9* | hpux10* | hpux11*)
6936d31dbc53Smrg	case $cc_basename in
6937d31dbc53Smrg	  CC*)
6938d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6939d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
6940d31dbc53Smrg	    if test "$host_cpu" != ia64; then
6941d31dbc53Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
6942d31dbc53Smrg	    fi
6943d31dbc53Smrg	    ;;
6944d31dbc53Smrg	  aCC*)
6945d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6946d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
6947d31dbc53Smrg	    case $host_cpu in
6948d31dbc53Smrg	    hppa*64*|ia64*)
6949d31dbc53Smrg	      # +Z the default
6950d31dbc53Smrg	      ;;
6951d31dbc53Smrg	    *)
6952d31dbc53Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
6953d31dbc53Smrg	      ;;
6954d31dbc53Smrg	    esac
6955d31dbc53Smrg	    ;;
6956d31dbc53Smrg	  *)
6957d31dbc53Smrg	    ;;
6958d31dbc53Smrg	esac
6959d31dbc53Smrg	;;
6960d31dbc53Smrg      interix*)
6961d31dbc53Smrg	# This is c89, which is MS Visual C++ (no shared libs)
6962d31dbc53Smrg	# Anyone wants to do a port?
6963d31dbc53Smrg	;;
6964d31dbc53Smrg      irix5* | irix6* | nonstopux*)
6965d31dbc53Smrg	case $cc_basename in
6966d31dbc53Smrg	  CC*)
6967d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6968d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
6969d31dbc53Smrg	    # CC pic flag -KPIC is the default.
6970d31dbc53Smrg	    ;;
6971d31dbc53Smrg	  *)
6972d31dbc53Smrg	    ;;
6973d31dbc53Smrg	esac
6974d31dbc53Smrg	;;
6975d31dbc53Smrg      linux*)
6976d31dbc53Smrg	case $cc_basename in
6977d31dbc53Smrg	  KCC*)
6978d31dbc53Smrg	    # KAI C++ Compiler
6979d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
6980d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
6981d31dbc53Smrg	    ;;
6982d31dbc53Smrg	  icpc* | ecpc*)
6983d31dbc53Smrg	    # Intel C++
6984d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6985d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
6986d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
6987d31dbc53Smrg	    ;;
6988d31dbc53Smrg	  pgCC*)
6989d31dbc53Smrg	    # Portland Group C++ compiler.
6990d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
6991d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
6992d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
6993d31dbc53Smrg	    ;;
6994d31dbc53Smrg	  cxx*)
6995d31dbc53Smrg	    # Compaq C++
6996d31dbc53Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
6997d31dbc53Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
6998d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
6999d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7000d31dbc53Smrg	    ;;
7001d31dbc53Smrg	  *)
7002d31dbc53Smrg	    ;;
7003d31dbc53Smrg	esac
7004d31dbc53Smrg	;;
7005d31dbc53Smrg      lynxos*)
7006d31dbc53Smrg	;;
7007d31dbc53Smrg      m88k*)
7008d31dbc53Smrg	;;
7009d31dbc53Smrg      mvs*)
7010d31dbc53Smrg	case $cc_basename in
7011d31dbc53Smrg	  cxx*)
7012d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
7013d31dbc53Smrg	    ;;
7014d31dbc53Smrg	  *)
7015d31dbc53Smrg	    ;;
7016d31dbc53Smrg	esac
7017d31dbc53Smrg	;;
7018d31dbc53Smrg      netbsd*)
7019d31dbc53Smrg	;;
7020d31dbc53Smrg      osf3* | osf4* | osf5*)
7021d31dbc53Smrg	case $cc_basename in
7022d31dbc53Smrg	  KCC*)
7023d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
7024d31dbc53Smrg	    ;;
7025d31dbc53Smrg	  RCC*)
7026d31dbc53Smrg	    # Rational C++ 2.4.1
7027d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7028d31dbc53Smrg	    ;;
7029d31dbc53Smrg	  cxx*)
7030d31dbc53Smrg	    # Digital/Compaq C++
7031d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7032d31dbc53Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
7033d31dbc53Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
7034d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
7035d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7036d31dbc53Smrg	    ;;
7037d31dbc53Smrg	  *)
7038d31dbc53Smrg	    ;;
7039d31dbc53Smrg	esac
7040d31dbc53Smrg	;;
7041d31dbc53Smrg      psos*)
7042d31dbc53Smrg	;;
7043d31dbc53Smrg      solaris*)
7044d31dbc53Smrg	case $cc_basename in
7045d31dbc53Smrg	  CC*)
7046d31dbc53Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
7047d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7048d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7049d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
7050d31dbc53Smrg	    ;;
7051d31dbc53Smrg	  gcx*)
7052d31dbc53Smrg	    # Green Hills C++ Compiler
7053d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
7054d31dbc53Smrg	    ;;
7055d31dbc53Smrg	  *)
7056d31dbc53Smrg	    ;;
7057d31dbc53Smrg	esac
7058d31dbc53Smrg	;;
7059d31dbc53Smrg      sunos4*)
7060d31dbc53Smrg	case $cc_basename in
7061d31dbc53Smrg	  CC*)
7062d31dbc53Smrg	    # Sun C++ 4.x
7063d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7064d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7065d31dbc53Smrg	    ;;
7066d31dbc53Smrg	  lcc*)
7067d31dbc53Smrg	    # Lucid
7068d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7069d31dbc53Smrg	    ;;
7070d31dbc53Smrg	  *)
7071d31dbc53Smrg	    ;;
7072d31dbc53Smrg	esac
7073d31dbc53Smrg	;;
7074d31dbc53Smrg      tandem*)
7075d31dbc53Smrg	case $cc_basename in
7076d31dbc53Smrg	  NCC*)
7077d31dbc53Smrg	    # NonStop-UX NCC 3.20
7078d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7079d31dbc53Smrg	    ;;
7080d31dbc53Smrg	  *)
7081d31dbc53Smrg	    ;;
7082d31dbc53Smrg	esac
7083d31dbc53Smrg	;;
7084d31dbc53Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
7085d31dbc53Smrg	case $cc_basename in
7086d31dbc53Smrg	  CC*)
7087d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7088d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7089d31dbc53Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7090d31dbc53Smrg	    ;;
7091d31dbc53Smrg	esac
7092d31dbc53Smrg	;;
7093d31dbc53Smrg      vxworks*)
7094d31dbc53Smrg	;;
7095d31dbc53Smrg      *)
7096d31dbc53Smrg	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
7097d31dbc53Smrg	;;
7098d31dbc53Smrg    esac
7099d31dbc53Smrg  fi
7100d31dbc53Smrg],
7101d31dbc53Smrg[
7102d31dbc53Smrg  if test "$GCC" = yes; then
7103d31dbc53Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7104d31dbc53Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
7105d31dbc53Smrg
7106d31dbc53Smrg    case $host_os in
7107d31dbc53Smrg      aix*)
7108d31dbc53Smrg      # All AIX code is PIC.
7109d31dbc53Smrg      if test "$host_cpu" = ia64; then
7110d31dbc53Smrg	# AIX 5 now supports IA64 processor
7111d31dbc53Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7112d31dbc53Smrg      fi
7113d31dbc53Smrg      ;;
711432b578d3Smrg
7115d31dbc53Smrg    amigaos*)
7116d31dbc53Smrg      # FIXME: we need at least 68020 code to build shared libraries, but
7117d31dbc53Smrg      # adding the `-m68020' flag to GCC prevents building anything better,
7118d31dbc53Smrg      # like `-m68040'.
7119d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
7120d31dbc53Smrg      ;;
712132b578d3Smrg
7122d31dbc53Smrg    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
7123d31dbc53Smrg      # PIC is the default for these OSes.
7124d31dbc53Smrg      ;;
712532b578d3Smrg
7126d31dbc53Smrg    mingw* | pw32* | os2*)
7127d31dbc53Smrg      # This hack is so that the source file can tell whether it is being
7128d31dbc53Smrg      # built for inclusion in a dll (and should export symbols for example).
7129d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
7130d31dbc53Smrg      ;;
713132b578d3Smrg
7132d31dbc53Smrg    darwin* | rhapsody*)
7133d31dbc53Smrg      # PIC is the default on this platform
7134d31dbc53Smrg      # Common symbols not allowed in MH_DYLIB files
7135d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
7136d31dbc53Smrg      ;;
713732b578d3Smrg
7138d31dbc53Smrg    interix3*)
7139d31dbc53Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
7140d31dbc53Smrg      # Instead, we relocate shared libraries at runtime.
7141d31dbc53Smrg      ;;
714232b578d3Smrg
7143d31dbc53Smrg    msdosdjgpp*)
7144d31dbc53Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
7145d31dbc53Smrg      # on systems that don't support them.
7146d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
7147d31dbc53Smrg      enable_shared=no
7148d31dbc53Smrg      ;;
714932b578d3Smrg
7150d31dbc53Smrg    sysv4*MP*)
7151d31dbc53Smrg      if test -d /usr/nec; then
7152d31dbc53Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
7153d31dbc53Smrg      fi
7154d31dbc53Smrg      ;;
715532b578d3Smrg
7156d31dbc53Smrg    hpux*)
7157d31dbc53Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
7158d31dbc53Smrg      # not for PA HP-UX.
7159d31dbc53Smrg      case $host_cpu in
7160d31dbc53Smrg      hppa*64*|ia64*)
7161d31dbc53Smrg	# +Z the default
7162d31dbc53Smrg	;;
7163d31dbc53Smrg      *)
7164d31dbc53Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7165d31dbc53Smrg	;;
7166d31dbc53Smrg      esac
7167d31dbc53Smrg      ;;
716832b578d3Smrg
7169d31dbc53Smrg    *)
7170d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
7171d31dbc53Smrg      ;;
7172d31dbc53Smrg    esac
7173d31dbc53Smrg  else
7174d31dbc53Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
7175d31dbc53Smrg    case $host_os in
7176d31dbc53Smrg    aix*)
7177d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7178d31dbc53Smrg      if test "$host_cpu" = ia64; then
7179d31dbc53Smrg	# AIX 5 now supports IA64 processor
7180d31dbc53Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7181d31dbc53Smrg      else
7182d31dbc53Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
7183d31dbc53Smrg      fi
7184d31dbc53Smrg      ;;
7185d31dbc53Smrg      darwin*)
7186d31dbc53Smrg        # PIC is the default on this platform
7187d31dbc53Smrg        # Common symbols not allowed in MH_DYLIB files
7188d31dbc53Smrg       case $cc_basename in
7189d31dbc53Smrg         xlc*)
7190d31dbc53Smrg         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
7191d31dbc53Smrg         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7192d31dbc53Smrg         ;;
7193d31dbc53Smrg       esac
7194d31dbc53Smrg       ;;
719532b578d3Smrg
7196d31dbc53Smrg    mingw* | pw32* | os2*)
7197d31dbc53Smrg      # This hack is so that the source file can tell whether it is being
7198d31dbc53Smrg      # built for inclusion in a dll (and should export symbols for example).
7199d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
7200d31dbc53Smrg      ;;
720132b578d3Smrg
7202d31dbc53Smrg    hpux9* | hpux10* | hpux11*)
7203d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7204d31dbc53Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
7205d31dbc53Smrg      # not for PA HP-UX.
7206d31dbc53Smrg      case $host_cpu in
7207d31dbc53Smrg      hppa*64*|ia64*)
7208d31dbc53Smrg	# +Z the default
7209d31dbc53Smrg	;;
7210d31dbc53Smrg      *)
7211d31dbc53Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
7212d31dbc53Smrg	;;
7213d31dbc53Smrg      esac
7214d31dbc53Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
7215d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
7216d31dbc53Smrg      ;;
721732b578d3Smrg
7218d31dbc53Smrg    irix5* | irix6* | nonstopux*)
7219d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7220d31dbc53Smrg      # PIC (with -KPIC) is the default.
7221d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7222d31dbc53Smrg      ;;
722332b578d3Smrg
7224d31dbc53Smrg    newsos6)
7225d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7226d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7227d31dbc53Smrg      ;;
722832b578d3Smrg
7229d31dbc53Smrg    linux*)
7230d31dbc53Smrg      case $cc_basename in
7231d31dbc53Smrg      icc* | ecc*)
7232d31dbc53Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7233d31dbc53Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7234d31dbc53Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
7235d31dbc53Smrg        ;;
7236d31dbc53Smrg      pgcc* | pgf77* | pgf90* | pgf95*)
7237d31dbc53Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
7238d31dbc53Smrg	# which looks to be a dead project)
7239d31dbc53Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7240d31dbc53Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
7241d31dbc53Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7242d31dbc53Smrg        ;;
7243d31dbc53Smrg      ccc*)
7244d31dbc53Smrg        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7245d31dbc53Smrg        # All Alpha code is PIC.
7246d31dbc53Smrg        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7247d31dbc53Smrg        ;;
7248d31dbc53Smrg      esac
7249d31dbc53Smrg      ;;
725032b578d3Smrg
7251d31dbc53Smrg    osf3* | osf4* | osf5*)
7252d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7253d31dbc53Smrg      # All OSF/1 code is PIC.
7254d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
7255d31dbc53Smrg      ;;
725632b578d3Smrg
7257d31dbc53Smrg    solaris*)
7258d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7259d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7260d31dbc53Smrg      case $cc_basename in
7261d31dbc53Smrg      f77* | f90* | f95*)
7262d31dbc53Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
7263d31dbc53Smrg      *)
7264d31dbc53Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
7265d31dbc53Smrg      esac
7266d31dbc53Smrg      ;;
726732b578d3Smrg
7268d31dbc53Smrg    sunos4*)
7269d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
7270d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
7271d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7272d31dbc53Smrg      ;;
727332b578d3Smrg
7274d31dbc53Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
7275d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7276d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7277d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7278d31dbc53Smrg      ;;
727932b578d3Smrg
7280d31dbc53Smrg    sysv4*MP*)
7281d31dbc53Smrg      if test -d /usr/nec ;then
7282d31dbc53Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
7283d31dbc53Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7284d31dbc53Smrg      fi
7285d31dbc53Smrg      ;;
728632b578d3Smrg
7287d31dbc53Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
7288d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7289d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
7290d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7291d31dbc53Smrg      ;;
729232b578d3Smrg
7293d31dbc53Smrg    unicos*)
7294d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
7295d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
7296d31dbc53Smrg      ;;
729732b578d3Smrg
7298d31dbc53Smrg    uts4*)
7299d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
7300d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
7301d31dbc53Smrg      ;;
730232b578d3Smrg
7303d31dbc53Smrg    *)
7304d31dbc53Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
7305d31dbc53Smrg      ;;
7306d31dbc53Smrg    esac
7307d31dbc53Smrg  fi
7308d31dbc53Smrg])
7309d31dbc53SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
731032b578d3Smrg
731132b578d3Smrg#
7312d31dbc53Smrg# Check to make sure the PIC flag actually works.
731332b578d3Smrg#
7314d31dbc53Smrgif test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
7315d31dbc53Smrg  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
7316d31dbc53Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
7317d31dbc53Smrg    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
7318d31dbc53Smrg    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
7319d31dbc53Smrg     "" | " "*) ;;
7320d31dbc53Smrg     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
7321d31dbc53Smrg     esac],
7322d31dbc53Smrg    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
7323d31dbc53Smrg     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
732432b578d3Smrgfi
7325d31dbc53Smrgcase $host_os in
7326d31dbc53Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
7327d31dbc53Smrg  *djgpp*)
7328d31dbc53Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
7329d31dbc53Smrg    ;;
7330d31dbc53Smrg  *)
7331d31dbc53Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
7332d31dbc53Smrg    ;;
7333d31dbc53Smrgesac
733432b578d3Smrg
7335d31dbc53Smrg#
7336d31dbc53Smrg# Check to make sure the static flag actually works.
7337d31dbc53Smrg#
7338d31dbc53Smrgwl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
7339d31dbc53SmrgAC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
7340d31dbc53Smrg  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
7341d31dbc53Smrg  $lt_tmp_static_flag,
7342d31dbc53Smrg  [],
7343d31dbc53Smrg  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
734432b578d3Smrg])
734532b578d3Smrg
734632b578d3Smrg
7347d31dbc53Smrg# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
7348d31dbc53Smrg# ------------------------------------
7349d31dbc53Smrg# See if the linker supports building shared libraries.
7350d31dbc53SmrgAC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
7351d31dbc53Smrg[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
7352d31dbc53Smrgifelse([$1],[CXX],[
7353d31dbc53Smrg  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
7354d31dbc53Smrg  case $host_os in
7355d31dbc53Smrg  aix4* | aix5*)
7356d31dbc53Smrg    # If we're using GNU nm, then we don't want the "-C" option.
7357d31dbc53Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
7358d31dbc53Smrg    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
7359d31dbc53Smrg      _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'
7360d31dbc53Smrg    else
7361d31dbc53Smrg      _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'
7362d31dbc53Smrg    fi
7363d31dbc53Smrg    ;;
7364d31dbc53Smrg  pw32*)
7365d31dbc53Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
7366d31dbc53Smrg  ;;
7367d31dbc53Smrg  cygwin* | mingw*)
7368d31dbc53Smrg    _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'
7369d31dbc53Smrg  ;;
7370d31dbc53Smrg  *)
7371d31dbc53Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
7372d31dbc53Smrg  ;;
7373d31dbc53Smrg  esac
7374d31dbc53Smrg],[
7375d31dbc53Smrg  runpath_var=
7376d31dbc53Smrg  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
7377d31dbc53Smrg  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7378d31dbc53Smrg  _LT_AC_TAGVAR(archive_cmds, $1)=
7379d31dbc53Smrg  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
7380d31dbc53Smrg  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
7381d31dbc53Smrg  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
7382d31dbc53Smrg  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
7383d31dbc53Smrg  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
7384d31dbc53Smrg  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
7385d31dbc53Smrg  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
7386d31dbc53Smrg  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
7387d31dbc53Smrg  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
7388d31dbc53Smrg  _LT_AC_TAGVAR(hardcode_direct, $1)=no
7389d31dbc53Smrg  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
7390d31dbc53Smrg  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
7391d31dbc53Smrg  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
7392d31dbc53Smrg  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
7393d31dbc53Smrg  _LT_AC_TAGVAR(module_cmds, $1)=
7394d31dbc53Smrg  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
7395d31dbc53Smrg  _LT_AC_TAGVAR(always_export_symbols, $1)=no
7396d31dbc53Smrg  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
7397d31dbc53Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
7398d31dbc53Smrg  # included in the symbol list
7399d31dbc53Smrg  _LT_AC_TAGVAR(include_expsyms, $1)=
7400d31dbc53Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
7401d31dbc53Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
7402d31dbc53Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
7403d31dbc53Smrg  # as well as any symbol that contains `d'.
7404d31dbc53Smrg  _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
7405d31dbc53Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
7406d31dbc53Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
7407d31dbc53Smrg  # the symbol is explicitly referenced.  Since portable code cannot
7408d31dbc53Smrg  # rely on this symbol name, it's probably fine to never include it in
7409d31dbc53Smrg  # preloaded symbol tables.
7410d31dbc53Smrg  extract_expsyms_cmds=
7411d31dbc53Smrg  # Just being paranoid about ensuring that cc_basename is set.
7412d31dbc53Smrg  _LT_CC_BASENAME([$compiler])
7413d31dbc53Smrg  case $host_os in
7414d31dbc53Smrg  cygwin* | mingw* | pw32*)
7415d31dbc53Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
7416d31dbc53Smrg    # When not using gcc, we currently assume that we are using
7417d31dbc53Smrg    # Microsoft Visual C++.
7418d31dbc53Smrg    if test "$GCC" != yes; then
7419d31dbc53Smrg      with_gnu_ld=no
7420d31dbc53Smrg    fi
7421d31dbc53Smrg    ;;
7422d31dbc53Smrg  interix*)
7423d31dbc53Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
7424d31dbc53Smrg    with_gnu_ld=yes
7425d31dbc53Smrg    ;;
7426d31dbc53Smrg  openbsd*)
7427d31dbc53Smrg    with_gnu_ld=no
7428d31dbc53Smrg    ;;
7429d31dbc53Smrg  esac
7430d31dbc53Smrg
7431d31dbc53Smrg  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
7432d31dbc53Smrg  if test "$with_gnu_ld" = yes; then
7433d31dbc53Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
7434d31dbc53Smrg    wlarc='${wl}'
743532b578d3Smrg
7436d31dbc53Smrg    # Set some defaults for GNU ld with shared library support. These
7437d31dbc53Smrg    # are reset later if shared libraries are not supported. Putting them
7438d31dbc53Smrg    # here allows them to be overridden if necessary.
7439d31dbc53Smrg    runpath_var=LD_RUN_PATH
7440d31dbc53Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
7441d31dbc53Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7442d31dbc53Smrg    # ancient GNU ld didn't support --whole-archive et. al.
7443d31dbc53Smrg    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
7444d31dbc53Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
7445d31dbc53Smrg      else
7446d31dbc53Smrg  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
7447d31dbc53Smrg    fi
7448d31dbc53Smrg    supports_anon_versioning=no
7449d31dbc53Smrg    case `$LD -v 2>/dev/null` in
7450d31dbc53Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
7451d31dbc53Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
7452d31dbc53Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
7453d31dbc53Smrg      *\ 2.11.*) ;; # other 2.11 versions
7454d31dbc53Smrg      *) supports_anon_versioning=yes ;;
7455d31dbc53Smrg    esac
745632b578d3Smrg
7457d31dbc53Smrg    # See if GNU ld supports shared libraries.
7458d31dbc53Smrg    case $host_os in
7459d31dbc53Smrg    aix3* | aix4* | aix5*)
7460d31dbc53Smrg      # On AIX/PPC, the GNU linker is very broken
7461d31dbc53Smrg      if test "$host_cpu" != ia64; then
7462d31dbc53Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
7463d31dbc53Smrg	cat <<EOF 1>&2
746432b578d3Smrg
7465d31dbc53Smrg*** Warning: the GNU linker, at least up to release 2.9.1, is reported
7466d31dbc53Smrg*** to be unable to reliably create shared libraries on AIX.
7467d31dbc53Smrg*** Therefore, libtool is disabling shared libraries support.  If you
7468d31dbc53Smrg*** really care for shared libraries, you may want to modify your PATH
7469d31dbc53Smrg*** so that a non-GNU linker is found, and then restart.
747032b578d3Smrg
7471d31dbc53SmrgEOF
7472d31dbc53Smrg      fi
7473d31dbc53Smrg      ;;
747432b578d3Smrg
7475d31dbc53Smrg    amigaos*)
7476d31dbc53Smrg      _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)'
7477d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7478d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
747932b578d3Smrg
7480d31dbc53Smrg      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
7481d31dbc53Smrg      # that the semantics of dynamic libraries on AmigaOS, at least up
7482d31dbc53Smrg      # to version 4, is to share data among multiple programs linked
7483d31dbc53Smrg      # with the same dynamic library.  Since this doesn't match the
7484d31dbc53Smrg      # behavior of shared libraries on other platforms, we can't use
7485d31dbc53Smrg      # them.
7486d31dbc53Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
7487d31dbc53Smrg      ;;
748832b578d3Smrg
7489d31dbc53Smrg    beos*)
7490d31dbc53Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
7491d31dbc53Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
7492d31dbc53Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
7493d31dbc53Smrg	# support --undefined.  This deserves some investigation.  FIXME
7494d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7495d31dbc53Smrg      else
7496d31dbc53Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
7497d31dbc53Smrg      fi
7498d31dbc53Smrg      ;;
749932b578d3Smrg
7500d31dbc53Smrg    cygwin* | mingw* | pw32*)
7501d31dbc53Smrg      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
7502d31dbc53Smrg      # as there is no search path for DLLs.
7503d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7504d31dbc53Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
7505d31dbc53Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=no
7506d31dbc53Smrg      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7507d31dbc53Smrg      _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'
750832b578d3Smrg
7509d31dbc53Smrg      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
7510d31dbc53Smrg        _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'
7511d31dbc53Smrg	# If the export-symbols file already is a .def file (1st line
7512d31dbc53Smrg	# is EXPORTS), use it as is; otherwise, prepend...
7513d31dbc53Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7514d31dbc53Smrg	  cp $export_symbols $output_objdir/$soname.def;
7515d31dbc53Smrg	else
7516d31dbc53Smrg	  echo EXPORTS > $output_objdir/$soname.def;
7517d31dbc53Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
7518d31dbc53Smrg	fi~
7519d31dbc53Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
7520d31dbc53Smrg      else
7521d31dbc53Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
7522d31dbc53Smrg      fi
7523d31dbc53Smrg      ;;
752432b578d3Smrg
7525d31dbc53Smrg    interix3*)
7526d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
7527d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7528d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7529d31dbc53Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7530d31dbc53Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
7531d31dbc53Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
7532d31dbc53Smrg      # default) and relocated if they conflict, which is a slow very memory
7533d31dbc53Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
7534d31dbc53Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
7535d31dbc53Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
7536d31dbc53Smrg      _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'
7537d31dbc53Smrg      _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'
7538d31dbc53Smrg      ;;
753932b578d3Smrg
7540d31dbc53Smrg    linux*)
7541d31dbc53Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
7542d31dbc53Smrg	tmp_addflag=
7543d31dbc53Smrg	case $cc_basename,$host_cpu in
7544d31dbc53Smrg	pgcc*)				# Portland Group C compiler
7545d31dbc53Smrg	  _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'
7546d31dbc53Smrg	  tmp_addflag=' $pic_flag'
7547d31dbc53Smrg	  ;;
7548d31dbc53Smrg	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
7549d31dbc53Smrg	  _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'
7550d31dbc53Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
7551d31dbc53Smrg	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
7552d31dbc53Smrg	  tmp_addflag=' -i_dynamic' ;;
7553d31dbc53Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
7554d31dbc53Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
7555d31dbc53Smrg	ifc* | ifort*)			# Intel Fortran compiler
7556d31dbc53Smrg	  tmp_addflag=' -nofor_main' ;;
7557d31dbc53Smrg	esac
7558d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
755932b578d3Smrg
7560d31dbc53Smrg	if test $supports_anon_versioning = yes; then
7561d31dbc53Smrg	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
7562d31dbc53Smrg  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
7563d31dbc53Smrg  $echo "local: *; };" >> $output_objdir/$libname.ver~
7564d31dbc53Smrg	  $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
7565d31dbc53Smrg	fi
7566d31dbc53Smrg      else
7567d31dbc53Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
7568d31dbc53Smrg      fi
7569d31dbc53Smrg      ;;
757032b578d3Smrg
7571d31dbc53Smrg    netbsd*)
7572d31dbc53Smrg      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
7573d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
7574d31dbc53Smrg	wlarc=
7575d31dbc53Smrg      else
7576d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7577d31dbc53Smrg	_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'
7578d31dbc53Smrg      fi
7579d31dbc53Smrg      ;;
758032b578d3Smrg
7581d31dbc53Smrg    solaris*)
7582d31dbc53Smrg      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
7583d31dbc53Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
7584d31dbc53Smrg	cat <<EOF 1>&2
758532b578d3Smrg
7586d31dbc53Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
7587d31dbc53Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
7588d31dbc53Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
7589d31dbc53Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
7590d31dbc53Smrg*** your PATH or compiler configuration so that the native linker is
7591d31dbc53Smrg*** used, and then restart.
759232b578d3Smrg
7593d31dbc53SmrgEOF
7594d31dbc53Smrg      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
7595d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7596d31dbc53Smrg	_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'
7597d31dbc53Smrg      else
7598d31dbc53Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
7599d31dbc53Smrg      fi
7600d31dbc53Smrg      ;;
760132b578d3Smrg
7602d31dbc53Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
7603d31dbc53Smrg      case `$LD -v 2>&1` in
7604d31dbc53Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) 
7605d31dbc53Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
7606d31dbc53Smrg	cat <<_LT_EOF 1>&2
760732b578d3Smrg
7608d31dbc53Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
7609d31dbc53Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
7610d31dbc53Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
7611d31dbc53Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
7612d31dbc53Smrg*** your PATH or compiler configuration so that the native linker is
7613d31dbc53Smrg*** used, and then restart.
761432b578d3Smrg
7615d31dbc53Smrg_LT_EOF
7616d31dbc53Smrg	;;
7617d31dbc53Smrg	*)
7618d31dbc53Smrg	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
7619d31dbc53Smrg	    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
7620d31dbc53Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
7621d31dbc53Smrg	    _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'
7622d31dbc53Smrg	  else
7623d31dbc53Smrg	    _LT_AC_TAGVAR(ld_shlibs, $1)=no
7624d31dbc53Smrg	  fi
7625d31dbc53Smrg	;;
7626d31dbc53Smrg      esac
7627d31dbc53Smrg      ;;
762832b578d3Smrg
7629d31dbc53Smrg    sunos4*)
7630d31dbc53Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
7631d31dbc53Smrg      wlarc=
7632d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
7633d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7634d31dbc53Smrg      ;;
763532b578d3Smrg
7636d31dbc53Smrg    *)
7637d31dbc53Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
7638d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7639d31dbc53Smrg	_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'
764032b578d3Smrg      else
7641d31dbc53Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
764232b578d3Smrg      fi
764332b578d3Smrg      ;;
764432b578d3Smrg    esac
764532b578d3Smrg
7646d31dbc53Smrg    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
7647d31dbc53Smrg      runpath_var=
7648d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
7649d31dbc53Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
7650d31dbc53Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
7651d31dbc53Smrg    fi
7652d31dbc53Smrg  else
7653d31dbc53Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
7654d31dbc53Smrg    case $host_os in
7655d31dbc53Smrg    aix3*)
7656d31dbc53Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
7657d31dbc53Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
7658d31dbc53Smrg      _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'
7659d31dbc53Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
7660d31dbc53Smrg      # are no directories specified by -L.
7661d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
7662d31dbc53Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
7663d31dbc53Smrg	# Neither direct hardcoding nor static linking is supported with a
7664d31dbc53Smrg	# broken collect2.
7665d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
7666d31dbc53Smrg      fi
7667d31dbc53Smrg      ;;
766832b578d3Smrg
7669d31dbc53Smrg    aix4* | aix5*)
7670d31dbc53Smrg      if test "$host_cpu" = ia64; then
7671d31dbc53Smrg	# On IA64, the linker does run time linking by default, so we don't
7672d31dbc53Smrg	# have to do anything special.
7673d31dbc53Smrg	aix_use_runtimelinking=no
7674d31dbc53Smrg	exp_sym_flag='-Bexport'
7675d31dbc53Smrg	no_entry_flag=""
7676d31dbc53Smrg      else
7677d31dbc53Smrg	# If we're using GNU nm, then we don't want the "-C" option.
7678d31dbc53Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
7679d31dbc53Smrg	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
7680d31dbc53Smrg	  _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'
7681d31dbc53Smrg	else
7682d31dbc53Smrg	  _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'
7683d31dbc53Smrg	fi
7684d31dbc53Smrg	aix_use_runtimelinking=no
768532b578d3Smrg
7686d31dbc53Smrg	# Test if we are trying to use run time linking or normal
7687d31dbc53Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
7688d31dbc53Smrg	# need to do runtime linking.
7689d31dbc53Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
7690d31dbc53Smrg	  for ld_flag in $LDFLAGS; do
7691d31dbc53Smrg  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
7692d31dbc53Smrg  	    aix_use_runtimelinking=yes
7693d31dbc53Smrg  	    break
7694d31dbc53Smrg  	  fi
7695d31dbc53Smrg	  done
7696d31dbc53Smrg	  ;;
7697d31dbc53Smrg	esac
769832b578d3Smrg
7699d31dbc53Smrg	exp_sym_flag='-bexport'
7700d31dbc53Smrg	no_entry_flag='-bnoentry'
7701d31dbc53Smrg      fi
770232b578d3Smrg
7703d31dbc53Smrg      # When large executables or shared objects are built, AIX ld can
7704d31dbc53Smrg      # have problems creating the table of contents.  If linking a library
7705d31dbc53Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
7706d31dbc53Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
7707d31dbc53Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
770832b578d3Smrg
7709d31dbc53Smrg      _LT_AC_TAGVAR(archive_cmds, $1)=''
7710d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
7711d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
7712d31dbc53Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
771332b578d3Smrg
7714d31dbc53Smrg      if test "$GCC" = yes; then
7715d31dbc53Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
7716d31dbc53Smrg	# We only want to do this on AIX 4.2 and lower, the check
7717d31dbc53Smrg	# below for broken collect2 doesn't work under 4.3+
7718d31dbc53Smrg	  collect2name=`${CC} -print-prog-name=collect2`
7719d31dbc53Smrg	  if test -f "$collect2name" && \
7720d31dbc53Smrg  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
7721d31dbc53Smrg	  then
7722d31dbc53Smrg  	  # We have reworked collect2
7723d31dbc53Smrg  	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
7724d31dbc53Smrg	  else
7725d31dbc53Smrg  	  # We have old collect2
7726d31dbc53Smrg  	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
7727d31dbc53Smrg  	  # It fails to find uninstalled libraries when the uninstalled
7728d31dbc53Smrg  	  # path is not listed in the libpath.  Setting hardcode_minus_L
7729d31dbc53Smrg  	  # to unsupported forces relinking
7730d31dbc53Smrg  	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
7731d31dbc53Smrg  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7732d31dbc53Smrg  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
7733d31dbc53Smrg	  fi
7734d31dbc53Smrg	  ;;
7735d31dbc53Smrg	esac
7736d31dbc53Smrg	shared_flag='-shared'
7737d31dbc53Smrg	if test "$aix_use_runtimelinking" = yes; then
7738d31dbc53Smrg	  shared_flag="$shared_flag "'${wl}-G'
7739d31dbc53Smrg	fi
7740d31dbc53Smrg      else
7741d31dbc53Smrg	# not using gcc
7742d31dbc53Smrg	if test "$host_cpu" = ia64; then
7743d31dbc53Smrg  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
7744d31dbc53Smrg  	# chokes on -Wl,-G. The following line is correct:
7745d31dbc53Smrg	  shared_flag='-G'
7746d31dbc53Smrg	else
7747d31dbc53Smrg	  if test "$aix_use_runtimelinking" = yes; then
7748d31dbc53Smrg	    shared_flag='${wl}-G'
7749d31dbc53Smrg	  else
7750d31dbc53Smrg	    shared_flag='${wl}-bM:SRE'
7751d31dbc53Smrg	  fi
7752d31dbc53Smrg	fi
7753d31dbc53Smrg      fi
775432b578d3Smrg
7755d31dbc53Smrg      # It seems that -bexpall does not export symbols beginning with
7756d31dbc53Smrg      # underscore (_), so it is better to generate a list of symbols to export.
7757d31dbc53Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
7758d31dbc53Smrg      if test "$aix_use_runtimelinking" = yes; then
7759d31dbc53Smrg	# Warning - without using the other runtime loading flags (-brtl),
7760d31dbc53Smrg	# -berok will link without error, but may produce a broken library.
7761d31dbc53Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
7762d31dbc53Smrg       # Determine the default libpath from the value encoded in an empty executable.
7763d31dbc53Smrg       _LT_AC_SYS_LIBPATH_AIX
7764d31dbc53Smrg       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7765d31dbc53Smrg	_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"
7766d31dbc53Smrg       else
7767d31dbc53Smrg	if test "$host_cpu" = ia64; then
7768d31dbc53Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
7769d31dbc53Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
7770d31dbc53Smrg	  _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"
7771d31dbc53Smrg	else
7772d31dbc53Smrg	 # Determine the default libpath from the value encoded in an empty executable.
7773d31dbc53Smrg	 _LT_AC_SYS_LIBPATH_AIX
7774d31dbc53Smrg	 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7775d31dbc53Smrg	  # Warning - without using the other run time loading flags,
7776d31dbc53Smrg	  # -berok will link without error, but may produce a broken library.
7777d31dbc53Smrg	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
7778d31dbc53Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
7779d31dbc53Smrg	  # Exported symbols can be pulled into shared objects from archives
7780d31dbc53Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
7781d31dbc53Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
7782d31dbc53Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
7783d31dbc53Smrg	  _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'
7784d31dbc53Smrg	fi
7785d31dbc53Smrg      fi
7786d31dbc53Smrg      ;;
778732b578d3Smrg
7788d31dbc53Smrg    amigaos*)
7789d31dbc53Smrg      _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)'
7790d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7791d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
7792d31dbc53Smrg      # see comment about different semantics on the GNU ld section
7793d31dbc53Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
7794d31dbc53Smrg      ;;
779532b578d3Smrg
7796d31dbc53Smrg    bsdi[[45]]*)
7797d31dbc53Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
7798d31dbc53Smrg      ;;
779932b578d3Smrg
7800d31dbc53Smrg    cygwin* | mingw* | pw32*)
7801d31dbc53Smrg      # When not using gcc, we currently assume that we are using
7802d31dbc53Smrg      # Microsoft Visual C++.
7803d31dbc53Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
7804d31dbc53Smrg      # no search path for DLLs.
7805d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
7806d31dbc53Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
7807d31dbc53Smrg      # Tell ltmain to make .lib files, not .a files.
7808d31dbc53Smrg      libext=lib
7809d31dbc53Smrg      # Tell ltmain to make .dll files, not .so files.
7810d31dbc53Smrg      shrext_cmds=".dll"
7811d31dbc53Smrg      # FIXME: Setting linknames here is a bad hack.
7812d31dbc53Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
7813d31dbc53Smrg      # The linker will automatically build a .lib file if we build a DLL.
7814d31dbc53Smrg      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
7815d31dbc53Smrg      # FIXME: Should let the user specify the lib program.
7816d31dbc53Smrg      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
7817d31dbc53Smrg      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
7818d31dbc53Smrg      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7819d31dbc53Smrg      ;;
782032b578d3Smrg
7821d31dbc53Smrg    darwin* | rhapsody*)
7822d31dbc53Smrg      case $host_os in
7823d31dbc53Smrg        rhapsody* | darwin1.[[012]])
7824d31dbc53Smrg         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
7825d31dbc53Smrg         ;;
7826d31dbc53Smrg       *) # Darwin 1.3 on
7827d31dbc53Smrg         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
7828d31dbc53Smrg           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
7829d31dbc53Smrg         else
7830d31dbc53Smrg           case ${MACOSX_DEPLOYMENT_TARGET} in
7831d31dbc53Smrg             10.[[012]])
7832d31dbc53Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
7833d31dbc53Smrg               ;;
7834d31dbc53Smrg             10.*)
7835d31dbc53Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
7836d31dbc53Smrg               ;;
7837d31dbc53Smrg           esac
7838d31dbc53Smrg         fi
7839d31dbc53Smrg         ;;
7840d31dbc53Smrg      esac
7841d31dbc53Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
7842d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
7843d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
7844d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
7845d31dbc53Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
7846d31dbc53Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
7847d31dbc53Smrg    if test "$GCC" = yes ; then
7848d31dbc53Smrg    	output_verbose_link_cmd='echo'
7849d31dbc53Smrg        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
7850d31dbc53Smrg      _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
7851d31dbc53Smrg      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
7852d31dbc53Smrg      _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}'
7853d31dbc53Smrg      _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}'
7854d31dbc53Smrg    else
7855d31dbc53Smrg      case $cc_basename in
7856d31dbc53Smrg        xlc*)
7857d31dbc53Smrg         output_verbose_link_cmd='echo'
7858d31dbc53Smrg         _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'
7859d31dbc53Smrg         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
7860d31dbc53Smrg          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
7861d31dbc53Smrg         _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}'
7862d31dbc53Smrg          _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}'
7863d31dbc53Smrg          ;;
7864d31dbc53Smrg       *)
7865d31dbc53Smrg         _LT_AC_TAGVAR(ld_shlibs, $1)=no
7866d31dbc53Smrg          ;;
7867d31dbc53Smrg      esac
7868d31dbc53Smrg    fi
7869d31dbc53Smrg      ;;
787032b578d3Smrg
7871d31dbc53Smrg    dgux*)
7872d31dbc53Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
7873d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7874d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7875d31dbc53Smrg      ;;
787632b578d3Smrg
7877d31dbc53Smrg    freebsd1*)
7878d31dbc53Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
7879d31dbc53Smrg      ;;
788032b578d3Smrg
7881d31dbc53Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
7882d31dbc53Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
7883d31dbc53Smrg    # does not break anything, and helps significantly (at the cost of a little
7884d31dbc53Smrg    # extra space).
7885d31dbc53Smrg    freebsd2.2*)
7886d31dbc53Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
7887d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7888d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
7889d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7890d31dbc53Smrg      ;;
789132b578d3Smrg
7892d31dbc53Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
7893d31dbc53Smrg    freebsd2*)
7894d31dbc53Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
7895d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
7896d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
7897d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7898d31dbc53Smrg      ;;
789932b578d3Smrg
7900d31dbc53Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
7901d31dbc53Smrg    freebsd* | kfreebsd*-gnu | dragonfly*)
7902d31dbc53Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
7903d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7904d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
7905d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7906d31dbc53Smrg      ;;
790732b578d3Smrg
7908d31dbc53Smrg    hpux9*)
7909d31dbc53Smrg      if test "$GCC" = yes; then
7910d31dbc53Smrg	_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'
7911d31dbc53Smrg      else
7912d31dbc53Smrg	_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'
7913d31dbc53Smrg      fi
7914d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7915d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
7916d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
791732b578d3Smrg
7918d31dbc53Smrg      # hardcode_minus_L: Not really in the search PATH,
7919d31dbc53Smrg      # but as the default location of the library.
7920d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
7921d31dbc53Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7922d31dbc53Smrg      ;;
792332b578d3Smrg
7924d31dbc53Smrg    hpux10*)
7925d31dbc53Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
7926d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
7927d31dbc53Smrg      else
7928d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
7929d31dbc53Smrg      fi
7930d31dbc53Smrg      if test "$with_gnu_ld" = no; then
7931d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7932d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
793332b578d3Smrg
7934d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
7935d31dbc53Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
793632b578d3Smrg
7937d31dbc53Smrg	# hardcode_minus_L: Not really in the search PATH,
7938d31dbc53Smrg	# but as the default location of the library.
7939d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
7940d31dbc53Smrg      fi
7941d31dbc53Smrg      ;;
794232b578d3Smrg
7943d31dbc53Smrg    hpux11*)
7944d31dbc53Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
7945d31dbc53Smrg	case $host_cpu in
7946d31dbc53Smrg	hppa*64*)
7947d31dbc53Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
7948d31dbc53Smrg	  ;;
7949d31dbc53Smrg	ia64*)
7950d31dbc53Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
7951d31dbc53Smrg	  ;;
7952d31dbc53Smrg	*)
7953d31dbc53Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
7954d31dbc53Smrg	  ;;
7955d31dbc53Smrg	esac
7956d31dbc53Smrg      else
7957d31dbc53Smrg	case $host_cpu in
7958d31dbc53Smrg	hppa*64*)
7959d31dbc53Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
7960d31dbc53Smrg	  ;;
7961d31dbc53Smrg	ia64*)
7962d31dbc53Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
7963d31dbc53Smrg	  ;;
7964d31dbc53Smrg	*)
7965d31dbc53Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
7966d31dbc53Smrg	  ;;
7967d31dbc53Smrg	esac
7968d31dbc53Smrg      fi
7969d31dbc53Smrg      if test "$with_gnu_ld" = no; then
7970d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7971d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
797232b578d3Smrg
7973d31dbc53Smrg	case $host_cpu in
7974d31dbc53Smrg	hppa*64*|ia64*)
7975d31dbc53Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
7976d31dbc53Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
7977d31dbc53Smrg	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
7978d31dbc53Smrg	  ;;
7979d31dbc53Smrg	*)
7980d31dbc53Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
7981d31dbc53Smrg	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
798232b578d3Smrg
7983d31dbc53Smrg	  # hardcode_minus_L: Not really in the search PATH,
7984d31dbc53Smrg	  # but as the default location of the library.
7985d31dbc53Smrg	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
7986d31dbc53Smrg	  ;;
7987d31dbc53Smrg	esac
7988d31dbc53Smrg      fi
7989d31dbc53Smrg      ;;
799032b578d3Smrg
7991d31dbc53Smrg    irix5* | irix6* | nonstopux*)
7992d31dbc53Smrg      if test "$GCC" = yes; then
7993d31dbc53Smrg	_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'
7994d31dbc53Smrg      else
7995d31dbc53Smrg	_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'
7996d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
7997d31dbc53Smrg      fi
7998d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7999d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8000d31dbc53Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
8001d31dbc53Smrg      ;;
800232b578d3Smrg
8003d31dbc53Smrg    netbsd*)
8004d31dbc53Smrg      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
8005d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
8006d31dbc53Smrg      else
8007d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
8008d31dbc53Smrg      fi
8009d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
8010d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8011d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8012d31dbc53Smrg      ;;
801332b578d3Smrg
8014d31dbc53Smrg    newsos6)
8015d31dbc53Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8016d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8017d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8018d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8019d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8020d31dbc53Smrg      ;;
802132b578d3Smrg
8022d31dbc53Smrg    openbsd*)
8023d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8024d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8025d31dbc53Smrg      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
8026d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
8027d31dbc53Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
8028d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
8029d31dbc53Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
8030d31dbc53Smrg      else
8031d31dbc53Smrg       case $host_os in
8032d31dbc53Smrg	 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
8033d31dbc53Smrg	   _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8034d31dbc53Smrg	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
8035d31dbc53Smrg	   ;;
8036d31dbc53Smrg	 *)
8037d31dbc53Smrg	   _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
8038d31dbc53Smrg	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
8039d31dbc53Smrg	   ;;
8040d31dbc53Smrg       esac
8041d31dbc53Smrg      fi
8042d31dbc53Smrg      ;;
804332b578d3Smrg
8044d31dbc53Smrg    os2*)
8045d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8046d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
8047d31dbc53Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
8048d31dbc53Smrg      _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'
8049d31dbc53Smrg      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
8050d31dbc53Smrg      ;;
805132b578d3Smrg
8052d31dbc53Smrg    osf3*)
8053d31dbc53Smrg      if test "$GCC" = yes; then
8054d31dbc53Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
8055d31dbc53Smrg	_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'
8056d31dbc53Smrg      else
8057d31dbc53Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
8058d31dbc53Smrg	_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'
8059d31dbc53Smrg      fi
8060d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8061d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8062d31dbc53Smrg      ;;
806332b578d3Smrg
8064d31dbc53Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
8065d31dbc53Smrg      if test "$GCC" = yes; then
8066d31dbc53Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
8067d31dbc53Smrg	_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'
8068d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
8069d31dbc53Smrg      else
8070d31dbc53Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
8071d31dbc53Smrg	_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'
8072d31dbc53Smrg	_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~
8073d31dbc53Smrg	$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'
807432b578d3Smrg
8075d31dbc53Smrg	# Both c and cxx compiler support -rpath directly
8076d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
8077d31dbc53Smrg      fi
8078d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
8079d31dbc53Smrg      ;;
808032b578d3Smrg
8081d31dbc53Smrg    solaris*)
8082d31dbc53Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
8083d31dbc53Smrg      if test "$GCC" = yes; then
8084d31dbc53Smrg	wlarc='${wl}'
8085d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
8086d31dbc53Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
8087d31dbc53Smrg	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
8088d31dbc53Smrg      else
8089d31dbc53Smrg	wlarc=''
8090d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
8091d31dbc53Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
8092d31dbc53Smrg  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
8093d31dbc53Smrg      fi
8094d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
8095d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8096d31dbc53Smrg      case $host_os in
8097d31dbc53Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
8098d31dbc53Smrg      *)
8099d31dbc53Smrg 	# The compiler driver will combine linker options so we
8100d31dbc53Smrg 	# cannot just pass the convience library names through
8101d31dbc53Smrg 	# without $wl, iff we do not link with $LD.
8102d31dbc53Smrg 	# Luckily, gcc supports the same syntax we need for Sun Studio.
8103d31dbc53Smrg 	# Supported since Solaris 2.6 (maybe 2.5.1?)
8104d31dbc53Smrg 	case $wlarc in
8105d31dbc53Smrg 	'')
8106d31dbc53Smrg 	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
8107d31dbc53Smrg 	*)
8108d31dbc53Smrg 	  _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' ;;
8109d31dbc53Smrg 	esac ;;
8110d31dbc53Smrg      esac
8111d31dbc53Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
8112d31dbc53Smrg      ;;
811332b578d3Smrg
8114d31dbc53Smrg    sunos4*)
8115d31dbc53Smrg      if test "x$host_vendor" = xsequent; then
8116d31dbc53Smrg	# Use $CC to link under sequent, because it throws in some extra .o
8117d31dbc53Smrg	# files that make .init and .fini sections work.
8118d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
8119d31dbc53Smrg      else
8120d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
8121d31dbc53Smrg      fi
8122d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8123d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
8124d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
8125d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8126d31dbc53Smrg      ;;
812732b578d3Smrg
8128d31dbc53Smrg    sysv4)
8129d31dbc53Smrg      case $host_vendor in
8130d31dbc53Smrg	sni)
8131d31dbc53Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8132d31dbc53Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
8133d31dbc53Smrg	;;
8134d31dbc53Smrg	siemens)
8135d31dbc53Smrg	  ## LD is ld it makes a PLAMLIB
8136d31dbc53Smrg	  ## CC just makes a GrossModule.
8137d31dbc53Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
8138d31dbc53Smrg	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
8139d31dbc53Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
8140d31dbc53Smrg        ;;
8141d31dbc53Smrg	motorola)
8142d31dbc53Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8143d31dbc53Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
8144d31dbc53Smrg	;;
8145d31dbc53Smrg      esac
8146d31dbc53Smrg      runpath_var='LD_RUN_PATH'
8147d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8148d31dbc53Smrg      ;;
814932b578d3Smrg
8150d31dbc53Smrg    sysv4.3*)
8151d31dbc53Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8152d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8153d31dbc53Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
8154d31dbc53Smrg      ;;
815532b578d3Smrg
8156d31dbc53Smrg    sysv4*MP*)
8157d31dbc53Smrg      if test -d /usr/nec; then
8158d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8159d31dbc53Smrg	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8160d31dbc53Smrg	runpath_var=LD_RUN_PATH
8161d31dbc53Smrg	hardcode_runpath_var=yes
8162d31dbc53Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
8163d31dbc53Smrg      fi
8164d31dbc53Smrg      ;;
816532b578d3Smrg
8166d31dbc53Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*)
8167d31dbc53Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
8168d31dbc53Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
8169d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8170d31dbc53Smrg      runpath_var='LD_RUN_PATH'
817132b578d3Smrg
8172d31dbc53Smrg      if test "$GCC" = yes; then
8173d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8174d31dbc53Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8175d31dbc53Smrg      else
8176d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8177d31dbc53Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8178d31dbc53Smrg      fi
8179d31dbc53Smrg      ;;
818032b578d3Smrg
8181d31dbc53Smrg    sysv5* | sco3.2v5* | sco5v6*)
8182d31dbc53Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
8183d31dbc53Smrg      # link with -lc, and that would cause any symbols used from libc to
8184d31dbc53Smrg      # always be unresolved, which means just about no library would
8185d31dbc53Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
8186d31dbc53Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
8187d31dbc53Smrg      # as -z defs.
8188d31dbc53Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
8189d31dbc53Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
8190d31dbc53Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
8191d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8192d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
8193d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
8194d31dbc53Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
8195d31dbc53Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
8196d31dbc53Smrg      runpath_var='LD_RUN_PATH'
819732b578d3Smrg
8198d31dbc53Smrg      if test "$GCC" = yes; then
8199d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
8200d31dbc53Smrg	_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'
8201d31dbc53Smrg      else
8202d31dbc53Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
8203d31dbc53Smrg	_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'
8204d31dbc53Smrg      fi
8205d31dbc53Smrg      ;;
820632b578d3Smrg
8207d31dbc53Smrg    uts4*)
8208d31dbc53Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8209d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
8210d31dbc53Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
8211d31dbc53Smrg      ;;
821232b578d3Smrg
8213d31dbc53Smrg    *)
8214d31dbc53Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
8215d31dbc53Smrg      ;;
8216d31dbc53Smrg    esac
8217d31dbc53Smrg  fi
821832b578d3Smrg])
8219d31dbc53SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
8220d31dbc53Smrgtest "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
822132b578d3Smrg
822232b578d3Smrg#
8223d31dbc53Smrg# Do we need to explicitly link libc?
8224d31dbc53Smrg#
8225d31dbc53Smrgcase "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
8226d31dbc53Smrgx|xyes)
8227d31dbc53Smrg  # Assume -lc should be added
8228d31dbc53Smrg  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
822932b578d3Smrg
8230d31dbc53Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
8231d31dbc53Smrg    case $_LT_AC_TAGVAR(archive_cmds, $1) in
8232d31dbc53Smrg    *'~'*)
8233d31dbc53Smrg      # FIXME: we may have to deal with multi-command sequences.
8234d31dbc53Smrg      ;;
8235d31dbc53Smrg    '$CC '*)
8236d31dbc53Smrg      # Test whether the compiler implicitly links with -lc since on some
8237d31dbc53Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
8238d31dbc53Smrg      # to ld, don't add -lc before -lgcc.
8239d31dbc53Smrg      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
8240d31dbc53Smrg      $rm conftest*
8241d31dbc53Smrg      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
8242d31dbc53Smrg
8243d31dbc53Smrg      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
8244d31dbc53Smrg        soname=conftest
8245d31dbc53Smrg        lib=conftest
8246d31dbc53Smrg        libobjs=conftest.$ac_objext
8247d31dbc53Smrg        deplibs=
8248d31dbc53Smrg        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
8249d31dbc53Smrg	pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
8250d31dbc53Smrg        compiler_flags=-v
8251d31dbc53Smrg        linker_flags=-v
8252d31dbc53Smrg        verstring=
8253d31dbc53Smrg        output_objdir=.
8254d31dbc53Smrg        libname=conftest
8255d31dbc53Smrg        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
8256d31dbc53Smrg        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
8257d31dbc53Smrg        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
8258d31dbc53Smrg        then
8259d31dbc53Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
8260d31dbc53Smrg        else
8261d31dbc53Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
8262d31dbc53Smrg        fi
8263d31dbc53Smrg        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
8264d31dbc53Smrg      else
8265d31dbc53Smrg        cat conftest.err 1>&5
8266d31dbc53Smrg      fi
8267d31dbc53Smrg      $rm conftest*
8268d31dbc53Smrg      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
8269d31dbc53Smrg      ;;
8270d31dbc53Smrg    esac
8271d31dbc53Smrg  fi
8272d31dbc53Smrg  ;;
827332b578d3Smrgesac
8274d31dbc53Smrg])# AC_LIBTOOL_PROG_LD_SHLIBS
827532b578d3Smrg
827632b578d3Smrg
8277d31dbc53Smrg# _LT_AC_FILE_LTDLL_C
8278d31dbc53Smrg# -------------------
8279d31dbc53Smrg# Be careful that the start marker always follows a newline.
8280d31dbc53SmrgAC_DEFUN([_LT_AC_FILE_LTDLL_C], [
8281d31dbc53Smrg# /* ltdll.c starts here */
8282d31dbc53Smrg# #define WIN32_LEAN_AND_MEAN
8283d31dbc53Smrg# #include <windows.h>
8284d31dbc53Smrg# #undef WIN32_LEAN_AND_MEAN
8285d31dbc53Smrg# #include <stdio.h>
828632b578d3Smrg#
8287d31dbc53Smrg# #ifndef __CYGWIN__
8288d31dbc53Smrg# #  ifdef __CYGWIN32__
8289d31dbc53Smrg# #    define __CYGWIN__ __CYGWIN32__
8290d31dbc53Smrg# #  endif
8291d31dbc53Smrg# #endif
8292d31dbc53Smrg#
8293d31dbc53Smrg# #ifdef __cplusplus
8294d31dbc53Smrg# extern "C" {
8295d31dbc53Smrg# #endif
8296d31dbc53Smrg# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
8297d31dbc53Smrg# #ifdef __cplusplus
8298d31dbc53Smrg# }
8299d31dbc53Smrg# #endif
8300d31dbc53Smrg#
8301d31dbc53Smrg# #ifdef __CYGWIN__
8302d31dbc53Smrg# #include <cygwin/cygwin_dll.h>
8303d31dbc53Smrg# DECLARE_CYGWIN_DLL( DllMain );
8304d31dbc53Smrg# #endif
8305d31dbc53Smrg# HINSTANCE __hDllInstance_base;
8306d31dbc53Smrg#
8307d31dbc53Smrg# BOOL APIENTRY
8308d31dbc53Smrg# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
8309d31dbc53Smrg# {
8310d31dbc53Smrg#   __hDllInstance_base = hInst;
8311d31dbc53Smrg#   return TRUE;
8312d31dbc53Smrg# }
8313d31dbc53Smrg# /* ltdll.c ends here */
8314d31dbc53Smrg])# _LT_AC_FILE_LTDLL_C
831532b578d3Smrg
831632b578d3Smrg
8317d31dbc53Smrg# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
8318d31dbc53Smrg# ---------------------------------
8319d31dbc53SmrgAC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
832032b578d3Smrg
832132b578d3Smrg
8322d31dbc53Smrg# old names
8323d31dbc53SmrgAC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
8324d31dbc53SmrgAC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
8325d31dbc53SmrgAC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
8326d31dbc53SmrgAC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
8327d31dbc53SmrgAC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
8328d31dbc53SmrgAC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
8329d31dbc53SmrgAC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
833032b578d3Smrg
8331d31dbc53Smrg# This is just to silence aclocal about the macro not being used
8332d31dbc53Smrgifelse([AC_DISABLE_FAST_INSTALL])
833332b578d3Smrg
8334d31dbc53SmrgAC_DEFUN([LT_AC_PROG_GCJ],
8335d31dbc53Smrg[AC_CHECK_TOOL(GCJ, gcj, no)
8336d31dbc53Smrg  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
8337d31dbc53Smrg  AC_SUBST(GCJFLAGS)
8338d31dbc53Smrg])
833932b578d3Smrg
8340d31dbc53SmrgAC_DEFUN([LT_AC_PROG_RC],
8341d31dbc53Smrg[AC_CHECK_TOOL(RC, windres, no)
8342d31dbc53Smrg])
8343d31dbc53Smrg
8344d31dbc53Smrg# NOTE: This macro has been submitted for inclusion into   #
8345d31dbc53Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
8346d31dbc53Smrg#  a released version of Autoconf we should remove this    #
8347d31dbc53Smrg#  macro and use it instead.                               #
8348d31dbc53Smrg# LT_AC_PROG_SED
8349d31dbc53Smrg# --------------
8350d31dbc53Smrg# Check for a fully-functional sed program, that truncates
8351d31dbc53Smrg# as few characters as possible.  Prefer GNU sed if found.
8352d31dbc53SmrgAC_DEFUN([LT_AC_PROG_SED],
8353d31dbc53Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
8354d31dbc53SmrgAC_CACHE_VAL(lt_cv_path_SED,
8355d31dbc53Smrg[# Loop through the user's path and test for sed and gsed.
8356d31dbc53Smrg# Then use that list of sed's as ones to test for truncation.
8357d31dbc53Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8358d31dbc53Smrgfor as_dir in $PATH
8359d31dbc53Smrgdo
8360d31dbc53Smrg  IFS=$as_save_IFS
8361d31dbc53Smrg  test -z "$as_dir" && as_dir=.
8362d31dbc53Smrg  for lt_ac_prog in sed gsed; do
8363d31dbc53Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
8364d31dbc53Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
8365d31dbc53Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
8366d31dbc53Smrg      fi
8367d31dbc53Smrg    done
8368d31dbc53Smrg  done
8369d31dbc53Smrgdone
8370d31dbc53Smrglt_ac_max=0
8371d31dbc53Smrglt_ac_count=0
8372d31dbc53Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
8373d31dbc53Smrg# along with /bin/sed that truncates output.
8374d31dbc53Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8375d31dbc53Smrg  test ! -f $lt_ac_sed && continue
8376d31dbc53Smrg  cat /dev/null > conftest.in
8377d31dbc53Smrg  lt_ac_count=0
8378d31dbc53Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
8379d31dbc53Smrg  # Check for GNU sed and select it if it is found.
8380d31dbc53Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
8381d31dbc53Smrg    lt_cv_path_SED=$lt_ac_sed
8382d31dbc53Smrg    break
8383d31dbc53Smrg  fi
8384d31dbc53Smrg  while true; do
8385d31dbc53Smrg    cat conftest.in conftest.in >conftest.tmp
8386d31dbc53Smrg    mv conftest.tmp conftest.in
8387d31dbc53Smrg    cp conftest.in conftest.nl
8388d31dbc53Smrg    echo >>conftest.nl
8389d31dbc53Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
8390d31dbc53Smrg    cmp -s conftest.out conftest.nl || break
8391d31dbc53Smrg    # 10000 chars as input seems more than enough
8392d31dbc53Smrg    test $lt_ac_count -gt 10 && break
8393d31dbc53Smrg    lt_ac_count=`expr $lt_ac_count + 1`
8394d31dbc53Smrg    if test $lt_ac_count -gt $lt_ac_max; then
8395d31dbc53Smrg      lt_ac_max=$lt_ac_count
8396d31dbc53Smrg      lt_cv_path_SED=$lt_ac_sed
8397d31dbc53Smrg    fi
8398d31dbc53Smrg  done
8399d31dbc53Smrgdone
8400d31dbc53Smrg])
8401d31dbc53SmrgSED=$lt_cv_path_SED
8402d31dbc53SmrgAC_MSG_RESULT([$SED])
8403d31dbc53Smrg])
8404d31dbc53Smrg
8405d31dbc53Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
8406d31dbc53Smrg# 
8407d31dbc53Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
8408d31dbc53Smrg#
8409d31dbc53Smrg# This program is free software; you can redistribute it and/or modify
8410d31dbc53Smrg# it under the terms of the GNU General Public License as published by
8411d31dbc53Smrg# the Free Software Foundation; either version 2 of the License, or
8412d31dbc53Smrg# (at your option) any later version.
8413d31dbc53Smrg#
8414d31dbc53Smrg# This program is distributed in the hope that it will be useful, but
8415d31dbc53Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
8416d31dbc53Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
8417d31dbc53Smrg# General Public License for more details.
841832b578d3Smrg#
8419d31dbc53Smrg# You should have received a copy of the GNU General Public License
8420d31dbc53Smrg# along with this program; if not, write to the Free Software
8421d31dbc53Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
8422d31dbc53Smrg#
8423d31dbc53Smrg# As a special exception to the GNU General Public License, if you
8424d31dbc53Smrg# distribute this file as part of a program that contains a
8425d31dbc53Smrg# configuration script generated by Autoconf, you may include it under
8426d31dbc53Smrg# the same distribution terms that you use for the rest of that program.
842732b578d3Smrg
8428d31dbc53Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
8429d31dbc53Smrg# ----------------------------------
8430d31dbc53SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
8431d31dbc53Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
8432d31dbc53Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
8433d31dbc53SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
8434d31dbc53Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
8435d31dbc53Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
8436d31dbc53Smrgfi
8437d31dbc53Smrgif test -n "$PKG_CONFIG"; then
8438d31dbc53Smrg	_pkg_min_version=m4_ifval([$1], [$1], [0.9.0])
8439d31dbc53Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
8440d31dbc53Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
8441d31dbc53Smrg		AC_MSG_RESULT([yes])
8442d31dbc53Smrg	else
8443d31dbc53Smrg		AC_MSG_RESULT([no])
8444d31dbc53Smrg		PKG_CONFIG=""
8445d31dbc53Smrg	fi
8446d31dbc53Smrg		
8447d31dbc53Smrgfi[]dnl
8448d31dbc53Smrg])# PKG_PROG_PKG_CONFIG
844932b578d3Smrg
8450d31dbc53Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
8451d31dbc53Smrg#
8452d31dbc53Smrg# Check to see whether a particular set of modules exists.  Similar
8453d31dbc53Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
8454d31dbc53Smrg#
8455d31dbc53Smrg#
8456d31dbc53Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
8457d31dbc53Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
8458d31dbc53Smrg# PKG_CHECK_EXISTS manually
8459d31dbc53Smrg# --------------------------------------------------------------
8460d31dbc53SmrgAC_DEFUN([PKG_CHECK_EXISTS],
8461d31dbc53Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8462d31dbc53Smrgif test -n "$PKG_CONFIG" && \
8463d31dbc53Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
8464d31dbc53Smrg  m4_ifval([$2], [$2], [:])
8465d31dbc53Smrgm4_ifvaln([$3], [else
8466d31dbc53Smrg  $3])dnl
8467d31dbc53Smrgfi])
846832b578d3Smrg
846932b578d3Smrg
8470d31dbc53Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
8471d31dbc53Smrg# ---------------------------------------------
8472d31dbc53Smrgm4_define([_PKG_CONFIG],
8473d31dbc53Smrg[if test -n "$PKG_CONFIG"; then
8474d31dbc53Smrg        PKG_CHECK_EXISTS([$3],
8475d31dbc53Smrg                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
8476d31dbc53Smrg			 [pkg_failed=yes])
847732b578d3Smrgelse
8478d31dbc53Smrg	pkg_failed=untried
8479d31dbc53Smrgfi[]dnl
8480d31dbc53Smrg])# _PKG_CONFIG
848132b578d3Smrg
8482d31dbc53Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
8483d31dbc53Smrg# [ACTION-IF-NOT-FOUND])
848432b578d3Smrg#
848532b578d3Smrg#
8486d31dbc53Smrg# Note that if there is a possibility the first call to
8487d31dbc53Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
8488d31dbc53Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
8489d31dbc53Smrg#
8490d31dbc53Smrg#
8491d31dbc53Smrg# --------------------------------------------------------------
8492d31dbc53SmrgAC_DEFUN([PKG_CHECK_MODULES],
8493d31dbc53Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8494d31dbc53SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
8495d31dbc53SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
849632b578d3Smrg
8497d31dbc53Smrgpkg_failed=no
8498d31dbc53SmrgAC_MSG_CHECKING([for $1])
849932b578d3Smrg
8500d31dbc53Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
8501d31dbc53Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
850232b578d3Smrg
8503d31dbc53Smrgif test $pkg_failed = yes; then
8504d31dbc53Smrg	$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
8505d31dbc53Smrg	# Put the nasty error message in config.log where it belongs
8506d31dbc53Smrg	echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD
850732b578d3Smrg
8508d31dbc53Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
8509d31dbc53Smrg[Package requirements ($2) were not met.
8510d31dbc53SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
8511d31dbc53Smrginstalled software in a non-standard prefix.
851232b578d3Smrg
8513d31dbc53SmrgAlternatively you may set the $1_CFLAGS and $1_LIBS environment variables
8514d31dbc53Smrgto avoid the need to call pkg-config.  See the pkg-config man page for
8515d31dbc53Smrgmore details.])],
8516d31dbc53Smrg		[$4])
8517d31dbc53Smrgelif test $pkg_failed = untried; then
8518d31dbc53Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
8519d31dbc53Smrg[The pkg-config script could not be found or is too old.  Make sure it
8520d31dbc53Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
8521d31dbc53Smrgpath to pkg-config.
852232b578d3Smrg
8523d31dbc53SmrgAlternatively you may set the $1_CFLAGS and $1_LIBS environment variables
8524d31dbc53Smrgto avoid the need to call pkg-config.  See the pkg-config man page for
8525d31dbc53Smrgmore details.
852632b578d3Smrg
8527d31dbc53SmrgTo get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
8528d31dbc53Smrg		[$4])
8529d31dbc53Smrgelse
8530d31dbc53Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
8531d31dbc53Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
8532d31dbc53Smrg        AC_MSG_RESULT([yes])
8533d31dbc53Smrg	ifelse([$3], , :, [$3])
8534d31dbc53Smrgfi[]dnl
8535d31dbc53Smrg])# PKG_CHECK_MODULES
853632b578d3Smrg
8537