[v5,3/4] configure: support compiling with no arch optimizations

Message ID 1505739611-19678-4-git-send-email-odpbot@yandex.ru
State New
Headers show
Series
  • [v5,1/4] linux-gen: split arm into arm and aarch64
Related show

Commit Message

Github ODP bot Sept. 18, 2017, 1 p.m.
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 163 (lumag:improve-build-4)
 ** https://github.com/Linaro/odp/pull/163
 ** Patch: https://github.com/Linaro/odp/pull/163.patch
 ** Base sha: e1c46f8e296a730ed27141a33189185bb7dfd1b1
 ** Merge commit sha: a232c0012683b33d1a12d67ce30127ac78ba57e0
 **/
 configure.ac                       | 68 +++++++++++++++++---------------------
 platform/linux-generic/Makefile.am |  8 ++++-
 2 files changed, 38 insertions(+), 38 deletions(-)

Patch

diff --git a/configure.ac b/configure.ac
index 99bee092f..bea8f4dfd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -104,45 +104,44 @@  AX_VALGRIND_CHECK
 ##########################################################################
 # Which architecture optimizations will we use
 ##########################################################################
-AS_CASE([$host],
-  [x86*], [ARCH_DIR=x86],
-  [i686*], [ARCH_DIR=x86],
-  [mips64*], [ARCH_DIR=mips64],
-  [powerpc*], [ARCH_DIR=powerpc],
-  [aarch64*], [ARCH_DIR=aarch64],
-  [arm*], [ARCH_DIR=arm],
-  [ARCH_DIR=undefined]
-)
+AC_ARG_WITH([arch-default],
+	    [AS_HELP_STRING([with-arch-default], [use generic arch files])],
+	    [ARCH_DIR=default
+	     ARCH_ABI=default],
+[AS_CASE([$host],
+  [x86*], [ARCH_DIR=x86
+	   ARCH_ABI=x86_64-linux],
+  [i686*], [ARCH_DIR=x86
+	    ARCH_ABI=x86_32-linux],
+  [mips64*], [ARCH_DIR=mips64
+	      ARCH_ABI=mips64-linux],
+  [powerpc*], [ARCH_DIR=powerpc
+	       ARCH_ABI=power64-linux],
+  [aarch64*], [ARCH_DIR=aarch64
+	       ARCH_ABI=arm64-linux],
+  [arm*], [ARCH_DIR=arm
+	   ARCH_ABI=arm32-linux],
+  [ARCH_DIR=undefined
+   ARCH_ABI=undefined]
+)])
 AC_SUBST([ARCH_DIR])
+AC_SUBST([ARCH_ABI])
 
 ##########################################################################
 # Warn on the defaults if arch is undefined
 ##########################################################################
-if test "${ARCH_DIR}" = "undefined";
-then
-    echo "ARCH_DIR is undefined, please add your ARCH_DIR based on host=${host}"
-    exit 1
-fi
+AS_IF([test "${ARCH_DIR}" = "undefined"],
+      [AC_MSG_ERROR([ARCH_DIR is undefined, please add your ARCH_DIR based on host=${host}])])
 
-##########################################################################
-# Architecture for ABI support
-##########################################################################
-AS_CASE([$host],
-  [x86*],     [ARCH_ABI=x86_64-linux],
-  [i686*],    [ARCH_ABI=x86_32-linux],
-  [mips64*],  [ARCH_ABI=mips64-linux],
-  [powerpc*], [ARCH_ABI=power64-linux],
-  [aarch64*], [ARCH_ABI=arm64-linux],
-  [arm*],     [ARCH_ABI=arm32-linux],
-  [ARCH_ABI=undefined]
-)
-AC_SUBST([ARCH_ABI])
+AS_IF([test "${ARCH_ABI}" = "undefined"],
+      [AC_MSG_ERROR([ARCH_ABI is undefined, please add your ARCH_ABI based on host=${host}])])
 
-if test "${ARCH_ABI}" = "undefined";
-then
-    echo "ARCH_ABI is undefined, please add your ARCH_ABI based on host=${host}"
-    exit 1
-fi
+AM_CONDITIONAL([ARCH_IS_DEFAULT], [test "x${ARCH_DIR}" = "xdefault"])
+AM_CONDITIONAL([ARCH_IS_ARM], [test "x${ARCH_DIR}" = "xarm"])
+AM_CONDITIONAL([ARCH_IS_AARCH64], [test "x${ARCH_DIR}" = "xaarch64"])
+AM_CONDITIONAL([ARCH_IS_MIPS64], [test "x${ARCH_DIR}" = "xmips64"])
+AM_CONDITIONAL([ARCH_IS_POWERPC], [test "x${ARCH_DIR}" = "xpowerpc"])
+AM_CONDITIONAL([ARCH_IS_X86], [test "x${ARCH_DIR}" = "xx86"])
 
 ##########################################################################
 # Set correct pkgconfig version
@@ -219,11 +218,6 @@  AM_CONDITIONAL([HAVE_DOXYGEN], [test "x${DOXYGEN}" = "xdoxygen"])
 AM_CONDITIONAL([user_guide], [test "x${user_guides}" = "xyes" ])
 AM_CONDITIONAL([HAVE_MSCGEN], [test "x${MSCGEN}" = "xmscgen"])
 AM_CONDITIONAL([helper_linux], [test x$helper_linux = xyes ])
-AM_CONDITIONAL([ARCH_IS_ARM], [test "x${ARCH_DIR}" = "xarm"])
-AM_CONDITIONAL([ARCH_IS_AARCH64], [test "x${ARCH_DIR}" = "xaarch64"])
-AM_CONDITIONAL([ARCH_IS_MIPS64], [test "x${ARCH_DIR}" = "xmips64"])
-AM_CONDITIONAL([ARCH_IS_POWERPC], [test "x${ARCH_DIR}" = "xpowerpc"])
-AM_CONDITIONAL([ARCH_IS_X86], [test "x${ARCH_DIR}" = "xx86"])
 
 ##########################################################################
 # Setup doxygen documentation
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
index 0ebb6f76c..753885208 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -259,7 +259,13 @@  arch_odp_headers = $(srcdir)/arch/x86/odp/api/cpu_arch.h
 noinst_HEADERS += $(srcdir)/arch/x86/cpu_flags.h
 endif
 
-noinst_HEADERS += $(srcdir)/arch/default/odp/api/cpu_arch.h
+if ARCH_IS_DEFAULT
+__LIB__libodp_linux_la_SOURCES += arch/default/odp_cpu_arch.c \
+				  arch/default/odp_cpu_cycles.c \
+				  arch/default/odp_global_time.c \
+				  arch/default/odp_sysinfo_parse.c
+arch_odp_headers = $(srcdir)/arch/default/odp/api/cpu_arch.h
+endif
 
 odpapiinclude_HEADERS += $(arch_odp_headers)