]> sourceware.org Git - glibc.git/blame - sysdeps/unix/sysv/linux/configure
Update.
[glibc.git] / sysdeps / unix / sysv / linux / configure
CommitLineData
f65fd747
UD
1 # Local configure fragment for sysdeps/unix/sysv/linux.
2
3# On Linux, the default is to use libio instead of stdio.
4test $stdio = default && stdio=libio
5
f65fd747
UD
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.
8inhibit_glue=yes
9
14a44a69 10if test -n "$sysheaders"; then
c1ed883f
GK
11 OLD_CPPFLAGS=$CPPFLAGS
12 CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
14a44a69 13fi
f65fd747 14echo $ac_n "checking installed Linux kernel header files""... $ac_c" 1>&6
14a44a69 15echo "configure:16: checking installed Linux kernel header files" >&5
63f791d3 16if eval "test \"`echo '$''{'libc_cv_linux2010'+set}'`\" = set"; then
f65fd747
UD
17 echo $ac_n "(cached) $ac_c" 1>&6
18else
19 cat > conftest.$ac_ext <<EOF
14a44a69 20#line 21 "configure"
f65fd747
UD
21#include "confdefs.h"
22#include <linux/version.h>
0ea554bf 23#if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE < (2 *65536+ 0 *256+ 10) /* 2.0.10 */
f65fd747
UD
24eat flaming death
25#endif
f65fd747 26EOF
0ea554bf
UD
27if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
28 egrep "eat flaming death" >/dev/null 2>&1; then
564210fe 29 rm -rf conftest*
0ea554bf 30 libc_cv_linux2010='TOO OLD!'
564210fe
RM
31else
32 rm -rf conftest*
0ea554bf 33 libc_cv_linux2010='2.0.10 or later'
564210fe
RM
34fi
35rm -f conftest*
0ea554bf 36
564210fe
RM
37fi
38
f65fd747 39echo "$ac_t""$libc_cv_linux2010" 1>&6
6b3a2224 40if test "$libc_cv_linux2010" != '2.0.10 or later'; then
036cc82f 41 { echo "configure: error: GNU libc requires kernel header files from
6b3a2224 42Linux 2.0.10 or later to be installed before configuring.
036cc82f
RM
43The kernel header files are found usually in /usr/include/asm and
44/usr/include/linux; make sure these directories use files from
6b3a2224 45Linux 2.0.10 or later. This check uses <linux/version.h>, so
036cc82f 46make sure that file was built correctly when installing the kernel header
14a44a69
UD
47files. To use kernel headers not from /usr/include/linux, use the
48configure option --with-headers." 1>&2; exit 1; }
49fi
958f238f
UD
50
51# If the user gave a minimal version number test whether the available
003a02c6
UD
52# kernel headers are young enough. Additionally we have minimal
53# kernel versions for some architectures.
48d0c5d8 54case "$machine" in
3e1f480e
AJ
55 mips*)
56 arch_minimum_kernel=2.2.15
57 ;;
48d0c5d8
UD
58 sh*)
59 arch_minimum_kernel=2.3.99
60 ;;
61 ia64*)
62 arch_minimum_kernel=2.4.0
63 ;;
b15cb495
UD
64 hppa*)
65 arch_minimum_kernel=2.3.99
66 ;;
48d0c5d8
UD
67 *)
68 arch_minimum_kernel=2.0.10
69 ;;
70esac
003a02c6 71if test -n "$minimum_kernel"; then
48d0c5d8
UD
72
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/'`))
75
76 if test $user_version -lt $arch_version; then
003a02c6
UD
77 echo "configure: warning: minimum kernel version reset to $arch_minimum_kernel" 1>&2
78 minimum_kernel=$arch_minimum_kernel
79 fi
80else
48d0c5d8
UD
81 if test $arch_minimum_kernel != '2.0.10'; then
82 minimum_kernel=$arch_minimum_kernel
83 fi
003a02c6
UD
84fi
85
958f238f
UD
86if test -n "$minimum_kernel"; then
87 echo $ac_n "checking for kernel header at least $minimum_kernel""... $ac_c" 1>&6
b15cb495 88echo "configure:89: checking for kernel header at least $minimum_kernel" >&5
0ea554bf 89 decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
a986484f 90 abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
958f238f 91 cat > conftest.$ac_ext <<EOF
7c91639e 92#line 93 "configure"
0ea554bf 93#include "confdefs.h"
958f238f 94#include <linux/version.h>
958f238f
UD
95#if LINUX_VERSION_CODE < $decnum
96eat flaming death
97#endif
958f238f 98EOF
0ea554bf
UD
99if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
100 egrep "eat flaming death" >/dev/null 2>&1; then
101 rm -rf conftest*
102 libc_minimum_kernel='too old!'
103else
104 rm -rf conftest*
105 libc_minimum_kernel=ok
106fi
107rm -f conftest*
108
109 echo "$ac_t""$libc_minimum_kernel" 1>&6
110 if test "$libc_minimum_kernel" = ok; then
958f238f
UD
111 cat >> confdefs.h <<EOF
112#define __LINUX_KERNEL_VERSION $decnum
a986484f
UD
113EOF
114
115 cat >> confdefs.h <<EOF
116#define __ABI_TAG_VERSION $abinum
958f238f
UD
117EOF
118
958f238f 119 else
0ea554bf 120 { echo "configure: error: *** The available kernel headers are older than the requested
958f238f
UD
121*** compatible kernel version" 1>&2; exit 1; }
122 fi
958f238f
UD
123fi
124
14a44a69 125if test -n "$sysheaders"; then
c1ed883f 126 CPPFLAGS=$OLD_CPPFLAGS
564210fe 127fi
84384f5b
UD
128# The Linux filesystem standard prescribes where to place "essential"
129# files. I.e., when the installation prefix is "/usr" we have to place
6d52618b 130# shared library objects and the configuration files on the root partition
84384f5b 131# in /lib and /etc.
e5aa91c3 132if test "$prefix" = "/usr" -o "$prefix" = "/usr/"; then
1c25bcac
UD
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';
a1d84548
UD
138 # Locale data can be shared between 32bit and 64bit libraries
139 libc_cv_localedir='${exec_prefix}/lib/locale'
1c25bcac
UD
140 fi
141 else
142 libc_cv_slibdir="/lib"
143 fi
cee49e0c
AJ
144 # Allow the user to override the path with --sysconfdir
145 if test $sysconfdir = '${prefix}/etc'; then
146 libc_cv_sysconfdir=/etc
147 else
148 libc_cv_sysconfdir=$sysconfdir
149 fi
1ef32c3d 150 libc_cv_rootsbindir="/sbin"
84384f5b 151fi
c6645251 152
63f791d3 153# Under Linux the LinuxThreads add-on should be available.
c6645251 154case $add_ons in
003a02c6 155 # It is available. Good.
c6645251 156 *linuxthreads*)
63f791d3 157 message=
c6645251
UD
158 ;;
159 *)
a18f587d 160 message="\
68dbb3a6 161*** WARNING: Are you sure you do not want to use the \`linuxthreads'
8d617a71 162*** add-on?"
c6645251
UD
163 ;;
164esac
a18f587d
UD
165
166if test "$message"; then
167 if test $enable_sanity = yes; then
168 echo "\
8d617a71 169*** You should not compile the GNU libc without the \`linuxthreads'
63f791d3
GK
170*** add-on. Not using them risks being incompatible with the
171*** libraries of other systems. Consider getting the add-on and restarting
a18f587d 172*** the configuration.
63f791d3 173*** If you really mean to not use this add-on, run configure again
a18f587d
UD
174*** using the extra parameter \`--disable-sanity-checks'."
175 exit 1
176 else
177 echo "$message"
178 fi
179fi
1ef32c3d 180
b43b13ac
UD
181# One Linux we use ldconfig.
182use_ldconfig=yes
cb343854
UD
183
184# We need some extensions to the `ldd' script.
185
186case "$machine" in
a381d207 187 i[3456]86* | m68*)
cb343854
UD
188 ldd_rewrite_script=../sysdeps/unix/sysv/linux/ldd-rewrite.sed
189 ;;
3a8599b2 190 sparc*)
a381d207
UD
191 ldd_rewrite_script=../sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
192 ;;
cb343854
UD
193 *)
194 ;;
195esac
196
0fea0021 197
eeabe877
UD
198if 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
203 ac_prefix=$prefix
204 else
205 ac_prefix=$ac_default_prefix
206 fi
207 echo $ac_n "checking for symlinks in ${ac_prefix}/include""... $ac_c" 1>&6
7c91639e 208echo "configure:209: checking for symlinks in ${ac_prefix}/include" >&5
fcb7e0a5 209 ac_message=
eeabe877 210 if test -L ${ac_prefix}/include/net; then
fcb7e0a5
UD
211 ac_message="$ac_message
212 ${ac_prefix}/include/net is a symlink"
eeabe877
UD
213 fi
214 if test -L ${ac_prefix}/include/scsi; then
fcb7e0a5 215 ac_message="$ac_message
eeabe877
UD
216 ${ac_prefix}/include/scsi is a symlink"
217 fi
fcb7e0a5
UD
218 if test -n "$ac_message"; then
219 { echo "configure: error: $ac_message
0fea0021
UD
220\`make install' will destroy the target of the link(s).
221Delete the links and re-run configure, or better still, move the entire
eeabe877
UD
222${ac_prefix}/include directory out of the way." 1>&2; exit 1; }
223 else
224 echo "$ac_t""ok" 1>&6
225 fi
0fea0021 226fi
This page took 0.232167 seconds and 5 git commands to generate.