Move x86_64 timer_*.c out of nptl/
[glibc.git] / sysdeps / unix / sysv / linux / configure
blob6ba2454d7e29c1c72bf36287fa13585b87c3e821
2 # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
3 # -------------------------------------------------------
4 # Tests whether HEADER exists and can be compiled using the include files in
5 # INCLUDES, setting the cache variable VAR accordingly.
6 ac_fn_c_check_header_compile ()
8   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
9   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
10 $as_echo_n "checking for $2... " >&6; }
11 if eval \${$3+:} false; then :
12   $as_echo_n "(cached) " >&6
13 else
14   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15 /* end confdefs.h.  */
17 #include <$2>
18 _ACEOF
19 if ac_fn_c_try_compile "$LINENO"; then :
20   eval "$3=yes"
21 else
22   eval "$3=no"
24 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26 eval ac_res=\$$3
27                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
28 $as_echo "$ac_res" >&6; }
29   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
31 } # ac_fn_c_check_header_compile
32 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
33  # Local configure fragment for sysdeps/unix/sysv/linux.
35 if test -n "$sysheaders"; then
36   OLD_CPPFLAGS=$CPPFLAGS
37   CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
41 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
42 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
43 if ${ac_cv_path_GREP+:} false; then :
44   $as_echo_n "(cached) " >&6
45 else
46   if test -z "$GREP"; then
47   ac_path_GREP_found=false
48   # Loop through the user's path and test for each of PROGNAME-LIST
49   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
50 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
52   IFS=$as_save_IFS
53   test -z "$as_dir" && as_dir=.
54     for ac_prog in grep ggrep; do
55     for ac_exec_ext in '' $ac_executable_extensions; do
56       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
57       { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
58 # Check for GNU ac_path_GREP and select it if it is found.
59   # Check for GNU $ac_path_GREP
60 case `"$ac_path_GREP" --version 2>&1` in
61 *GNU*)
62   ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
64   ac_count=0
65   $as_echo_n 0123456789 >"conftest.in"
66   while :
67   do
68     cat "conftest.in" "conftest.in" >"conftest.tmp"
69     mv "conftest.tmp" "conftest.in"
70     cp "conftest.in" "conftest.nl"
71     $as_echo 'GREP' >> "conftest.nl"
72     "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
73     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
74     as_fn_arith $ac_count + 1 && ac_count=$as_val
75     if test $ac_count -gt ${ac_path_GREP_max-0}; then
76       # Best one so far, save it but keep looking for a better one
77       ac_cv_path_GREP="$ac_path_GREP"
78       ac_path_GREP_max=$ac_count
79     fi
80     # 10*(2^10) chars as input seems more than enough
81     test $ac_count -gt 10 && break
82   done
83   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
84 esac
86       $ac_path_GREP_found && break 3
87     done
88   done
89   done
90 IFS=$as_save_IFS
91   if test -z "$ac_cv_path_GREP"; then
92     as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
93   fi
94 else
95   ac_cv_path_GREP=$GREP
99 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
100 $as_echo "$ac_cv_path_GREP" >&6; }
101  GREP="$ac_cv_path_GREP"
104 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
105 $as_echo_n "checking for egrep... " >&6; }
106 if ${ac_cv_path_EGREP+:} false; then :
107   $as_echo_n "(cached) " >&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      if test -z "$EGREP"; then
113   ac_path_EGREP_found=false
114   # Loop through the user's path and test for each of PROGNAME-LIST
115   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
116 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
118   IFS=$as_save_IFS
119   test -z "$as_dir" && as_dir=.
120     for ac_prog in egrep; do
121     for ac_exec_ext in '' $ac_executable_extensions; do
122       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
123       { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
124 # Check for GNU ac_path_EGREP and select it if it is found.
125   # Check for GNU $ac_path_EGREP
126 case `"$ac_path_EGREP" --version 2>&1` in
127 *GNU*)
128   ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
130   ac_count=0
131   $as_echo_n 0123456789 >"conftest.in"
132   while :
133   do
134     cat "conftest.in" "conftest.in" >"conftest.tmp"
135     mv "conftest.tmp" "conftest.in"
136     cp "conftest.in" "conftest.nl"
137     $as_echo 'EGREP' >> "conftest.nl"
138     "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
139     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
140     as_fn_arith $ac_count + 1 && ac_count=$as_val
141     if test $ac_count -gt ${ac_path_EGREP_max-0}; then
142       # Best one so far, save it but keep looking for a better one
143       ac_cv_path_EGREP="$ac_path_EGREP"
144       ac_path_EGREP_max=$ac_count
145     fi
146     # 10*(2^10) chars as input seems more than enough
147     test $ac_count -gt 10 && break
148   done
149   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
150 esac
152       $ac_path_EGREP_found && break 3
153     done
154   done
155   done
156 IFS=$as_save_IFS
157   if test -z "$ac_cv_path_EGREP"; then
158     as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
159   fi
160 else
161   ac_cv_path_EGREP=$EGREP
164    fi
166 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
167 $as_echo "$ac_cv_path_EGREP" >&6; }
168  EGREP="$ac_cv_path_EGREP"
171 { $as_echo "$as_me:${as_lineno-$LINENO}: checking installed Linux kernel header files" >&5
172 $as_echo_n "checking installed Linux kernel header files... " >&6; }
173 if ${libc_cv_linux2632+:} false; then :
174   $as_echo_n "(cached) " >&6
175 else
176   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
177 /* end confdefs.h.  */
178 #include <linux/version.h>
179 #if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE <  (2 *65536+ 6 *256+ 32) /* 2.6.32 */
180 eat flaming death
181 #endif
182 _ACEOF
183 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
184   $EGREP "eat flaming death" >/dev/null 2>&1; then :
185   libc_cv_linux2632='TOO OLD!'
186 else
187   libc_cv_linux2632='2.6.32 or later'
189 rm -f conftest*
192 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_linux2632" >&5
193 $as_echo "$libc_cv_linux2632" >&6; }
194 if test "$libc_cv_linux2632" != '2.6.32 or later'; then
195   as_fn_error $? "GNU libc requires kernel header files from
196 Linux 2.6.32 or later to be installed before configuring.
197 The kernel header files are found usually in /usr/include/asm and
198 /usr/include/linux; make sure these directories use files from
199 Linux 2.6.32 or later.  This check uses <linux/version.h>, so
200 make sure that file was built correctly when installing the kernel header
201 files.  To use kernel headers not from /usr/include/linux, use the
202 configure option --with-headers." "$LINENO" 5
205 # If the user gave a minimal version number test whether the available
206 # kernel headers are young enough.  Additionally we have minimal
207 # kernel versions for some architectures.  If a previous configure fragment
208 # set arch_minimum_kernel already, let that override our defaults here.
209 # Note that we presume such a fragment has set libc_cv_gcc_unwind_find_fde
210 # if appropriate too.
211 test -n "$arch_minimum_kernel" ||
212 case "$machine" in
213   i386*)
214     libc_cv_gcc_unwind_find_fde=yes
215     arch_minimum_kernel=2.6.32
216     ;;
217   x86_64/x32)
218     arch_minimum_kernel=3.4.0
219     ;;
220   powerpc/powerpc32*)
221     libc_cv_gcc_unwind_find_fde=yes
222     arch_minimum_kernel=2.6.32
223     ;;
224   s390/s390-32)
225     libc_cv_gcc_unwind_find_fde=yes
226     arch_minimum_kernel=2.6.32
227     ;;
228   s390/s390-64)
229     libc_cv_gcc_unwind_find_fde=yes
230     arch_minimum_kernel=2.6.32
231     ;;
232   sh*)
233     arch_minimum_kernel=2.6.32
234     libc_cv_gcc_unwind_find_fde=yes
235     ;;
236   sparc/sparc64*)
237     libc_cv_gcc_unwind_find_fde=yes
238     arch_minimum_kernel=2.6.32
239     ;;
240   sparc*)
241     libc_cv_gcc_unwind_find_fde=yes
242     arch_minimum_kernel=2.6.32
243     ;;
244   *)
245     arch_minimum_kernel=2.6.32
246     ;;
247 esac
248 if test -n "$minimum_kernel"; then
250   user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
251   arch_version=$((`echo "$arch_minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
253   if test $user_version -lt $arch_version; then
254     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: minimum kernel version reset to $arch_minimum_kernel" >&5
255 $as_echo "$as_me: WARNING: minimum kernel version reset to $arch_minimum_kernel" >&2;}
256     minimum_kernel=$arch_minimum_kernel
257   fi
258 else
259   minimum_kernel=$arch_minimum_kernel
262 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kernel header at least $minimum_kernel" >&5
263 $as_echo_n "checking for kernel header at least $minimum_kernel... " >&6; }
264 decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
265 abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
266 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
267 /* end confdefs.h.  */
268 #include <linux/version.h>
269 #if LINUX_VERSION_CODE < $decnum
270 eat flaming death
271 #endif
272 _ACEOF
273 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
274   $EGREP "eat flaming death" >/dev/null 2>&1; then :
275   libc_minimum_kernel='too old!'
276 else
277   libc_minimum_kernel=ok
279 rm -f conftest*
281 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_minimum_kernel" >&5
282 $as_echo "$libc_minimum_kernel" >&6; }
283 if test "$libc_minimum_kernel" = ok; then
284   cat >>confdefs.h <<_ACEOF
285 #define __LINUX_KERNEL_VERSION $decnum
286 _ACEOF
288   cat >>confdefs.h <<_ACEOF
289 #define __ABI_TAG_VERSION $abinum
290 _ACEOF
292 else
293   as_fn_error $? "*** The available kernel headers are older than the requested
294 *** compatible kernel version" "$LINENO" 5
297 # Until we start requiring 2.6.37+ headers, we need to check for the
298 # availability of linux/fanotify.h for testing purposes.
299 ac_fn_c_check_header_compile "$LINENO" "linux/fanotify.h" "ac_cv_header_linux_fanotify_h" "/* No default includes.  */
301 if test "x$ac_cv_header_linux_fanotify_h" = xyes; then :
302   $as_echo "#define HAVE_LINUX_FANOTIFY_H 1" >>confdefs.h
308 # The result of the above test for the use of the FDE code is invalid if
309 # the user overrides the decision about the minimum ABI.
310 if test "$oldest_abi" != default && test "2.2.4" \< "$oldest_abi"; then
311   libc_cv_gcc_unwind_find_fde=no
314 if test -n "$sysheaders"; then
315   CPPFLAGS=$OLD_CPPFLAGS
318 # Under Linux the NPTL add-on should be available.
319 case $add_ons in
320   # It is available.  Good.
321   *nptl*)
322     nptl_missing=
323     ;;
324   *)
325     nptl_missing=yes
326     ;;
327 esac
329 if test "$nptl_missing"; then
330   if test $enable_sanity = yes; then
331     echo "\
332 *** On GNU/Linux systems it is normal to compile GNU libc with the
333 *** \`nptl' add-on.  Without that, the library will be
334 *** incompatible with normal GNU/Linux systems.
335 *** If you really mean to not use this add-on, run configure again
336 *** using the extra parameter \`--disable-sanity-checks'."
337     exit 1
338   else
339     echo "\
340 *** WARNING: Are you sure you do not want to use the \`nptl'
341 *** add-on?"
342   fi
345 if test "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
346   if test $enable_sanity = yes; then
347     echo "\
348 *** On GNU/Linux systems the GNU C Library should not be installed into
349 *** /usr/local since this might make your system totally unusable.
350 *** We strongly advise to use a different prefix.  For details read the FAQ.
351 *** If you really mean to do this, run configure again using the extra
352 *** parameter \`--disable-sanity-checks'."
353     exit 1
354   else
355     echo "\
356 *** WARNING: Do you really want to install the GNU C Library into /usr/local?
357 *** This might make your system totally unusable, for details read the FAQ."
358   fi
362 # One Linux we use ldconfig.
363 use_ldconfig=yes
365 # We need some extensions to the `ldd' script.
367 case "$machine" in
368   i[3456]86*)
369     ldd_rewrite_script=sysdeps/unix/sysv/linux/ldd-rewrite.sed
370     ;;
371   s390*)
372     ldd_rewrite_script=sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
373     ;;
374   sparc*)
375     ldd_rewrite_script=sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
376     ;;
377   x86_64*)
378     ldd_rewrite_script=sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
379     ;;
380   powerpc*)
381     ldd_rewrite_script=sysdeps/unix/sysv/linux/powerpc/ldd-rewrite.sed
382     ;;
383   *)
384     ;;
385 esac
388 if test $host = $build; then
389   # If $prefix/include/{net,scsi} are symlinks, make install will
390   # clobber what they're linked to (probably a kernel tree).
391   # test -L ought to work on all Linux boxes.
392   if test "x$prefix" != xNONE; then
393     ac_prefix=$prefix
394   else
395     ac_prefix=$ac_default_prefix
396   fi
397   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for symlinks in ${ac_prefix}/include" >&5
398 $as_echo_n "checking for symlinks in ${ac_prefix}/include... " >&6; }
399   ac_message=
400   if test -L ${ac_prefix}/include/net; then
401     ac_message="$ac_message
402    ${ac_prefix}/include/net is a symlink"
403   fi
404   if test -L ${ac_prefix}/include/scsi; then
405     ac_message="$ac_message
406    ${ac_prefix}/include/scsi is a symlink"
407   fi
408   if test -n "$ac_message"; then
409     as_fn_error $? "$ac_message
410 \`make install' will destroy the target of the link(s).
411 Delete the links and re-run configure, or better still, move the entire
412 ${ac_prefix}/include directory out of the way." "$LINENO" 5
413   else
414     { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
415 $as_echo "ok" >&6; }
416   fi
419 # We have inlined syscalls.
420 $as_echo "#define HAVE_INLINED_SYSCALLS 1" >>confdefs.h