4 dnl Check for MIPS/IRIX ABI flags. Sets $abi and $abilibdirext to some
7 AC_DEFUN([AC_MIPS_ABI], [
9 AC_HELP_STRING([--with-mips-abi=abi],[ABI to use for IRIX (32, n32, or 64)]))
13 with_mips_abi="${with_mips_abi:-yes}"
14 if test -n "$GCC"; then
16 # GCC < 2.8 only supports the O32 ABI. GCC >= 2.8 has a flag to select
17 # which ABI to use, but only supports (as of 2.8.1) the N32 and 64 ABIs.
19 # Default to N32, but if GCC doesn't grok -mabi=n32, we assume an old
20 # GCC and revert back to O32. The same goes if O32 is asked for - old
21 # GCCs doesn't like the -mabi option, and new GCCs can't output O32.
23 # Don't you just love *all* the different SGI ABIs?
25 case "${with_mips_abi}" in
26 32|o32) abi='-mabi=32'; abilibdirext='' ;;
27 n32|yes) abi='-mabi=n32'; abilibdirext='32' ;;
28 64) abi='-mabi=64'; abilibdirext='64' ;;
29 no) abi=''; abilibdirext='';;
30 *) AC_MSG_ERROR("Invalid ABI specified") ;;
32 if test -n "$abi" ; then
33 ac_foo=krb_cv_gcc_`echo $abi | tr =- __`
35 dnl can't use AC_CACHE_CHECK here, since it doesn't quote CACHE-ID to
38 AC_MSG_CHECKING([if $CC supports the $abi option])
39 AC_CACHE_VAL($ac_foo, [
42 AC_TRY_COMPILE(,int x;, eval $ac_foo=yes, eval $ac_foo=no)
45 ac_res=`eval echo \\\$$ac_foo`
46 AC_MSG_RESULT($ac_res)
47 if test $ac_res = no; then
48 # Try to figure out why that failed...
52 CFLAGS="$CFLAGS -mabi=n32"
53 AC_TRY_COMPILE(,int x;, ac_res=yes, ac_res=no)
55 if test $ac_res = yes; then
57 AC_MSG_ERROR([$CC does not support the $with_mips_abi ABI])
64 if test $with_mips_abi = yes; then
65 # Old GCC, default to O32
70 AC_MSG_ERROR([$CC does not support the $with_mips_abi ABI])
74 fi #if test $ac_res = no; then
75 fi #if test -n "$abi" ; then
77 case "${with_mips_abi}" in
78 32|o32) abi='-32'; abilibdirext='' ;;
79 n32|yes) abi='-n32'; abilibdirext='32' ;;
80 64) abi='-64'; abilibdirext='64' ;;
81 no) abi=''; abilibdirext='';;
82 *) AC_MSG_ERROR("Invalid ABI specified") ;;
84 fi #if test -n "$GCC"; then