summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2009-03-13 12:33:21 +0100
committerAndreas Baumann <abaumann@yahoo.com>2009-03-13 12:33:21 +0100
commit805e712bf04f55a6fb1c27d40d7917fa7f6ac43f (patch)
tree2aedd7bc3466924e0ed2ea52d2a780523c6b1f87
parent174f62bcf9707dfa26cf6d2dc0888198c36428d4 (diff)
downloadwolfbones-805e712bf04f55a6fb1c27d40d7917fa7f6ac43f.tar.gz
wolfbones-805e712bf04f55a6fb1c27d40d7917fa7f6ac43f.tar.bz2
added pcc support
-rw-r--r--docs/port/README.pcc3
-rw-r--r--docs/port/README.tcc3
-rw-r--r--makefiles/gmake/compiler.mk13
-rwxr-xr-xmakefiles/gmake/guess_env25
4 files changed, 42 insertions, 2 deletions
diff --git a/docs/port/README.pcc b/docs/port/README.pcc
new file mode 100644
index 0000000..67f10b7
--- /dev/null
+++ b/docs/port/README.pcc
@@ -0,0 +1,3 @@
+Portable C Compiler, 0.9.9, 090313 snapshot:
+
+make CC=pcc
diff --git a/docs/port/README.tcc b/docs/port/README.tcc
new file mode 100644
index 0000000..217e20f
--- /dev/null
+++ b/docs/port/README.tcc
@@ -0,0 +1,3 @@
+Tiny C compiler, 0.9.24:
+
+make CC=tcc
diff --git a/makefiles/gmake/compiler.mk b/makefiles/gmake/compiler.mk
index 1d1bce3..e77e6d7 100644
--- a/makefiles/gmake/compiler.mk
+++ b/makefiles/gmake/compiler.mk
@@ -197,6 +197,19 @@ endif
# end of spro section
+# start of pcc section
+
+# currently we don't need this, the pcc flags are fairly consistent
+#PCC_MAJOR_VERSION ?= $(shell $(TOPDIR)/makefiles/gmake/guess_env --pcc-major-version $(CC) "$(CURDIR)" $(TOPDIR))
+#PCC_MINOR_VERSION ?= $(shell $(TOPDIR)/makefiles/gmake/guess_env --pcc-minor-version $(CC) "$(CURDIR)" $(TOPDIR))
+
+ifeq "$(COMPILER)" "pcc"
+COMPILE_FLAGS = \
+ --fatal-warnings
+endif
+
+# end of pcc section
+
# set flags for threading support using POSIX threads. This is completly different
# between compiler/platforms
ifeq "$(COMPILER)" "gcc"
diff --git a/makefiles/gmake/guess_env b/makefiles/gmake/guess_env
index 3a7fdf6..b494513 100755
--- a/makefiles/gmake/guess_env
+++ b/makefiles/gmake/guess_env
@@ -81,7 +81,12 @@ else
if test $? = 0; then
COMPILER='spro'
else
- COMPILER='unknown'
+ ( $CC -v | head -n 1 | grep 'pcc' ) >/dev/null
+ if test $? = 0; then
+ COMPILER='pcc'
+ else
+ COMPILER='unknown'
+ fi
fi
fi
fi
@@ -113,11 +118,19 @@ fi
# version of spro (Sun Pro compiler, Sun Studio)
-if test $COMPILER = 'spro'; then
+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
+# version of pcc (Portable C Compiler)
+
+if test $COMPILER = "pcc"; then
+ PCC_VERSION=`$CC -v | head -n 1 | cut -d ' ' -f 2`
+ PCC_MAJOR_VERSION=`echo $PCC_VERSION | cut -d . -f 1`
+ PCC_MINOR_VERSION=`echo $PCC_VERSION | cut -d . -f 2`
+fi
+
case "$1" in
--platform) echo $PLATFORM
;;
@@ -154,6 +167,12 @@ case "$1" in
--spro-major-version) echo $SPRO_MAJOR_VERSION
;;
+
+ --pcc-major-version) echo $PCC_MAJOR_VERSION
+ ;;
+
+ --pcc-minor-version) echo $PCC_MINOR_VERSION
+ ;;
esac
MAKEFILE_DIR="$3/$4"
@@ -173,5 +192,7 @@ TCC_MINOR_VERSION=$TCC_MINOR_VERSION
ICC_MAJOR_VERSION=$ICC_MAJOR_VERSION
ICC_MINOR_VERSION=$ICC_MINOR_VERSION
SPRO_MAJOR_VERSION=$SPRO_MAJOR_VERSION
+PCC_MAJOR_VERSION=$PCC_MAJOR_VERSION
+PCC_MINOR_VERSION=$PCC_MINOR_VERSION
EOF
fi