]> git.ipfire.org Git - thirdparty/gcc.git/blame - zlib/aclocal.m4
aclocal.m4, configure: Rebuilt.
[thirdparty/gcc.git] / zlib / aclocal.m4
CommitLineData
dfac8a13
TT
1dnl aclocal.m4 generated automatically by aclocal 1.4
2
3dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11dnl PARTICULAR PURPOSE.
12
13# FIXME: We temporarily define our own version of AC_PROG_CC. This is
14# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
15# are probably using a cross compiler, which will not be able to fully
16# link an executable. This should really be fixed in autoconf
17# itself.
18
19AC_DEFUN(LIB_AC_PROG_CC,
20[AC_BEFORE([$0], [AC_PROG_CPP])dnl
025fd00e
TT
21dnl Fool anybody using AC_PROG_CC.
22AC_PROVIDE([AC_PROG_CC])
dfac8a13
TT
23AC_CHECK_PROG(CC, gcc, gcc)
24if test -z "$CC"; then
25 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
26 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
27fi
28
29AC_PROG_CC_GNU
30
31if test $ac_cv_prog_gcc = yes; then
32 GCC=yes
33dnl Check whether -g works, even if CFLAGS is set, in case the package
34dnl plays around with CFLAGS (such as to build both debugging and
35dnl normal versions of a library), tasteless as that idea is.
36 ac_test_CFLAGS="${CFLAGS+set}"
37 ac_save_CFLAGS="$CFLAGS"
38 CFLAGS=
39 AC_PROG_CC_G
40 if test "$ac_test_CFLAGS" = set; then
41 CFLAGS="$ac_save_CFLAGS"
42 elif test $ac_cv_prog_cc_g = yes; then
43 CFLAGS="-g -O2"
44 else
45 CFLAGS="-O2"
46 fi
47else
48 GCC=
49 test "${CFLAGS+set}" = set || CFLAGS="-g"
50fi
51])
52
53# Do all the work for Automake. This macro actually does too much --
54# some checks are only needed if your package does certain things.
55# But this isn't really a big deal.
56
57# serial 1
58
59dnl Usage:
60dnl AM_INIT_AUTOMAKE(package,version, [no-define])
61
62AC_DEFUN(AM_INIT_AUTOMAKE,
63[AC_REQUIRE([AC_PROG_INSTALL])
64PACKAGE=[$1]
65AC_SUBST(PACKAGE)
66VERSION=[$2]
67AC_SUBST(VERSION)
68dnl test to see if srcdir already configured
69if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
70 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
71fi
72ifelse([$3],,
73AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
74AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
75AC_REQUIRE([AM_SANITY_CHECK])
76AC_REQUIRE([AC_ARG_PROGRAM])
77dnl FIXME This is truly gross.
78missing_dir=`cd $ac_aux_dir && pwd`
79AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
80AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
81AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
82AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
83AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
84AC_REQUIRE([AC_PROG_MAKE_SET])])
85
86#
87# Check to make sure that the build environment is sane.
88#
89
90AC_DEFUN(AM_SANITY_CHECK,
91[AC_MSG_CHECKING([whether build environment is sane])
92# Just in case
93sleep 1
94echo timestamp > conftestfile
95# Do `set' in a subshell so we don't clobber the current shell's
96# arguments. Must try -L first in case configure is actually a
97# symlink; some systems play weird games with the mod time of symlinks
98# (eg FreeBSD returns the mod time of the symlink's containing
99# directory).
100if (
101 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
102 if test "[$]*" = "X"; then
103 # -L didn't work.
104 set X `ls -t $srcdir/configure conftestfile`
105 fi
106 if test "[$]*" != "X $srcdir/configure conftestfile" \
107 && test "[$]*" != "X conftestfile $srcdir/configure"; then
108
109 # If neither matched, then we have a broken ls. This can happen
110 # if, for instance, CONFIG_SHELL is bash and it inherits a
111 # broken ls alias from the environment. This has actually
112 # happened. Such a system could not be considered "sane".
113 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
114alias in your environment])
115 fi
116
117 test "[$]2" = conftestfile
118 )
119then
120 # Ok.
121 :
122else
123 AC_MSG_ERROR([newly created file is older than distributed files!
124Check your system clock])
125fi
126rm -f conftest*
127AC_MSG_RESULT(yes)])
128
129dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
130dnl The program must properly implement --version.
131AC_DEFUN(AM_MISSING_PROG,
132[AC_MSG_CHECKING(for working $2)
133# Run test in a subshell; some versions of sh will print an error if
134# an executable is not found, even if stderr is redirected.
135# Redirect stdin to placate older versions of autoconf. Sigh.
136if ($2 --version) < /dev/null > /dev/null 2>&1; then
137 $1=$2
138 AC_MSG_RESULT(found)
139else
140 $1="$3/missing $2"
141 AC_MSG_RESULT(missing)
142fi
143AC_SUBST($1)])
144
145# Add --enable-maintainer-mode option to configure.
146# From Jim Meyering
147
148# serial 1
149
150AC_DEFUN(AM_MAINTAINER_MODE,
151[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
152 dnl maintainer-mode is disabled by default
153 AC_ARG_ENABLE(maintainer-mode,
154[ --enable-maintainer-mode enable make rules and dependencies not useful
155 (and sometimes confusing) to the casual installer],
156 USE_MAINTAINER_MODE=$enableval,
157 USE_MAINTAINER_MODE=no)
158 AC_MSG_RESULT($USE_MAINTAINER_MODE)
159 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
160 MAINT=$MAINTAINER_MODE_TRUE
161 AC_SUBST(MAINT)dnl
162]
163)
164
165# Define a conditional.
166
167AC_DEFUN(AM_CONDITIONAL,
168[AC_SUBST($1_TRUE)
169AC_SUBST($1_FALSE)
170if $2; then
171 $1_TRUE=
172 $1_FALSE='#'
173else
174 $1_TRUE='#'
175 $1_FALSE=
176fi])
177
178
025fd00e 179# serial 35 AC_PROG_LIBTOOL
dfac8a13
TT
180AC_DEFUN(AC_PROG_LIBTOOL,
181[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
182
183# Save cache, so that ltconfig can load it
184AC_CACHE_SAVE
185
186# Actually configure libtool. ac_aux_dir is where install-sh is found.
187CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
025fd00e
TT
188LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
189DLLTOOL="$DLLTOOL" AS="$AS" \
dfac8a13
TT
190${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
191$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
192|| AC_MSG_ERROR([libtool configure failed])
193
194# Reload cache, that may have been modified by ltconfig
195AC_CACHE_LOAD
196
197# This can be used to rebuild libtool when needed
198LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
199
200# Always use our own libtool.
201LIBTOOL='$(SHELL) $(top_builddir)/libtool'
202AC_SUBST(LIBTOOL)dnl
203
204# Redirect the config.log output again, so that the ltconfig log is not
205# clobbered by the next message.
206exec 5>>./config.log
207])
208
209AC_DEFUN(AC_LIBTOOL_SETUP,
210[AC_PREREQ(2.13)dnl
211AC_REQUIRE([AC_ENABLE_SHARED])dnl
212AC_REQUIRE([AC_ENABLE_STATIC])dnl
213AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
214AC_REQUIRE([AC_CANONICAL_HOST])dnl
215AC_REQUIRE([AC_CANONICAL_BUILD])dnl
216AC_REQUIRE([AC_PROG_RANLIB])dnl
217AC_REQUIRE([AC_PROG_CC])dnl
218AC_REQUIRE([AC_PROG_LD])dnl
219AC_REQUIRE([AC_PROG_NM])dnl
025fd00e
TT
220AC_REQUIRE([AC_SYS_NM_PARSE])dnl
221AC_REQUIRE([AC_SYS_SYMBOL_UNDERSCORE])dnl
dfac8a13
TT
222AC_REQUIRE([AC_PROG_LN_S])dnl
223dnl
224
225# Check for any special flags to pass to ltconfig.
226libtool_flags="--cache-file=$cache_file"
227test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
228test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
229test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
025fd00e
TT
230test "$lt_dlopen" = yes && libtool_flags="$libtool_flags --enable-dlopen"
231test "$silent" = yes && libtool_flags="$libtool_flags --silent"
dfac8a13
TT
232test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
233test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
234
235# Some flags need to be propagated to the compiler or linker for good
236# libtool support.
237case "$host" in
238*-*-irix6*)
239 # Find out which ABI we are using.
240 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
241 if AC_TRY_EVAL(ac_compile); then
242 case "`/usr/bin/file conftest.o`" in
243 *32-bit*)
244 LD="${LD-ld} -32"
245 ;;
246 *N32*)
247 LD="${LD-ld} -n32"
248 ;;
249 *64-bit*)
250 LD="${LD-ld} -64"
251 ;;
252 esac
253 fi
254 rm -rf conftest*
255 ;;
256
257*-*-sco3.2v5*)
258 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
259 SAVE_CFLAGS="$CFLAGS"
260 CFLAGS="$CFLAGS -belf"
261 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
262 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
263 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
264 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
265 CFLAGS="$SAVE_CFLAGS"
266 fi
267 ;;
268
025fd00e
TT
269*-*-cygwin*)
270 AC_SYS_LIBTOOL_CYGWIN
dfac8a13 271 ;;
025fd00e 272
dfac8a13 273esac
dfac8a13 274
025fd00e
TT
275# enable the --disable-libtool-lock switch
276
277AC_ARG_ENABLE(libtool-lock,
278[ --disable-libtool-lock force libtool not to do file locking],
279need_locks=$enableval,
280need_locks=yes)
281
282if test x"$need_locks" = xno; then
283 libtool_flags="$libtool_flags --disable-lock"
284fi
285])
e656c72f 286
025fd00e
TT
287# AC_LIBTOOL_DLOPEN - check for dlopen support
288AC_DEFUN(AC_LIBTOOL_DLOPEN, [lt_dlopen=yes])
dfac8a13
TT
289
290# AC_ENABLE_SHARED - implement the --enable-shared flag
291# Usage: AC_ENABLE_SHARED[(DEFAULT)]
292# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
293# `yes'.
025fd00e
TT
294AC_DEFUN(AC_ENABLE_SHARED,
295[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
dfac8a13
TT
296AC_ARG_ENABLE(shared,
297changequote(<<, >>)dnl
298<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
299changequote([, ])dnl
300[p=${PACKAGE-default}
301case "$enableval" in
302yes) enable_shared=yes ;;
303no) enable_shared=no ;;
304*)
305 enable_shared=no
306 # Look at the argument we got. We use all the common list separators.
307 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
308 for pkg in $enableval; do
309 if test "X$pkg" = "X$p"; then
310 enable_shared=yes
311 fi
312 done
313 IFS="$ac_save_ifs"
314 ;;
315esac],
316enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
317])
318
319# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
025fd00e
TT
320AC_DEFUN(AC_DISABLE_SHARED,
321[AC_ENABLE_SHARED(no)])
dfac8a13
TT
322
323# AC_ENABLE_STATIC - implement the --enable-static flag
324# Usage: AC_ENABLE_STATIC[(DEFAULT)]
325# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
326# `yes'.
025fd00e
TT
327AC_DEFUN(AC_ENABLE_STATIC,
328[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
dfac8a13
TT
329AC_ARG_ENABLE(static,
330changequote(<<, >>)dnl
331<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
332changequote([, ])dnl
333[p=${PACKAGE-default}
334case "$enableval" in
335yes) enable_static=yes ;;
336no) enable_static=no ;;
337*)
338 enable_static=no
339 # Look at the argument we got. We use all the common list separators.
340 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
341 for pkg in $enableval; do
342 if test "X$pkg" = "X$p"; then
343 enable_static=yes
344 fi
345 done
346 IFS="$ac_save_ifs"
347 ;;
348esac],
349enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
350])
351
352# AC_DISABLE_STATIC - set the default static flag to --disable-static
025fd00e
TT
353AC_DEFUN(AC_DISABLE_STATIC,
354[AC_ENABLE_STATIC(no)])
dfac8a13
TT
355
356
357# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
358# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
359# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
360# `yes'.
025fd00e
TT
361AC_DEFUN(AC_ENABLE_FAST_INSTALL,
362[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
dfac8a13
TT
363AC_ARG_ENABLE(fast-install,
364changequote(<<, >>)dnl
365<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
366changequote([, ])dnl
367[p=${PACKAGE-default}
368case "$enableval" in
369yes) enable_fast_install=yes ;;
370no) enable_fast_install=no ;;
371*)
372 enable_fast_install=no
373 # Look at the argument we got. We use all the common list separators.
374 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
375 for pkg in $enableval; do
376 if test "X$pkg" = "X$p"; then
377 enable_fast_install=yes
378 fi
379 done
380 IFS="$ac_save_ifs"
381 ;;
382esac],
383enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
384])
385
386# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
025fd00e
TT
387AC_DEFUN(AC_DISABLE_FAST_INSTALL,
388[AC_ENABLE_FAST_INSTALL(no)])
389
dfac8a13
TT
390
391# AC_PROG_LD - find the path to the GNU or non-GNU linker
392AC_DEFUN(AC_PROG_LD,
393[AC_ARG_WITH(gnu-ld,
394[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
395test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
396AC_REQUIRE([AC_PROG_CC])dnl
397AC_REQUIRE([AC_CANONICAL_HOST])dnl
398AC_REQUIRE([AC_CANONICAL_BUILD])dnl
399ac_prog=ld
400if test "$ac_cv_prog_gcc" = yes; then
401 # Check if gcc -print-prog-name=ld gives a path.
402 AC_MSG_CHECKING([for ld used by GCC])
403 ac_prog=`($CC -print-prog-name=ld) 2>&5`
404 case "$ac_prog" in
405 # Accept absolute paths.
406changequote(,)dnl
025fd00e 407 /* | [A-Za-z]:[\\/]*)
dfac8a13
TT
408 re_direlt='/[^/][^/]*/\.\./'
409changequote([,])dnl
410 # Canonicalize the path of ld
411 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
412 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
413 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
414 done
415 test -z "$LD" && LD="$ac_prog"
416 ;;
417 "")
418 # If it fails, then pretend we aren't using GCC.
419 ac_prog=ld
420 ;;
421 *)
422 # If it is relative, then search for the first ld in PATH.
423 with_gnu_ld=unknown
424 ;;
425 esac
426elif test "$with_gnu_ld" = yes; then
427 AC_MSG_CHECKING([for GNU ld])
428else
429 AC_MSG_CHECKING([for non-GNU ld])
430fi
431AC_CACHE_VAL(ac_cv_path_LD,
432[if test -z "$LD"; then
025fd00e 433 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
dfac8a13
TT
434 for ac_dir in $PATH; do
435 test -z "$ac_dir" && ac_dir=.
025fd00e 436 if test -f "$ac_dir/$ac_prog"; then
dfac8a13
TT
437 ac_cv_path_LD="$ac_dir/$ac_prog"
438 # Check to see if the program is GNU ld. I'd rather use --version,
439 # but apparently some GNU ld's only accept -v.
440 # Break only if it was the GNU/non-GNU ld that we prefer.
441 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
442 test "$with_gnu_ld" != no && break
443 else
444 test "$with_gnu_ld" != yes && break
445 fi
446 fi
447 done
448 IFS="$ac_save_ifs"
449else
450 ac_cv_path_LD="$LD" # Let the user override the test with a path.
451fi])
452LD="$ac_cv_path_LD"
453if test -n "$LD"; then
454 AC_MSG_RESULT($LD)
455else
456 AC_MSG_RESULT(no)
457fi
458test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
459AC_SUBST(LD)
460AC_PROG_LD_GNU
461])
462
463AC_DEFUN(AC_PROG_LD_GNU,
464[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
465[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
466if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
467 ac_cv_prog_gnu_ld=yes
468else
469 ac_cv_prog_gnu_ld=no
470fi])
471])
472
473# AC_PROG_NM - find the path to a BSD-compatible name lister
474AC_DEFUN(AC_PROG_NM,
475[AC_MSG_CHECKING([for BSD-compatible nm])
476AC_CACHE_VAL(ac_cv_path_NM,
477[if test -n "$NM"; then
478 # Let the user override the test.
479 ac_cv_path_NM="$NM"
480else
025fd00e 481 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
dfac8a13
TT
482 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
483 test -z "$ac_dir" && ac_dir=.
025fd00e 484 if test -f $ac_dir/nm; then
dfac8a13
TT
485 # Check to see if the nm accepts a BSD-compat flag.
486 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
487 # nm: unknown option "B" ignored
488 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
489 ac_cv_path_NM="$ac_dir/nm -B"
490 break
491 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
492 ac_cv_path_NM="$ac_dir/nm -p"
493 break
494 else
495 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
496 continue # so that we can try to find one that supports BSD flags
497 fi
498 fi
499 done
500 IFS="$ac_save_ifs"
501 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
502fi])
503NM="$ac_cv_path_NM"
504AC_MSG_RESULT([$NM])
505AC_SUBST(NM)
506])
507
025fd00e
TT
508# AC_SYS_NM_PARSE - Check for command to grab the raw symbol name followed
509# by C symbol name from nm.
510AC_DEFUN(AC_SYS_NM_PARSE,
dfac8a13 511[AC_REQUIRE([AC_CANONICAL_HOST])dnl
025fd00e
TT
512AC_REQUIRE([AC_PROG_NM])dnl
513# Check for command to grab the raw symbol name followed by C symbol from nm.
514AC_MSG_CHECKING([command to parse $NM output])
515AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe,
516[# These are sane defaults that work on at least a few old systems.
517# {They come from Ultrix. What could be older than Ultrix?!! ;)}
518
519changequote(,)dnl
520# Character class describing NM global symbol codes.
521ac_symcode='[BCDEGRST]'
522
523# Regexp to match symbols that can be accessed directly from C.
524ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
525
526# Transform the above into a raw symbol and a C symbol.
527ac_symxfrm='\1 \2\3 \3'
528
529# Transform an extracted symbol line into a proper C declaration
530ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
531
532# Define system-specific variables.
533case "$host_os" in
534aix*)
535 ac_symcode='[BCDT]'
dfac8a13 536 ;;
025fd00e
TT
537cygwin* | mingw*)
538 ac_symcode='[ABCDGISTW]'
dfac8a13 539 ;;
025fd00e
TT
540hpux*)
541 ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
542 ;;
543irix*)
544 ac_symcode='[BCDEGRST]'
545 ;;
546solaris*)
547 ac_symcode='[BDT]'
dfac8a13
TT
548 ;;
549esac
025fd00e
TT
550
551# If we're using GNU nm, then use its standard symbol codes.
552if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
553 ac_symcode='[ABCDGISTW]'
554fi
555changequote([,])dnl
556
557# Try without a prefix undercore, then with it.
558for ac_symprfx in "" "_"; do
559
560 ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($ac_symcode\)[ ][ ]*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
561
562 # Check to see that the pipe works correctly.
563 ac_pipe_works=no
564 rm -f conftest.$ac_ext
565 cat > conftest.$ac_ext <<EOF
566#ifdef __cplusplus
567extern "C" {
568#endif
569char nm_test_var;
570void nm_test_func(){}
571#ifdef __cplusplus
572}
573#endif
574int main(){nm_test_var='a';nm_test_func;return 0;}
575EOF
576
577 if AC_TRY_EVAL(ac_compile); then
578 # Now try to grab the symbols.
579 ac_nlist=conftest.nm
580
581 if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
582
583 # Try sorting and uniquifying the output.
584 if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
585 mv -f "$ac_nlist"T "$ac_nlist"
586 else
587 rm -f "$ac_nlist"T
588 fi
589
590 # Make sure that we snagged all the symbols we need.
591 if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
592 if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
593 cat <<EOF > conftest.c
594#ifdef __cplusplus
595extern "C" {
596#endif
597
598EOF
599 # Now generate the symbol file.
600 eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
601
602 cat <<EOF >> conftest.c
603#if defined (__STDC__) && __STDC__
604# define lt_ptr_t void *
605#else
606# define lt_ptr_t char *
607# define const
608#endif
609
610/* The mapping between symbol names and symbols. */
611const struct {
612 const char *name;
613 lt_ptr_t address;
614}
615changequote(,)dnl
616lt_preloaded_symbols[] =
617changequote([,])dnl
618{
619EOF
620 sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
621 cat <<\EOF >> conftest.c
622 {0, (lt_ptr_t) 0}
623};
624
625#ifdef __cplusplus
626}
627#endif
628EOF
629 # Now try linking the two files.
630 mv conftest.$ac_objext conftestm.$ac_objext
631 ac_save_LIBS="$LIBS"
632 ac_save_CFLAGS="$CFLAGS"
633 LIBS="conftestm.$ac_objext"
634 CFLAGS="$CFLAGS$no_builtin_flag"
635 if AC_TRY_EVAL(ac_link) && test -s conftest; then
636 ac_pipe_works=yes
637 else
638 echo "configure: failed program was:" >&AC_FD_CC
639 cat conftest.c >&AC_FD_CC
640 fi
641 LIBS="$ac_save_LIBS"
642 CFLAGS="$ac_save_CFLAGS"
643 else
644 echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
645 fi
646 else
647 echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
648 fi
649 else
650 echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
651 fi
652 else
653 echo "$progname: failed program was:" >&AC_FD_CC
654 cat conftest.c >&AC_FD_CC
655 fi
656 rm -rf conftest*
657
658 # Do not use the global_symbol_pipe unless it works.
659 if test "$ac_pipe_works" = yes; then
660 if test x"$ac_symprfx" = x"_"; then
661 ac_cv_sys_symbol_underscore=yes
662 else
663 ac_cv_sys_symbol_underscore=no
664 fi
665 break
666 else
667 ac_cv_sys_global_symbol_pipe=
668 fi
669done
670])
671
672ac_result=yes
673if test -z "$ac_cv_sys_global_symbol_pipe"; then
674 ac_result=no
675fi
676AC_MSG_RESULT($ac_result)
677])
678
679# AC_SYS_LIBTOOL_CYGWIN - find tools needed on cygwin
680AC_DEFUN(AC_SYS_LIBTOOL_CYGWIN,
681[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
682AC_CHECK_TOOL(AS, as, false)
683])
684
685# AC_SYS_SYMBOL_UNDERSCORE - does the compiler prefix global symbols
686# with an underscore?
687AC_DEFUN(AC_SYS_SYMBOL_UNDERSCORE,
688[AC_REQUIRE([AC_PROG_NM])dnl
689AC_REQUIRE([AC_SYS_NM_PARSE])dnl
690AC_MSG_CHECKING([for _ prefix in compiled symbols])
691AC_CACHE_VAL(ac_cv_sys_symbol_underscore,
692[ac_cv_sys_symbol_underscore=no
693cat > conftest.$ac_ext <<EOF
694void nm_test_func(){}
695int main(){nm_test_func;return 0;}
696EOF
697if AC_TRY_EVAL(ac_compile); then
698 # Now try to grab the symbols.
699 ac_nlist=conftest.nm
700 if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
701 # See whether the symbols have a leading underscore.
702 if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
703 ac_cv_sys_symbol_underscore=yes
704 else
705 if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
706 :
707 else
708 echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
709 fi
710 fi
711 else
712 echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
713 fi
714else
715 echo "configure: failed program was:" >&AC_FD_CC
716 cat conftest.c >&AC_FD_CC
717fi
718rm -rf conftest*
719])
720AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
721USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no}
722AC_SUBST(USE_SYMBOL_UNDERSCORE)dnl
723])
724
725# AC_CHECK_LIBM - check for math library
726AC_DEFUN(AC_CHECK_LIBM, [
727AC_CHECK_LIB(mw, _mwvalidcheckl)
728AC_CHECK_LIB(m, cos)
dfac8a13
TT
729])
730
731# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
732# the libltdl convenience library, adds --enable-ltdl-convenience to
733# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
734# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
735# to be `${top_builddir}/libltdl'. Make sure you start DIR with
736# '${top_builddir}/' (note the single quotes!) if your package is not
737# flat, and, if you're not using automake, define top_builddir as
738# appropriate in the Makefiles.
025fd00e 739AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [
dfac8a13
TT
740 case "$enable_ltdl_convenience" in
741 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
742 "") enable_ltdl_convenience=yes
743 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
744 esac
745 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
746])
747
748# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
749# the libltdl installable library, and adds --enable-ltdl-install to
750# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
751# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
752# to be `${top_builddir}/libltdl'. Make sure you start DIR with
753# '${top_builddir}/' (note the single quotes!) if your package is not
754# flat, and, if you're not using automake, define top_builddir as
755# appropriate in the Makefiles.
756# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
025fd00e
TT
757AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [
758 AC_CHECK_LIB(ltdl, main, LIBLTDL="-lltdl", [
759 case "$enable_ltdl_install" in
760 no) AC_MSG_WARN([libltdl not installed, but installation disabled]) ;;
761 "") enable_ltdl_install=yes
762 ac_configure_args="$ac_configure_args --enable-ltdl-install" ;;
763 esac
dfac8a13 764 ])
025fd00e 765 if test x"$enable_ltdl_install" != x"no"; then
dfac8a13
TT
766 LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
767 fi
768])
769
770dnl old names
771AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
772AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
773AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
774AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
775AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
776AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
777AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
025fd00e
TT
778AC_DEFUN(AM_SYS_NM_PARSE, [indir([AC_SYS_NM_PARSE])])dnl
779AC_DEFUN(AM_SYS_SYMBOL_UNDERSCORE, [indir([AC_SYS_SYMBOL_UNDERSCORE])])dnl
780AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN, [indir([AC_SYS_LIBTOOL_CYGWIN])])dnl
dfac8a13 781