summaryrefslogtreecommitdiff
path: root/mk/compiler
diff options
context:
space:
mode:
authorgrant <grant>2005-02-15 07:43:43 +0000
committergrant <grant>2005-02-15 07:43:43 +0000
commitadfc07717068cd9d6206439177ad8cc73b27bd6e (patch)
treec1273d3f6640df9366e9233a012376a7d0a2cb6b /mk/compiler
parent2dce9d50f8361e32ac836f9b34f270430e011db1 (diff)
downloadpkgsrc-adfc07717068cd9d6206439177ad8cc73b27bd6e.tar.gz
add support for icc, the Intel C++ Compiler (Linux).
icc is a high performance compiler suite for Linux/i386 and ia64, and is free for non-commercial use. see: http://www.intel.com/software/products/compilers/clin/ for more information. tested with icc version 8.0 and 8.1 on Slackware 10/i386.
Diffstat (limited to 'mk/compiler')
-rw-r--r--mk/compiler/icc.mk81
1 files changed, 81 insertions, 0 deletions
diff --git a/mk/compiler/icc.mk b/mk/compiler/icc.mk
new file mode 100644
index 00000000000..75a04b6ac17
--- /dev/null
+++ b/mk/compiler/icc.mk
@@ -0,0 +1,81 @@
+# $NetBSD: icc.mk,v 1.1 2005/02/15 07:43:43 grant Exp $
+
+.if !defined(COMPILER_ICC_MK)
+COMPILER_ICC_MK= defined
+
+.include "../../mk/bsd.prefs.mk"
+
+ICCBASE?= /opt/intel_cc_80
+
+# LANGUAGES.<compiler> is the list of supported languages by the
+# compiler.
+#
+LANGUAGES.icc= # empty
+
+_ICC_DIR= ${WRKDIR}/.icc
+_ICC_VARS= # empty
+.if exists(${ICCBASE}/bin/icc)
+LANGUAGES.icc+= c
+_ICC_VARS+= CC
+_ICC_CC= ${_ICC_DIR}/bin/icc
+_ALIASES.CC= cc
+CCPATH= ${ICCBASE}/bin/icc
+PKG_CC:= ${_ICC_CC}
+LANGUAGES.icc+= c++
+_ICC_VARS+= CXX
+_ICC_CXX= ${_ICC_DIR}/bin/icpc
+_ALIASES.CXX= CC c++
+CXXPATH= ${ICCBASE}/bin/icpc
+PKG_CXX:= ${_ICC_CXX}
+.endif
+_COMPILER_STRIP_VARS+= ${_ICC_VARS}
+
+# icc passes rpath directives to the linker using "-Wl,-R".
+_LINKER_RPATH_FLAG= -Wl,-R
+
+# icc passes rpath directives to the linker using "-Wl,-R".
+_COMPILER_RPATH_FLAG= -Wl,-R
+
+.if exists(${CCPATH})
+CC_VERSION_STRING!= ${CCPATH} -V 2>&1 | ${GREP} '^Intel'
+_CC_VERSION!= ${CCPATH} -v 2>&1 || ${TRUE}
+CC_VERSION= Intel C++ Compiler ${_CC_VERSION}
+.else
+CC_VERSION_STRING?= ${CC_VERSION}
+CC_VERSION?= Intel C++ Compiler
+.endif
+
+# _LANGUAGES.<compiler> is ${LANGUAGES.<compiler>} restricted to the
+# ones requested by the package in USE_LANGUAGES.
+#
+_LANGUAGES.icc= # empty
+.for _lang_ in ${USE_LANGUAGES}
+_LANGUAGES.icc+= ${LANGUAGES.icc:M${_lang_}}
+.endfor
+
+# Prepend the path to the compiler to the PATH.
+.if !empty(_LANGUAGES.icc)
+PREPEND_PATH+= ${_ICC_DIR}/bin
+.endif
+
+# Create compiler driver scripts in ${WRKDIR}.
+.for _var_ in ${_ICC_VARS}
+. if !target(${_ICC_${_var_}})
+override-tools: ${_ICC_${_var_}}
+${_ICC_${_var_}}:
+ ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ (${ECHO} '#!${TOOLS_SHELL}'; \
+ ${ECHO} 'exec ${ICCBASE}/bin/${.TARGET:T} "$$@"'; \
+ ) > ${.TARGET}
+ ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET}
+. for _alias_ in ${_ALIASES.${_var_}:S/^/${.TARGET:H}\//}
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ if [ ! -x "${_alias_}" ]; then \
+ ${LN} -f ${.TARGET} ${_alias_}; \
+ fi
+. endfor
+. endif
+.endfor
+
+.endif # COMPILER_ICC_MK