Remove *xattr syscalls.
[glibc.git] / sysdeps / unix / sysv / linux / configure
blobd6dee760e6207de4de1d73fd01233b3912febd6a
1  # Local configure fragment for sysdeps/unix/sysv/linux.
3 # The Linux kernel headers can be found in
4 #   /lib/modules/$(uname -r)/build/include
5 # Check whether this directory is available.
6 if test -z "$sysheaders" &&
7    test -d /lib/modules/`uname -r`/build/include; then
8   sysheaders="/lib/modules/`uname -r`/build/include"
9   ccheaders=`$CC -print-file-name=include`
10       SYSINCLUDES="-I $sysheaders"
13 # Don't bother trying to generate any glue code to be compatible with the
14 # existing system library, because we are the only system library.
15 inhibit_glue=yes
17 if test -n "$sysheaders"; then
18   OLD_CPPFLAGS=$CPPFLAGS
19   CPPFLAGS="$CPPFLAGS $SYSINCLUDES"
21 echo $ac_n "checking installed Linux kernel header files""... $ac_c" 1>&6
22 echo "configure:23: checking installed Linux kernel header files" >&5
23 if eval "test \"`echo '$''{'libc_cv_linux2010'+set}'`\" = set"; then
24   echo $ac_n "(cached) $ac_c" 1>&6
25 else
26   cat > conftest.$ac_ext <<EOF
27 #line 28 "configure"
28 #include "confdefs.h"
29 #include <linux/version.h>
30 #if !defined LINUX_VERSION_CODE || LINUX_VERSION_CODE <  (2 *65536+ 0 *256+ 10) /* 2.0.10 */
31 eat flaming death
32 #endif
33 EOF
34 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
35   egrep "eat flaming death" >/dev/null 2>&1; then
36   rm -rf conftest*
37   libc_cv_linux2010='TOO OLD!'
38 else
39   rm -rf conftest*
40   libc_cv_linux2010='2.0.10 or later'
42 rm -f conftest*
46 echo "$ac_t""$libc_cv_linux2010" 1>&6
47 if test "$libc_cv_linux2010" != '2.0.10 or later'; then
48   { echo "configure: error: GNU libc requires kernel header files from
49 Linux 2.0.10 or later to be installed before configuring.
50 The kernel header files are found usually in /usr/include/asm and
51 /usr/include/linux; make sure these directories use files from
52 Linux 2.0.10 or later.  This check uses <linux/version.h>, so
53 make sure that file was built correctly when installing the kernel header
54 files.  To use kernel headers not from /usr/include/linux, use the
55 configure option --with-headers." 1>&2; exit 1; }
58 # If the user gave a minimal version number test whether the available
59 # kernel headers are young enough.  Additionally we have minimal
60 # kernel versions for some architectures.
61 case "$machine" in
62   alpha*)
63     arch_minimum_kernel=2.1.100
64     libc_cv_gcc_unwind_find_fde=yes
65     ;;
66   arm*)
67     arch_minimum_kernel=2.0.10
68     libc_cv_gcc_unwind_find_fde=yes
69     ;;
70   i386*)
71     libc_cv_gcc_unwind_find_fde=yes
72     arch_minimum_kernel=2.0.10
73     ;;
74   ia64*)
75     arch_minimum_kernel=2.4.0
76     ;;
77   hppa*)
78     arch_minimum_kernel=2.3.99
79     ;;
80   m68k*)
81     arch_minimum_kernel=2.0.10
82     libc_cv_gcc_unwind_find_fde=yes
83     ;;
84   mips*)
85     arch_minimum_kernel=2.4.0
86     libc_cv_gcc_unwind_find_fde=yes
87     ;;
88   powerpc*)
89     libc_cv_gcc_unwind_find_fde=yes
90     arch_minimum_kernel=2.0.10
91     ;;
92   s390/s390-32)
93     libc_cv_gcc_unwind_find_fde=yes
94     arch_minimum_kernel=2.2.10
95     ;;
96   s390/s390-64)
97     libc_cv_gcc_unwind_find_fde=yes
98     arch_minimum_kernel=2.4.0
99     ;;
100   sh*)
101     arch_minimum_kernel=2.3.99
102     libc_cv_gcc_unwind_find_fde=yes
103     ;;
104   sparc*)
105     libc_cv_gcc_unwind_find_fde=yes
106     arch_minimum_kernel=2.0.10
107     ;;
108   x86_64*)
109     arch_minimum_kernel=2.4.0
110     ;;
111   *)
112     arch_minimum_kernel=2.0.10
113     ;;
114 esac
115 if test -n "$minimum_kernel"; then
116   
117   user_version=$((`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
118   arch_version=$((`echo "$arch_minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \* 65536 + \2 \* 256 + \3/'`))
119   
120   if test $user_version -lt $arch_version; then
121     echo "configure: warning: minimum kernel version reset to $arch_minimum_kernel" 1>&2
122     minimum_kernel=$arch_minimum_kernel
123   fi
124 else
125   if test $arch_minimum_kernel != '2.0.10'; then
126     minimum_kernel=$arch_minimum_kernel
127   fi
130 if test -n "$minimum_kernel"; then
131   echo $ac_n "checking for kernel header at least $minimum_kernel""... $ac_c" 1>&6
132 echo "configure:133: checking for kernel header at least $minimum_kernel" >&5
133   decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
134   abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
135   cat > conftest.$ac_ext <<EOF
136 #line 137 "configure"
137 #include "confdefs.h"
138 #include <linux/version.h>
139 #if LINUX_VERSION_CODE < $decnum
140 eat flaming death
141 #endif
143 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
144   egrep "eat flaming death" >/dev/null 2>&1; then
145   rm -rf conftest*
146   libc_minimum_kernel='too old!'
147 else
148   rm -rf conftest*
149   libc_minimum_kernel=ok
151 rm -f conftest*
153   echo "$ac_t""$libc_minimum_kernel" 1>&6
154   if test "$libc_minimum_kernel" = ok; then
155     cat >> confdefs.h <<EOF
156 #define __LINUX_KERNEL_VERSION $decnum
159     cat >> confdefs.h <<EOF
160 #define __ABI_TAG_VERSION $abinum
163   else
164     { echo "configure: error: *** The available kernel headers are older than the requested
165 *** compatible kernel version" 1>&2; exit 1; }
166   fi
169 # The result of the above test for the use of the FDE code is invalid if
170 # the user overrides the decision about the minimum ABI.
171 if test "$oldest_abi" != default && test "2.2.4" \< "$oldest_abi"; then
172   libc_cv_gcc_unwind_find_fde=no
175 if test -n "$sysheaders"; then
176   CPPFLAGS=$OLD_CPPFLAGS
178 # The Linux filesystem standard prescribes where to place "essential"
179 # files.  I.e., when the installation prefix is "/usr" we have to place
180 # shared library objects and the configuration files on the root partition
181 # in /lib and /etc.
182 if test "$prefix" = "/usr" -o "$prefix" = "/usr/"; then
183   # 64bit libraries on sparc go to /lib64 and not /lib
184   if test "$machine" = "sparc/sparc64" -o "$machine" = "x86_64"; then
185     libc_cv_slibdir="/lib64"
186     if test "$libdir" = '${exec_prefix}/lib'; then
187       libdir='${exec_prefix}/lib64';
188       # Locale data can be shared between 32bit and 64bit libraries
189       libc_cv_localedir='${exec_prefix}/lib/locale'
190     fi
191   else
192     libc_cv_slibdir="/lib"
193   fi
194   # Allow the user to override the path with --sysconfdir
195   if test $sysconfdir = '${prefix}/etc'; then
196     libc_cv_sysconfdir=/etc
197   else
198     libc_cv_sysconfdir=$sysconfdir
199    fi
200   libc_cv_rootsbindir="/sbin"
203 # Under Linux the LinuxThreads add-on should be available.
204 case $add_ons in
205   # It is available.  Good.
206   *linuxthreads*)
207     linuxthreads_missing=
208     ;;
209   *)
210     linuxthreads_missing=yes
211     ;;
212 esac
214 if test "$linuxthreads_missing"; then
215   if test $enable_sanity = yes; then
216     echo "\
217 *** On GNU/Linux systems it is normal to compile GNU libc with the
218 *** \`linuxthreads' add-on.  Without that, the library will be
219 *** incompatible with normal GNU/Linux systems.
220 *** If you really mean to not use this add-on, run configure again
221 *** using the extra parameter \`--disable-sanity-checks'."
222     exit 1
223   else
224     echo "\
225 *** WARNING: Are you sure you do not want to use the \`linuxthreads'
226 *** add-on?"
227   fi
230 if test "$prefix" = "/usr/local" -o "$prefix" = "/usr/local/" -o "$prefix" = "NONE"; then
231   if test $enable_sanity = yes; then
232     echo "\
233 *** On GNU/Linux systems the GNU C Library should not be installed into
234 *** /usr/local since this might make your system totally unusable.
235 *** We strongly advise to use a different prefix.  For details read the FAQ.
236 *** If you really mean to do this, run configure again using the extra
237 *** parameter \`--disable-sanity-checks'."
238     exit 1
239   else
240     echo "\
241 *** WARNING: Do you really want to install the GNU C Library into /usr/local?
242 *** This might make your system totally unusable, for details read the FAQ."
243   fi
247 # One Linux we use ldconfig.
248 use_ldconfig=yes
250 # We need some extensions to the `ldd' script.
252 case "$machine" in
253   i[3456]86* | m68*)
254     ldd_rewrite_script=../sysdeps/unix/sysv/linux/ldd-rewrite.sed
255     ;;
256   ia64*)
257     ldd_rewrite_script=../sysdeps/unix/sysv/linux/ia64/ldd-rewrite.sed
258     ;;
259   s390*)
260     ldd_rewrite_script=../sysdeps/unix/sysv/linux/s390/ldd-rewrite.sed
261     ;;
262   sparc*)
263     ldd_rewrite_script=../sysdeps/unix/sysv/linux/sparc/ldd-rewrite.sed
264     ;;
265   x86_64*)
266     ldd_rewrite_script=../sysdeps/unix/sysv/linux/x86_64/ldd-rewrite.sed
267     ;;
268   *)
269     ;;
270 esac
273 if test $host = $build; then
274   # If $prefix/include/{net,scsi} are symlinks, make install will
275   # clobber what they're linked to (probably a kernel tree).
276   # test -L ought to work on all Linux boxes.
277   if test "x$prefix" != xNONE; then
278     ac_prefix=$prefix
279   else
280     ac_prefix=$ac_default_prefix
281   fi
282   echo $ac_n "checking for symlinks in ${ac_prefix}/include""... $ac_c" 1>&6
283 echo "configure:284: checking for symlinks in ${ac_prefix}/include" >&5
284   ac_message=
285   if test -L ${ac_prefix}/include/net; then
286     ac_message="$ac_message
287    ${ac_prefix}/include/net is a symlink"
288   fi
289   if test -L ${ac_prefix}/include/scsi; then
290     ac_message="$ac_message
291    ${ac_prefix}/include/scsi is a symlink"
292   fi
293   if test -n "$ac_message"; then
294     { echo "configure: error: $ac_message
295 \`make install' will destroy the target of the link(s).
296 Delete the links and re-run configure, or better still, move the entire
297 ${ac_prefix}/include directory out of the way." 1>&2; exit 1; }
298   else
299     echo "$ac_t""ok" 1>&6
300   fi