Permalink
Browse files

BUILD: Allow forcing optimisation level at configuration time

  • Loading branch information...
csnover authored and ccawley2011 committed Dec 20, 2017
1 parent 6396f73 commit 1ca9763d8a8059bdc1ab4e2dcb9e000bf5822023
Showing with 12 additions and 6 deletions.
  1. +12 −6 configure
@@ -988,6 +988,7 @@ Optional Features:
optimizations)
--enable-release-mode enable building in release mode (without optimizations)
--enable-optimizations enable optimizations
--enable-optimizations=FLAG enable a specific optimization level (e.g. -O2)
--enable-profiling enable profiling
--enable-plugins enable the support for dynamic plugins
--default-dynamic make plugins dynamic by default
@@ -1355,6 +1356,11 @@ for ac_option in $@; do
--disable-optimizations)
_optimizations=no
;;
--enable-optimizations=*)
arg=`echo $ac_option | cut -d '=' -f 2`
_optimizations=yes
_optimization_level=$arg
;;
--enable-profiling)
_enable_prof=yes
;;
@@ -3724,16 +3730,16 @@ if test "$_optimizations" = yes ; then
# cache misses are minimized by keeping the code small as well.
cc_check_no_clean -Os && _optimization_level=-Os || _optimization_level=-O2
echo_n -- "$_optimization_level"

if cc_check_no_clean $_optimization_level -ftree-vectorize; then
echo_n " with auto-vectorization"
append_var CXXFLAGS "-ftree-vectorize"
fi
else
echo_n -- "$_optimization_level (forced)"
fi
append_var CXXFLAGS "$_optimization_level"

if cc_check_no_clean $_optimization_level -ftree-vectorize; then
echo_n " with auto-vectorization"
append_var CXXFLAGS "-ftree-vectorize"
fi
echo ""
append_var CXXFLAGS "$_optimization_level"

# Enabling optimizations also makes it possible to use -Wuninitialized, so
# let's do that.

0 comments on commit 1ca9763

Please sign in to comment.