aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal H. Walfield <[email protected]>2015-12-17 11:49:06 +0000
committerNeal H. Walfield <[email protected]>2015-12-22 14:03:50 +0000
commit02eb9fc9d5863abcfed6af704e618f8cac7cc2e8 (patch)
tree676f3230d08afcc53506bdc5fbcab2d53c6ced87
parentgpg: Suppress a warning. (diff)
downloadgnupg-02eb9fc9d5863abcfed6af704e618f8cac7cc2e8.tar.gz
gnupg-02eb9fc9d5863abcfed6af704e618f8cac7cc2e8.zip
Only add the user supplied CFLAGS after running any autoconf tests.
* configure.ac: Only add the user supplied CFLAGS after running any autoconf tests. -- Signed-off-by: Neal H. Walfield <[email protected]> If the user's CFLAGS include -Werror, then some configure tests fail. To avoid this, we only add the user's CFLAGS after all of the configure tests have run.
-rw-r--r--configure.ac12
1 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 77487b23c..266eae5bf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,6 +85,13 @@ AB_INIT
AC_GNU_SOURCE
+# Before we do anything with the C compiler, we first save the user's
+# CFLAGS (they are restored at the end of the configure script). This
+# is because some configure checks don't work with -Werror, but we'd
+# like to use -Werror with our build.
+CFLAGS_orig=$CFLAGS
+CFLAGS=
+
# Some status variables.
have_gpg_error=no
have_libgcrypt=no
@@ -1576,6 +1583,11 @@ AC_ARG_ENABLE(optimization,
fi])
#
+# Add user CFLAGS.
+#
+CFLAGS="$CFLAGS $CFLAGS_orig"
+
+#
# Decide what to build
#