1 dnl We require that everyone use exactly the same Autoconf version so that
2 dnl the internal functions defined and used by the main configure script
3 dnl match those expected by the fragments. When changing this version,
4 dnl install.texi also needs to be updated.
5 m4_define([GLIBC_AUTOCONF_VERSION], [2.69])
6 m4_if(m4_defn([AC_AUTOCONF_VERSION]), GLIBC_AUTOCONF_VERSION, [],
8 Exactly version GLIBC_AUTOCONF_VERSION of Autoconf is required but you have
9 m4_defn([AC_AUTOCONF_VERSION])
12 dnl We define the macro GLIBC_PROVIDES to do an AC_PROVIDE for each macro
13 dnl which appears in configure.ac before the sysdep configure scripts are run.
14 dnl Each sysdep configure.ac does GLIBC_PROVIDES first, to avoid any
15 dnl AC_REQUIREs or AC_BEFOREs duplicating their code.
17 define([GLIBC_PROVIDES], [dnl
18 AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
19 AC_PROVIDE([AC_CONFIG_SUBDIRS])dnl
20 AC_PROVIDE([_AS_ECHO_N_PREPARE])dnl
21 AC_PROVIDE([_AS_ECHO_PREPARE])dnl
22 AC_PROVIDE([_AS_CR_PREPARE])dnl
23 AC_PROVIDE([_AS_TR_SH_PREPARE])dnl
24 AC_PROVIDE([_AS_VAR_ARITH_PREPARE])dnl
25 AC_PROVIDE([AC_PROG_INSTALL])dnl
26 AC_PROVIDE([AC_PROG_CC])dnl
27 AC_PROVIDE([AC_PROG_CPP])dnl
28 AC_PROVIDE([_AS_PATH_SEPARATOR_PREPARE])dnl
29 AC_PROVIDE([_AS_TEST_PREPARE])dnl
30 AC_PROVIDE([_AS_BASENAME_PREPARE])dnl
31 AC_PROVIDE([_AS_ME_PREPARE])dnl
32 AC_PROVIDE([_AS_LINENO_PREPARE])dnl
33 AC_PROVIDE([AS_SHELL_FN_as_fn_set_status])dnl
34 AC_PROVIDE([AS_SHELL_FN_as_fn_exit])dnl
35 AC_PROVIDE([AS_SHELL_FN_as_fn_arith])dnl
36 AC_PROVIDE([AS_SHELL_FN_ac_fn_c_try_compile])dnl
37 define([AS_MESSAGE_LOG_FD],5)dnl
38 define([AS_MESSAGE_FD],6)dnl
39 dnl Ripped out of AS_INIT, which does more cruft we do not want.
40 m4_wrap([m4_divert_pop([BODY])[]])
41 m4_divert_push([BODY])[]dnl
42 dnl End of ripped out of AS_INIT.
43 # This file is generated from configure.ac by Autoconf. DO NOT EDIT!
44 define([_AC_LANG], [C])dnl
47 dnl Check for a symbol
49 AC_DEFUN([AC_CHECK_SYMBOL], [dnl
50 AC_MSG_CHECKING(for $1)
51 AC_CACHE_VAL(ac_cv_check_symbol_$1, [dnl
54 extern char *$1[]; puts(*$1);,
56 ac_cv_check_symbol_$1=yes, ac_cv_check_symbol_$1=no)])
57 if test "$ac_cv_check_symbol_$1" = yes; then
59 ac_tr_symbol=`echo $1 | tr '[a-z]' '[A-Z]'`
61 AC_DEFINE_UNQUOTED(HAVE_${ac_tr_symbol})
63 AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
66 dnl Locate a program and check that its version is acceptable.
67 dnl AC_PROG_CHECK_VER(var, namelist, version-switch,
68 dnl [version-extract-regexp], version-glob [, do-if-fail])
69 AC_DEFUN([AC_CHECK_PROG_VER],
70 [AC_CHECK_PROGS([$1], [$2])
71 if test -z "[$]$1"; then
74 # Found it, now check the version.
75 AC_MSG_CHECKING([version of [$]$1])
77 ac_prog_version=`<<$>>$1 $3 2>&1 ifelse(<<$4>>,,,
78 <<| sed -n 's/^.*patsubst(<<$4>>,/,\/).*$/\1/p'>>)`
79 case $ac_prog_version in
80 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
83 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
84 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
87 AC_MSG_RESULT([$ac_prog_version])
90 [if test $ac_verc_fail = yes; then
95 dnl These modifications are to allow for an empty cross compiler tree.
96 define([_AC_COMPILER_EXEEXT], [EXEEXT=
99 AC_DEFUN([LIBC_PROG_FOO_GNU],
100 [# Most GNU programs take a -v and spit out some text including
101 # the word 'GNU'. Some try to read stdin, so give them /dev/null.
102 if $1 -o conftest -v </dev/null 2>&1 | grep GNU > /dev/null 2>&1; then
109 AC_DEFUN([LIBC_PROG_BINUTILS],
110 [# Was a --with-binutils option given?
111 if test -n "$path_binutils"; then
112 # Make absolute; ensure a single trailing slash.
113 path_binutils=`(cd $path_binutils; pwd) | sed 's%/*$%/%'`
114 CC="$CC -B$path_binutils"
116 AS=`$CC -print-prog-name=as`
117 LD=`$CC -print-prog-name=ld`
118 AR=`$CC -print-prog-name=ar`
120 OBJDUMP=`$CC -print-prog-name=objdump`
122 OBJCOPY=`$CC -print-prog-name=objcopy`
125 # Determine whether we are using GNU binutils.
126 AC_CACHE_CHECK(whether $AS is GNU as, libc_cv_prog_as_gnu,
127 [LIBC_PROG_FOO_GNU($AS, libc_cv_prog_as_gnu=yes, libc_cv_prog_as_gnu=no)])
129 gnu_as=$libc_cv_prog_as_gnu
131 AC_CACHE_CHECK(whether $LD is GNU ld, libc_cv_prog_ld_gnu,
132 [LIBC_PROG_FOO_GNU($LD, libc_cv_prog_ld_gnu=yes, libc_cv_prog_ld_gnu=no)])
133 gnu_ld=$libc_cv_prog_ld_gnu
136 dnl Run a static link test with -nostdlib -nostartfiles.
137 dnl LIBC_TRY_LINK_STATIC([code], [action-if-true], [action-if-false])
138 AC_DEFUN([LIBC_TRY_LINK_STATIC],
139 [cat > conftest.c <<EOF
140 int _start (void) { return 0; }
141 int __start (void) { return 0; }
144 AS_IF([AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest
145 conftest.c -static -nostartfiles -nostdlib
146 1>&AS_MESSAGE_LOG_FD])],
150 dnl Test a compiler option or options with an empty input file.
151 dnl LIBC_TRY_CC_OPTION([options], [action-if-true], [action-if-false])
152 AC_DEFUN([LIBC_TRY_CC_OPTION],
153 [AS_IF([AC_TRY_COMMAND([${CC-cc} $1 -xc /dev/null -S -o /dev/null])],
156 dnl Find and source sysdeps/*/preconfigure.
157 dnl LIBC_PRECONFIGURE([$srcdir], [for])
158 AC_DEFUN([LIBC_PRECONFIGURE], [dnl
159 if frags=`ls -d $1/sysdeps/*/preconfigure 2> /dev/null`
161 AC_MSG_CHECKING($2 preconfigure fragments)
162 for frag in $frags; do
163 name=`echo "$frag" | sed 's@/[[^/]]*[$]@@;s@^.*/@@'`
164 echo $ECHO_N "$name $ECHO_C" >&AS_MESSAGE_FD
170 # These two macros are taken from GCC's config/acx.m4.
171 dnl Support the --with-pkgversion configure option.
172 dnl ACX_PKGVERSION(default-pkgversion)
173 AC_DEFUN([ACX_PKGVERSION],[
174 AC_ARG_WITH(pkgversion,
175 AS_HELP_STRING([--with-pkgversion=PKG],
176 [Use PKG in the version string in place of "$1"]),
178 yes) AC_MSG_ERROR([package version not specified]) ;;
180 *) PKGVERSION="($withval) " ;;
184 PKGVERSION_TEXI=`echo "$PKGVERSION" | sed 's/@/@@/g'`
186 AC_SUBST(PKGVERSION_TEXI)
189 dnl Support the --with-bugurl configure option.
190 dnl ACX_BUGURL(default-bugurl)
191 AC_DEFUN([ACX_BUGURL],[
193 AS_HELP_STRING([--with-bugurl=URL],
194 [Direct users to URL to report a bug]),
196 yes) AC_MSG_ERROR([bug URL not specified]) ;;
210 REPORT_BUGS_TO="<$BUGURL>"
211 REPORT_BUGS_TEXI=@uref{`echo "$BUGURL" | sed 's/@/@@/g'`}
214 AC_SUBST(REPORT_BUGS_TO)
215 AC_SUBST(REPORT_BUGS_TEXI)
218 dnl Check linker option support.
219 dnl LIBC_LINKER_FEATURE([ld_option], [cc_option], [action-if-true], [action-if-false])
220 AC_DEFUN([LIBC_LINKER_FEATURE],
221 [AC_MSG_CHECKING([for linker that supports $1])
222 libc_linker_feature=no
223 if test x"$gnu_ld" = x"yes"; then
224 libc_linker_check=`$LD -v --help 2>/dev/null | grep "\$1"`
225 if test -n "$libc_linker_check"; then
226 cat > conftest.c <<EOF
227 int _start (void) { return 42; }
229 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
230 $2 -nostdlib -nostartfiles
231 -fPIC -shared -o conftest.so conftest.c
232 1>&AS_MESSAGE_LOG_FD])
234 libc_linker_feature=yes
239 if test $libc_linker_feature = yes; then
244 AC_MSG_RESULT($libc_linker_feature)])
246 dnl Add a makefile variable, with value set from a shell string
247 dnl (expanded by the shell inside double quotes), to config.make.
248 dnl LIBC_CONFIG_VAR(make-variable, shell-value)
249 AC_DEFUN([LIBC_CONFIG_VAR],
250 [config_vars="$config_vars
253 dnl Check that function FUNC was inlined as a builtin. The code fragment
254 dnl CODE is compiled with additional options CC_OPTION. If FUNC is
255 dnl not found in the assembly then it is assumed the compiler has support
256 dnl for this builtin and has inlined the call. If the compiler has the
257 dnl feature then ACTION-IF-TRUE is called, otherwise ACTION-IF-FALSE.
258 dnl It is up to the caller to provide a CC_OPTION that ensures the
259 dnl builtin is inlined if present.
260 dnl Warning: This may not work for some machines. For example on ARM the
261 dnl ABI dictates that some functions should not be inlined and instead
262 dnl should be provided by a compiler helper library e.g. __aeabi_memcpy.
263 dnl This is done to reduce code size.
264 dnl LIBC_COMPILER_BUILTIN([func], [code], [cc_option], [action-if-true], [action-if-false])
265 AC_DEFUN([LIBC_COMPILER_BUILTIN_INLINED],
266 [AC_MSG_CHECKING([for compiler support of inlined builtin function $1])
267 libc_compiler_builtin_inlined=no
268 cat > conftest.c <<EOF
269 int _start (void) { $2 return 0; }
271 if ! AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
272 $3 -nostdlib -nostartfiles
273 -S conftest.c -o - | fgrep "$1"
274 1>&AS_MESSAGE_LOG_FD])
276 libc_compiler_builtin_inlined=yes
279 if test $libc_compiler_builtin_inlined = yes; then
284 AC_MSG_RESULT($libc_compiler_builtin_inlined)])
286 dnl Default to slibdir named SLIBDIR instead of "lib", and rtlddir
287 dnl named RTLDDIR instead of "lib". This is used to put 64-bit
288 dnl libraries in /lib64.
289 dnl LIBC_SLIBDIR_RTLDDIR([slibdir], [rtlddir])
290 AC_DEFUN([LIBC_SLIBDIR_RTLDDIR],
291 [test -n "$libc_cv_slibdir" ||
296 if test "$libdir" = '${exec_prefix}/lib'; then
297 libdir='${exec_prefix}/$1';
298 # Locale data can be shared between 32-bit and 64-bit libraries.
299 libc_cv_localedir='${exec_prefix}/lib/locale'