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
14 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19 if ac_fn_c_try_compile "$LINENO"; then :
24 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
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"
40 { $as_echo "$as_me:${as_lineno-$LINENO}: checking installed Linux kernel header files" >&5
41 $as_echo_n "checking installed Linux kernel header files... " >&6; }
42 if ${libc_cv_linux2632+:} false; then :
43 $as_echo_n "(cached) " >&6
45 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47 #include <linux/version.h>
48 #if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE < (2 *65536+ 6 *256+ 32) /* 2.6.32 */
49 # error kernel headers missing or too old
59 if ac_fn_c_try_compile "$LINENO"; then :
60 libc_cv_linux2632='2.6.32 or later'
62 libc_cv_linux2632='missing or too old!'
64 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
66 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_linux2632" >&5
67 $as_echo "$libc_cv_linux2632" >&6; }
68 if test "$libc_cv_linux2632" != '2.6.32 or later'; then
69 as_fn_error $? "GNU libc requires kernel header files from
70 Linux 2.6.32 or later to be installed before configuring.
71 The kernel header files are found usually in /usr/include/asm and
72 /usr/include/linux; make sure these directories use files from
73 Linux 2.6.32 or later. This check uses <linux/version.h>, so
74 make sure that file was built correctly when installing the kernel header
75 files. To use kernel headers not from /usr/include/linux, use the
76 configure option --with-headers." "$LINENO" 5
79 # If the user gave a minimal version number test whether the available
80 # kernel headers are young enough. Additionally we have minimal
81 # kernel versions for some architectures. If a previous configure fragment
82 # set arch_minimum_kernel already, let that override our defaults here.
83 # Note that we presume such a fragment has set libc_cv_gcc_unwind_find_fde
85 test -n "$arch_minimum_kernel" || arch_minimum_kernel=2.6.32
86 if test -n "$minimum_kernel"; then
88 user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
89 arch_version=$((`echo "$arch_minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
91 if test $user_version -lt $arch_version; then
92 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: minimum kernel version reset to $arch_minimum_kernel" >&5
93 $as_echo "$as_me: WARNING: minimum kernel version reset to $arch_minimum_kernel" >&2;}
94 minimum_kernel=$arch_minimum_kernel
97 minimum_kernel=$arch_minimum_kernel
100 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kernel header at least $minimum_kernel" >&5
101 $as_echo_n "checking for kernel header at least $minimum_kernel... " >&6; }
102 decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
103 abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
104 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
105 /* end confdefs.h. */
106 #include <linux/version.h>
107 #if LINUX_VERSION_CODE < $decnum
108 # error kernel headers too old
118 if ac_fn_c_try_compile "$LINENO"; then :
119 libc_minimum_kernel=ok
121 libc_minimum_kernel='too old!'
123 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
124 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_minimum_kernel" >&5
125 $as_echo "$libc_minimum_kernel" >&6; }
126 if test "$libc_minimum_kernel" = ok; then
127 cat >>confdefs.h <<_ACEOF
128 #define __LINUX_KERNEL_VERSION $decnum
131 cat >>confdefs.h <<_ACEOF
132 #define __ABI_TAG_VERSION $abinum
136 as_fn_error $? "*** The available kernel headers are older than the requested
137 *** compatible kernel version" "$LINENO" 5
140 # Until we start requiring 2.6.37+ headers, we need to check for the
141 # availability of linux/fanotify.h for testing purposes.
142 ac_fn_c_check_header_compile "$LINENO" "linux/fanotify.h" "ac_cv_header_linux_fanotify_h" "/* No default includes. */
144 if test "x$ac_cv_header_linux_fanotify_h" = xyes; then :
145 $as_echo "#define HAVE_LINUX_FANOTIFY_H 1" >>confdefs.h
151 # The result of the above test for the use of the FDE code is invalid if
152 # the user overrides the decision about the minimum ABI.
153 if test "$oldest_abi" != default && test "2.2.4" \< "$oldest_abi"; then
154 libc_cv_gcc_unwind_find_fde=no
157 if test -n "$sysheaders"; then
158 CPPFLAGS=$OLD_CPPFLAGS
161 # Under Linux the NPTL add-on should be available.
163 # It is available. Good.
172 if test "$nptl_missing"; then
173 if test $enable_sanity = yes; then
175 *** On GNU/Linux systems it is normal to compile GNU libc with the
176 *** \`nptl' add-on. Without that, the library will be
177 *** incompatible with normal GNU/Linux systems.
178 *** If you really mean to not use this add-on, run configure again
179 *** using the extra parameter \`--disable-sanity-checks'."
183 *** WARNING: Are you sure you do not want to use the \`nptl'
188 if test "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
189 if test $enable_sanity = yes; then
191 *** On GNU/Linux systems the GNU C Library should not be installed into
192 *** /usr/local since this might make your system totally unusable.
193 *** We strongly advise to use a different prefix. For details read the FAQ.
194 *** If you really mean to do this, run configure again using the extra
195 *** parameter \`--disable-sanity-checks'."
199 *** WARNING: Do you really want to install the GNU C Library into /usr/local?
200 *** This might make your system totally unusable, for details read the FAQ."
205 # One Linux we use ldconfig.
208 if test $host = $build; then
209 # If $prefix/include/{net,scsi} are symlinks, make install will
210 # clobber what they're linked to (probably a kernel tree).
211 # test -L ought to work on all Linux boxes.
212 if test "x$prefix" != xNONE; then
215 ac_prefix=$ac_default_prefix
217 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for symlinks in ${ac_prefix}/include" >&5
218 $as_echo_n "checking for symlinks in ${ac_prefix}/include... " >&6; }
220 if test -L ${ac_prefix}/include/net; then
221 ac_message="$ac_message
222 ${ac_prefix}/include/net is a symlink"
224 if test -L ${ac_prefix}/include/scsi; then
225 ac_message="$ac_message
226 ${ac_prefix}/include/scsi is a symlink"
228 if test -n "$ac_message"; then
229 as_fn_error $? "$ac_message
230 \`make install' will destroy the target of the link(s).
231 Delete the links and re-run configure, or better still, move the entire
232 ${ac_prefix}/include directory out of the way." "$LINENO" 5
234 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
239 # We have inlined syscalls.
240 $as_echo "#define HAVE_INLINED_SYSCALLS 1" >>confdefs.h