From 5b62287f982be281c5d436b556051d09c1c348d2 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sat, 5 Dec 2015 17:56:42 +0100 Subject: [PATCH] Add a --enable-opt compile-time switch --- configure.ac | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configure.ac b/configure.ac index 303fb072..ca17614d 100644 --- a/configure.ac +++ b/configure.ac @@ -135,6 +135,14 @@ AC_ARG_ENABLE(debug, ]) ]) +AC_ARG_ENABLE(opt, +[AS_HELP_STRING(--enable-opt,Optimize for the native CPU - The resulting library will be faster but not portable)], +[ + AS_IF([test "x$enableval" = "xyes"], [ + CFLAGS="$CFLAGS -flto -march=native" + LDFLAGS="$LDFLAGS -flto -march=native"]) +]) + AC_SUBST([MAINT]) dnl Checks