3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 04:32:37 +01:00

build: Make sure --disable-optimization works

acinclude.m4 still adds -O2 and various FORTIFY_SOURCE flags, even if
--disable-optimization is used during configure.  Fix that.
This commit is contained in:
Denis Kenzior 2023-06-19 15:22:52 -05:00
parent dba29c1bfb
commit 6e98d6bf13
2 changed files with 7 additions and 3 deletions

View File

@ -48,8 +48,7 @@ AC_DEFUN([AC_PROG_CC_UBSAN], [
AC_DEFUN([COMPILER_FLAGS], [
if (test "${CFLAGS}" = ""); then
CFLAGS="-Wall -O2 -fsigned-char -fno-exceptions"
CFLAGS+=" -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
CFLAGS="-Wall -fsigned-char -fno-exceptions"
fi
if (test "$USE_MAINTAINER_MODE" = "yes"); then
CFLAGS+=" -Werror -Wextra"

View File

@ -37,10 +37,15 @@ LT_INIT([disable-static])
AC_ARG_ENABLE(optimization, AS_HELP_STRING([--disable-optimization],
[disable code optimization through compiler]), [
if (test "${enableval}" = "no"); then
CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -O0"
CFLAGS="$CFLAGS -O0"
fi
])
if (test "${enable_optimization}" != "no"); then
CFLAGS="$CFLAGS -O2"
CFLAGS+=" -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
fi
AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],
[enable compiling with debugging information]), [
if (test "${enableval}" = "yes" &&