Skip to content

Commit

Permalink
Append instead of Prepend user-CFLAGS to default CFLAGS allowing the …
Browse files Browse the repository at this point in the history
…user to override default variables
  • Loading branch information
jonasnick committed Jan 5, 2020
1 parent 613c34c commit ecba813
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ case $host_os in
;;
esac

CFLAGS="$CFLAGS -W"
CFLAGS="-W $CFLAGS"

warn_CFLAGS="-std=c89 -pedantic -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wno-unused-function -Wno-long-long -Wno-overlength-strings"
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $warn_CFLAGS"
CFLAGS="$warn_CFLAGS $CFLAGS"
AC_MSG_CHECKING([if ${CC} supports ${warn_CFLAGS}])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[char foo;]])],
[ AC_MSG_RESULT([yes]) ],
Expand All @@ -72,7 +72,7 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[char foo;]])],
])

saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fvisibility=hidden"
CFLAGS="-fvisibility=hidden $CFLAGS"
AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[char foo;]])],
[ AC_MSG_RESULT([yes]) ],
Expand Down Expand Up @@ -173,10 +173,10 @@ AC_CHECK_TYPES([__int128])

if test x"$enable_coverage" = x"yes"; then
AC_DEFINE(COVERAGE, 1, [Define this symbol to compile out all VERIFY code])
CFLAGS="$CFLAGS -O0 --coverage"
LDFLAGS="$LDFLAGS --coverage"
CFLAGS="-O0 --coverage $CFLAGS"
LDFLAGS="--coverage $LDFLAGS"
else
CFLAGS="$CFLAGS -O3"
CFLAGS="-O3 $CFLAGS"
fi

if test x"$use_ecmult_static_precomputation" != x"no"; then
Expand All @@ -194,7 +194,7 @@ if test x"$use_ecmult_static_precomputation" != x"no"; then

warn_CFLAGS_FOR_BUILD="-Wall -Wextra -Wno-unused-function"
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $warn_CFLAGS_FOR_BUILD"
CFLAGS="$warn_CFLAGS_FOR_BUILD $CFLAGS"
AC_MSG_CHECKING([if native ${CC_FOR_BUILD} supports ${warn_CFLAGS_FOR_BUILD}])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[char foo;]])],
[ AC_MSG_RESULT([yes]) ],
Expand Down

0 comments on commit ecba813

Please sign in to comment.