about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/mips/configure.ac
blob: 7087a14a5efddee6f950a98b7dd3e24f58400af1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
sinclude(./aclocal.m4)dnl Autoconf lossage
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local configure fragment for sysdeps/unix/sysv/linux/mips.

AC_COMPILE_IFELSE(
  [AC_LANG_PROGRAM([
    #if (_MIPS_SIM != _ABIO32)
    #error Not O32 ABI
    #endif])],
  [libc_mips_abi=o32],
  [AC_COMPILE_IFELSE(
    [AC_LANG_PROGRAM([
      #if (_MIPS_SIM != _ABIN32)
      #error Not N32 ABI
      #endif])],
    [libc_mips_abi=n32],
    [AC_COMPILE_IFELSE(
      [AC_LANG_PROGRAM([
        #if (_MIPS_SIM != _ABI64)
        #error Not 64 ABI
        #endif])],
      [libc_mips_abi=n64],
      [])])])

if test -z "$libc_mips_abi"; then
  AC_MSG_ERROR([could not determine what ABI the compiler is using])
fi

AC_COMPILE_IFELSE(
  [AC_LANG_PROGRAM([
    #if !defined(__mips_soft_float)
    #error Not soft ABI
    #endif])],
  [libc_mips_float=soft],
  [AC_COMPILE_IFELSE(
    [AC_LANG_PROGRAM([
      #if !defined(__mips_hard_float)
      #error Not hard ABI
      #endif])],
    [libc_mips_float=hard],
    [])])

if test -z "$libc_mips_float"; then
  AC_MSG_ERROR([could not determine if compiler is using hard or soft floating point ABI])
fi

AC_CACHE_CHECK([whether the compiler is using the 2008 NaN encoding],
  libc_cv_mips_nan2008, [AC_EGREP_CPP(yes, [dnl
#ifdef __mips_nan2008
yes
#endif], libc_cv_mips_nan2008=yes, libc_cv_mips_nan2008=no)])

libc_mips_nan=
if test x"$libc_cv_mips_nan2008" = xyes; then
  libc_mips_nan=_2008
fi

LIBC_CONFIG_VAR([default-abi],
  [${libc_mips_abi}_${libc_mips_float}${libc_mips_nan}])

case "$prefix" in
/usr | /usr/)
  # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib.
  # Allow earlier configure scripts to handle libc_cv_slibdir, libdir,
  # and libc_cv_localedir.
  test -n "$libc_cv_slibdir" || \
  case $machine in
  mips/mips64/n64/* )
    libc_cv_slibdir="/lib64"
    if test "$libdir" = '${exec_prefix}/lib'; then
      libdir='${exec_prefix}/lib64';
      # Locale data can be shared between 32bit and 64bit libraries
      libc_cv_localedir='${exec_prefix}/lib/locale'
    fi
    ;;
  mips/mips64/n32/* )
    libc_cv_slibdir="/lib32"
    if test "$libdir" = '${exec_prefix}/lib'; then
      libdir='${exec_prefix}/lib32';
      # Locale data can be shared between 32bit and 64bit libraries
      libc_cv_localedir='${exec_prefix}/lib/locale'
    fi
    ;;
  *)
    libc_cv_slibdir="/lib"
    ;;
  esac
esac

libc_cv_gcc_unwind_find_fde=yes

if test -z "$arch_minimum_kernel"; then
  if test x$libc_cv_mips_nan2008 = xyes; then
    # FIXME: Adjust this setting to the actual first upstream kernel
    # version to support the 2008 NaN encoding and then remove this
    # comment.
    arch_minimum_kernel=10.0.0
  fi
fi