pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk For Portable C Compiler.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/35ece2d41a2d
branches:  trunk
changeset: 533381:35ece2d41a2d
user:      reed <reed%pkgsrc.org@localhost>
date:      Tue Sep 18 01:51:10 2007 +0000

description:
For Portable C Compiler.

Add beginning of PKGSRC_COMPILER=pcc support.
Based on "sunpro".

Please help improve this. I have not tested with C++ or fortan.

diffstat:

 mk/compiler.mk     |   5 ++-
 mk/compiler/pcc.mk |  78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 81 insertions(+), 2 deletions(-)

diffs (108 lines):

diff -r 4207cedf51ab -r 35ece2d41a2d mk/compiler.mk
--- a/mk/compiler.mk    Mon Sep 17 22:40:27 2007 +0000
+++ b/mk/compiler.mk    Tue Sep 18 01:51:10 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: compiler.mk,v 1.61 2007/06/09 18:44:37 rillig Exp $
+# $NetBSD: compiler.mk,v 1.62 2007/09/18 01:51:10 reed Exp $
 #
 # This Makefile fragment implements handling for supported C/C++/Fortran
 # compilers.
@@ -20,6 +20,7 @@
 #              hp              HP-UX C/aC++ compilers
 #              mipspro         Silicon Graphics, Inc. MIPSpro (n32/n64)
 #              mipspro-ucode   Silicon Graphics, Inc. MIPSpro (o32)
+#              pcc             Portable C Compiler
 #              sunpro          Sun Microsystems, Inc. WorkShip/Forte/Sun
 #                              ONE Studio
 #              xlc             IBM's XL C/C++ compiler suite (Darwin/MacOSX)
@@ -86,7 +87,7 @@
 _USE_PKGSRC_GCC=       yes
 .endif
 
-_COMPILERS=            ccc gcc icc ido mipspro mipspro-ucode sunpro xlc hp
+_COMPILERS=            ccc gcc icc ido mipspro mipspro-ucode sunpro xlc hp pcc
 _PSEUDO_COMPILERS=     ccache distcc f2c
 
 .if defined(NOT_FOR_COMPILER) && !empty(NOT_FOR_COMPILER)
diff -r 4207cedf51ab -r 35ece2d41a2d mk/compiler/pcc.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/compiler/pcc.mk        Tue Sep 18 01:51:10 2007 +0000
@@ -0,0 +1,78 @@
+# $NetBSD: pcc.mk,v 1.1 2007/09/18 01:51:10 reed Exp $
+#
+# This is the compiler definition for the PCC compiler.
+#
+# User-settable variables:
+#
+# PCCBASE
+#      The base directory where the compiler is installed.
+#
+
+.if !defined(COMPILER_PCC_MK)
+COMPILER_PCC_MK=       defined
+
+# Add the dependency on pcc
+# NOTE: not enabled by default as may be installed already
+# TODO: check for this?
+#BUILD_DEPENDS+= pcc-[0-9]*:../../lang/pcc
+
+.include "../../mk/bsd.prefs.mk"
+
+PCCBASE?=              ${PREFIX}
+
+# common definitions
+_COMPILER_TYPE.c=      CC
+_COMPILER_TYPE.c++ =   CXX
+_COMPILER_TYPE.fortran=        FC
+
+# PCC-specific definitions
+_COMPILER_LANGS=       c c++ fortran
+_COMPILER_NAME.c=      pcc
+# TODO:
+_COMPILER_NAME.c++ =   CC
+_COMPILER_NAME.fortran=        f77
+
+# LANGUAGES.<compiler> is the list of supported languages by the
+# compiler.
+#
+LANGUAGES.pcc= # empty
+
+.for l in ${_COMPILER_LANGS}
+.  for t in ${_COMPILER_TYPE.${l}}
+.    for n in ${_COMPILER_NAME.${l}}
+.      if exists(${PCCBASE}/bin/${n})
+LANGUAGES.pcc+=        ${l}
+_COMPILER_STRIP_VARS+= ${t}
+${t}PATH=              ${PCCBASE}/bin/${n}
+PKG_${t}:=             ${PCCBASE}/bin/${n}
+.      endif
+.    endfor
+.  endfor
+.endfor
+
+# Turn on C99 support if required
+#.if !empty(USE_LANGUAGES:Mc99)
+#_WRAP_EXTRA_ARGS.CC+= -xc99
+#.endif
+
+_LINKER_RPATH_FLAG=    -R
+
+_COMPILER_RPATH_FLAG=  -Wl,-R
+
+.if exists(${CCPATH})
+CC_VERSION_STRING!=    ${CCPATH} -v 2>&1 || ${TRUE}
+CC_VERSION!=           ${CCPATH} -v 2>&1 | ${GREP} '^pcc'
+.else
+CC_VERSION_STRING?=    ${CC_VERSION}
+CC_VERSION?=           pcc
+.endif
+
+# _LANGUAGES.<compiler> is ${LANGUAGES.<compiler>} restricted to the
+# ones requested by the package in USE_LANGUAGES.
+#
+_LANGUAGES.pcc=        # empty
+.for _lang_ in ${USE_LANGUAGES}
+_LANGUAGES.pcc+=       ${LANGUAGES.pcc:M${_lang_}}
+.endfor
+
+.endif # COMPILER_PCC_MK



Home | Main Index | Thread Index | Old Index