1 # Local configure fragment for sysdeps/unix/sysv/linux.
3 # The Linux kernel headers can be found in
4 # /lib/modules/$(uname -r)/build/include
5 # Check whether this directory is available.
6 if test -z "$sysheaders" &&
7 test -d /lib/modules/`uname -r`/build/include; then
8 sysheaders="/lib/modules/`uname -r`/build/include"
9 ccheaders=`$CC -print-file-name=include`
10 SYSINCLUDES="-I $sysheaders"
13 # Don't bother trying to generate any glue code to be compatible with the
14 # existing system library, because we are the only system library.
17 if test -n "$sysheaders"; then
18 OLD_CPPFLAGS=$CPPFLAGS
19 CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
21 echo $ac_n "checking installed Linux kernel header files""... $ac_c" 1>&6
22 echo "configure:23: checking installed Linux kernel header files" >&5
23 if eval "test \"`echo '$''{'libc_cv_linux2010'+set}'`\" = set"; then
24 echo $ac_n "(cached) $ac_c" 1>&6
26 cat > conftest.$ac_ext <<EOF
29 #include <linux/version.h>
30 #if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE < (2 *65536+ 0 *256+ 10) /* 2.0.10 */
34 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
35 egrep "eat flaming death" >/dev/null 2>&1; then
37 libc_cv_linux2010='TOO OLD!'
40 libc_cv_linux2010='2.0.10 or later'
46 echo "$ac_t""$libc_cv_linux2010" 1>&6
47 if test "$libc_cv_linux2010" != '2.0.10 or later'; then
48 { echo "configure: error: GNU libc requires kernel header files from
49 Linux 2.0.10 or later to be installed before configuring.
50 The kernel header files are found usually in /usr/include/asm and
51 /usr/include/linux; make sure these directories use files from
52 Linux 2.0.10 or later. This check uses <linux/version.h>, so
53 make sure that file was built correctly when installing the kernel header
54 files. To use kernel headers not from /usr/include/linux, use the
55 configure option --with-headers." 1>&2; exit 1; }
58 # If the user gave a minimal version number test whether the available
59 # kernel headers are young enough. Additionally we have minimal
60 # kernel versions for some architectures.
63 arch_minimum_kernel=2.1.100
64 libc_cv_gcc_unwind_find_fde=yes
67 arch_minimum_kernel=2.0.10
68 libc_cv_gcc_unwind_find_fde=yes
71 libc_cv_gcc_unwind_find_fde=yes
72 arch_minimum_kernel=2.0.10
75 arch_minimum_kernel=2.4.0
78 arch_minimum_kernel=2.3.99
81 arch_minimum_kernel=2.0.10
82 libc_cv_gcc_unwind_find_fde=yes
85 arch_minimum_kernel=2.4.0
86 libc_cv_gcc_unwind_find_fde=yes
89 libc_cv_gcc_unwind_find_fde=yes
90 arch_minimum_kernel=2.0.10
93 libc_cv_gcc_unwind_find_fde=yes
94 arch_minimum_kernel=2.2.10
97 libc_cv_gcc_unwind_find_fde=yes
98 arch_minimum_kernel=2.4.0
101 arch_minimum_kernel=2.3.99
102 libc_cv_gcc_unwind_find_fde=yes
105 libc_cv_gcc_unwind_find_fde=yes
106 arch_minimum_kernel=2.0.10
109 arch_minimum_kernel=2.4.0
112 arch_minimum_kernel=2.0.10
115 if test -n "$minimum_kernel"; then
117 user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
118 arch_version=$((`echo "$arch_minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
120 if test $user_version -lt $arch_version; then
121 echo "configure: warning: minimum kernel version reset to $arch_minimum_kernel" 1>&2
122 minimum_kernel=$arch_minimum_kernel
125 if test $arch_minimum_kernel != '2.0.10'; then
126 minimum_kernel=$arch_minimum_kernel
130 if test -n "$minimum_kernel"; then
131 echo $ac_n "checking for kernel header at least $minimum_kernel""... $ac_c" 1>&6
132 echo "configure:133: checking for kernel header at least $minimum_kernel" >&5
133 decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
134 abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
135 cat > conftest.$ac_ext <<EOF
136 #line 137 "configure"
137 #include "confdefs.h"
138 #include <linux/version.h>
139 #if LINUX_VERSION_CODE < $decnum
143 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
144 egrep "eat flaming death" >/dev/null 2>&1; then
146 libc_minimum_kernel='too old!'
149 libc_minimum_kernel=ok
153 echo "$ac_t""$libc_minimum_kernel" 1>&6
154 if test "$libc_minimum_kernel" = ok; then
155 cat >> confdefs.h <<EOF
156 #define __LINUX_KERNEL_VERSION $decnum
159 cat >> confdefs.h <<EOF
160 #define __ABI_TAG_VERSION $abinum
164 { echo "configure: error: *** The available kernel headers are older than the requested
165 *** compatible kernel version" 1>&2; exit 1; }
169 # The result of the above test for the use of the FDE code is invalid if
170 # the user overrides the decision about the minimum ABI.
171 if test "$oldest_abi" != default && test "2.2.4" \< "$oldest_abi"; then
172 libc_cv_gcc_unwind_find_fde=no
175 if test -n "$sysheaders"; then
176 CPPFLAGS=$OLD_CPPFLAGS
178 # The Linux filesystem standard prescribes where to place "essential"
179 # files. I.e., when the installation prefix is "/usr" we have to place
180 # shared library objects and the configuration files on the root partition
182 if test "$prefix" = "/usr" -o "$prefix" = "/usr/"; then
183 # 64bit libraries on sparc go to /lib64 and not /lib
184 if test "$machine" = "sparc/sparc64" -o "$machine" = "x86_64"; then
185 libc_cv_slibdir="/lib64"
186 if test "$libdir" = '${exec_prefix}/lib'; then
187 libdir='${exec_prefix}/lib64';
188 # Locale data can be shared between 32bit and 64bit libraries
189 libc_cv_localedir='${exec_prefix}/lib/locale'
192 libc_cv_slibdir="/lib"
194 # Allow the user to override the path with --sysconfdir
195 if test $sysconfdir = '${prefix}/etc'; then
196 libc_cv_sysconfdir=/etc
198 libc_cv_sysconfdir=$sysconfdir
200 libc_cv_rootsbindir="/sbin"
203 # Under Linux the LinuxThreads add-on should be available.
205 # It is available. Good.
207 linuxthreads_missing=
210 linuxthreads_missing=yes
214 if test "$linuxthreads_missing"; then
215 if test $enable_sanity = yes; then
217 *** On GNU/Linux systems it is normal to compile GNU libc with the
218 *** \`linuxthreads' add-on. Without that, the library will be
219 *** incompatible with normal GNU/Linux systems.
220 *** If you really mean to not use this add-on, run configure again
221 *** using the extra parameter \`--disable-sanity-checks'."
225 *** WARNING: Are you sure you do not want to use the \`linuxthreads'
230 if test "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
231 if test $enable_sanity = yes; then
233 *** On GNU/Linux systems the GNU C Library should not be installed into
234 *** /usr/local since this might make your system totally unusable.
235 *** We strongly advise to use a different prefix. For details read the FAQ.
236 *** If you really mean to do this, run configure again using the extra
237 *** parameter \`--disable-sanity-checks'."
241 *** WARNING: Do you really want to install the GNU C Library into /usr/local?
242 *** This might make your system totally unusable, for details read the FAQ."
247 # One Linux we use ldconfig.
250 # We need some extensions to the `ldd' script.
254 ldd_rewrite_script=../sysdeps/unix/sysv/linux/ldd-rewrite.sed
257 ldd_rewrite_script=../sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed
260 ldd_rewrite_script=../sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
263 ldd_rewrite_script=../sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
266 ldd_rewrite_script=../sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
273 if test $host = $build; then
274 # If $prefix/include/{net,scsi} are symlinks, make install will
275 # clobber what they're linked to (probably a kernel tree).
276 # test -L ought to work on all Linux boxes.
277 if test "x$prefix" != xNONE; then
280 ac_prefix=$ac_default_prefix
282 echo $ac_n "checking for symlinks in ${ac_prefix}/include""... $ac_c" 1>&6
283 echo "configure:284: checking for symlinks in ${ac_prefix}/include" >&5
285 if test -L ${ac_prefix}/include/net; then
286 ac_message="$ac_message
287 ${ac_prefix}/include/net is a symlink"
289 if test -L ${ac_prefix}/include/scsi; then
290 ac_message="$ac_message
291 ${ac_prefix}/include/scsi is a symlink"
293 if test -n "$ac_message"; then
294 { echo "configure: error: $ac_message
295 \`make install' will destroy the target of the link(s).
296 Delete the links and re-run configure, or better still, move the entire
297 ${ac_prefix}/include directory out of the way." 1>&2; exit 1; }
299 echo "$ac_t""ok" 1>&6