aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/m4/configure.m4
diff options
context:
space:
mode:
Diffstat (limited to 'platform/linux-generic/m4/configure.m4')
-rw-r--r--platform/linux-generic/m4/configure.m4155
1 files changed, 78 insertions, 77 deletions
diff --git a/platform/linux-generic/m4/configure.m4 b/platform/linux-generic/m4/configure.m4
index 8e008de44..d662ecfcd 100644
--- a/platform/linux-generic/m4/configure.m4
+++ b/platform/linux-generic/m4/configure.m4
@@ -1,86 +1,87 @@
-# Enable -fvisibility=hidden if using a gcc that supports it
-OLD_CFLAGS="$CFLAGS"
-AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
-VISIBILITY_CFLAGS="-fvisibility=hidden"
-CFLAGS="$CFLAGS $VISIBILITY_CFLAGS"
-AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
- [VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]);
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2014 Linaro Limited
+#
-AC_SUBST(VISIBILITY_CFLAGS)
-# Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed.
-CFLAGS=$OLD_CFLAGS
+ODP_IMPLEMENTATION_NAME="odp-linux"
+ODP_LIB_NAME="odp-linux"
-AC_MSG_CHECKING(for GCC atomic builtins)
-AC_LINK_IFELSE(
- [AC_LANG_SOURCE(
- [[int main() {
- int v = 1;
- __atomic_fetch_add(&v, 1, __ATOMIC_RELAXED);
- __atomic_fetch_sub(&v, 1, __ATOMIC_RELAXED);
- __atomic_store_n(&v, 1, __ATOMIC_RELAXED);
- __atomic_load_n(&v, __ATOMIC_RELAXED);
- return 0;
- }
- ]])],
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no)
- echo "GCC-style __atomic builtins not supported by the compiler."
- echo "Use newer version. For gcc > 4.7.0"
- exit -1)
+ODP_VISIBILITY
+ODP_ATOMIC
-dnl Check whether -latomic is needed
-use_libatomic=no
-
-AC_MSG_CHECKING(whether -latomic is needed for 64-bit atomic built-ins)
-AC_LINK_IFELSE(
- [AC_LANG_SOURCE([[
- #include <stdint.h>
- static uint64_t loc;
- int main(void)
- {
- uint64_t prev = __atomic_exchange_n(&loc, 7, __ATOMIC_RELAXED);
- return 0;
- }
- ]])],
- [AC_MSG_RESULT(no)],
- [AC_MSG_RESULT(yes)
- AC_CHECK_LIB(
- [atomic], [__atomic_exchange_8],
- [use_libatomic=yes],
- [AC_MSG_FAILURE([__atomic_exchange_8 is not available])])
- ])
-
-AC_MSG_CHECKING(whether -latomic is needed for 128-bit atomic built-ins)
-AC_LINK_IFELSE(
- [AC_LANG_SOURCE([[
- static __int128 loc;
- int main(void)
- {
- __int128 prev;
- prev = __atomic_exchange_n(&loc, 7, __ATOMIC_RELAXED);
- return 0;
- }
- ]])],
- [AC_MSG_RESULT(no)],
- [AC_MSG_RESULT(yes)
- AC_CHECK_LIB(
- [atomic], [__atomic_exchange_16],
- [use_libatomic=yes],
- [AC_MSG_CHECKING([cannot detect support for 128-bit atomics])])
- ])
+ODP_PTHREAD
+ODP_TIMER
+m4_include([platform/linux-generic/m4/odp_cpu.m4])
+m4_include([platform/linux-generic/m4/odp_event_validation.m4])
+m4_include([platform/linux-generic/m4/odp_pcap.m4])
+m4_include([platform/linux-generic/m4/odp_scheduler.m4])
-if test "x$use_libatomic" = "xyes"; then
- ATOMIC_LIBS="-latomic"
-fi
-AC_SUBST([ATOMIC_LIBS])
+AC_ARG_WITH([pcap],
+ [AS_HELP_STRING([--without-pcap],
+ [compile without PCAP [default=with] (linux-generic)])],
+ [],
+ [with_pcap=yes])
+have_pcap=no
+AS_IF([test "x$with_pcap" != xno],
+ [ODP_PCAP([with_pcap=yes]‚[with_pcap=no])])
+AC_CONFIG_COMMANDS_PRE([dnl
+AM_CONDITIONAL([ODP_PKTIO_PCAP], [test x$have_pcap = xyes])
+])
-m4_include([platform/linux-generic/m4/odp_pthread.m4])
-m4_include([platform/linux-generic/m4/odp_timer.m4])
+m4_include([platform/linux-generic/m4/odp_libconfig.m4])
m4_include([platform/linux-generic/m4/odp_openssl.m4])
-m4_include([platform/linux-generic/m4/odp_pcap.m4])
-m4_include([platform/linux-generic/m4/odp_netmap.m4])
+m4_include([platform/linux-generic/m4/odp_crypto.m4])
+m4_include([platform/linux-generic/m4/odp_ipsec_mb.m4])
+m4_include([platform/linux-generic/m4/odp_pcapng.m4])
m4_include([platform/linux-generic/m4/odp_dpdk.m4])
-m4_include([platform/linux-generic/m4/odp_schedule.m4])
+m4_include([platform/linux-generic/m4/odp_wfe.m4])
+m4_include([platform/linux-generic/m4/odp_xdp.m4])
+m4_include([platform/linux-generic/m4/odp_ml.m4])
+ODP_EVENT_VALIDATION
+ODP_SCHEDULER
+
+AS_VAR_APPEND([PLAT_DEP_LIBS], ["${ATOMIC_LIBS} ${AARCH64CRYPTO_LIBS} ${LIBCONFIG_LIBS} ${OPENSSL_LIBS} ${IPSEC_MB_LIBS} ${DPDK_LIBS_LT} ${LIBCLI_LIBS} ${LIBXDP_LIBS} ${ORT_LIBS}"])
+
+# Add text to the end of configure with platform specific settings.
+# Make sure it's aligned same as other lines in configure.ac.
+AS_VAR_APPEND([PLAT_CFG_TEXT], ["
+ event_validation: ${enable_event_validation}
+ openssl: ${with_openssl}
+ openssl_rand: ${openssl_rand}
+ crypto: ${with_crypto}
+ pcap: ${have_pcap}
+ pcapng: ${have_pcapng}
+ wfe_locks: ${use_wfe_locks}
+ ml_support: ${ml_support}
+ default_config_path: ${default_config_path}"])
+
+# Ignore Clang specific errors about fields with variable sized type not at the
+# end of a struct. This style is used by e.g. odp_packet_hdr_t and
+# odp_timeout_hdr_t.
+ODP_CHECK_CFLAG([-Wno-error=gnu-variable-sized-type-not-at-end])
+AC_CONFIG_COMMANDS_PRE([dnl
+AM_CONDITIONAL([PLATFORM_IS_LINUX_GENERIC],
+ [test "${with_platform}" = "linux-generic"])
AC_CONFIG_FILES([platform/linux-generic/Makefile
- platform/linux-generic/include/odp/api/plat/static_inline.h])
+ platform/linux-generic/libodp-linux.pc
+ platform/linux-generic/dumpconfig/Makefile
+ platform/linux-generic/example/Makefile
+ platform/linux-generic/example/ml/Makefile
+ platform/linux-generic/test/Makefile
+ platform/linux-generic/test/example/Makefile
+ platform/linux-generic/test/example/classifier/Makefile
+ platform/linux-generic/test/example/ipsec_api/Makefile
+ platform/linux-generic/test/example/ipsec_crypto/Makefile
+ platform/linux-generic/test/example/l2fwd_simple/Makefile
+ platform/linux-generic/test/example/l3fwd/Makefile
+ platform/linux-generic/test/example/packet/Makefile
+ platform/linux-generic/test/example/ping/Makefile
+ platform/linux-generic/test/example/simple_pipeline/Makefile
+ platform/linux-generic/test/example/switch/Makefile
+ platform/linux-generic/test/validation/api/shmem/Makefile
+ platform/linux-generic/test/validation/api/pktio/Makefile
+ platform/linux-generic/test/validation/api/ml/Makefile
+ platform/linux-generic/test/performance/Makefile
+ platform/linux-generic/test/performance/dmafwd/Makefile
+ platform/linux-generic/test/pktio_ipc/Makefile])
+])