Update.
[glibc.git] / aclocal.m4
blobba9ca30e74fa6c0d452bd52c77ce6d886ba8e2a6
1 dnl We define the macro GLIBC_PROVIDES to do an AC_PROVIDE for each macro
2 dnl which appears in configure.in before the sysdep configure scripts are run.
3 dnl Each sysdep configure.in does GLIBC_PROVIDES first, to avoid any
4 dnl AC_REQUIREs or AC_BEFOREs duplicating their code.
5 dnl
6 define([AC_FD_MSG],6)dnl Autoconf lossage.
7 define([AC_FD_CC],5)dnl Autoconf lossage.
8 AC_DEFUN([GLIBC_PROVIDES], [dnl
9 AC_PROVIDE([AC_PROG_INSTALL])dnl
10 AC_PROVIDE([AC_PROG_RANLIB])dnl
11 AC_PROVIDE([AC_PROG_CC])dnl
12 AC_PROVIDE([AC_PROG_CPP])dnl
13 define([AC_LANG], [C])dnl
14 # This file is generated from configure.in by Autoconf.  DO NOT EDIT!
15 ])dnl
16 dnl
17 dnl Check for a symbol
18 dnl
19 AC_DEFUN(AC_CHECK_SYMBOL, [dnl
20 AC_MSG_CHECKING(for $1)
21 AC_CACHE_VAL(ac_cv_check_symbol_$1, [dnl
22 AC_TRY_LINK(,
23 changequote(,)dnl
24 extern char *$1[]; puts(*$1);,
25 changequote([,])dnl
26             ac_cv_check_symbol_$1=yes, ac_cv_check_symbol_$1=no)])
27 if test "$ac_cv_check_symbol_$1" = yes; then
28 changequote(,)dnl
29   ac_tr_symbol=`echo $1 | tr '[a-z]' '[A-Z]'`
30 changequote([,])dnl
31   AC_DEFINE_UNQUOTED(HAVE_${ac_tr_symbol})
33 AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
34 dnl
36 dnl Locate a program and check that its version is acceptable.
37 dnl AC_PROG_CHECK_VER(var, namelist, version-switch,
38 dnl                   [version-extract-regexp], version-glob [, do-if-fail])
39 AC_DEFUN(AC_CHECK_PROG_VER,
40 [AC_CHECK_PROGS([$1], [$2])
41 if test -z "[$]$1"; then
42   ac_verc_fail=yes
43 else
44   # Found it, now check the version.
45   AC_MSG_CHECKING([version of [$]$1])
46 changequote(<<,>>)dnl
47   ac_prog_version=`<<$>>$1 $3 2>&1 ifelse(<<$4>>,,,
48                    <<| sed -n 's/^.*patsubst(<<$4>>,/,\/).*$/\1/p'>>)`
49   case $ac_prog_version in
50     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
51     <<$5>>)
52 changequote([,])dnl
53        ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
54     *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
56   esac
57   AC_MSG_RESULT([$ac_prog_version])
59 ifelse([$6],,,
60 [if test $ac_verc_fail = yes; then
61   $6
62 fi])
65 dnl These modifications are to allow for an empty cross compiler tree.
66 dnl In the situation that cross-linking is impossible, the variable
67 dnl `cross_linkable' will be substituted with "yes".
68 dnl The vercheck macros are expected to have been called already.
69 AC_DEFUN(AC_PROG_CC_LOCAL,
70 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
72 AC_PROG_CC_WORKS_LOCAL
73 AC_PROG_CC_GNU
74 if test $ac_cv_prog_gcc != yes; then
75   AC_MSG_ERROR([GNU libc must be compiled using GNU CC])
79 AC_DEFUN(AC_PROG_CC_WORKS_LOCAL,
80 [AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $LDFLAGS) works])
81 AC_CACHE_VAL(ac_cv_prog_cc_works,
82 [AC_LANG_SAVE
83 AC_LANG_C
84 AC_TRY_COMPILER([main(){return(0);}], ac_cv_prog_cc_works, ac_cv_prog_cc_cross)
85 AC_LANG_RESTORE])
86 AC_MSG_RESULT($ac_cv_prog_cc_works)
87 if test $ac_cv_prog_cc_works = no; then
88  cross_linkable=no
89  ac_cv_prog_cc_cross=yes
90 dnl AC_MSG_ERROR([installation or configuration problem: C compiler cannot create executables.])
91 else
92  cross_linkable=yes
94 AC_CACHE_CHECK(
95 [whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler],
96 ac_cv_prog_cc_cross, [:])
97 AC_SUBST(cross_linkable)
98 cross_compiling=$ac_cv_prog_cc_cross
101 AC_DEFUN(LIBC_PROG_FOO_GNU,
102 [# Most GNU programs take a -v and spit out some text including
103 # the word 'GNU'.  Some try to read stdin, so give them /dev/null.
104 if $1 -o conftest -v </dev/null 2>&1 | grep GNU > /dev/null 2>&1; then
105   $2
106 else
107   $3
109 rm -fr contest*])
111 AC_DEFUN(LIBC_PROG_BINUTILS,
112 [# Was a --with-binutils option given?
113 if test -n "$path_binutils"; then
114     # Make absolute; ensure a single trailing slash.
115     path_binutils=`(cd $path_binutils; pwd) | sed 's%/*$%/%'`
116     CC="$CC -B$path_binutils"
118 AS=`$CC -print-prog-name=as`
119 LD=`$CC -print-prog-name=ld`
120 AR=`$CC -print-prog-name=ar`
121 AC_SUBST(AR)
123 # ranlib has to be treated a bit differently since it might not exist at all.
124 RANLIB=`$CC -print-prog-name=ranlib`
125 if test $RANLIB = ranlib; then
126 # This extra check has to happen since gcc simply echos the parameter in
127 # case it cannot find the value in its own directories.
128 AC_CHECK_TOOL(RANLIB, ranlib, :)
130 AC_SUBST(RANLIB)
132 # Determine whether we are using GNU binutils.
133 AC_CACHE_CHECK(whether $AS is GNU as, libc_cv_prog_as_gnu,
134 [LIBC_PROG_FOO_GNU($AS, libc_cv_prog_as_gnu=yes, libc_cv_prog_as_gnu=no)])
135 rm -f a.out
136 gnu_as=$libc_cv_prog_as_gnu
138 AC_CACHE_CHECK(whether $LD is GNU ld, libc_cv_prog_ld_gnu,
139 [LIBC_PROG_FOO_GNU($LD, libc_cv_prog_ld_gnu=yes, libc_cv_prog_ld_gnu=no)])
140 gnu_ld=$libc_cv_prog_ld_gnu