aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/powerpc/preconfigure.ac
blob: 6c63bd8257b7e40a548a4de4cbb2fe26ce7d62bc (plain)
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
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
# Local preconfigure fragment for sysdeps/powerpc

case "$machine" in
powerpc64le)
  base_machine=powerpc machine=powerpc/powerpc64/le
  ;;
powerpc64*)
  base_machine=powerpc machine=powerpc/powerpc64/be
  ;;
powerpc*)
  base_machine=powerpc machine=powerpc/powerpc32
  with_fp_cond="!defined __NO_FPRS__"
  case "$host_os" in
    *gnuspe*)
      # SPE support was dropped in glibc 2.30.
      AC_MSG_ERROR([Host system type $host is no longer supported.])
    ;;
  esac
  ;;
esac

# Lets ask the compiler which Power processor we've got, in case the user did
# not choose a --with-cpu value.  Scan a trivial generated assembly program
# and scrape the first
#   .machine <machine>
# or
#   .ascii "-mcpu=<machine>"
# directive which shows up, and try using it.
case "${machine}:${submachine}" in
*powerpc*:)
  archcpu=`echo "int foo () { return 0; }" \
	   | $CC $CFLAGS $CPPFLAGS -S -frecord-gcc-switches -xc -o - - \
	   | grep -E "mcpu=|[.]machine" -m 1 \
	   | sed -e "s/.*machine //" -e "s/.*mcpu=\(.*\)\"/\1/"`
  # Note if you add patterns here you must ensure that an appropriate
  # directory exists in sysdeps/powerpc.  Likewise, if we find a
  # cpu, don't let the generic configure append extra compiler options.
  case "$archcpu" in
  405fp|440fp|464fp|476fp)
    submachine=${archcpu%fp}
    AC_CACHE_VAL(libc_cv_cc_submachine,libc_cv_cc_submachine="")
    ;;
  405|440|464|476)
    submachine=${archcpu}
    AC_CACHE_VAL(libc_cv_cc_submachine,libc_cv_cc_submachine="")
    ;;

  a2|970|power[[4-9]]|power5x|power6+|power10)
    submachine=${archcpu}
    AC_CACHE_VAL(libc_cv_cc_submachine,libc_cv_cc_submachine="")
    ;;
  *)
    # We couldn't figure it out, assume none
    ;;
  esac
  ;;
esac