From 7677b1bdb5df04b2e780d1bacf76f9de3f64d478 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 13 Jan 2008 23:32:43 +0100 Subject: [PATCH] Add options for debug and PIE support --- bootstrap-configure | 1 + configure.in | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/bootstrap-configure b/bootstrap-configure index 1da77da..2b8dc78 100755 --- a/bootstrap-configure +++ b/bootstrap-configure @@ -6,6 +6,7 @@ fi ./bootstrap && \ ./configure --enable-maintainer-mode \ + --enable-debug \ --prefix=/usr \ --mandir=/usr/share/man \ --localstatedir=/var \ diff --git a/configure.in b/configure.in index 8f13afc..0cbb0ad 100644 --- a/configure.in +++ b/configure.in @@ -9,7 +9,7 @@ AM_MAINTAINER_MODE AC_PREFIX_DEFAULT(/usr/local) if (test "${CFLAGS}" = ""); then - CFLAGS="-Wall -O2" + CFLAGS="-Wall -O2 -D_FORTIFY_SOURCE=2" fi AC_LANG_C @@ -24,6 +24,23 @@ m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])]) AC_DISABLE_STATIC AC_PROG_LIBTOOL +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 +]) + PKG_CHECK_MODULES(GMODULE, gmodule-2.0, dummy=yes, AC_MSG_ERROR(gmodule is required)) AC_SUBST(GMODULE_CFLAGS) -- 2.7.4