Remove socket.S implementation
[glibc.git] / sysdeps / unix / sysv / linux / configure
blobef9d4256d3e57e638de427590ac06f5808423946
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"
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
44 else
45   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
46 /* end confdefs.h.  */
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
50 #endif
51 int
52 main ()
55   ;
56   return 0;
58 _ACEOF
59 if ac_fn_c_try_compile "$LINENO"; then :
60   libc_cv_linux2632='2.6.32 or later'
61 else
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
84 # if appropriate too.
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
95   fi
96 else
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
109 #endif
111 main ()
114   ;
115   return 0;
117 _ACEOF
118 if ac_fn_c_try_compile "$LINENO"; then :
119   libc_minimum_kernel=ok
120 else
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
129 _ACEOF
131   cat >>confdefs.h <<_ACEOF
132 #define __ABI_TAG_VERSION $abinum
133 _ACEOF
135 else
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 if test -n "$sysheaders"; then
152   CPPFLAGS=$OLD_CPPFLAGS
155 if test "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
156   if test $enable_sanity = yes; then
157     echo "\
158 *** On GNU/Linux systems the GNU C Library should not be installed into
159 *** /usr/local since this might make your system totally unusable.
160 *** We strongly advise to use a different prefix.  For details read the FAQ.
161 *** If you really mean to do this, run configure again using the extra
162 *** parameter \`--disable-sanity-checks'."
163     exit 1
164   else
165     echo "\
166 *** WARNING: Do you really want to install the GNU C Library into /usr/local?
167 *** This might make your system totally unusable, for details read the FAQ."
168   fi
172 # One Linux we use ldconfig.
173 use_ldconfig=yes
175 if test $host = $build; then
176   # If $prefix/include/{net,scsi} are symlinks, make install will
177   # clobber what they're linked to (probably a kernel tree).
178   # test -L ought to work on all Linux boxes.
179   if test "x$prefix" != xNONE; then
180     ac_prefix=$prefix
181   else
182     ac_prefix=$ac_default_prefix
183   fi
184   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for symlinks in ${ac_prefix}/include" >&5
185 $as_echo_n "checking for symlinks in ${ac_prefix}/include... " >&6; }
186   ac_message=
187   if test -L ${ac_prefix}/include/net; then
188     ac_message="$ac_message
189    ${ac_prefix}/include/net is a symlink"
190   fi
191   if test -L ${ac_prefix}/include/scsi; then
192     ac_message="$ac_message
193    ${ac_prefix}/include/scsi is a symlink"
194   fi
195   if test -n "$ac_message"; then
196     as_fn_error $? "$ac_message
197 \`make install' will destroy the target of the link(s).
198 Delete the links and re-run configure, or better still, move the entire
199 ${ac_prefix}/include directory out of the way." "$LINENO" 5
200   else
201     { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
202 $as_echo "ok" >&6; }
203   fi
206 # We have inlined syscalls.
207 $as_echo "#define HAVE_INLINED_SYSCALLS 1" >>confdefs.h