Override elf_nacl.xr linker script so that libc_pic.os links correctly
[glibc/nacl-glibc.git] / sysdeps / unix / sysv / linux / configure
blob1e66d3aaa1ee75b0e809aae58bde5528210429d2
1 # This file is generated from configure.in by Autoconf.  DO NOT EDIT!
2  # Local configure fragment for sysdeps/unix/sysv/linux.
4 # The Linux kernel headers can be found in
5 #   /lib/modules/$(uname -r)/build/include
6 # Check whether this directory is available.
7 if test -z "$sysheaders" &&
8    test "x$cross_compiling" = xno &&
9    test -d /lib/modules/`uname -r`/build/include; then
10   sysheaders="/lib/modules/`uname -r`/build/include"
11   ccheaders=`$CC -print-file-name=include`
12       SYSINCLUDES="-I $sysheaders"
15 # Don't bother trying to generate any glue code to be compatible with the
16 # existing system library, because we are the only system library.
17 inhibit_glue=yes
19 if test -n "$sysheaders"; then
20   OLD_CPPFLAGS=$CPPFLAGS
21   CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
25 { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
26 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
27 if test "${ac_cv_path_GREP+set}" = set; then
28   echo $ECHO_N "(cached) $ECHO_C" >&6
29 else
30   # Extract the first word of "grep ggrep" to use in msg output
31 if test -z "$GREP"; then
32 set dummy grep ggrep; ac_prog_name=$2
33 if test "${ac_cv_path_GREP+set}" = set; then
34   echo $ECHO_N "(cached) $ECHO_C" >&6
35 else
36   ac_path_GREP_found=false
37 # Loop through the user's path and test for each of PROGNAME-LIST
38 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
39 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
41   IFS=$as_save_IFS
42   test -z "$as_dir" && as_dir=.
43   for ac_prog in grep ggrep; do
44   for ac_exec_ext in '' $ac_executable_extensions; do
45     ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
46     { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
47     # Check for GNU ac_path_GREP and select it if it is found.
48   # Check for GNU $ac_path_GREP
49 case `"$ac_path_GREP" --version 2>&1` in
50 *GNU*)
51   ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
53   ac_count=0
54   echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
55   while :
56   do
57     cat "conftest.in" "conftest.in" >"conftest.tmp"
58     mv "conftest.tmp" "conftest.in"
59     cp "conftest.in" "conftest.nl"
60     echo 'GREP' >> "conftest.nl"
61     "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
62     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
63     ac_count=`expr $ac_count + 1`
64     if test $ac_count -gt ${ac_path_GREP_max-0}; then
65       # Best one so far, save it but keep looking for a better one
66       ac_cv_path_GREP="$ac_path_GREP"
67       ac_path_GREP_max=$ac_count
68     fi
69     # 10*(2^10) chars as input seems more than enough
70     test $ac_count -gt 10 && break
71   done
72   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
73 esac
76     $ac_path_GREP_found && break 3
77   done
78 done
80 done
81 IFS=$as_save_IFS
86 GREP="$ac_cv_path_GREP"
87 if test -z "$GREP"; then
88   { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
89 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
90    { (exit 1); exit 1; }; }
93 else
94   ac_cv_path_GREP=$GREP
99 { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
100 echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
101  GREP="$ac_cv_path_GREP"
104 { echo "$as_me:$LINENO: checking for egrep" >&5
105 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
106 if test "${ac_cv_path_EGREP+set}" = set; then
107   echo $ECHO_N "(cached) $ECHO_C" >&6
108 else
109   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
110    then ac_cv_path_EGREP="$GREP -E"
111    else
112      # Extract the first word of "egrep" to use in msg output
113 if test -z "$EGREP"; then
114 set dummy egrep; ac_prog_name=$2
115 if test "${ac_cv_path_EGREP+set}" = set; then
116   echo $ECHO_N "(cached) $ECHO_C" >&6
117 else
118   ac_path_EGREP_found=false
119 # Loop through the user's path and test for each of PROGNAME-LIST
120 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
121 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
123   IFS=$as_save_IFS
124   test -z "$as_dir" && as_dir=.
125   for ac_prog in egrep; do
126   for ac_exec_ext in '' $ac_executable_extensions; do
127     ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
128     { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
129     # Check for GNU ac_path_EGREP and select it if it is found.
130   # Check for GNU $ac_path_EGREP
131 case `"$ac_path_EGREP" --version 2>&1` in
132 *GNU*)
133   ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
135   ac_count=0
136   echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
137   while :
138   do
139     cat "conftest.in" "conftest.in" >"conftest.tmp"
140     mv "conftest.tmp" "conftest.in"
141     cp "conftest.in" "conftest.nl"
142     echo 'EGREP' >> "conftest.nl"
143     "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
144     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
145     ac_count=`expr $ac_count + 1`
146     if test $ac_count -gt ${ac_path_EGREP_max-0}; then
147       # Best one so far, save it but keep looking for a better one
148       ac_cv_path_EGREP="$ac_path_EGREP"
149       ac_path_EGREP_max=$ac_count
150     fi
151     # 10*(2^10) chars as input seems more than enough
152     test $ac_count -gt 10 && break
153   done
154   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
155 esac
158     $ac_path_EGREP_found && break 3
159   done
160 done
162 done
163 IFS=$as_save_IFS
168 EGREP="$ac_cv_path_EGREP"
169 if test -z "$EGREP"; then
170   { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
171 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
172    { (exit 1); exit 1; }; }
175 else
176   ac_cv_path_EGREP=$EGREP
180    fi
182 { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
183 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
184  EGREP="$ac_cv_path_EGREP"
187 { echo "$as_me:$LINENO: checking installed Linux kernel header files" >&5
188 echo $ECHO_N "checking installed Linux kernel header files... $ECHO_C" >&6; }
189 if test "${libc_cv_linux2010+set}" = set; then
190   echo $ECHO_N "(cached) $ECHO_C" >&6
191 else
192   cat >conftest.$ac_ext <<_ACEOF
193 /* confdefs.h.  */
194 _ACEOF
195 cat confdefs.h >>conftest.$ac_ext
196 cat >>conftest.$ac_ext <<_ACEOF
197 /* end confdefs.h.  */
198 #include <linux/version.h>
199 #if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE <  (2 *65536+ 0 *256+ 10) /* 2.0.10 */
200 eat flaming death
201 #endif
202 _ACEOF
203 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
204   $EGREP "eat flaming death" >/dev/null 2>&1; then
205   libc_cv_linux2010='TOO OLD!'
206 else
207   libc_cv_linux2010='2.0.10 or later'
209 rm -f conftest*
212 { echo "$as_me:$LINENO: result: $libc_cv_linux2010" >&5
213 echo "${ECHO_T}$libc_cv_linux2010" >&6; }
214 if test "$libc_cv_linux2010" != '2.0.10 or later'; then
215   { { echo "$as_me:$LINENO: error: GNU libc requires kernel header files from
216 Linux 2.0.10 or later to be installed before configuring.
217 The kernel header files are found usually in /usr/include/asm and
218 /usr/include/linux; make sure these directories use files from
219 Linux 2.0.10 or later.  This check uses <linux/version.h>, so
220 make sure that file was built correctly when installing the kernel header
221 files.  To use kernel headers not from /usr/include/linux, use the
222 configure option --with-headers." >&5
223 echo "$as_me: error: GNU libc requires kernel header files from
224 Linux 2.0.10 or later to be installed before configuring.
225 The kernel header files are found usually in /usr/include/asm and
226 /usr/include/linux; make sure these directories use files from
227 Linux 2.0.10 or later.  This check uses <linux/version.h>, so
228 make sure that file was built correctly when installing the kernel header
229 files.  To use kernel headers not from /usr/include/linux, use the
230 configure option --with-headers." >&2;}
231    { (exit 1); exit 1; }; }
234 # If the user gave a minimal version number test whether the available
235 # kernel headers are young enough.  Additionally we have minimal
236 # kernel versions for some architectures.  If a previous configure fragment
237 # set arch_minimum_kernel already, let that override our defaults here.
238 # Note that we presume such a fragment has set libc_cv_gcc_unwind_find_fde
239 # if appropriate too.
240 test -n "$arch_minimum_kernel" ||
241 case "$machine" in
242   alpha*)
243     arch_minimum_kernel=2.1.100
244     libc_cv_gcc_unwind_find_fde=yes
245     ;;
246   arm*)
247     arch_minimum_kernel=2.0.10
248     libc_cv_gcc_unwind_find_fde=yes
249     ;;
250   i386*)
251     libc_cv_gcc_unwind_find_fde=yes
252     arch_minimum_kernel=2.0.10
253     ;;
254   ia64*)
255     arch_minimum_kernel=2.4.0
256     ;;
257   hppa*)
258     libc_cv_gcc_unwind_find_fde=yes
259     arch_minimum_kernel=2.4.19
260     ;;
261   m68k*)
262     arch_minimum_kernel=2.0.10
263     libc_cv_gcc_unwind_find_fde=yes
264     ;;
265   powerpc/powerpc32)
266     libc_cv_gcc_unwind_find_fde=yes
267     arch_minimum_kernel=2.0.10
268     ;;
269   powerpc/powerpc64)
270     arch_minimum_kernel=2.4.21
271     ;;
272   s390/s390-32)
273     libc_cv_gcc_unwind_find_fde=yes
274     arch_minimum_kernel=2.2.10
275     ;;
276   s390/s390-64)
277     libc_cv_gcc_unwind_find_fde=yes
278     arch_minimum_kernel=2.4.0
279     ;;
280   sh*)
281     arch_minimum_kernel=2.3.99
282     libc_cv_gcc_unwind_find_fde=yes
283     ;;
284   sparc/sparc64*)
285     libc_cv_gcc_unwind_find_fde=yes
286     arch_minimum_kernel=2.4.21
287     ;;
288   sparc*)
289     libc_cv_gcc_unwind_find_fde=yes
290     arch_minimum_kernel=2.0.10
291     ;;
292   x86_64*)
293     arch_minimum_kernel=2.4.0
294     ;;
295   *)
296     arch_minimum_kernel=2.0.10
297     ;;
298 esac
299 if test -n "$minimum_kernel"; then
301   user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
302   arch_version=$((`echo "$arch_minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
304   if test $user_version -lt $arch_version; then
305     { echo "$as_me:$LINENO: WARNING: minimum kernel version reset to $arch_minimum_kernel" >&5
306 echo "$as_me: WARNING: minimum kernel version reset to $arch_minimum_kernel" >&2;}
307     minimum_kernel=$arch_minimum_kernel
308   fi
309 else
310   if test $arch_minimum_kernel != '2.0.10'; then
311     minimum_kernel=$arch_minimum_kernel
312   fi
315 if test -n "$minimum_kernel"; then
316   { echo "$as_me:$LINENO: checking for kernel header at least $minimum_kernel" >&5
317 echo $ECHO_N "checking for kernel header at least $minimum_kernel... $ECHO_C" >&6; }
318   decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
319   abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
320   cat >conftest.$ac_ext <<_ACEOF
321 /* confdefs.h.  */
322 _ACEOF
323 cat confdefs.h >>conftest.$ac_ext
324 cat >>conftest.$ac_ext <<_ACEOF
325 /* end confdefs.h.  */
326 #include <linux/version.h>
327 #if LINUX_VERSION_CODE < $decnum
328 eat flaming death
329 #endif
330 _ACEOF
331 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
332   $EGREP "eat flaming death" >/dev/null 2>&1; then
333   libc_minimum_kernel='too old!'
334 else
335   libc_minimum_kernel=ok
337 rm -f conftest*
339   { echo "$as_me:$LINENO: result: $libc_minimum_kernel" >&5
340 echo "${ECHO_T}$libc_minimum_kernel" >&6; }
341   if test "$libc_minimum_kernel" = ok; then
342     cat >>confdefs.h <<_ACEOF
343 #define __LINUX_KERNEL_VERSION $decnum
344 _ACEOF
346     cat >>confdefs.h <<_ACEOF
347 #define __ABI_TAG_VERSION $abinum
348 _ACEOF
350   else
351     { { echo "$as_me:$LINENO: error: *** The available kernel headers are older than the requested
352 *** compatible kernel version" >&5
353 echo "$as_me: error: *** The available kernel headers are older than the requested
354 *** compatible kernel version" >&2;}
355    { (exit 1); exit 1; }; }
356   fi
359 # The result of the above test for the use of the FDE code is invalid if
360 # the user overrides the decision about the minimum ABI.
361 if test "$oldest_abi" != default && test "2.2.4" \< "$oldest_abi"; then
362   libc_cv_gcc_unwind_find_fde=no
364 libc_cv_gcc_unwind_find_fde=no
366 if test -n "$sysheaders"; then
367   CPPFLAGS=$OLD_CPPFLAGS
369 # The Linux filesystem standard prescribes where to place "essential"
370 # files.  I.e., when the installation prefix is "/usr" we have to place
371 # shared library objects and the configuration files on the root partition
372 # in /lib and /etc.
373 case "$prefix" in
374 /usr | /usr/)
375   # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib.
376   # Allow earlier configure scripts to handle libc_cv_slibdir, libdir,
377   # and libc_cv_localedir.
378   test -n "$libc_cv_slibdir" || \
379   case $machine in
380   sparc/sparc64 | x86_64 | powerpc/powerpc64 | s390/s390-64)
381     libc_cv_slibdir="/lib64"
382     if test "$libdir" = '${exec_prefix}/lib'; then
383       libdir='${exec_prefix}/lib64';
384       # Locale data can be shared between 32bit and 64bit libraries
385       libc_cv_localedir='${exec_prefix}/lib/locale'
386     fi
387     ;;
388   *)
389     libc_cv_slibdir="/lib"
390     ;;
391   esac
392   # Allow the user to override the path with --sysconfdir
393   if test $sysconfdir = '${prefix}/etc'; then
394     libc_cv_sysconfdir=/etc
395   else
396     libc_cv_sysconfdir=$sysconfdir
397    fi
398   libc_cv_rootsbindir="/sbin"
399   ;;
400 esac
402 # Under Linux the NPTL add-on should be available.
403 case $add_ons in
404   # It is available.  Good.
405   *nptl*)
406     nptl_missing=
407     ;;
408   *)
409     nptl_missing=yes
410     ;;
411 esac
413 if test "$nptl_missing"; then
414   if test $enable_sanity = yes; then
415     echo "\
416 *** On GNU/Linux systems it is normal to compile GNU libc with the
417 *** \`nptl' add-on.  Without that, the library will be
418 *** incompatible with normal GNU/Linux systems.
419 *** If you really mean to not use this add-on, run configure again
420 *** using the extra parameter \`--disable-sanity-checks'."
421     exit 1
422   else
423     echo "\
424 *** WARNING: Are you sure you do not want to use the \`nptl'
425 *** add-on?"
426   fi
429 if test "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
430   if test $enable_sanity = yes; then
431     echo "\
432 *** On GNU/Linux systems the GNU C Library should not be installed into
433 *** /usr/local since this might make your system totally unusable.
434 *** We strongly advise to use a different prefix.  For details read the FAQ.
435 *** If you really mean to do this, run configure again using the extra
436 *** parameter \`--disable-sanity-checks'."
437     exit 1
438   else
439     echo "\
440 *** WARNING: Do you really want to install the GNU C Library into /usr/local?
441 *** This might make your system totally unusable, for details read the FAQ."
442   fi
446 # One Linux we use ldconfig.
447 use_ldconfig=yes
449 # We need some extensions to the `ldd' script.
451 case "$machine" in
452   i[3456]86* | m68*)
453     ldd_rewrite_script=../sysdeps/unix/sysv/linux/ldd-rewrite.sed
454     ;;
455   ia64*)
456     ldd_rewrite_script=../sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed
457     ;;
458   s390*)
459     ldd_rewrite_script=../sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
460     ;;
461   sparc*)
462     ldd_rewrite_script=../sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
463     ;;
464   x86_64*)
465     ldd_rewrite_script=../sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
466     ;;
467   powerpc*)
468     ldd_rewrite_script=../sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed
469     ;;
470   *)
471     ;;
472 esac
475 if test $host = $build; then
476   # If $prefix/include/{net,scsi} are symlinks, make install will
477   # clobber what they're linked to (probably a kernel tree).
478   # test -L ought to work on all Linux boxes.
479   if test "x$prefix" != xNONE; then
480     ac_prefix=$prefix
481   else
482     ac_prefix=$ac_default_prefix
483   fi
484   { echo "$as_me:$LINENO: checking for symlinks in ${ac_prefix}/include" >&5
485 echo $ECHO_N "checking for symlinks in ${ac_prefix}/include... $ECHO_C" >&6; }
486   ac_message=
487   if test -L ${ac_prefix}/include/net; then
488     ac_message="$ac_message
489    ${ac_prefix}/include/net is a symlink"
490   fi
491   if test -L ${ac_prefix}/include/scsi; then
492     ac_message="$ac_message
493    ${ac_prefix}/include/scsi is a symlink"
494   fi
495   if test -n "$ac_message"; then
496     { { echo "$as_me:$LINENO: error: $ac_message
497 \`make install' will destroy the target of the link(s).
498 Delete the links and re-run configure, or better still, move the entire
499 ${ac_prefix}/include directory out of the way." >&5
500 echo "$as_me: error: $ac_message
501 \`make install' will destroy the target of the link(s).
502 Delete the links and re-run configure, or better still, move the entire
503 ${ac_prefix}/include directory out of the way." >&2;}
504    { (exit 1); exit 1; }; }
505   else
506     { echo "$as_me:$LINENO: result: ok" >&5
507 echo "${ECHO_T}ok" >&6; }
508   fi
511 # We have inlined syscalls.
512 cat >>confdefs.h <<\_ACEOF
513 #define HAVE_INLINED_SYSCALLS 1
514 _ACEOF