Set arch_minimum_kernel to 3.4.0 for x32
[glibc.git] / sysdeps / unix / sysv / linux / configure.ac
blob1be921f65e4fc2d25b93c9d5d656873ad5928a6c
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.
6 inhibit_glue=yes
8 define([LIBC_LINUX_VERSION],[2.6.19])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 */])[
19 eat flaming death
20 #endif],
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
39 # if appropriate too.
40 test -n "$arch_minimum_kernel" ||
41 case "$machine" in
42   i386*)
43     libc_cv_gcc_unwind_find_fde=yes
44     arch_minimum_kernel=2.6.16
45     ;;
46   x86_64/x32)
47     arch_minimum_kernel=3.4.0
48     ;;
49   powerpc/powerpc32*)
50     libc_cv_gcc_unwind_find_fde=yes
51     arch_minimum_kernel=2.6.16
52     ;;
53   s390/s390-32)
54     libc_cv_gcc_unwind_find_fde=yes
55     arch_minimum_kernel=2.6.16
56     ;;
57   s390/s390-64)
58     libc_cv_gcc_unwind_find_fde=yes
59     arch_minimum_kernel=2.6.16
60     ;;
61   sh*)
62     arch_minimum_kernel=2.6.16
63     libc_cv_gcc_unwind_find_fde=yes
64     ;;
65   sparc/sparc64*)
66     libc_cv_gcc_unwind_find_fde=yes
67     arch_minimum_kernel=2.6.16
68     ;;
69   sparc*)
70     libc_cv_gcc_unwind_find_fde=yes
71     arch_minimum_kernel=2.6.16
72     ;;
73   *)
74     arch_minimum_kernel=2.6.16
75     ;;
76 esac
77 if test -n "$minimum_kernel"; then
78   changequote(,)
79   user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
80   arch_version=$((`echo "$arch_minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
81   changequote([,])
82   if test $user_version -lt $arch_version; then
83     AC_MSG_WARN([minimum kernel version reset to $arch_minimum_kernel])
84     minimum_kernel=$arch_minimum_kernel
85   fi
86 else
87   minimum_kernel=$arch_minimum_kernel
90 AC_MSG_CHECKING(for kernel header at least $minimum_kernel)
91 changequote(,)dnl
92 decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
93 abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
94 changequote([,])dnl
95 AC_EGREP_CPP([eat flaming death], [#include <linux/version.h>
96 #if LINUX_VERSION_CODE < $decnum
97 eat flaming death
98 #endif], libc_minimum_kernel='too old!', libc_minimum_kernel=ok)
99 AC_MSG_RESULT($libc_minimum_kernel)
100 if test "$libc_minimum_kernel" = ok; then
101   AC_DEFINE_UNQUOTED(__LINUX_KERNEL_VERSION, $decnum)
102   AC_DEFINE_UNQUOTED(__ABI_TAG_VERSION, $abinum)
103 else
104   AC_MSG_ERROR([*** The available kernel headers are older than the requested
105 *** compatible kernel version])
108 # The result of the above test for the use of the FDE code is invalid if
109 # the user overrides the decision about the minimum ABI.
110 if test "$oldest_abi" != default && test "2.2.4" \< "$oldest_abi"; then
111   libc_cv_gcc_unwind_find_fde=no
114 if test -n "$sysheaders"; then
115   CPPFLAGS=$OLD_CPPFLAGS
118 # Under Linux the NPTL add-on should be available.
119 case $add_ons in
120   # It is available.  Good.
121   *nptl*)
122     nptl_missing=
123     ;;
124   *)
125     nptl_missing=yes
126     ;;
127 esac
129 if test "$nptl_missing"; then
130   if test $enable_sanity = yes; then
131     echo "\
132 *** On GNU/Linux systems it is normal to compile GNU libc with the
133 *** \`nptl' add-on.  Without that, the library will be
134 *** incompatible with normal GNU/Linux systems.
135 *** If you really mean to not use this add-on, run configure again
136 *** using the extra parameter \`--disable-sanity-checks'."
137     exit 1
138   else
139     echo "\
140 *** WARNING: Are you sure you do not want to use the \`nptl'
141 *** add-on?"
142   fi
145 if test "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
146   if test $enable_sanity = yes; then
147     echo "\
148 *** On GNU/Linux systems the GNU C Library should not be installed into
149 *** /usr/local since this might make your system totally unusable.
150 *** We strongly advise to use a different prefix.  For details read the FAQ.
151 *** If you really mean to do this, run configure again using the extra
152 *** parameter \`--disable-sanity-checks'."
153     exit 1
154   else
155     echo "\
156 *** WARNING: Do you really want to install the GNU C Library into /usr/local?
157 *** This might make your system totally unusable, for details read the FAQ."
158   fi
162 # One Linux we use ldconfig.
163 use_ldconfig=yes
165 # We need some extensions to the `ldd' script.
166 changequote(,)
167 case "$machine" in
168   i[3456]86*)
169     ldd_rewrite_script=sysdeps/unix/sysv/linux/ldd-rewrite.sed
170     ;;
171   s390*)
172     ldd_rewrite_script=sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
173     ;;
174   sparc*)
175     ldd_rewrite_script=sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
176     ;;
177   x86_64*)
178     ldd_rewrite_script=sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
179     ;;
180   powerpc*)
181     ldd_rewrite_script=sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed
182     ;;
183   *)
184     ;;
185 esac
186 changequote([,])
188 if test $host = $build; then
189   # If $prefix/include/{net,scsi} are symlinks, make install will
190   # clobber what they're linked to (probably a kernel tree).
191   # test -L ought to work on all Linux boxes.
192   if test "x$prefix" != xNONE; then
193     ac_prefix=$prefix
194   else
195     ac_prefix=$ac_default_prefix
196   fi
197   AC_MSG_CHECKING([for symlinks in ${ac_prefix}/include])
198   ac_message=
199   if test -L ${ac_prefix}/include/net; then
200     ac_message="$ac_message
201    ${ac_prefix}/include/net is a symlink"
202   fi
203   if test -L ${ac_prefix}/include/scsi; then
204     ac_message="$ac_message
205    ${ac_prefix}/include/scsi is a symlink"
206   fi
207   if test -n "$ac_message"; then
208     AC_MSG_ERROR([$ac_message
209 \`make install' will destroy the target of the link(s).
210 Delete the links and re-run configure, or better still, move the entire
211 ${ac_prefix}/include directory out of the way.])
212   else
213     AC_MSG_RESULT(ok)
214   fi
217 # We have inlined syscalls.
218 AC_DEFINE(HAVE_INLINED_SYSCALLS)