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