chiark / gitweb /
configure.ac: Delay checking the assembler until we know the target CPU.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 5 Jul 2017 21:08:11 +0000 (22:08 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 5 Jul 2017 21:14:20 +0000 (22:14 +0100)
It turns out that assemblers are deficient in target-specific ways, so
we have to figure out what the target is like before we can probe for
the brokenness.  Reorder things so that this is possible.  No functional
change.

configure.ac

index 32a80e0158758287bd1eb343ba9c087a4d3ed5ab..8c32c92ad8ff85cf8842a585594590283b06588c 100644 (file)
@@ -67,27 +67,9 @@ AC_DEFUN([AC_LANG_CONFTEST(CPPAS)],
 $1
 _ACEOF])
 
-AC_CACHE_CHECK(
-  [whether the assembler is likely to work], [mdw_cv_gnuish_as],
-  [AC_LANG_PUSH([CPPAS])
-   AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
-       .text
-       .L\$_test = 23
-.macro mymac
-       .L\$_test = .L\$_test + 1
-.endm
-       .globl  foo
-       .extern bar
-       mymac]])],
-     [mdw_cv_gnuish_as=yes], [mdw_cv_gnuish_as=no])
-   AC_LANG_POP([CPPAS])])
-AM_CONDITIONAL([GNUISH_AS], [test $mdw_cv_gnuish_as = yes])
-
 dnl--------------------------------------------------------------------------
 dnl Host-specific configuration.
 
-AC_MSG_CHECKING([CPU family and ABI])
-
 dnl The table of CPU families and ABIs which we might support.  Support is
 dnl not uniform: each dispatched function might or might not have an
 dnl implementation for any particular CPU/ABI combination.
@@ -108,17 +90,32 @@ m4_ifdef([catacomb_seen_abi/$3],
          [m4_undefine([catacomb_seen_abi/$3])])])
 
 dnl Identify the current host.
-if test $mdw_cv_gnuish_as = no; then
-  CPUFAM=nil ABI=nil
-else
-  case $host_cpu,$host_os in
-    m4_define([catacomb_CPU_CASE],
-      [$1) CPUFAM=$2 ABI=$3 ;;
+case $host_cpu,$host_os in
+  m4_define([catacomb_CPU_CASE],
+    [$1) CPUFAM=$2 ABI=$3 ;;
 ])
-    catacomb_CPU_FAMILIES([catacomb_CPU_CASE])
-    *) CPUFAM=nil ABI=nil ;;
-  esac
-fi
+  catacomb_CPU_FAMILIES([catacomb_CPU_CASE])
+  *) CPUFAM=nil ABI=nil ;;
+esac
+
+dnl Now check the assembler.  We may have target-specific requirements here,
+dnl so we couldn't do this any earlier.
+AC_CACHE_CHECK(
+  [whether the assembler is likely to work], [mdw_cv_gnuish_as],
+  [AC_LANG_PUSH([CPPAS])
+   AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+       .text
+       .L\$_test = 23
+.macro mymac
+       .L\$_test = .L\$_test + 1
+.endm
+       .globl  foo
+       .extern bar
+       mymac]])],
+     [mdw_cv_gnuish_as=yes], [mdw_cv_gnuish_as=no])
+   AC_LANG_POP([CPPAS])])
+AM_CONDITIONAL([GNUISH_AS], [test $mdw_cv_gnuish_as = yes])
+if test $mdw_cv_gnuish_as = no; then CPUFAM=nil ABI=nil; fi
 
 dnl A hairy macro used to set the `CPUFAM_...' and `ABI_...' variables.  We
 dnl basically need to do the same thing for the family and ABI, so it's worth
@@ -135,6 +132,9 @@ m4_define([catacomb_DEFINE_CPU_OR_ABI],
   *) AC_MSG_ERROR([BUG: unexpected $1 \`$1']) ;;
 esac])
 
+dnl Now that's out the way, we can explain what we're doing.
+AC_MSG_CHECKING([CPU family and ABI])
+
 dnl Figure out the target CPU family and ABI.
 catacomb_CPU_FAMILIES([catacomb_CLEAR_FLAGS])
 catacomb_DEFINE_CPU_OR_ABI([CPUFAM], [2], [cpu],