If we compile not under a SCM system, assume that we should not use -Werror
authorBrian Aker <brian@tangent.org>
Tue, 18 Sep 2012 05:01:18 +0000 (01:01 -0400)
committerBrian Aker <brian@tangent.org>
Tue, 18 Sep 2012 05:01:18 +0000 (01:01 -0400)
m4/ax_harden_compiler_flags.m4

index 4d647996dcd466f0ac97aa2cb9fa5772ebcebd3c..d8b997f7b64d9d6e66c9afb3439b6a74850b68be 100644 (file)
@@ -62,7 +62,9 @@
 
       AC_LANG_PUSH([C])
       AX_APPEND_COMPILE_FLAGS([-O2])
-      AX_APPEND_COMPILE_FLAGS([-Werror])
+      AS_IF([test "$ac_cv_vcs_checkout" = yes], [
+        AX_APPEND_COMPILE_FLAGS([-Werror])
+        ])
       AX_APPEND_COMPILE_FLAGS([-Wall])
       AX_APPEND_COMPILE_FLAGS([-Wextra])
       AX_APPEND_COMPILE_FLAGS([-std=c99])
@@ -80,7 +82,9 @@
       AC_REQUIRE([AX_HARDEN_C_COMPILER_FLAGS])
       AC_LANG_PUSH([C++])
       AX_APPEND_COMPILE_FLAGS([-O2])
-      AX_APPEND_COMPILE_FLAGS([-Werror])
+      AS_IF([test "$ac_cv_vcs_checkout" = yes], [
+        AX_APPEND_COMPILE_FLAGS([-Werror])
+        ])
       AX_APPEND_COMPILE_FLAGS([-Wall])
       AX_APPEND_COMPILE_FLAGS([-Wextra])
       AX_APPEND_COMPILE_FLAGS([-Wpragmas])
       AX_APPEND_COMPILE_FLAGS([-floop-parallelize-all])
       AX_APPEND_COMPILE_FLAGS([-fwrapv])
       AX_APPEND_COMPILE_FLAGS([-ggdb])
-      AX_CHECK_LINK_FLAG([-Werror])
+      AS_IF([test "$ac_cv_vcs_checkout" = yes], [
+          AX_CHECK_LINK_FLAG([-Werror])
+          ])
       AX_CHECK_LINK_FLAG([-z relro -z now])
       AC_LANG_POP
   ])