[glib] Only use gcc-specific options when the compiler is gcc



commit 6274386e52efd7c951d5e40ed2eacd5d0a843b83
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Sep 4 20:06:53 2011 -0400

    Only use gcc-specific options when the compiler is gcc
    
    The -Wstrict-aliasing option that we use to compile atomic
    tests does not exist with compilers other than gcc, so
    don't pass it to those.
    https://bugzilla.gnome.org/show_bug.cgi?id=652272
    https://bugzilla.gnome.org/show_bug.cgi?id=656152

 configure.ac           |    2 ++
 glib/tests/Makefile.am |    5 ++++-
 2 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index c2aac0a..061964e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -108,6 +108,8 @@ dnl Checks for programs.
 AC_PROG_CC
 AC_PROG_CPP
 
+AM_CONDITIONAL(HAVE_GCC, [test "$GCC" = "yes"])
+
 AC_CANONICAL_HOST
 
 AC_MSG_CHECKING([for the BeOS])
diff --git a/glib/tests/Makefile.am b/glib/tests/Makefile.am
index 3f4bd14..6bb8ca3 100644
--- a/glib/tests/Makefile.am
+++ b/glib/tests/Makefile.am
@@ -191,7 +191,10 @@ unix_nothreads_SOURCES = unix.c
 unix_nothreads_LDADD  = $(progs_ldadd)
 
 noinst_PROGRAMS += atomic
-atomic_CFLAGS = -Wstrict-aliasing=2 $(INCLUDES)
+atomic_CFLAGS = $(INCLUDES)
+if HAVE_GCC
+atomic_CFLAGS += -Wstrict-aliasing=2
+endif
 atomic_LDADD = $(progs_ldadd)
 
 TEST_PROGS    += bitlock



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]