@@ -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
@@ -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)