[Mesa-dev] [PATCH 4/7] configure.ac: Introduce HAVE_ARM_ASM/HAVE_AARCH64_ASM and the -D flags.

Eric Anholt eric at anholt.net
Tue Aug 8 20:19:49 UTC 2017


I've been trying to get away without these conditionals in vc4, but it
meant compiling extra unused code on x86, and build failing on ARMv6.
---
 Android.common.mk |  8 ++++++++
 configure.ac      | 24 ++++++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/Android.common.mk b/Android.common.mk
index 6bd30816bc41..435e3da40a5f 100644
--- a/Android.common.mk
+++ b/Android.common.mk
@@ -87,6 +87,14 @@ LOCAL_CFLAGS += \
 	-DUSE_X86_ASM
 
 endif
+ifeq ($(TARGET_ARCH),arm)
+LOCAL_CFLAGS += \
+	-DUSE_ARM_ASM
+endif
+ifeq ($(TARGET_ARCH),aarch64)
+LOCAL_CFLAGS += \
+	-DUSE_AARCH64_ASM
+endif
 endif
 
 ifneq ($(LOCAL_IS_HOST_MODULE),true)
diff --git a/configure.ac b/configure.ac
index 5b12dd8506a5..d4f36898ba5b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -773,6 +773,20 @@ if test "x$enable_asm" = xyes; then
             ;;
         esac
         ;;
+    aarch64)
+        case "$host_os" in
+        linux*)
+            asm_arch=aarch64
+            ;;
+        esac
+        ;;
+    arm)
+        case "$host_os" in
+        linux*)
+            asm_arch=arm
+            ;;
+        esac
+        ;;
     esac
 
     case "$asm_arch" in
@@ -792,6 +806,14 @@ if test "x$enable_asm" = xyes; then
         DEFINES="$DEFINES -DUSE_PPC64LE_ASM"
         AC_MSG_RESULT([yes, ppc64le])
         ;;
+    aarch64)
+        DEFINES="$DEFINES -DUSE_AARCH64_ASM"
+        AC_MSG_RESULT([yes, aarch64])
+        ;;
+    arm)
+        DEFINES="$DEFINES -DUSE_ARM_ASM"
+        AC_MSG_RESULT([yes, arm])
+        ;;
     *)
         AC_MSG_RESULT([no, platform not supported])
         ;;
@@ -2729,6 +2751,8 @@ AM_CONDITIONAL(HAVE_X86_ASM, test "x$asm_arch" = xx86 -o "x$asm_arch" = xx86_64)
 AM_CONDITIONAL(HAVE_X86_64_ASM, test "x$asm_arch" = xx86_64)
 AM_CONDITIONAL(HAVE_SPARC_ASM, test "x$asm_arch" = xsparc)
 AM_CONDITIONAL(HAVE_PPC64LE_ASM, test "x$asm_arch" = xppc64le)
+AM_CONDITIONAL(HAVE_AARCH64_ASM, test "x$asm_arch" = xaarch64)
+AM_CONDITIONAL(HAVE_ARM_ASM, test "x$asm_arch" = xarm)
 
 AC_SUBST([NINE_MAJOR], 1)
 AC_SUBST([NINE_MINOR], 0)
-- 
2.13.3



More information about the mesa-dev mailing list