From 61054f0d5c2ccb945c240704fc4bfa6a708eaf46 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 27 Jul 2015 15:10:00 -0600 Subject: [PATCH] configure: add --disable-optimizations Sometimes we want to build without optimizations enabled for debugging issues, make this possible without editing the Makefile. Also fixup --disable-shm to not output a symbol until after we have initialized config-host.*. Signed-off-by: Jens Axboe --- Makefile | 6 +++++- configure | 13 ++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7fe7d4d1..24663a48 100644 --- a/Makefile +++ b/Makefile @@ -22,12 +22,16 @@ endif DEBUGFLAGS = -D_FORTIFY_SOURCE=2 -DFIO_INC_DEBUG CPPFLAGS= -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DFIO_INTERNAL $(DEBUGFLAGS) -OPTFLAGS= -O3 -g -ffast-math +OPTFLAGS= -g -ffast-math CFLAGS = -std=gnu99 -Wwrite-strings -Wall -Wdeclaration-after-statement $(OPTFLAGS) $(EXTFLAGS) $(BUILD_CFLAGS) -I. -I$(SRCDIR) LIBS += -lm $(EXTLIBS) PROGS = fio SCRIPTS = $(addprefix $(SRCDIR)/,tools/fio_generate_plots tools/plot/fio2gnuplot tools/genfio) +ifndef CONFIG_FIO_NO_OPT + CFLAGS += -O3 +endif + ifdef CONFIG_GFIO PROGS += gfio endif diff --git a/configure b/configure index 1cc54da2..4fb65e66 100755 --- a/configure +++ b/configure @@ -168,7 +168,9 @@ for opt do ;; --enable-libhdfs) libhdfs="yes" ;; - --disable-shm) output_sym "CONFIG_NO_SHM" + --disable-shm) no_shm="yes" + ;; + --disable-optimizations) disable_opt="yes" ;; --help) show_help="yes" @@ -193,6 +195,7 @@ if test "$show_help" = "yes" ; then echo "--disable-gfapi Disable gfapi" echo "--enable-libhdfs Enable hdfs support" echo "--disable-shm Disable SHM support" + echo "--disable-optimizations Don't enable compiler optimizations" exit $exit_val fi @@ -220,6 +223,14 @@ printf " '%s'" "$0" "$@" >> $config_host_mak echo >> $config_host_mak echo "CONFIG_TARGET_OS=$targetos" >> $config_host_mak +if test "$no_shm" = "yes" ; then + output_sym "CONFIG_NO_SHM" +fi + +if test "$disable_opt" = "yes" ; then + output_sym "CONFIG_FIO_NO_OPT" +fi + # Some host OSes need non-standard checks for which CPU to use. # Note that these checks are broken for cross-compilation: if you're # cross-compiling to one of these OSes then you'll need to specify -- 2.25.1