From c99665ed84f4a4aa7f4d581508f8028def95d772 Mon Sep 17 00:00:00 2001 From: "James D. Mitchell" Date: Fri, 28 Feb 2020 14:04:18 +0000 Subject: [PATCH] build: add --without-march-native flag --- configure.ac | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 47ff4f632..1b52f7fc5 100644 --- a/configure.ac +++ b/configure.ac @@ -94,8 +94,16 @@ AS_IF([test "x$enable_debug" = xyes], AM_CONDITIONAL([KERNEL_DEBUG], [test "x$enable_debug" = xyes]) -AX_CHECK_COMPILE_FLAG(-march=native, - AX_APPEND_FLAG(-march=native)) +AC_ARG_WITH([march-native], + [AS_HELP_STRING([--without-march-native], + [do not use compile flag -march=native even if available])] + ) + +AS_IF([test "x$with_march_native" == "xno" ], + [AC_MSG_NOTICE([the compile flag -march=native will not be used even if available])]) + +AS_IF([test "x$with_march_native" != "xno"], + [AX_CHECK_COMPILE_FLAG(-march=native, AX_APPEND_FLAG(-march=native))]) dnl ## dnl ## Output everything