1 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
2 # Local configure fragment for sysdeps/unix/sysv/linux.
4 # Don't bother trying to generate any glue code to be compatible with the
5 # existing system library, because we are the only system library.
8 define([LIBC_LINUX_VERSION],[2.0.10])dnl
9 if test -n "$sysheaders"; then
10 OLD_CPPFLAGS=$CPPFLAGS
11 CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
13 define([libc_cv_linuxVER], [libc_cv_linux]patsubst(LIBC_LINUX_VERSION,[\.]))dnl
14 AC_CACHE_CHECK(installed Linux kernel header files, libc_cv_linuxVER, [dnl
15 AC_EGREP_CPP([eat flaming death], [#include <linux/version.h>
16 #if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE < ]dnl
17 patsubst(LIBC_LINUX_VERSION,[^\([^.]*\)\.\([^.]*\)\.\([^.]*\)$],dnl
18 [ (\1 *65536+ \2 *256+ \3) /* \1.\2.\3 */])[
21 libc_cv_linuxVER='TOO OLD!',
22 libc_cv_linuxVER='LIBC_LINUX_VERSION or later')])
23 if test "$libc_cv_linuxVER" != 'LIBC_LINUX_VERSION or later'; then
24 AC_MSG_ERROR([GNU libc requires kernel header files from
25 Linux LIBC_LINUX_VERSION or later to be installed before configuring.
26 The kernel header files are found usually in /usr/include/asm and
27 /usr/include/linux; make sure these directories use files from
28 Linux LIBC_LINUX_VERSION or later. This check uses <linux/version.h>, so
29 make sure that file was built correctly when installing the kernel header
30 files. To use kernel headers not from /usr/include/linux, use the
31 configure option --with-headers.])
34 # If the user gave a minimal version number test whether the available
35 # kernel headers are young enough. Additionally we have minimal
36 # kernel versions for some architectures. If a previous configure fragment
37 # set arch_minimum_kernel already, let that override our defaults here.
38 # Note that we presume such a fragment has set libc_cv_gcc_unwind_find_fde
40 test -n "$arch_minimum_kernel" ||
43 arch_minimum_kernel=2.1.100
44 libc_cv_gcc_unwind_find_fde=yes
47 arch_minimum_kernel=2.0.10
48 libc_cv_gcc_unwind_find_fde=yes
51 libc_cv_gcc_unwind_find_fde=yes
52 arch_minimum_kernel=2.0.10
55 arch_minimum_kernel=2.4.0
58 libc_cv_gcc_unwind_find_fde=yes
59 arch_minimum_kernel=2.4.19
62 arch_minimum_kernel=2.0.10
63 libc_cv_gcc_unwind_find_fde=yes
66 libc_cv_gcc_unwind_find_fde=yes
67 arch_minimum_kernel=2.0.10
70 arch_minimum_kernel=2.4.21
73 libc_cv_gcc_unwind_find_fde=yes
74 arch_minimum_kernel=2.2.10
77 libc_cv_gcc_unwind_find_fde=yes
78 arch_minimum_kernel=2.4.0
81 arch_minimum_kernel=2.3.99
82 libc_cv_gcc_unwind_find_fde=yes
85 libc_cv_gcc_unwind_find_fde=yes
86 arch_minimum_kernel=2.4.21
89 libc_cv_gcc_unwind_find_fde=yes
90 arch_minimum_kernel=2.0.10
93 arch_minimum_kernel=2.4.0
96 arch_minimum_kernel=2.0.10
99 if test -n "$minimum_kernel"; then
101 user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
102 arch_version=$((`echo "$arch_minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
104 if test $user_version -lt $arch_version; then
105 AC_MSG_WARN([minimum kernel version reset to $arch_minimum_kernel])
106 minimum_kernel=$arch_minimum_kernel
109 if test $arch_minimum_kernel != '2.0.10'; then
110 minimum_kernel=$arch_minimum_kernel
114 if test -n "$minimum_kernel"; then
115 AC_MSG_CHECKING(for kernel header at least $minimum_kernel)
117 decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
118 abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
120 AC_EGREP_CPP([eat flaming death], [#include <linux/version.h>
121 #if LINUX_VERSION_CODE < $decnum
123 #endif], libc_minimum_kernel='too old!', libc_minimum_kernel=ok)
124 AC_MSG_RESULT($libc_minimum_kernel)
125 if test "$libc_minimum_kernel" = ok; then
126 AC_DEFINE_UNQUOTED(__LINUX_KERNEL_VERSION, $decnum)
127 AC_DEFINE_UNQUOTED(__ABI_TAG_VERSION, $abinum)
129 AC_MSG_ERROR([*** The available kernel headers are older than the requested
130 *** compatible kernel version])
134 # The result of the above test for the use of the FDE code is invalid if
135 # the user overrides the decision about the minimum ABI.
136 if test "$oldest_abi" != default && test "2.2.4" \< "$oldest_abi"; then
137 libc_cv_gcc_unwind_find_fde=no
140 if test -n "$sysheaders"; then
141 CPPFLAGS=$OLD_CPPFLAGS
143 # The Linux filesystem standard prescribes where to place "essential"
144 # files. I.e., when the installation prefix is "/usr" we have to place
145 # shared library objects and the configuration files on the root partition
149 # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib.
150 # Allow earlier configure scripts to handle libc_cv_slibdir, libdir,
151 # and libc_cv_localedir.
152 test -n "$libc_cv_slibdir" || \
154 sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64)
155 libc_cv_slibdir="/lib64"
156 if test "$libdir" = '${exec_prefix}/lib'; then
157 libdir='${exec_prefix}/lib64';
158 # Locale data can be shared between 32bit and 64bit libraries
159 libc_cv_localedir='${exec_prefix}/lib/locale'
163 libc_cv_slibdir="/lib"
166 # Allow the user to override the path with --sysconfdir
167 if test $sysconfdir = '${prefix}/etc'; then
168 libc_cv_sysconfdir=/etc
170 libc_cv_sysconfdir=$sysconfdir
172 libc_cv_rootsbindir="/sbin"
176 # Under Linux the NPTL add-on should be available.
178 # It is available. Good.
187 if test "$nptl_missing"; then
188 if test $enable_sanity = yes; then
190 *** On GNU/Linux systems it is normal to compile GNU libc with the
191 *** \`nptl' add-on. Without that, the library will be
192 *** incompatible with normal GNU/Linux systems.
193 *** If you really mean to not use this add-on, run configure again
194 *** using the extra parameter \`--disable-sanity-checks'."
198 *** WARNING: Are you sure you do not want to use the \`nptl'
203 if test "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
204 if test $enable_sanity = yes; then
206 *** On GNU/Linux systems the GNU C Library should not be installed into
207 *** /usr/local since this might make your system totally unusable.
208 *** We strongly advise to use a different prefix. For details read the FAQ.
209 *** If you really mean to do this, run configure again using the extra
210 *** parameter \`--disable-sanity-checks'."
214 *** WARNING: Do you really want to install the GNU C Library into /usr/local?
215 *** This might make your system totally unusable, for details read the FAQ."
220 # One Linux we use ldconfig.
223 # We need some extensions to the `ldd' script.
227 ldd_rewrite_script=../sysdeps/unix/sysv/linux/ldd-rewrite.sed
230 ldd_rewrite_script=../sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed
233 ldd_rewrite_script=../sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
236 ldd_rewrite_script=../sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
239 ldd_rewrite_script=../sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
242 ldd_rewrite_script=../sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed
249 if test $host = $build; then
250 # If $prefix/include/{net,scsi} are symlinks, make install will
251 # clobber what they're linked to (probably a kernel tree).
252 # test -L ought to work on all Linux boxes.
253 if test "x$prefix" != xNONE; then
256 ac_prefix=$ac_default_prefix
258 AC_MSG_CHECKING([for symlinks in ${ac_prefix}/include])
260 if test -L ${ac_prefix}/include/net; then
261 ac_message="$ac_message
262 ${ac_prefix}/include/net is a symlink"
264 if test -L ${ac_prefix}/include/scsi; then
265 ac_message="$ac_message
266 ${ac_prefix}/include/scsi is a symlink"
268 if test -n "$ac_message"; then
269 AC_MSG_ERROR([$ac_message
270 \`make install' will destroy the target of the link(s).
271 Delete the links and re-run configure, or better still, move the entire
272 ${ac_prefix}/include directory out of the way.])
278 # We have inlined syscalls.
279 AC_DEFINE(HAVE_INLINED_SYSCALLS)