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