Fix 'illegal option -xassembler-with-cpp' error (Oracle SunCC)
authorIvan Maidanski <ivmai@mail.ru>
Mon, 9 Jun 2014 22:25:31 +0000 (02:25 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 9 Jun 2014 22:27:59 +0000 (02:27 +0400)
* Makefile.am (ASM_CPP_OPTIONS): Move comment to configure.ac.
* Makefile.am (COMPILER_XLC): Rename to ASM_WITH_CPP_UNSUPPORTED.
* configure.ac (COMPILER_XLC): Likewise.
* configure.ac (compiler_suncc): New variable (set to "yes" if Solaris
Sun C compiler).
* configure.ac (ASM_WITH_CPP_UNSUPPORTED): Define not only for
compiler_xlc but also for compiler_suncc.

Makefile.am
configure.ac

index 2aacca2..ce91bf0 100644 (file)
@@ -141,14 +141,12 @@ AM_CFLAGS = @GC_CFLAGS@
 ## FIXME: we shouldn't have to do this, but automake forces us to.
 ## We use -Wp,-P to strip #line directives.  Irix `as' chokes on
 ## these.
-if COMPILER_XLC
-  ## XLC neither requires nor tolerates the unnecessary assembler goop
+if ASM_WITH_CPP_UNSUPPORTED
   ASM_CPP_OPTIONS =
 else
-  ## We use -Wp,-P to strip #line directives.  Irix `as' chokes on
-  ## these.
   ASM_CPP_OPTIONS = -Wp,-P -x assembler-with-cpp
 endif
+
 .s.lo:
        $(LTCOMPILE) $(ASM_CPP_OPTIONS) -c $<
 
index 9539f0d..32982b0 100644 (file)
@@ -377,6 +377,7 @@ AM_CONDITIONAL(PTHREADS, test x$THREADS = xposix)
 AM_CONDITIONAL(DARWIN_THREADS, test x$darwin_threads = xtrue)
 AM_CONDITIONAL(WIN32_THREADS, test x$win32_threads = xtrue)
 
+compiler_suncc=no
 case "$host" in
    powerpc-*-darwin*)
       powerpc_darwin=true
@@ -384,6 +385,7 @@ case "$host" in
    *-*-solaris*)
       if test "$GCC" != yes; then
         # Solaris SunCC
+        compiler_suncc=yes
         CFLAGS="-O $CFLAGS"
       fi
       ;;
@@ -414,12 +416,16 @@ AC_TRY_COMPILE([],[
  #endif
 ], [compiler_xlc=yes], [compiler_xlc=no])
 AC_MSG_RESULT($compiler_xlc)
-AM_CONDITIONAL(COMPILER_XLC,test $compiler_xlc = yes)
 if test $compiler_xlc = yes -a "$powerpc_darwin" = true; then
   # the darwin stack-frame-walking code is completely broken on xlc
   AC_DEFINE([DARWIN_DONT_PARSE_STACK], 1, [See doc/README.macros.])
 fi
 
+# XLC neither requires nor tolerates the unnecessary assembler goop.
+# Similar for the Sun C compiler.
+AM_CONDITIONAL([ASM_WITH_CPP_UNSUPPORTED],
+    [test $compiler_xlc = yes -o $compiler_suncc = yes])
+
 if test "$GCC" = yes; then
   # Disable aliasing optimization unless forced to.
   AC_MSG_CHECKING([whether gcc supports -fno-strict-aliasing])