introduce AS_IF to replace `if test' #2

This commit is contained in:
Francesco Lannutti 2012-11-17 09:50:17 +01:00 committed by rlar
parent 8b25094231
commit 543a793a78
1 changed files with 10 additions and 16 deletions

View File

@ -198,22 +198,16 @@ AC_PROG_CC
# Set default CFLAGS - only use -Wall if we have gcc
# the above AC_PROG_CC may set CFLAGS to "-O2 -g"
if test "x$enable_debug" = xno; then
if test "x$GCC" = xyes; then
AC_MSG_WARN([Removing debugging option!])
CFLAGS="-O2 -Wall -Wextra -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs -Wold-style-definition -Wredundant-decls -Wconversion -s $ext_CFLAGS"
else
AC_MSG_WARN([Removing debugging option!])
CFLAGS="-O2 $ext_CFLAGS"
fi
else
AC_DEFINE([NGDEBUG], [1], [Compile with debug info])
if test "x$GCC" = xyes; then
CFLAGS="-g -O1 -Wall -Wextra -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs -Wold-style-definition -Wredundant-decls -Wconversion $ext_CFLAGS"
else
CFLAGS="-g $ext_CFLAGS"
fi
fi
AS_IF([test "x$enable_debug" = xno],
[AS_IF([test "x$GCC" = xyes],
[AC_MSG_WARN([Removing debugging option!])
CFLAGS="-O2 -Wall -Wextra -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs -Wold-style-definition -Wredundant-decls -Wconversion -s $ext_CFLAGS"],
[AC_MSG_WARN([Removing debugging option!])
CFLAGS="-O2 $ext_CFLAGS"])],
[AC_DEFINE([NGDEBUG], [1], [Compile with debug info])
AS_IF([test "x$GCC" = xyes],
[CFLAGS="-g -O1 -Wall -Wextra -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs -Wold-style-definition -Wredundant-decls -Wconversion $ext_CFLAGS"],
[CFLAGS="-g $ext_CFLAGS"])])
# the profiling option
if test "x$enable_gprof" = xyes; then