]> git.ipfire.org Git - thirdparty/glibc.git/blame - aclocal.m4
* aclocal.m4 (GLIBC_PROVIDES): Add AC_PROVIDE([_AS_ECHO_N_PREPARE]).
[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
3a12e572 6define([GLIBC_PROVIDES], [dnl
b9cb349f 7AC_PROVIDE([_AS_ECHO_N_PREPARE])dnl
28f540f4
RM
8AC_PROVIDE([AC_PROG_INSTALL])dnl
9AC_PROVIDE([AC_PROG_RANLIB])dnl
10AC_PROVIDE([AC_PROG_CC])dnl
11AC_PROVIDE([AC_PROG_CPP])dnl
3a12e572
UD
12define([AS_MESSAGE_LOG_FD],5)dnl
13define([AS_MESSAGE_FD],6)dnl
14AS_INIT()dnl
15m4_divert_text([HEADER-COMMENT],
16[@%:@ This file is generated from configure.in by Autoconf. DO NOT EDIT!])
b9cb349f 17define([_AC_LANG], [C])dnl
28f540f4
RM
18])dnl
19dnl
20dnl Check for a symbol
21dnl
3a12e572 22AC_DEFUN([AC_CHECK_SYMBOL], [dnl
28f540f4
RM
23AC_MSG_CHECKING(for $1)
24AC_CACHE_VAL(ac_cv_check_symbol_$1, [dnl
7cfb2d8b 25AC_TRY_LINK(,
28f540f4
RM
26changequote(,)dnl
27extern char *$1[]; puts(*$1);,
28changequote([,])dnl
29 ac_cv_check_symbol_$1=yes, ac_cv_check_symbol_$1=no)])
30if test "$ac_cv_check_symbol_$1" = yes; then
31changequote(,)dnl
32 ac_tr_symbol=`echo $1 | tr '[a-z]' '[A-Z]'`
33changequote([,])dnl
34 AC_DEFINE_UNQUOTED(HAVE_${ac_tr_symbol})
35fi
36AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
37dnl
ebbad4cc 38
63bda0c1
UD
39dnl Locate a program and check that its version is acceptable.
40dnl AC_PROG_CHECK_VER(var, namelist, version-switch,
4bca4c17 41dnl [version-extract-regexp], version-glob [, do-if-fail])
3a12e572 42AC_DEFUN([AC_CHECK_PROG_VER],
4bca4c17
UD
43[AC_CHECK_PROGS([$1], [$2])
44if test -z "[$]$1"; then
45 ac_verc_fail=yes
63bda0c1 46else
4bca4c17
UD
47 # Found it, now check the version.
48 AC_MSG_CHECKING([version of [$]$1])
63bda0c1 49changequote(<<,>>)dnl
4bca4c17
UD
50 ac_prog_version=`<<$>>$1 $3 2>&1 ifelse(<<$4>>,,,
51 <<| sed -n 's/^.*patsubst(<<$4>>,/,\/).*$/\1/p'>>)`
52 case $ac_prog_version in
53 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
54 <<$5>>)
63bda0c1 55changequote([,])dnl
4bca4c17
UD
56 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
57 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
58
63bda0c1 59 esac
4bca4c17 60 AC_MSG_RESULT([$ac_prog_version])
63bda0c1 61fi
4bca4c17
UD
62ifelse([$6],,,
63[if test $ac_verc_fail = yes; then
64 $6
65fi])
63bda0c1
UD
66])
67
ebbad4cc 68dnl These modifications are to allow for an empty cross compiler tree.
3a12e572 69define([_AC_COMPILER_EXEEXT], [EXEEXT=
ebbad4cc 70])
650425ce 71
3a12e572 72AC_DEFUN([LIBC_PROG_FOO_GNU],
650425ce
UD
73[# Most GNU programs take a -v and spit out some text including
74# the word 'GNU'. Some try to read stdin, so give them /dev/null.
256705f4 75if $1 -o conftest -v </dev/null 2>&1 | grep GNU > /dev/null 2>&1; then
650425ce
UD
76 $2
77else
78 $3
256705f4
UD
79fi
80rm -fr contest*])
650425ce 81
3a12e572 82AC_DEFUN([LIBC_PROG_BINUTILS],
650425ce
UD
83[# Was a --with-binutils option given?
84if test -n "$path_binutils"; then
85 # Make absolute; ensure a single trailing slash.
86 path_binutils=`(cd $path_binutils; pwd) | sed 's%/*$%/%'`
63bda0c1 87 CC="$CC -B$path_binutils"
650425ce 88fi
6916c5e1
UD
89AS=`$CC -print-prog-name=as`
90LD=`$CC -print-prog-name=ld`
5edb9387
UD
91AR=`$CC -print-prog-name=ar`
92AC_SUBST(AR)
93
94# ranlib has to be treated a bit differently since it might not exist at all.
70d633a0
RM
95ac_ranlib=`$CC -print-prog-name=ranlib`
96if test "x$ac_ranlib" = xranlib; then
5edb9387
UD
97# This extra check has to happen since gcc simply echos the parameter in
98# case it cannot find the value in its own directories.
99AC_CHECK_TOOL(RANLIB, ranlib, :)
70d633a0
RM
100else
101 RANLIB=$ac_ranlib
5edb9387
UD
102fi
103AC_SUBST(RANLIB)
650425ce
UD
104
105# Determine whether we are using GNU binutils.
106AC_CACHE_CHECK(whether $AS is GNU as, libc_cv_prog_as_gnu,
107[LIBC_PROG_FOO_GNU($AS, libc_cv_prog_as_gnu=yes, libc_cv_prog_as_gnu=no)])
a5a0310d 108rm -f a.out
650425ce
UD
109gnu_as=$libc_cv_prog_as_gnu
110
111AC_CACHE_CHECK(whether $LD is GNU ld, libc_cv_prog_ld_gnu,
112[LIBC_PROG_FOO_GNU($LD, libc_cv_prog_ld_gnu=yes, libc_cv_prog_ld_gnu=no)])
63bda0c1
UD
113gnu_ld=$libc_cv_prog_ld_gnu
114])