]>
Commit | Line | Data |
---|---|---|
28f540f4 RM |
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 | |
7cfb2d8b RM |
6 | define(AC_FD_MSG,6)dnl Autoconf lossage. |
7 | define(AC_FD_CC,5)dnl Autoconf lossage. | |
28f540f4 RM |
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 | |
7cfb2d8b | 21 | AC_TRY_LINK(, |
28f540f4 RM |
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}) | |
31 | fi | |
32 | AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl | |
33 | dnl | |
ebbad4cc UD |
34 | |
35 | dnl These modifications are to allow for an empty cross compiler tree. | |
36 | dnl In the situation that cross-linking is impossible, the variable | |
37 | dnl `cross_linkable' will be substituted with "yes". | |
38 | AC_DEFUN(AC_PROG_CC_LOCAL, | |
39 | [AC_BEFORE([$0], [AC_PROG_CPP])dnl | |
40 | AC_CHECK_PROG(CC, gcc, gcc) | |
41 | if 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]) | |
44 | fi | |
45 | ||
46 | AC_PROG_CC_WORKS_LOCAL | |
47 | AC_PROG_CC_GNU | |
48 | ||
49 | dnl The following differs from the AC_PROG_CC macro in autoconf. Since | |
50 | dnl we require a recent version of gcc to be used we do not need to go | |
51 | dnl into lengths and test for bugs in old versions. It must be gcc 2.7 | |
52 | dnl or above. | |
53 | if test $ac_cv_prog_gcc = yes; then | |
54 | GCC=yes | |
55 | ||
56 | dnl Check the version | |
57 | cat > conftest.c <<EOF | |
58 | #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) | |
59 | yes; | |
60 | #endif | |
61 | EOF | |
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 | |
69 | else | |
70 | AC_MSG_ERROR([GNU libc must be compiled using GNU CC]) | |
71 | fi | |
72 | ]) | |
73 | ||
74 | AC_DEFUN(AC_PROG_CC_WORKS_LOCAL, | |
75 | [AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $LDFLAGS) works]) | |
76 | AC_LANG_SAVE | |
77 | AC_LANG_C | |
78 | AC_TRY_COMPILER([main(){return(0);}], ac_cv_prog_cc_works, ac_cv_prog_cc_cross) | |
79 | AC_LANG_RESTORE | |
80 | AC_MSG_RESULT($ac_cv_prog_cc_works) | |
81 | if test $ac_cv_prog_cc_works = no; then | |
82 | cross_linkable=no | |
83 | ac_cv_prog_cc_cross=yes | |
84 | dnl AC_MSG_ERROR([installation or configuration problem: C compiler cannot create executables.]) | |
85 | else | |
86 | cross_linkable=yes | |
87 | fi | |
88 | AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler]) | |
89 | AC_MSG_RESULT($ac_cv_prog_cc_cross) | |
90 | AC_SUBST(cross_linkable) | |
91 | cross_compiling=$ac_cv_prog_cc_cross | |
92 | ]) |