Fix CFLAGS in configure regarding -O flag passing to SunCC compiler
authorIvan Maidanski <ivmai@mail.ru>
Sun, 8 Jun 2014 13:24:17 +0000 (17:24 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 9 Jun 2014 22:12:06 +0000 (02:12 +0400)
* configure.ac (CFLAGS): Add -O flag if Solaris SunCC (i.e., not GCC)
regardless of threads support (i.e., even in case it is off).

configure.ac

index 5edd11b..9539f0d 100644 (file)
@@ -310,9 +310,8 @@ case "$THREADS" in
         ;;
     esac
     case "$host" in
-     sparc*-*-solaris*)
+      sparc*-*-solaris*)
         if test "$GCC" != yes; then
-          CFLAGS="-O $CFLAGS"
           need_atomic_ops_asm=true
         fi
         ;;
@@ -382,6 +381,12 @@ case "$host" in
    powerpc-*-darwin*)
       powerpc_darwin=true
       ;;
+   *-*-solaris*)
+      if test "$GCC" != yes; then
+        # Solaris SunCC
+        CFLAGS="-O $CFLAGS"
+      fi
+      ;;
    *-*-wince*)
       if test "$enable_gc_debug" != "no"; then
         AC_DEFINE([GC_READ_ENV_FILE], 1,