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