Message ID | 20250923122006.12212-1-gert@greenie.muc.de |
---|---|
State | New |
Headers | show |
Series | [Openvpn-devel,v2] configure.ac: Make ACL_CHECK_ADD_COMPILE_FLAGS append instead of prepend | expand |
So, as discussed on IRC, this is not really intended to "change anything noticeable" - but when working on adding CFLAGS and generally autoconf related, it helps when "add this to CFLAGS" does not "it will show up in front" (because your mental model expects this "at the end"). Tested, -W arguments and -g/-O2/-std=c11 are in reverse order, everything else is the same. Your patch has been applied to the master branch. commit 9bfd4d246c50743c8ff9cdb72afc8741eab91f03 Author: Frank Lichtenheld Date: Tue Sep 23 14:20:00 2025 +0200 configure.ac: Make ACL_CHECK_ADD_COMPILE_FLAGS append instead of prepend Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com> Acked-by: Gert Doering <gert@greenie.muc.de> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1204 Message-Id: <20250923122006.12212-1-gert@greenie.muc.de> URL: https://sourceforge.net/p/openvpn/mailman/message/59237450/ Signed-off-by: Gert Doering <gert@greenie.muc.de> -- kind regards, Gert Doering
diff --git a/configure.ac b/configure.ac index a5485b0..c2feeea 100644 --- a/configure.ac +++ b/configure.ac @@ -1388,9 +1388,9 @@ # required for gcc, but some compilers such as clang need it. AC_DEFUN([ACL_CHECK_ADD_COMPILE_FLAGS], [ old_cflags="$CFLAGS" - CFLAGS="$1 -Werror $CFLAGS" + CFLAGS="-Werror $CFLAGS $1" AC_MSG_CHECKING([whether the compiler accepts $1]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [AC_MSG_RESULT([yes])]; CFLAGS="$1 $old_cflags", + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [AC_MSG_RESULT([yes])]; CFLAGS="$old_cflags $1", [AC_MSG_RESULT([no]); CFLAGS="$old_cflags"])] )