Don't add GCC options to non gcc compilers
authorTrond Norbye <trond.norbye@sun.com>
Thu, 5 Nov 2009 13:01:21 +0000 (14:01 +0100)
committerTrond Norbye <trond.norbye@sun.com>
Thu, 5 Nov 2009 13:01:21 +0000 (14:01 +0100)
Makefile.am
configure.ac

index d0080c7d9c4ec8a494506ddbafe8aec70a5be440..a69a5db113b202e70b1368a4d61a5354d05097de 100644 (file)
@@ -32,13 +32,6 @@ EXTRA_DIST =  \
 
 ACLOCAL_AMFLAGS = -I m4
 
-SUBUNIT_CFLAGS = -Wall -Werror -Wextra -Wstrict-prototypes -Wmissing-prototypes \
-       -Wwrite-strings -Wno-variadic-macros -I$(top_srcdir)/c/include
-AM_CFLAGS = $(SUBUNIT_CFLAGS)
-SUBUNIT_CXXFLAGS = -Wall -Werror -Wextra -Wwrite-strings -Wno-variadic-macros \
-       -I$(top_srcdir)/c/include
-AM_CXXFLAGS = $(SUBUNIT_CXXFLAGS)
-
 include_subunitdir = $(includedir)/subunit
 
 dist_bin_SCRIPTS = \
@@ -51,7 +44,7 @@ dist_bin_SCRIPTS = \
        filters/subunit2pyunit \
        filters/tap2subunit
 
-TESTS_ENVIRONMENT = SHELL_SHARE='$(top_srcdir)/shell/share/' PYTHONPATH='$(abs_top_srcdir)/python':${PYTHONPATH} 
+TESTS_ENVIRONMENT = SHELL_SHARE='$(top_srcdir)/shell/share/' PYTHONPATH='$(abs_top_srcdir)/python':${PYTHONPATH}
 TESTS = runtests.py $(check_PROGRAMS)
 
 ## install libsubunit.pc
@@ -100,7 +93,7 @@ check-local: perl/Makefile
        $(MAKE) -C perl check
 
 clean-local:
-       find . -name "*.pyc" | xargs -r rm
+       find . -name "*.pyc" | xargs rm -f
        rm -f perl/Makefile
 
 # Remove perl dir for VPATH builds.
index 76a91a48e893bb5907cb9e3a4854b1abfff4fe1b..cba73359bd933d0a41f9ca02d9011885aae7a6fb 100644 (file)
@@ -24,6 +24,20 @@ AC_PROG_INSTALL
 AC_PROG_LN_S
 AC_PROG_LIBTOOL
 AM_PATH_PYTHON
+
+if test "$GCC" = "yes"
+then
+  SUBUNIT_CFLAGS="-Wall -Werror -Wextra -Wstrict-prototypes "
+  SUBUNIT_CFLAGS="$SUBUNIT_CFLAGS -Wmissing-prototypes -Wwrite-strings "
+  SUBUNIT_CFLAGS="$SUBUNIT_CFLAGS -Wno-variadic-macros "
+  SUBUNIT_CXXFLAGS="-Wall -Werror -Wextra -Wwrite-strings -Wno-variadic-macros"
+fi
+
+AM_CFLAGS="$SUBUNIT_CFLAGS -I\$(top_srcdir)/c/include"
+AM_CXXFLAGS="$SUBUNIT_CXXFLAGS -I\$(top_srcdir)/c/include"
+AC_SUBST(AM_CFLAGS)
+AC_SUBST(AM_CXXFLAGS)
+
 # Checks for libraries.
 
 # Checks for header files.