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