~ chicken-core (chicken-5) f6925b6075dfdfe83aca155f09864909fba59b07


commit f6925b6075dfdfe83aca155f09864909fba59b07
Author:     felix <felix@call-with-current-continuation.org>
AuthorDate: Fri May 21 22:07:14 2010 +0200
Commit:     felix <felix@call-with-current-continuation.org>
CommitDate: Fri May 21 22:07:14 2010 +0200

    allow building with gcc on Solaris

diff --git a/Makefile.solaris b/Makefile.solaris
index 36868da5..bd2a133a 100644
--- a/Makefile.solaris
+++ b/Makefile.solaris
@@ -34,24 +34,49 @@ SRCDIR = ./
 # platform configuration
 
 ARCH ?= $(shell sh $(SRCDIR)/config-arch.sh)
+# default to SunPro CC
 export C_COMPILER ?= cc
 export INSTALL_PROGRAM ?= ginstall
 
 # options
 
+ifeq ($(C_COMPILER),cc)
 C_COMPILER_OPTIONS ?= -errtags -DHAVE_CHICKEN_CONFIG_H
+C_COMPILER_OPTIONS ?= -fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H
+else
+endif
+
 ifdef DEBUGBUILD
+ifeq ($(C_COMPILER),cc)
 C_COMPILER_OPTIMIZATION_OPTIONS ?= -g +w
 else
+C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused
+endif
+else
 ifdef OPTIMIZE_FOR_SPEED
+ifeq ($(C_COMPILER),cc)
 C_COMPILER_OPTIMIZATION_OPTIONS ?= -xdebugformat=stabs -xannotate=no -g -xO4
 else
-C_COMPILER_OPTIMIZATION_OPTIONS ?= -xdebugformat=stabs -xannotate=no -g -xO3
+C_COMPILER_OPTIMIZATION_OPTIONS ?= -O3 -fomit-frame-pointer
+endif
+else
+ifeq ($(C_COMPILER),cc)
+C_COMPILER_OPTIMIZATION_OPTIONS ?= -xannotate=no -xO3
+else
+C_COMPILER_OPTIMIZATION_OPTIONS ?= -Os -fomit-frame-pointer
+endif
 endif
 endif
+
+ifeq ($(C_COMPILER),cc)
 LINKER_LINK_SHARED_LIBRARY_OPTIONS = -G
 LINKER_LINK_SHARED_DLOADABLE_OPTIONS = -G
 LINKER_LINK_SHARED_PROGRAM_OPTIONS =
+else
+LINKER_LINK_SHARED_LIBRARY_OPTIONS = -shared
+LINKER_LINK_SHARED_DLOADABLE_OPTIONS = -shared -Wl,-R"$(RUNTIME_LINKER_PATH)" -Wl,-L.
+LINKER_LINK_SHARED_PROGRAM_OPTIONS = -Wl,-R"$(RUNTIME_LINKER_PATH)"
+endif
 LIBRARIES = -lrt -lsocket -lnsl -lm -ldl
 NEEDS_RELINKING = yes
 
diff --git a/README b/README
index 25739316..5b1125b6 100644
--- a/README
+++ b/README
@@ -255,6 +255,13 @@
 
         Solaris:
 
+	  - By default, CHICKEN is build with the SunPro C compiler (`cc').
+	    To use `gcc' instead of `cc', pass 
+
+	      C_COMPILER=gcc
+
+	    to the "make" invocation.
+
 	  - Older versions of Solaris have a bug in ld.so that causes
 	    trouble with dynamic loading.  Patching Solaris fixes the
 	    problem. Solaris 7 needs patch 106950-18. Solaris 8 has an
Trap