1 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
2 # Local configure fragment for sysdeps/unix/sysv/linux.
4 # The Linux kernel headers can be found in
5 # /lib/modules/$(uname -r)/build/include
6 # Check whether this directory is available.
7 if test -z "$sysheaders" &&
8 test "x$cross_compiling" = xno &&
9 test -d /lib/modules/`uname -r`/build/include; then
10 sysheaders="/lib/modules/`uname -r`/build/include"
11 ccheaders=`$CC -print-file-name=include`
12 dnl We don't have to use -nostdinc. We just want one more directory
14 SYSINCLUDES="-I $sysheaders"
17 # Don't bother trying to generate any glue code to be compatible with the
18 # existing system library, because we are the only system library.
21 define([LIBC_LINUX_VERSION],[2.0.10])dnl
22 if test -n "$sysheaders"; then
23 OLD_CPPFLAGS=$CPPFLAGS
24 CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
26 define([libc_cv_linuxVER], [libc_cv_linux]patsubst(LIBC_LINUX_VERSION,[\.]))dnl
27 AC_CACHE_CHECK(installed Linux kernel header files, libc_cv_linuxVER, [dnl
28 AC_EGREP_CPP([eat flaming death], [#include <linux/version.h>
29 #if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE < ]dnl
30 patsubst(LIBC_LINUX_VERSION,[^\([^.]*\)\.\([^.]*\)\.\([^.]*\)$],dnl
31 [ (\1 *65536+ \2 *256+ \3) /* \1.\2.\3 */])[
34 libc_cv_linuxVER='TOO OLD!',
35 libc_cv_linuxVER='LIBC_LINUX_VERSION or later')])
36 if test "$libc_cv_linuxVER" != 'LIBC_LINUX_VERSION or later'; then
37 AC_MSG_ERROR([GNU libc requires kernel header files from
38 Linux LIBC_LINUX_VERSION or later to be installed before configuring.
39 The kernel header files are found usually in /usr/include/asm and
40 /usr/include/linux; make sure these directories use files from
41 Linux LIBC_LINUX_VERSION or later. This check uses <linux/version.h>, so
42 make sure that file was built correctly when installing the kernel header
43 files. To use kernel headers not from /usr/include/linux, use the
44 configure option --with-headers.])
47 # If the user gave a minimal version number test whether the available
48 # kernel headers are young enough. Additionally we have minimal
49 # kernel versions for some architectures. If a previous configure fragment
50 # set arch_minimum_kernel already, let that override our defaults here.
51 # Note that we presume such a fragment has set libc_cv_gcc_unwind_find_fde
53 test -n "$arch_minimum_kernel" ||
56 arch_minimum_kernel=2.1.100
57 libc_cv_gcc_unwind_find_fde=yes
60 arch_minimum_kernel=2.0.10
61 libc_cv_gcc_unwind_find_fde=yes
64 libc_cv_gcc_unwind_find_fde=yes
65 arch_minimum_kernel=2.0.10
68 arch_minimum_kernel=2.4.0
71 libc_cv_gcc_unwind_find_fde=yes
72 arch_minimum_kernel=2.4.19
75 arch_minimum_kernel=2.0.10
76 libc_cv_gcc_unwind_find_fde=yes
79 arch_minimum_kernel=2.4.0
80 libc_cv_gcc_unwind_find_fde=yes
83 libc_cv_gcc_unwind_find_fde=yes
84 arch_minimum_kernel=2.0.10
87 arch_minimum_kernel=2.4.19
90 libc_cv_gcc_unwind_find_fde=yes
91 arch_minimum_kernel=2.2.10
94 libc_cv_gcc_unwind_find_fde=yes
95 arch_minimum_kernel=2.4.0
98 arch_minimum_kernel=2.3.99
99 libc_cv_gcc_unwind_find_fde=yes
102 libc_cv_gcc_unwind_find_fde=yes
103 arch_minimum_kernel=2.4.21
106 libc_cv_gcc_unwind_find_fde=yes
107 arch_minimum_kernel=2.0.10
110 arch_minimum_kernel=2.4.0
113 arch_minimum_kernel=2.0.10
116 if test -n "$minimum_kernel"; then
118 user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
119 arch_version=$((`echo "$arch_minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
121 if test $user_version -lt $arch_version; then
122 AC_MSG_WARN([minimum kernel version reset to $arch_minimum_kernel])
123 minimum_kernel=$arch_minimum_kernel
126 if test $arch_minimum_kernel != '2.0.10'; then
127 minimum_kernel=$arch_minimum_kernel
131 if test -n "$minimum_kernel"; then
132 AC_MSG_CHECKING(for kernel header at least $minimum_kernel)
134 decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
135 abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
137 AC_EGREP_CPP([eat flaming death], [#include <linux/version.h>
138 #if LINUX_VERSION_CODE < $decnum
140 #endif], libc_minimum_kernel='too old!', libc_minimum_kernel=ok)
141 AC_MSG_RESULT($libc_minimum_kernel)
142 if test "$libc_minimum_kernel" = ok; then
143 AC_DEFINE_UNQUOTED(__LINUX_KERNEL_VERSION, $decnum)
144 AC_DEFINE_UNQUOTED(__ABI_TAG_VERSION, $abinum)
146 AC_MSG_ERROR([*** The available kernel headers are older than the requested
147 *** compatible kernel version])
151 # The result of the above test for the use of the FDE code is invalid if
152 # the user overrides the decision about the minimum ABI.
153 if test "$oldest_abi" != default && test "2.2.4" \< "$oldest_abi"; then
154 libc_cv_gcc_unwind_find_fde=no
157 if test -n "$sysheaders"; then
158 CPPFLAGS=$OLD_CPPFLAGS
160 # The Linux filesystem standard prescribes where to place "essential"
161 # files. I.e., when the installation prefix is "/usr" we have to place
162 # shared library objects and the configuration files on the root partition
166 # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib
168 sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64 | \
170 libc_cv_slibdir="/lib64"
171 if test "$libdir" = '${exec_prefix}/lib'; then
172 libdir='${exec_prefix}/lib64';
173 # Locale data can be shared between 32bit and 64bit libraries
174 libc_cv_localedir='${exec_prefix}/lib/locale'
178 libc_cv_slibdir="/lib32"
179 if test "$libdir" = '${exec_prefix}/lib'; then
180 libdir='${exec_prefix}/lib32';
181 # Locale data can be shared between 32bit and 64bit libraries
182 libc_cv_localedir='${exec_prefix}/lib/locale'
186 libc_cv_slibdir="/lib"
189 # Allow the user to override the path with --sysconfdir
190 if test $sysconfdir = '${prefix}/etc'; then
191 libc_cv_sysconfdir=/etc
193 libc_cv_sysconfdir=$sysconfdir
195 libc_cv_rootsbindir="/sbin"
199 # Under Linux the NPTL add-on should be available.
201 # It is available. Good.
210 if test "$nptl_missing"; then
211 if test $enable_sanity = yes; then
213 *** On GNU/Linux systems it is normal to compile GNU libc with the
214 *** \`nptl' add-on. Without that, the library will be
215 *** incompatible with normal GNU/Linux systems.
216 *** If you really mean to not use this add-on, run configure again
217 *** using the extra parameter \`--disable-sanity-checks'."
221 *** WARNING: Are you sure you do not want to use the \`nptl'
226 if test "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
227 if test $enable_sanity = yes; then
229 *** On GNU/Linux systems the GNU C Library should not be installed into
230 *** /usr/local since this might make your system totally unusable.
231 *** We strongly advise to use a different prefix. For details read the FAQ.
232 *** If you really mean to do this, run configure again using the extra
233 *** parameter \`--disable-sanity-checks'."
237 *** WARNING: Do you really want to install the GNU C Library into /usr/local?
238 *** This might make your system totally unusable, for details read the FAQ."
243 # One Linux we use ldconfig.
246 # We need some extensions to the `ldd' script.
250 ldd_rewrite_script=../sysdeps/unix/sysv/linux/ldd-rewrite.sed
253 ldd_rewrite_script=../sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed
256 ldd_rewrite_script=../sysdeps/unix/sysv/linux/mips/mips64/ldd-rewrite.sed
259 ldd_rewrite_script=../sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
262 ldd_rewrite_script=../sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
265 ldd_rewrite_script=../sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
268 ldd_rewrite_script=../sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed
275 if test $host = $build; then
276 # If $prefix/include/{net,scsi} are symlinks, make install will
277 # clobber what they're linked to (probably a kernel tree).
278 # test -L ought to work on all Linux boxes.
279 if test "x$prefix" != xNONE; then
282 ac_prefix=$ac_default_prefix
284 AC_MSG_CHECKING([for symlinks in ${ac_prefix}/include])
286 if test -L ${ac_prefix}/include/net; then
287 ac_message="$ac_message
288 ${ac_prefix}/include/net is a symlink"
290 if test -L ${ac_prefix}/include/scsi; then
291 ac_message="$ac_message
292 ${ac_prefix}/include/scsi is a symlink"
294 if test -n "$ac_message"; then
295 AC_MSG_ERROR([$ac_message
296 \`make install' will destroy the target of the link(s).
297 Delete the links and re-run configure, or better still, move the entire
298 ${ac_prefix}/include directory out of the way.])
304 # We have inlined syscalls.
305 AC_DEFINE(HAVE_INLINED_SYSCALLS)