]> git.ipfire.org Git - thirdparty/glibc.git/blame - aclocal.m4
Direct __ppc_get_timebase to __builtin_ppc_get_timebase for GCC 4.8+.
[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
9632aaee 7AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
7967983f 8AC_PROVIDE([AC_CONFIG_SUBDIRS])dnl
b9cb349f 9AC_PROVIDE([_AS_ECHO_N_PREPARE])dnl
7967983f 10AC_PROVIDE([_AS_ECHO_PREPARE])dnl
2d37ce0f
RM
11AC_PROVIDE([_AS_CR_PREPARE])dnl
12AC_PROVIDE([_AS_TR_SH_PREPARE])dnl
b8493de0 13AC_PROVIDE([_AS_VAR_ARITH_PREPARE])dnl
28f540f4 14AC_PROVIDE([AC_PROG_INSTALL])dnl
28f540f4
RM
15AC_PROVIDE([AC_PROG_CC])dnl
16AC_PROVIDE([AC_PROG_CPP])dnl
45fba3df
RM
17AC_PROVIDE([_AS_PATH_SEPARATOR_PREPARE])dnl
18AC_PROVIDE([_AS_TEST_PREPARE])dnl
b8493de0
RM
19AC_PROVIDE([_AS_BASENAME_PREPARE])dnl
20AC_PROVIDE([_AS_ME_PREPARE])dnl
21AC_PROVIDE([_AS_LINENO_PREPARE])dnl
22AC_PROVIDE([AS_SHELL_FN_as_fn_set_status])dnl
23AC_PROVIDE([AS_SHELL_FN_as_fn_exit])dnl
24AC_PROVIDE([AS_SHELL_FN_as_fn_arith])dnl
25AC_PROVIDE([AS_SHELL_FN_ac_fn_c_try_compile])dnl
3a12e572
UD
26define([AS_MESSAGE_LOG_FD],5)dnl
27define([AS_MESSAGE_FD],6)dnl
52a0d149
RM
28dnl Ripped out of AS_INIT, which does more cruft we do not want.
29m4_wrap([m4_divert_pop([BODY])[]])
30m4_divert_push([BODY])[]dnl
31dnl End of ripped out of AS_INIT.
32# This file is generated from configure.in by Autoconf. DO NOT EDIT!
b9cb349f 33define([_AC_LANG], [C])dnl
28f540f4
RM
34])dnl
35dnl
36dnl Check for a symbol
37dnl
3a12e572 38AC_DEFUN([AC_CHECK_SYMBOL], [dnl
28f540f4
RM
39AC_MSG_CHECKING(for $1)
40AC_CACHE_VAL(ac_cv_check_symbol_$1, [dnl
7cfb2d8b 41AC_TRY_LINK(,
28f540f4
RM
42changequote(,)dnl
43extern char *$1[]; puts(*$1);,
44changequote([,])dnl
45 ac_cv_check_symbol_$1=yes, ac_cv_check_symbol_$1=no)])
46if test "$ac_cv_check_symbol_$1" = yes; then
47changequote(,)dnl
48 ac_tr_symbol=`echo $1 | tr '[a-z]' '[A-Z]'`
49changequote([,])dnl
50 AC_DEFINE_UNQUOTED(HAVE_${ac_tr_symbol})
51fi
52AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
53dnl
ebbad4cc 54
63bda0c1
UD
55dnl Locate a program and check that its version is acceptable.
56dnl AC_PROG_CHECK_VER(var, namelist, version-switch,
4bca4c17 57dnl [version-extract-regexp], version-glob [, do-if-fail])
3a12e572 58AC_DEFUN([AC_CHECK_PROG_VER],
4bca4c17
UD
59[AC_CHECK_PROGS([$1], [$2])
60if test -z "[$]$1"; then
61 ac_verc_fail=yes
63bda0c1 62else
4bca4c17
UD
63 # Found it, now check the version.
64 AC_MSG_CHECKING([version of [$]$1])
63bda0c1 65changequote(<<,>>)dnl
4bca4c17 66 ac_prog_version=`<<$>>$1 $3 2>&1 ifelse(<<$4>>,,,
e9433893 67 <<| sed -n 's/^.*patsubst(<<$4>>,/,\/).*$/\1/p'>>)`
4bca4c17
UD
68 case $ac_prog_version in
69 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
70 <<$5>>)
63bda0c1 71changequote([,])dnl
4bca4c17
UD
72 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
73 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
74
63bda0c1 75 esac
4bca4c17 76 AC_MSG_RESULT([$ac_prog_version])
63bda0c1 77fi
4bca4c17
UD
78ifelse([$6],,,
79[if test $ac_verc_fail = yes; then
80 $6
81fi])
63bda0c1
UD
82])
83
ebbad4cc 84dnl These modifications are to allow for an empty cross compiler tree.
3a12e572 85define([_AC_COMPILER_EXEEXT], [EXEEXT=
ebbad4cc 86])
650425ce 87
3a12e572 88AC_DEFUN([LIBC_PROG_FOO_GNU],
650425ce
UD
89[# Most GNU programs take a -v and spit out some text including
90# the word 'GNU'. Some try to read stdin, so give them /dev/null.
256705f4 91if $1 -o conftest -v </dev/null 2>&1 | grep GNU > /dev/null 2>&1; then
650425ce
UD
92 $2
93else
94 $3
256705f4
UD
95fi
96rm -fr contest*])
650425ce 97
3a12e572 98AC_DEFUN([LIBC_PROG_BINUTILS],
650425ce
UD
99[# Was a --with-binutils option given?
100if test -n "$path_binutils"; then
101 # Make absolute; ensure a single trailing slash.
102 path_binutils=`(cd $path_binutils; pwd) | sed 's%/*$%/%'`
63bda0c1 103 CC="$CC -B$path_binutils"
650425ce 104fi
6916c5e1
UD
105AS=`$CC -print-prog-name=as`
106LD=`$CC -print-prog-name=ld`
5edb9387
UD
107AR=`$CC -print-prog-name=ar`
108AC_SUBST(AR)
6e3d59bc
RM
109OBJDUMP=`$CC -print-prog-name=objdump`
110AC_SUBST(OBJDUMP)
1b74661a
RM
111OBJCOPY=`$CC -print-prog-name=objcopy`
112AC_SUBST(OBJCOPY)
5edb9387 113
650425ce
UD
114# Determine whether we are using GNU binutils.
115AC_CACHE_CHECK(whether $AS is GNU as, libc_cv_prog_as_gnu,
116[LIBC_PROG_FOO_GNU($AS, libc_cv_prog_as_gnu=yes, libc_cv_prog_as_gnu=no)])
a5a0310d 117rm -f a.out
650425ce
UD
118gnu_as=$libc_cv_prog_as_gnu
119
120AC_CACHE_CHECK(whether $LD is GNU ld, libc_cv_prog_ld_gnu,
121[LIBC_PROG_FOO_GNU($LD, libc_cv_prog_ld_gnu=yes, libc_cv_prog_ld_gnu=no)])
63bda0c1
UD
122gnu_ld=$libc_cv_prog_ld_gnu
123])
07037eeb
JM
124
125dnl Run a static link test with -nostdlib -nostartfiles.
126dnl LIBC_TRY_LINK_STATIC([code], [action-if-true], [action-if-false])
127AC_DEFUN([LIBC_TRY_LINK_STATIC],
128[cat > conftest.c <<EOF
129int _start (void) { return 0; }
130int __start (void) { return 0; }
131$1
132EOF
133AS_IF([AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest
134 conftest.c -static -nostartfiles -nostdlib
135 1>&AS_MESSAGE_LOG_FD])],
136 [$2], [$3])
137rm -f conftest*])
10a803e0 138
40b601fb
JM
139dnl Test a compiler option or options with an empty input file.
140dnl LIBC_TRY_CC_OPTION([options], [action-if-true], [action-if-false])
141AC_DEFUN([LIBC_TRY_CC_OPTION],
142[AS_IF([AC_TRY_COMMAND([${CC-cc} $1 -xc /dev/null -S -o /dev/null])],
143 [$2], [$3])])
144
10a803e0
RM
145dnl Find and source sysdeps/*/preconfigure.
146dnl LIBC_PRECONFIGURE([$srcdir], [for])
147AC_DEFUN([LIBC_PRECONFIGURE], [dnl
148if frags=`ls -d $1/sysdeps/*/preconfigure 2> /dev/null`
149then
150 AC_MSG_CHECKING($2 preconfigure fragments)
151 for frag in $frags; do
152 name=`echo "$frag" | sed 's@/[[^/]]*[$]@@;s@^.*/@@'`
153 echo $ECHO_N "$name $ECHO_C" >&AS_MESSAGE_FD
154 . "$frag"
155 done
156 AC_MSG_RESULT()
157fi])