summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/port/README.SunPro6
-rw-r--r--makefiles/compiler.mk17
-rw-r--r--makefiles/depend.mk11
-rwxr-xr-xmakefiles/guess_env18
4 files changed, 46 insertions, 6 deletions
diff --git a/docs/port/README.SunPro b/docs/port/README.SunPro
index 6808732..dd67b7b 100644
--- a/docs/port/README.SunPro
+++ b/docs/port/README.SunPro
@@ -1,5 +1,3 @@
-Sun C 5.9:
-gmake \
- CC=/opt/SUNWspro/bin/c99 COMPILE_FLAGS="-I. -O2 -mt -v" \
- MAKEDEPEND="/opt/SUNWspro/bin/c99 -xM1" clean all
+Sun Studio 12
+gmake CC=/opt/SUNWspro/bin/cc
diff --git a/makefiles/compiler.mk b/makefiles/compiler.mk
index 955de1f..829e878 100644
--- a/makefiles/compiler.mk
+++ b/makefiles/compiler.mk
@@ -170,7 +170,22 @@ COMPILE_FLAGS = \
-Wall -Werror -vec-report0
endif
-# end of tcc section
+# end of icc section
+
+# start of spro section
+
+# -xc99=all: full C99 compliance for the code (syntax and library functions)
+# -mt: enable mutlithreading (-D_REENTRANT for header files, -lthread for ld)
+# -errwarn=%all: convert all warnings to errors
+# -v: do more restrictive syntax checking
+# TODO: enable -O2
+
+ifeq "$(COMPILER)" "spro"
+COMPILE_FLAGS = \
+ -xc99=all -errwarn=%all -mt -v
+endif
+
+# end of spro section
CFLAGS = $(COMPILE_FLAGS) $(PLATFORM_COMPILE_FLAGS) $(INCLUDE_DIRS)
CCPPFLAGS = $(CCPP_COMPILE_FLAGS) $(PLATFORM_COMPILE_FLAGS) $(INCLUDE_DIRS)
diff --git a/makefiles/depend.mk b/makefiles/depend.mk
index 4bbbd00..9822e20 100644
--- a/makefiles/depend.mk
+++ b/makefiles/depend.mk
@@ -47,6 +47,17 @@ ifeq "$(COMPILER)" "icc"
endif
+ifeq "$(COMPILER)" "spro"
+
+%.d : %.c
+ @echo Generating dependencies for $<
+ $(CC) -xM1 $(INCLUDE_DIRS) $< > $@
+
+%.d : %.cpp
+ @echo Generating dependencies for $<
+ $(CCPP) -xM1 $(INCLUDE_DIRS) $< > $@
+endif
+
-include $(OBJS:.o=.d)
-include $(CPP_OBJS:.o=.d)
-include $(BIN_OBJS:.o=.d)
diff --git a/makefiles/guess_env b/makefiles/guess_env
index e871bcc..d0a31ae 100755
--- a/makefiles/guess_env
+++ b/makefiles/guess_env
@@ -76,7 +76,12 @@ else
if test $? = 0; then
COMPILER='icc'
else
- COMPILER='unknown'
+ ( $CC -xhelp=readme | head -n 1 | grep 'Sun Studio' ) >/dev/null
+ if test $? = 0; then
+ COMPILER='spro'
+ else
+ COMPILER='unknown'
+ fi
fi
fi
fi
@@ -105,6 +110,13 @@ if test $COMPILER = "icc"; then
ICC_MINOR_VERSION=`echo $ICC_VERSION | cut -d . -f 2`
fi
+# version of spro (Sun Pro compiler, Sun Studio)
+
+if test $COMPILER = 'spro'; then
+ SPRO_VERSION=`$CC -xhelp=readme | head -n 1 | cut -d ' ' -f 3`
+ SPRO_MAJOR_VERSION=`echo $SPRO_VERSION | cut -d : -f 1`
+fi
+
case "$1" in
--platform) echo $PLATFORM
;;
@@ -139,6 +151,9 @@ case "$1" in
--icc-minor-version) echo $ICC_MINOR_VERSION
;;
+ --spro-major-version) echo $SPRO_MAJOR_VERSION
+ ;;
+
--all)
cat <<EOF
ARCH = $ARCH
@@ -152,6 +167,7 @@ TCC_MAJOR_VERSION = $TCC_MAJOR_VERSION
TCC_MINOR_VERSION = $TCC_MINOR_VERSION
ICC_MAJOR_VERSION = $ICC_MAJOR_VERSION
ICC_MINOR_VERSION = $ICC_MINOR_VERSION
+SPRO_MAJOR_VERSION = $SPRO_MAJOR_VERSION
EOF
;;
esac