Add options for debug and PIE support
authorMarcel Holtmann <marcel@holtmann.org>
Sun, 13 Jan 2008 22:32:43 +0000 (23:32 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 13 Jan 2008 22:32:43 +0000 (23:32 +0100)
bootstrap-configure
configure.in

index 1da77da..2b8dc78 100755 (executable)
@@ -6,6 +6,7 @@ fi
 
 ./bootstrap && \
     ./configure --enable-maintainer-mode \
+               --enable-debug \
                --prefix=/usr \
                --mandir=/usr/share/man \
                --localstatedir=/var \
index 8f13afc..0cbb0ad 100644 (file)
@@ -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)