LT_INIT
# SIZE_MAX is missing without this
-CXXFLAGS="$CXXFLAGS -D__STDC_LIMIT_MACROS"
+AM_CXXFLAGS="$AM_CXXFLAGS -D__STDC_LIMIT_MACROS"
# Use the first x.y.z numbers of the version. Also allow x.y numbering.
AS_IF([echo "$PACKAGE_VERSION" | grep '^[[0-9]]*\.[[0-9]]*\.[[0-9]]'], [
AC_SUBST(SETTING_FILES)
AC_SUBST(SETTING_LINKED_FILES)
-CFLAGS="$CFLAGS $EXTRA_CFLAGS"
-CXXFLAGS="$CXXFLAGS $EXTRA_CFLAGS"
+AM_CFLAGS="$AM_CFLAGS $EXTRA_CFLAGS"
+AM_CXXFLAGS="$AM_CXXFLAGS $EXTRA_CFLAGS"
+AC_SUBST([AM_CFLAGS])
+AC_SUBST([AM_CXXFLAGS])
BINARY_LDFLAGS="$PIE_LDFLAGS $RELRO_LDFLAGS"
BINARY_CFLAGS="$PIE_CFLAGS"
if test "$not_userdb" != ""; then
echo " :$not_userdb"
fi
-echo "CFLAGS ......... : $CFLAGS"
+echo "AM_CFLAGS ...... : $AM_CFLAGS"
if test "$systemdsystemunitdir" != ""; then
echo "SYSTEMD ........ : $systemdservicetype - $systemdsystemunitdir/dovecot.service";
case "$host" in
*)
gl_COMPILER_OPTION_IF([-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2], [
- CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
+ AM_CFLAGS="$AM_CFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
],
[],
[AC_LANG_PROGRAM()]
CFLAGS="-std=$mystd"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()
], [
- CFLAGS="$CFLAGS $old_cflags"
+ AM_CFLAGS="$AM_CFLAGS $CFLAGS"
std=$mystd
break
- ], [
- CFLAGS="$old_cflags"
])
done
AC_MSG_RESULT($std)
+ CFLAGS="$old_cflags"
AS_IF([test "x$ac_cv_c_compiler_gnu" = "xyes"], [
dnl -Wcast-qual -Wcast-align -Wconversion -Wunreachable-code # too many warnings
dnl -Wstrict-prototypes -Wredundant-decls # may give warnings in some systems
dnl -Wmissing-format-attribute -Wmissing-noreturn -Wwrite-strings # a couple of warnings
- CFLAGS="$CFLAGS -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast"
+ AM_CFLAGS="$AM_CFLAGS -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast"
AS_IF([test "$have_clang" = "yes"], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#endif
]], [[]])],[],[
dnl clang 3.3+ unfortunately this gives warnings with hash.h
- CFLAGS="$CFLAGS -Wno-duplicate-decl-specifier"
+ AM_CFLAGS="$AM_CFLAGS -Wno-duplicate-decl-specifier"
])
], [
dnl This is simply to avoid warning when building strftime() wrappers..
- CFLAGS="$CFLAGS -fno-builtin-strftime"
+ AM_CFLAGS="$AM_CFLAGS -fno-builtin-strftime"
])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#endif
]], [[]])],[
dnl gcc4
- CFLAGS="$CFLAGS -Wstrict-aliasing=2"
+ AM_CFLAGS="$AM_CFLAGS -Wstrict-aliasing=2"
],[])
])
])
case "$host" in
*)
gl_COMPILER_OPTION_IF([-mfunction-return=$with_retpoline],
- [CFLAGS="$CFLAGS -mfunction-return=$with_retpoline"],
+ [AM_CFLAGS="$AM_CFLAGS -mfunction-return=$with_retpoline"],
[],
[AC_LANG_PROGRAM()]
)
gl_COMPILER_OPTION_IF([-mindirect-branch=$with_retpoline], [
- CFLAGS="$CFLAGS -mindirect-branch=$with_retpoline"
+ AM_CFLAGS="$AM_CFLAGS -mindirect-branch=$with_retpoline"
],
[],
[AC_LANG_PROGRAM()]
case "$host" in
*)
gl_COMPILER_OPTION_IF([-fstack-protector-strong], [
- CFLAGS="$CFLAGS -fstack-protector-strong"
+ AM_CFLAGS="$AM_CFLAGS -fstack-protector-strong"
],
[
gl_COMPILER_OPTION_IF([-fstack-protector], [
- CFLAGS="$CFLAGS -fstack-protector"
+ AM_CFLAGS="$AM_CFLAGS -fstack-protector"
], [], [AC_LANG_PROGRAM()])
],
[AC_LANG_PROGRAM()]
with_fuzzer=$withval,
with_fuzzer=no)
AS_IF([test x$with_fuzzer = xclang], [
- CFLAGS="$CFLAGS -fsanitize=fuzzer-no-link"
+ AM_CFLAGS="$AM_CFLAGS -fsanitize=fuzzer-no-link"
# use $LIB_FUZZING_ENGINE for linking if it exists
FUZZER_LDFLAGS=${LIB_FUZZING_ENGINE--fsanitize=fuzzer}
# May need to use CXXLINK for linking, which wants sources to