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