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