build: Add debug options to configure

This commit is contained in:
Marcel Holtmann 2014-07-16 02:10:15 +02:00
parent eedadd860b
commit ad27f03a49
2 changed files with 25 additions and 0 deletions

View File

@ -6,4 +6,5 @@ fi
./bootstrap && \
./configure --enable-maintainer-mode \
--enable-debug \
--prefix=/usr $*

View File

@ -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