1 # Local configure fragment for sysdeps/unix/sysv/linux.
3 # On Linux, the default is to use libio instead of stdio.
4 test $stdio = default && stdio=libio
6 # Don't bother trying to generate any glue code to be compatible with the
7 # existing system library, because we are the only system library.
10 if test -n "$sysheaders"; then
11 OLD_CPPFLAGS=$CPPFLAGS
12 CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
14 echo $ac_n "checking installed Linux kernel header files""... $ac_c" 1>&6
15 echo "configure:16: checking installed Linux kernel header files" >&5
16 if eval "test \"`echo '$''{'libc_cv_linux2010'+set}'`\" = set"; then
17 echo $ac_n "(cached) $ac_c" 1>&6
19 cat > conftest.$ac_ext <<EOF
22 #include <linux/version.h>
23 #if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE < (2 *65536+ 0 *256+ 10) /* 2.0.10 */
27 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
28 egrep "eat flaming death" >/dev/null 2>&1; then
30 libc_cv_linux2010='TOO OLD!'
33 libc_cv_linux2010='2.0.10 or later'
39 echo "$ac_t""$libc_cv_linux2010" 1>&6
40 if test "$libc_cv_linux2010" != '2.0.10 or later'; then
41 { echo "configure: error: GNU libc requires kernel header files from
42 Linux 2.0.10 or later to be installed before configuring.
43 The kernel header files are found usually in /usr/include/asm and
44 /usr/include/linux; make sure these directories use files from
45 Linux 2.0.10 or later. This check uses <linux/version.h>, so
46 make sure that file was built correctly when installing the kernel header
47 files. To use kernel headers not from /usr/include/linux, use the
48 configure option --with-headers." 1>&2; exit 1; }
51 # If the user gave a minimal version number test whether the available
52 # kernel headers are young enough. Additionally we have minimal
53 # kernel versions for some architectures.
56 arch_minimum_kernel=2.2.15
59 arch_minimum_kernel=2.3.99
62 arch_minimum_kernel=2.4.0
65 arch_minimum_kernel=2.3.99
68 arch_minimum_kernel=2.0.10
71 if test -n "$minimum_kernel"; then
73 user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
74 arch_version=$((`echo "$arch_minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
76 if test $user_version -lt $arch_version; then
77 echo "configure: warning: minimum kernel version reset to $arch_minimum_kernel" 1>&2
78 minimum_kernel=$arch_minimum_kernel
81 if test $arch_minimum_kernel != '2.0.10'; then
82 minimum_kernel=$arch_minimum_kernel
86 if test -n "$minimum_kernel"; then
87 echo $ac_n "checking for kernel header at least $minimum_kernel""... $ac_c" 1>&6
88 echo "configure:89: checking for kernel header at least $minimum_kernel" >&5
89 decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
90 abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
91 cat > conftest.$ac_ext <<EOF
94 #include <linux/version.h>
95 #if LINUX_VERSION_CODE < $decnum
99 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
100 egrep "eat flaming death" >/dev/null 2>&1; then
102 libc_minimum_kernel='too old!'
105 libc_minimum_kernel=ok
109 echo "$ac_t""$libc_minimum_kernel" 1>&6
110 if test "$libc_minimum_kernel" = ok; then
111 cat >> confdefs.h <<EOF
112 #define __LINUX_KERNEL_VERSION $decnum
115 cat >> confdefs.h <<EOF
116 #define __ABI_TAG_VERSION $abinum
120 { echo "configure: error: *** The available kernel headers are older than the requested
121 *** compatible kernel version" 1>&2; exit 1; }
125 if test -n "$sysheaders"; then
126 CPPFLAGS=$OLD_CPPFLAGS
128 # The Linux filesystem standard prescribes where to place "essential"
129 # files. I.e., when the installation prefix is "/usr" we have to place
130 # shared library objects and the configuration files on the root partition
132 if test "$prefix" = "/usr" -o "$prefix" = "/usr/"; then
133 # 64bit libraries on sparc go to /lib64 and not /lib
134 if test "$machine" = "sparc/sparc64"; then
135 libc_cv_slibdir="/lib64"
136 if test "$libdir" = '${exec_prefix}/lib'; then
137 libdir='${exec_prefix}/lib64';
138 # Locale data can be shared between 32bit and 64bit libraries
139 libc_cv_localedir='${exec_prefix}/lib/locale'
142 libc_cv_slibdir="/lib"
144 # Allow the user to override the path with --sysconfdir
145 if test $sysconfdir = '${prefix}/etc'; then
146 libc_cv_sysconfdir=/etc
148 libc_cv_sysconfdir=$sysconfdir
150 libc_cv_rootsbindir="/sbin"
153 # Under Linux the LinuxThreads add-on should be available.
155 # It is available. Good.
161 *** WARNING: Are you sure you do not want to use the \`linuxthreads'
166 if test "$message"; then
167 if test $enable_sanity = yes; then
169 *** You should not compile the GNU libc without the \`linuxthreads'
170 *** add-on. Not using them risks being incompatible with the
171 *** libraries of other systems. Consider getting the add-on and restarting
172 *** the configuration.
173 *** If you really mean to not use this add-on, run configure again
174 *** using the extra parameter \`--disable-sanity-checks'."
181 # One Linux we use ldconfig.
184 # We need some extensions to the `ldd' script.
188 ldd_rewrite_script=../sysdeps/unix/sysv/linux/ldd-rewrite.sed
191 ldd_rewrite_script=../sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
198 if test $host = $build; then
199 # If $prefix/include/{net,scsi} are symlinks, make install will
200 # clobber what they're linked to (probably a kernel tree).
201 # test -L ought to work on all Linux boxes.
202 if test "x$prefix" != xNONE; then
205 ac_prefix=$ac_default_prefix
207 echo $ac_n "checking for symlinks in ${ac_prefix}/include""... $ac_c" 1>&6
208 echo "configure:209: checking for symlinks in ${ac_prefix}/include" >&5
210 if test -L ${ac_prefix}/include/net; then
211 ac_message="$ac_message
212 ${ac_prefix}/include/net is a symlink"
214 if test -L ${ac_prefix}/include/scsi; then
215 ac_message="$ac_message
216 ${ac_prefix}/include/scsi is a symlink"
218 if test -n "$ac_message"; then
219 { echo "configure: error: $ac_message
220 \`make install' will destroy the target of the link(s).
221 Delete the links and re-run configure, or better still, move the entire
222 ${ac_prefix}/include directory out of the way." 1>&2; exit 1; }
224 echo "$ac_t""ok" 1>&6
232 # Extract the first word of "$ac_prog", so it can be a program name with args.
233 set dummy $ac_prog; ac_word=$2
234 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
235 echo "configure:236: checking for $ac_word" >&5
236 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
237 echo $ac_n "(cached) $ac_c" 1>&6
239 if test -n "$AS"; then
240 ac_cv_prog_AS="$AS" # Let the user override the test.
242 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
244 for ac_dir in $ac_dummy; do
245 test -z "$ac_dir" && ac_dir=.
246 if test -f $ac_dir/$ac_word; then
247 ac_cv_prog_AS="$ac_prog"
255 if test -n "$AS"; then
256 echo "$ac_t""$AS" 1>&6
258 echo "$ac_t""no" 1>&6
261 test -n "$AS" && break
264 if test -z "$AS"; then
267 # Found it, now check the version.
268 echo $ac_n "checking version of $AS""... $ac_c" 1>&6
269 echo "configure:270: checking version of $AS" >&5
270 ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\(-ia64-[0-9]*\)*\).*$/\1/p'`
271 case $ac_prog_version in
272 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
273 2.11.90.0.[5-9]* | 2.11.90.[1-9]* | 2.11.9[1-9]* | 2.11.[1-9]* | 2.1[2-9]*| 2.[2-9]*)
274 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
275 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
278 echo "$ac_t""$ac_prog_version" 1>&6
280 if test $ac_verc_fail = yes; then
281 echo "configure: warning: *** Your binutils versions are too old.
282 *** We strongly advise to update binutils. For details check
283 *** the FAQ and INSTALL documents." 1>&2