Update copyright dates with scripts/update-copyrights.
[glibc.git] / sysdeps / unix / sysv / linux / mips / configure.ac
blob5039ec969f285b44ece4e862dc351aeba161b3f3
1 sinclude(./aclocal.m4)dnl Autoconf lossage
2 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
3 # Local configure fragment for sysdeps/unix/sysv/linux/mips.
5 AC_COMPILE_IFELSE(
6   [AC_LANG_PROGRAM([
7     #if (_MIPS_SIM != _ABIO32)
8     #error Not O32 ABI
9     #endif])],
10   [libc_mips_abi=o32],
11   [AC_COMPILE_IFELSE(
12     [AC_LANG_PROGRAM([
13       #if (_MIPS_SIM != _ABIN32)
14       #error Not N32 ABI
15       #endif])],
16     [libc_mips_abi=n32],
17     [AC_COMPILE_IFELSE(
18       [AC_LANG_PROGRAM([
19         #if (_MIPS_SIM != _ABI64)
20         #error Not 64 ABI
21         #endif])],
22       [libc_mips_abi=n64],
23       [])])])
25 if test -z "$libc_mips_abi"; then
26   AC_MSG_ERROR([could not determine what ABI the compiler is using])
29 AC_COMPILE_IFELSE(
30   [AC_LANG_PROGRAM([
31     #if !defined(__mips_soft_float)
32     #error Not soft ABI
33     #endif])],
34   [libc_mips_float=soft],
35   [AC_COMPILE_IFELSE(
36     [AC_LANG_PROGRAM([
37       #if !defined(__mips_hard_float)
38       #error Not hard ABI
39       #endif])],
40     [libc_mips_float=hard],
41     [])])
43 if test -z "$libc_mips_float"; then
44   AC_MSG_ERROR([could not determine if compiler is using hard or soft floating point ABI])
47 libc_mips_o32_fp=
49 if test x"$libc_mips_abi" = xo32 -a x"$libc_mips_float" = xhard; then
50   AC_COMPILE_IFELSE(
51     [AC_LANG_PROGRAM([
52       #if !defined(__mips_fpr)
53       #error Missing FPR sizes
54       #endif])],
55     [AC_COMPILE_IFELSE(
56       [AC_LANG_PROGRAM([
57         #if (__mips_fpr != 32)
58         #error Not FP32
59         #endif])],
60       [libc_mips_o32_fp=32],
61       [AC_COMPILE_IFELSE(
62         [AC_LANG_PROGRAM([
63           #if (__mips_fpr != 0) || !defined(_MIPS_SPFPSET) || (_MIPS_SPFPSET != 16)
64           #error Not FPXX (without odd single-precision registers)
65           #endif])],
66         [libc_mips_o32_fp=xx],
67         [AC_COMPILE_IFELSE(
68           [AC_LANG_PROGRAM([
69             #if (__mips_fpr != 0)
70             #error Not FPXX (with odd single precision registers)
71             #endif])],
72           [libc_mips_o32_fp=xxo],
73           [AC_COMPILE_IFELSE(
74             [AC_LANG_PROGRAM([
75               #if (__mips_fpr != 64) || !defined(_MIPS_SPFPSET) || (_MIPS_SPFPSET != 16)
76               #error Not FP64A
77               #endif])],
78             [libc_mips_o32_fp=64a],
79             [AC_COMPILE_IFELSE(
80               [AC_LANG_PROGRAM([
81                 #if (__mips_fpr != 64)
82                 #error Not FP64
83                 #endif])],
84               [libc_mips_o32_fp=64],
85               [])])])])])],
86     [])
88 LIBC_CONFIG_VAR([o32-fpabi],[${libc_mips_o32_fp}])
90 AC_COMPILE_IFELSE(
91   [AC_LANG_PROGRAM([
92     #include <linux/prctl.h>
93     #if !defined(PR_GET_FP_MODE) || !defined(PR_SET_FP_MODE)
94     #error New prctl support for setting FP modes not found
95     #endif])],
96   [libc_mips_mode_switch=yes],
97   [libc_mips_mode_switch=no])
98 LIBC_CONFIG_VAR([mips-mode-switch],[${libc_mips_mode_switch}])
100 AC_CACHE_CHECK([whether the compiler is using the 2008 NaN encoding],
101   libc_cv_mips_nan2008, [AC_EGREP_CPP(yes, [dnl
102 #ifdef __mips_nan2008
104 #endif], libc_cv_mips_nan2008=yes, libc_cv_mips_nan2008=no)])
106 libc_mips_nan=
107 if test x"$libc_cv_mips_nan2008" = xyes; then
108   libc_mips_nan=_2008
111 LIBC_CONFIG_VAR([default-abi],
112   [${libc_mips_abi}_${libc_mips_float}${libc_mips_nan}])
114 case $machine in
115 mips/mips64/n64/*)
116   LIBC_SLIBDIR_RTLDDIR([lib64], [lib64])
117   ;;
118 mips/mips64/n32/*)
119   LIBC_SLIBDIR_RTLDDIR([lib32], [lib32])
120   ;;
121 esac
123 libc_cv_gcc_unwind_find_fde=yes
125 if test -z "$arch_minimum_kernel"; then
126   if test x$libc_cv_mips_nan2008 = xyes; then
127     # FIXME: Adjust this setting to the actual first upstream kernel
128     # version to support the 2008 NaN encoding and then remove this
129     # comment.
130     arch_minimum_kernel=10.0.0
131   fi