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