From b761a1f88584a309b34d5a8e2efe03b2dadadc83 Mon Sep 17 00:00:00 2001 From: grant Date: Wed, 6 Oct 2004 09:49:53 +0000 Subject: add initial support for IBM's XL C/C++ compiler. tested with version 6.0 on Mac OS X 10.3.5. to use XL C, set PKGSRC_COMPILER=xlc in mk.conf. XLCBASE defaults to /opt/ibmcmp/vacpp/6.0 (the default installation location on OS X), this can be overridden in mk.conf too. this is a work in progress - some simple packages can be built, but there are still lots of issues that need to be worked through. --- mk/compiler/xlc.mk | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 mk/compiler/xlc.mk (limited to 'mk/compiler/xlc.mk') diff --git a/mk/compiler/xlc.mk b/mk/compiler/xlc.mk new file mode 100644 index 00000000000..b4ab75dd3c6 --- /dev/null +++ b/mk/compiler/xlc.mk @@ -0,0 +1,62 @@ +# $NetBSD: xlc.mk,v 1.1 2004/10/06 09:49:53 grant Exp $ + +.if !defined(COMPILER_XLC_MK) +COMPILER_XLC_MK= defined + +.include "../../mk/bsd.prefs.mk" + +XLCBASE?= /opt/ibmcmp/vacpp/6.0 + +# LANGUAGES. is the list of supported languages by the compiler. +# _LANGUAGES. is ${LANGUAGES.} restricted to the ones +# requested by the package in USE_LANGUAGES. +# +LANGUAGES.xlc= c c++ +_LANGUAGES.xlc= # empty +.for _lang_ in ${USE_LANGUAGES} +_LANGUAGES.xlc+= ${LANGUAGES.xlc:M${_lang_}} +.endfor + +_XLC_DIR= ${WRKDIR}/.xlc +_XLC_LINKS= # empty +.if exists(${XLCBASE}/bin/cc) +_XLC_CC= ${_XLC_DIR}/bin/cc +_XLC_LINKS+= _XLC_CC +PKG_CC= ${_XLC_CC} +CC= ${PKG_CC:T} +.endif +.if exists(${XLCBASE}/bin/xlc++) +_XLC_CXX= ${_XLC_DIR}/bin/xlc++ +_XLC_LINKS+= _XLC_CXX +PKG_CXX= ${_XLC_CXX} +CXX= ${PKG_CXX:T} +.endif + +.if exists(${XLCBASE}/bin/cc) +CC_VERSION_STRING!= ${XLCBASE}/bin/cc -V 2>&1 | ${GREP} 'IBM XL C.*for' | ${SED} -e 's/^ *//' || ${TRUE} +CC_VERSION= ${CC_VERSION_STRING} +.else +CC_VERSION_STRING?= ${CC_VERSION} +CC_VERSION?= IBM XL C +.endif + +# Prepend the path to the compiler to the PATH. +.if !empty(_LANGUAGES.xlc) +PREPEND_PATH+= ${_XLC_DIR}/bin +.endif + +# Create compiler driver scripts in ${WRKDIR}. +.for _target_ in ${_XLC_LINKS} +. if !target(${${_target_}}) +override-tools: ${${_target_}} +${${_target_}}: + ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H} + ${_PKG_SILENT}${_PKG_DEBUG} \ + (${ECHO} '#!${TOOLS_SHELL}'; \ + ${ECHO} 'exec ${XLCBASE}/bin/${${_target_}:T} "$$@"'; \ + ) > ${.TARGET} + ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET} +. endif +.endfor + +.endif # COMPILER_XLC_MK -- cgit v1.2.3