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