From ad27f03a497c3809fac7b0dd392dc71eda1a13f7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 16 Jul 2014 02:10:15 +0200 Subject: [PATCH] build: Add debug options to configure --- bootstrap-configure | 1 + configure.ac | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/bootstrap-configure b/bootstrap-configure index eed3ebc2..7d35d712 100755 --- a/bootstrap-configure +++ b/bootstrap-configure @@ -6,4 +6,5 @@ fi ./bootstrap && \ ./configure --enable-maintainer-mode \ + --enable-debug \ --prefix=/usr $* diff --git a/configure.ac b/configure.ac index 320ba81f..1995b1b0 100644 --- a/configure.ac +++ b/configure.ac @@ -27,6 +27,30 @@ AC_PROG_LN_S LT_PREREQ(2.2) LT_INIT([disable-static]) +AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization], + [disable code optimization through compiler]), [ + if (test "${enableval}" = "no"); then + CFLAGS="$CFLAGS -O0" + fi +]) + +AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], + [enable compiling with debugging information]), [ + if (test "${enableval}" = "yes" && + test "${ac_cv_prog_cc_g}" = "yes"); then + CFLAGS="$CFLAGS -g" + fi +]) + +AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie], + [enable position independent executables flag]), [ + if (test "${enableval}" = "yes" && + test "${ac_cv_prog_cc_pie}" = "yes"); then + CFLAGS="$CFLAGS -fPIE" + LDFLAGS="$LDFLAGS -pie" + fi +]) + AC_CONFIG_FILES(Makefile) AC_OUTPUT