]> git.ipfire.org Git - thirdparty/glibc.git/blame - aclocal.m4
Update.
[thirdparty/glibc.git] / aclocal.m4
CommitLineData
28f540f4
RM
1dnl We define the macro GLIBC_PROVIDES to do an AC_PROVIDE for each macro
2dnl which appears in configure.in before the sysdep configure scripts are run.
3dnl Each sysdep configure.in does GLIBC_PROVIDES first, to avoid any
4dnl AC_REQUIREs or AC_BEFOREs duplicating their code.
5dnl
7cfb2d8b
RM
6define(AC_FD_MSG,6)dnl Autoconf lossage.
7define(AC_FD_CC,5)dnl Autoconf lossage.
28f540f4
RM
8AC_DEFUN([GLIBC_PROVIDES], [dnl
9AC_PROVIDE([AC_PROG_INSTALL])dnl
10AC_PROVIDE([AC_PROG_RANLIB])dnl
11AC_PROVIDE([AC_PROG_CC])dnl
12AC_PROVIDE([AC_PROG_CPP])dnl
13# This file is generated from configure.in by Autoconf. DO NOT EDIT!
14])dnl
15dnl
16dnl Check for a symbol
17dnl
18AC_DEFUN(AC_CHECK_SYMBOL, [dnl
19AC_MSG_CHECKING(for $1)
20AC_CACHE_VAL(ac_cv_check_symbol_$1, [dnl
7cfb2d8b 21AC_TRY_LINK(,
28f540f4
RM
22changequote(,)dnl
23extern char *$1[]; puts(*$1);,
24changequote([,])dnl
25 ac_cv_check_symbol_$1=yes, ac_cv_check_symbol_$1=no)])
26if test "$ac_cv_check_symbol_$1" = yes; then
27changequote(,)dnl
28 ac_tr_symbol=`echo $1 | tr '[a-z]' '[A-Z]'`
29changequote([,])dnl
30 AC_DEFINE_UNQUOTED(HAVE_${ac_tr_symbol})
31fi
32AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
33dnl
ebbad4cc
UD
34
35dnl These modifications are to allow for an empty cross compiler tree.
36dnl In the situation that cross-linking is impossible, the variable
37dnl `cross_linkable' will be substituted with "yes".
38AC_DEFUN(AC_PROG_CC_LOCAL,
39[AC_BEFORE([$0], [AC_PROG_CPP])dnl
40AC_CHECK_PROG(CC, gcc, gcc)
41if test -z "$CC"; then
42 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
43 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
44fi
45
46AC_PROG_CC_WORKS_LOCAL
47AC_PROG_CC_GNU
48
49dnl The following differs from the AC_PROG_CC macro in autoconf. Since
50dnl we require a recent version of gcc to be used we do not need to go
51dnl into lengths and test for bugs in old versions. It must be gcc 2.7
52dnl or above.
53if test $ac_cv_prog_gcc = yes; then
54 GCC=yes
55
56dnl Check the version
57 cat > conftest.c <<EOF
58#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
59 yes;
60#endif
61EOF
62 if AC_TRY_COMMAND(${CC-cc} -E conftest.c) | egrep yes >/dev/null 2>&1; then
63 if test -z "$CFLAGS"; then
64 CFLAGS="-g -O2"
65 fi
66 else
67 AC_MSG_ERROR([We require GNU CC version 2.7 or newer])
68 fi
69else
70 AC_MSG_ERROR([GNU libc must be compiled using GNU CC])
71fi
72])
73
74AC_DEFUN(AC_PROG_CC_WORKS_LOCAL,
75[AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $LDFLAGS) works])
76AC_LANG_SAVE
77AC_LANG_C
78AC_TRY_COMPILER([main(){return(0);}], ac_cv_prog_cc_works, ac_cv_prog_cc_cross)
79AC_LANG_RESTORE
80AC_MSG_RESULT($ac_cv_prog_cc_works)
81if test $ac_cv_prog_cc_works = no; then
82 cross_linkable=no
83 ac_cv_prog_cc_cross=yes
84dnl AC_MSG_ERROR([installation or configuration problem: C compiler cannot create executables.])
85else
86 cross_linkable=yes
87fi
88AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler])
89AC_MSG_RESULT($ac_cv_prog_cc_cross)
90AC_SUBST(cross_linkable)
91cross_compiling=$ac_cv_prog_cc_cross
92])