]> diplodocus.org Git - nmh/commitdiff
cppflags.m4: Don't trample CFLAGS and CPPFLAGS.
authorRalph Corderoy <ralph@inputplus.co.uk>
Sun, 20 Aug 2017 13:16:09 +0000 (14:16 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sun, 20 Aug 2017 13:21:47 +0000 (14:21 +0100)
They were always being restored, but not necessarily saved first.  There
might still be some odd behaviour in this area.  I'm seeing -D...
preprocessor symbols disappear on subsequent runs causing compilation
problems, e.g. strcasecmp(3) not prototyped.

m4/cppflags.m4

index 1e2401c..8e7bc14 100644 (file)
@@ -43,9 +43,10 @@ AC_DEFUN([NMH_ADDL_CPPFLAGS],
                   [AC_LANG_PROGRAM([#include <string.h>],
                                    [return strdup("x") == 0])],
                   [AM_CPPFLAGS="${nmh_cv_addl_cppflags}"; break;])])
-    done])
+    done
     CFLAGS="$nmh_saved_cflags"
     CPPFLAGS="$nmh_saved_cppflags"
+    ])
 
     dnl autoconf doesn't currently provide a macro to disable AC_LANG_WERROR,
     dnl so do it this way: