Set arch_minimum_kernel to 3.4.0 for x32
[glibc.git] / sysdeps / unix / sysv / linux / configure
blob643da86efad825de678f45bc5f2a4524595c01f5
1 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
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 if test -n "$sysheaders"; then
9   OLD_CPPFLAGS=$CPPFLAGS
10   CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
14 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
15 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
16 if ${ac_cv_path_GREP+:} false; then :
17   $as_echo_n "(cached) " >&6
18 else
19   if test -z "$GREP"; then
20   ac_path_GREP_found=false
21   # Loop through the user's path and test for each of PROGNAME-LIST
22   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
23 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
25   IFS=$as_save_IFS
26   test -z "$as_dir" && as_dir=.
27     for ac_prog in grep ggrep; do
28     for ac_exec_ext in '' $ac_executable_extensions; do
29       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
30       { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
31 # Check for GNU ac_path_GREP and select it if it is found.
32   # Check for GNU $ac_path_GREP
33 case `"$ac_path_GREP" --version 2>&1` in
34 *GNU*)
35   ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
37   ac_count=0
38   $as_echo_n 0123456789 >"conftest.in"
39   while :
40   do
41     cat "conftest.in" "conftest.in" >"conftest.tmp"
42     mv "conftest.tmp" "conftest.in"
43     cp "conftest.in" "conftest.nl"
44     $as_echo 'GREP' >> "conftest.nl"
45     "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
46     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
47     as_fn_arith $ac_count + 1 && ac_count=$as_val
48     if test $ac_count -gt ${ac_path_GREP_max-0}; then
49       # Best one so far, save it but keep looking for a better one
50       ac_cv_path_GREP="$ac_path_GREP"
51       ac_path_GREP_max=$ac_count
52     fi
53     # 10*(2^10) chars as input seems more than enough
54     test $ac_count -gt 10 && break
55   done
56   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
57 esac
59       $ac_path_GREP_found && break 3
60     done
61   done
62   done
63 IFS=$as_save_IFS
64   if test -z "$ac_cv_path_GREP"; then
65     as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
66   fi
67 else
68   ac_cv_path_GREP=$GREP
72 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
73 $as_echo "$ac_cv_path_GREP" >&6; }
74  GREP="$ac_cv_path_GREP"
77 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
78 $as_echo_n "checking for egrep... " >&6; }
79 if ${ac_cv_path_EGREP+:} false; then :
80   $as_echo_n "(cached) " >&6
81 else
82   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
83    then ac_cv_path_EGREP="$GREP -E"
84    else
85      if test -z "$EGREP"; then
86   ac_path_EGREP_found=false
87   # Loop through the user's path and test for each of PROGNAME-LIST
88   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
89 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
91   IFS=$as_save_IFS
92   test -z "$as_dir" && as_dir=.
93     for ac_prog in egrep; do
94     for ac_exec_ext in '' $ac_executable_extensions; do
95       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
96       { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
97 # Check for GNU ac_path_EGREP and select it if it is found.
98   # Check for GNU $ac_path_EGREP
99 case `"$ac_path_EGREP" --version 2>&1` in
100 *GNU*)
101   ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
103   ac_count=0
104   $as_echo_n 0123456789 >"conftest.in"
105   while :
106   do
107     cat "conftest.in" "conftest.in" >"conftest.tmp"
108     mv "conftest.tmp" "conftest.in"
109     cp "conftest.in" "conftest.nl"
110     $as_echo 'EGREP' >> "conftest.nl"
111     "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
112     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
113     as_fn_arith $ac_count + 1 && ac_count=$as_val
114     if test $ac_count -gt ${ac_path_EGREP_max-0}; then
115       # Best one so far, save it but keep looking for a better one
116       ac_cv_path_EGREP="$ac_path_EGREP"
117       ac_path_EGREP_max=$ac_count
118     fi
119     # 10*(2^10) chars as input seems more than enough
120     test $ac_count -gt 10 && break
121   done
122   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
123 esac
125       $ac_path_EGREP_found && break 3
126     done
127   done
128   done
129 IFS=$as_save_IFS
130   if test -z "$ac_cv_path_EGREP"; then
131     as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
132   fi
133 else
134   ac_cv_path_EGREP=$EGREP
137    fi
139 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
140 $as_echo "$ac_cv_path_EGREP" >&6; }
141  EGREP="$ac_cv_path_EGREP"
144 { $as_echo "$as_me:${as_lineno-$LINENO}: checking installed Linux kernel header files" >&5
145 $as_echo_n "checking installed Linux kernel header files... " >&6; }
146 if ${libc_cv_linux2619+:} false; then :
147   $as_echo_n "(cached) " >&6
148 else
149   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
150 /* end confdefs.h.  */
151 #include <linux/version.h>
152 #if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE <  (2 *65536+ 6 *256+ 19) /* 2.6.19 */
153 eat flaming death
154 #endif
155 _ACEOF
156 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
157   $EGREP "eat flaming death" >/dev/null 2>&1; then :
158   libc_cv_linux2619='TOO OLD!'
159 else
160   libc_cv_linux2619='2.6.19 or later'
162 rm -f conftest*
165 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_linux2619" >&5
166 $as_echo "$libc_cv_linux2619" >&6; }
167 if test "$libc_cv_linux2619" != '2.6.19 or later'; then
168   as_fn_error $? "GNU libc requires kernel header files from
169 Linux 2.6.19 or later to be installed before configuring.
170 The kernel header files are found usually in /usr/include/asm and
171 /usr/include/linux; make sure these directories use files from
172 Linux 2.6.19 or later.  This check uses <linux/version.h>, so
173 make sure that file was built correctly when installing the kernel header
174 files.  To use kernel headers not from /usr/include/linux, use the
175 configure option --with-headers." "$LINENO" 5
178 # If the user gave a minimal version number test whether the available
179 # kernel headers are young enough.  Additionally we have minimal
180 # kernel versions for some architectures.  If a previous configure fragment
181 # set arch_minimum_kernel already, let that override our defaults here.
182 # Note that we presume such a fragment has set libc_cv_gcc_unwind_find_fde
183 # if appropriate too.
184 test -n "$arch_minimum_kernel" ||
185 case "$machine" in
186   i386*)
187     libc_cv_gcc_unwind_find_fde=yes
188     arch_minimum_kernel=2.6.16
189     ;;
190   x86_64/x32)
191     arch_minimum_kernel=3.4.0
192     ;;
193   powerpc/powerpc32*)
194     libc_cv_gcc_unwind_find_fde=yes
195     arch_minimum_kernel=2.6.16
196     ;;
197   s390/s390-32)
198     libc_cv_gcc_unwind_find_fde=yes
199     arch_minimum_kernel=2.6.16
200     ;;
201   s390/s390-64)
202     libc_cv_gcc_unwind_find_fde=yes
203     arch_minimum_kernel=2.6.16
204     ;;
205   sh*)
206     arch_minimum_kernel=2.6.16
207     libc_cv_gcc_unwind_find_fde=yes
208     ;;
209   sparc/sparc64*)
210     libc_cv_gcc_unwind_find_fde=yes
211     arch_minimum_kernel=2.6.16
212     ;;
213   sparc*)
214     libc_cv_gcc_unwind_find_fde=yes
215     arch_minimum_kernel=2.6.16
216     ;;
217   *)
218     arch_minimum_kernel=2.6.16
219     ;;
220 esac
221 if test -n "$minimum_kernel"; then
223   user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
224   arch_version=$((`echo "$arch_minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
226   if test $user_version -lt $arch_version; then
227     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: minimum kernel version reset to $arch_minimum_kernel" >&5
228 $as_echo "$as_me: WARNING: minimum kernel version reset to $arch_minimum_kernel" >&2;}
229     minimum_kernel=$arch_minimum_kernel
230   fi
231 else
232   minimum_kernel=$arch_minimum_kernel
235 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kernel header at least $minimum_kernel" >&5
236 $as_echo_n "checking for kernel header at least $minimum_kernel... " >&6; }
237 decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
238 abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
239 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
240 /* end confdefs.h.  */
241 #include <linux/version.h>
242 #if LINUX_VERSION_CODE < $decnum
243 eat flaming death
244 #endif
245 _ACEOF
246 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
247   $EGREP "eat flaming death" >/dev/null 2>&1; then :
248   libc_minimum_kernel='too old!'
249 else
250   libc_minimum_kernel=ok
252 rm -f conftest*
254 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_minimum_kernel" >&5
255 $as_echo "$libc_minimum_kernel" >&6; }
256 if test "$libc_minimum_kernel" = ok; then
257   cat >>confdefs.h <<_ACEOF
258 #define __LINUX_KERNEL_VERSION $decnum
259 _ACEOF
261   cat >>confdefs.h <<_ACEOF
262 #define __ABI_TAG_VERSION $abinum
263 _ACEOF
265 else
266   as_fn_error $? "*** The available kernel headers are older than the requested
267 *** compatible kernel version" "$LINENO" 5
270 # The result of the above test for the use of the FDE code is invalid if
271 # the user overrides the decision about the minimum ABI.
272 if test "$oldest_abi" != default && test "2.2.4" \< "$oldest_abi"; then
273   libc_cv_gcc_unwind_find_fde=no
276 if test -n "$sysheaders"; then
277   CPPFLAGS=$OLD_CPPFLAGS
280 # Under Linux the NPTL add-on should be available.
281 case $add_ons in
282   # It is available.  Good.
283   *nptl*)
284     nptl_missing=
285     ;;
286   *)
287     nptl_missing=yes
288     ;;
289 esac
291 if test "$nptl_missing"; then
292   if test $enable_sanity = yes; then
293     echo "\
294 *** On GNU/Linux systems it is normal to compile GNU libc with the
295 *** \`nptl' add-on.  Without that, the library will be
296 *** incompatible with normal GNU/Linux systems.
297 *** If you really mean to not use this add-on, run configure again
298 *** using the extra parameter \`--disable-sanity-checks'."
299     exit 1
300   else
301     echo "\
302 *** WARNING: Are you sure you do not want to use the \`nptl'
303 *** add-on?"
304   fi
307 if test "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
308   if test $enable_sanity = yes; then
309     echo "\
310 *** On GNU/Linux systems the GNU C Library should not be installed into
311 *** /usr/local since this might make your system totally unusable.
312 *** We strongly advise to use a different prefix.  For details read the FAQ.
313 *** If you really mean to do this, run configure again using the extra
314 *** parameter \`--disable-sanity-checks'."
315     exit 1
316   else
317     echo "\
318 *** WARNING: Do you really want to install the GNU C Library into /usr/local?
319 *** This might make your system totally unusable, for details read the FAQ."
320   fi
324 # One Linux we use ldconfig.
325 use_ldconfig=yes
327 # We need some extensions to the `ldd' script.
329 case "$machine" in
330   i[3456]86*)
331     ldd_rewrite_script=sysdeps/unix/sysv/linux/ldd-rewrite.sed
332     ;;
333   s390*)
334     ldd_rewrite_script=sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
335     ;;
336   sparc*)
337     ldd_rewrite_script=sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
338     ;;
339   x86_64*)
340     ldd_rewrite_script=sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
341     ;;
342   powerpc*)
343     ldd_rewrite_script=sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed
344     ;;
345   *)
346     ;;
347 esac
350 if test $host = $build; then
351   # If $prefix/include/{net,scsi} are symlinks, make install will
352   # clobber what they're linked to (probably a kernel tree).
353   # test -L ought to work on all Linux boxes.
354   if test "x$prefix" != xNONE; then
355     ac_prefix=$prefix
356   else
357     ac_prefix=$ac_default_prefix
358   fi
359   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for symlinks in ${ac_prefix}/include" >&5
360 $as_echo_n "checking for symlinks in ${ac_prefix}/include... " >&6; }
361   ac_message=
362   if test -L ${ac_prefix}/include/net; then
363     ac_message="$ac_message
364    ${ac_prefix}/include/net is a symlink"
365   fi
366   if test -L ${ac_prefix}/include/scsi; then
367     ac_message="$ac_message
368    ${ac_prefix}/include/scsi is a symlink"
369   fi
370   if test -n "$ac_message"; then
371     as_fn_error $? "$ac_message
372 \`make install' will destroy the target of the link(s).
373 Delete the links and re-run configure, or better still, move the entire
374 ${ac_prefix}/include directory out of the way." "$LINENO" 5
375   else
376     { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
377 $as_echo "ok" >&6; }
378   fi
381 # We have inlined syscalls.
382 $as_echo "#define HAVE_INLINED_SYSCALLS 1" >>confdefs.h