]> 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 34
63bda0c1
UD
35dnl Locate a program and check that its version is acceptable.
36dnl AC_PROG_CHECK_VER(var, namelist, version-switch,
4bca4c17 37dnl [version-extract-regexp], version-glob [, do-if-fail])
63bda0c1 38AC_DEFUN(AC_CHECK_PROG_VER,
4bca4c17
UD
39[AC_CHECK_PROGS([$1], [$2])
40if test -z "[$]$1"; then
41 ac_verc_fail=yes
63bda0c1 42else
4bca4c17
UD
43 # Found it, now check the version.
44 AC_MSG_CHECKING([version of [$]$1])
63bda0c1 45changequote(<<,>>)dnl
4bca4c17
UD
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>>)
63bda0c1 51changequote([,])dnl
4bca4c17
UD
52 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
53 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
54
63bda0c1 55 esac
4bca4c17 56 AC_MSG_RESULT([$ac_prog_version])
63bda0c1 57fi
4bca4c17
UD
58ifelse([$6],,,
59[if test $ac_verc_fail = yes; then
60 $6
61fi])
63bda0c1
UD
62])
63
ebbad4cc
UD
64dnl These modifications are to allow for an empty cross compiler tree.
65dnl In the situation that cross-linking is impossible, the variable
66dnl `cross_linkable' will be substituted with "yes".
63bda0c1 67dnl The vercheck macros are expected to have been called already.
ebbad4cc
UD
68AC_DEFUN(AC_PROG_CC_LOCAL,
69[AC_BEFORE([$0], [AC_PROG_CPP])dnl
ebbad4cc
UD
70
71AC_PROG_CC_WORKS_LOCAL
72AC_PROG_CC_GNU
63bda0c1 73if test $ac_cv_prog_gcc != yes; then
ebbad4cc
UD
74 AC_MSG_ERROR([GNU libc must be compiled using GNU CC])
75fi
76])
77
78AC_DEFUN(AC_PROG_CC_WORKS_LOCAL,
79[AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $LDFLAGS) works])
63bda0c1
UD
80AC_CACHE_VAL(ac_cv_prog_cc_works,
81[AC_LANG_SAVE
ebbad4cc
UD
82AC_LANG_C
83AC_TRY_COMPILER([main(){return(0);}], ac_cv_prog_cc_works, ac_cv_prog_cc_cross)
63bda0c1 84AC_LANG_RESTORE])
ebbad4cc
UD
85AC_MSG_RESULT($ac_cv_prog_cc_works)
86if test $ac_cv_prog_cc_works = no; then
87 cross_linkable=no
88 ac_cv_prog_cc_cross=yes
89dnl AC_MSG_ERROR([installation or configuration problem: C compiler cannot create executables.])
90else
91 cross_linkable=yes
92fi
63bda0c1
UD
93AC_CACHE_CHECK(
94[whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler],
95ac_cv_prog_cc_cross, [:])
ebbad4cc
UD
96AC_SUBST(cross_linkable)
97cross_compiling=$ac_cv_prog_cc_cross
98])
650425ce
UD
99
100AC_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.
bc526b60 103if $1 -v </dev/null 2>&1 | grep GNU > /dev/null 2>&1; then
650425ce
UD
104 $2
105else
106 $3
107fi])
108
109AC_DEFUN(LIBC_PROG_BINUTILS,
110[# Was a --with-binutils option given?
111if test -n "$path_binutils"; then
112 # Make absolute; ensure a single trailing slash.
113 path_binutils=`(cd $path_binutils; pwd) | sed 's%/*$%/%'`
63bda0c1 114 CC="$CC -B$path_binutils"
650425ce 115fi
6916c5e1
UD
116AS=`$CC -print-prog-name=as`
117LD=`$CC -print-prog-name=ld`
650425ce
UD
118
119# Determine whether we are using GNU binutils.
120AC_CACHE_CHECK(whether $AS is GNU as, libc_cv_prog_as_gnu,
121[LIBC_PROG_FOO_GNU($AS, libc_cv_prog_as_gnu=yes, libc_cv_prog_as_gnu=no)])
a5a0310d 122rm -f a.out
650425ce
UD
123gnu_as=$libc_cv_prog_as_gnu
124
125AC_CACHE_CHECK(whether $LD is GNU ld, libc_cv_prog_ld_gnu,
126[LIBC_PROG_FOO_GNU($LD, libc_cv_prog_ld_gnu=yes, libc_cv_prog_ld_gnu=no)])
63bda0c1
UD
127gnu_ld=$libc_cv_prog_ld_gnu
128])