]>
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 | 34 | |
63bda0c1 UD |
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, fatal) | |
38 | AC_DEFUN(AC_CHECK_PROG_VER, | |
39 | [# Prepare to iterate over the program-name list. | |
40 | set dummy $2; shift | |
41 | AC_MSG_CHECKING([for [$]1]) | |
42 | AC_CACHE_VAL(ac_cv_prog_$1, [dnl | |
43 | if test -n "[$]$1"; then | |
44 | ac_cv_prog_$1="[$]$1" # Let the user override the test. | |
45 | else | |
46 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" | |
47 | for ac_word; do | |
48 | for ac_dir in $PATH; do | |
49 | test -z "$ac_dir" && ac_dir=. | |
50 | if test -f $ac_dir/$ac_word; then | |
51 | ac_cv_prog_$1="$ac_word" | |
52 | break | |
53 | fi | |
54 | done | |
55 | test -n "$ac_cv_prog_$1" && break | |
56 | done | |
57 | IFS="$ac_save_ifs" | |
58 | fi])dnl | |
59 | if test -z "$ac_cv_prog_$1"; then | |
60 | AC_MSG_RESULT(no) | |
61 | $1=: | |
62 | ac_verc_fail=t; ifelse([$6],,,[ac_verc_fatal=$6]) | |
63 | else | |
64 | # Found it, now check the version. | |
65 | ac_word=$ac_cv_prog_$1 | |
66 | dnl Do this by hand to avoid "(cached) (cached)". | |
67 | if test "[$]{ac_cv_prog_$1_ver+set}" != set; then | |
68 | changequote(<<,>>)dnl | |
69 | ac_cv_prog_$1_ver=`$ac_word $3 2>&1 ifelse(<<$4>>,,,<<| sed -n 's/^.*$4.*$/\1/p'>>)` | |
70 | fi | |
71 | if test -n "$ac_cv_prog_$1_ver"; then | |
72 | case $ac_cv_prog_$1_ver in | |
73 | <<$5>>) ac_vers_ok=", ok"; $1=$ac_cv_prog_$1;; | |
74 | changequote([,])dnl | |
75 | *) ac_vers_ok=", bad"; $1=: | |
76 | ac_verc_fail=t; ifelse([$6],,,[ac_verc_fatal=$6]);; | |
77 | esac | |
78 | else | |
79 | ac_vers_ok="v. ?.??, bad"; $1=: | |
80 | ac_verc_fail=t; ifelse([$6],,,[ac_verc_fatal=$6]) | |
81 | fi | |
82 | AC_MSG_RESULT($ac_word $ac_cv_prog_$1_ver$ac_vers_ok) | |
83 | fi | |
84 | AC_SUBST($1)dnl | |
85 | ]) | |
86 | ||
ebbad4cc UD |
87 | dnl These modifications are to allow for an empty cross compiler tree. |
88 | dnl In the situation that cross-linking is impossible, the variable | |
89 | dnl `cross_linkable' will be substituted with "yes". | |
63bda0c1 | 90 | dnl The vercheck macros are expected to have been called already. |
ebbad4cc UD |
91 | AC_DEFUN(AC_PROG_CC_LOCAL, |
92 | [AC_BEFORE([$0], [AC_PROG_CPP])dnl | |
ebbad4cc UD |
93 | |
94 | AC_PROG_CC_WORKS_LOCAL | |
95 | AC_PROG_CC_GNU | |
63bda0c1 | 96 | if test $ac_cv_prog_gcc != yes; then |
ebbad4cc UD |
97 | AC_MSG_ERROR([GNU libc must be compiled using GNU CC]) |
98 | fi | |
99 | ]) | |
100 | ||
101 | AC_DEFUN(AC_PROG_CC_WORKS_LOCAL, | |
102 | [AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $LDFLAGS) works]) | |
63bda0c1 UD |
103 | AC_CACHE_VAL(ac_cv_prog_cc_works, |
104 | [AC_LANG_SAVE | |
ebbad4cc UD |
105 | AC_LANG_C |
106 | AC_TRY_COMPILER([main(){return(0);}], ac_cv_prog_cc_works, ac_cv_prog_cc_cross) | |
63bda0c1 | 107 | AC_LANG_RESTORE]) |
ebbad4cc UD |
108 | AC_MSG_RESULT($ac_cv_prog_cc_works) |
109 | if test $ac_cv_prog_cc_works = no; then | |
110 | cross_linkable=no | |
111 | ac_cv_prog_cc_cross=yes | |
112 | dnl AC_MSG_ERROR([installation or configuration problem: C compiler cannot create executables.]) | |
113 | else | |
114 | cross_linkable=yes | |
115 | fi | |
63bda0c1 UD |
116 | AC_CACHE_CHECK( |
117 | [whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler], | |
118 | ac_cv_prog_cc_cross, [:]) | |
ebbad4cc UD |
119 | AC_SUBST(cross_linkable) |
120 | cross_compiling=$ac_cv_prog_cc_cross | |
121 | ]) | |
650425ce UD |
122 | |
123 | AC_DEFUN(LIBC_PROG_FOO_GNU, | |
124 | [# Most GNU programs take a -v and spit out some text including | |
125 | # the word 'GNU'. Some try to read stdin, so give them /dev/null. | |
bc526b60 | 126 | if $1 -v </dev/null 2>&1 | grep GNU > /dev/null 2>&1; then |
650425ce UD |
127 | $2 |
128 | else | |
129 | $3 | |
130 | fi]) | |
131 | ||
132 | AC_DEFUN(LIBC_PROG_BINUTILS, | |
133 | [# Was a --with-binutils option given? | |
134 | if test -n "$path_binutils"; then | |
135 | # Make absolute; ensure a single trailing slash. | |
136 | path_binutils=`(cd $path_binutils; pwd) | sed 's%/*$%/%'` | |
63bda0c1 | 137 | CC="$CC -B$path_binutils" |
650425ce UD |
138 | fi |
139 | AS=`$CC -print-file-name=as` | |
140 | LD=`$CC -print-file-name=ld` | |
141 | ||
142 | # Determine whether we are using GNU binutils. | |
143 | AC_CACHE_CHECK(whether $AS is GNU as, libc_cv_prog_as_gnu, | |
144 | [LIBC_PROG_FOO_GNU($AS, libc_cv_prog_as_gnu=yes, libc_cv_prog_as_gnu=no)]) | |
a5a0310d | 145 | rm -f a.out |
650425ce UD |
146 | gnu_as=$libc_cv_prog_as_gnu |
147 | ||
148 | AC_CACHE_CHECK(whether $LD is GNU ld, libc_cv_prog_ld_gnu, | |
149 | [LIBC_PROG_FOO_GNU($LD, libc_cv_prog_ld_gnu=yes, libc_cv_prog_ld_gnu=no)]) | |
63bda0c1 UD |
150 | gnu_ld=$libc_cv_prog_ld_gnu |
151 | ]) |