summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorgrant <grant@pkgsrc.org>2005-02-15 07:43:43 +0000
committergrant <grant@pkgsrc.org>2005-02-15 07:43:43 +0000
commit9fd9fe53317823a81e44451c9d9a964a7fd5281a (patch)
treec1273d3f6640df9366e9233a012376a7d0a2cb6b /mk
parente9eb68750b4b7515008f16d5cc410baba352cc45 (diff)
downloadpkgsrc-9fd9fe53317823a81e44451c9d9a964a7fd5281a.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')
-rw-r--r--mk/compiler.mk5
-rw-r--r--mk/compiler/icc.mk81
-rw-r--r--mk/wrapper/bsd.wrapper.mk23
-rw-r--r--mk/wrapper/cmd-sink-icc-cc59
-rw-r--r--mk/wrapper/transform-icc-cc68
5 files changed, 233 insertions, 3 deletions
diff --git a/mk/compiler.mk b/mk/compiler.mk
index a3dcc817671..9d7c21a74ce 100644
--- a/mk/compiler.mk
+++ b/mk/compiler.mk
@@ -1,4 +1,4 @@
-# $NetBSD: compiler.mk,v 1.44 2005/01/24 18:07:56 tv Exp $
+# $NetBSD: compiler.mk,v 1.45 2005/02/15 07:43:43 grant Exp $
#
# This Makefile fragment implements handling for supported C/C++/Fortran
# compilers.
@@ -14,6 +14,7 @@
# ccache compiler cache (chainable)
# distcc distributed C/C++ (chainable)
# f2c Fortran 77 to C compiler (chainable)
+# icc Intel C++ Compiler (Linux)
# gcc GNU
# mipspro Silicon Graphics, Inc. MIPSpro (n32/n64)
# mipspro-ucode Silicon Graphics, Inc. MIPSpro (o32)
@@ -81,7 +82,7 @@ USE_LANGUAGES:= c ${USE_LANGUAGES}
_USE_PKGSRC_GCC= yes
.endif
-_COMPILERS= ccc gcc mipspro mipspro-ucode sunpro xlc
+_COMPILERS= ccc gcc icc mipspro mipspro-ucode sunpro xlc
_PSEUDO_COMPILERS= ccache distcc f2c
.if defined(NOT_FOR_COMPILER) && !empty(NOT_FOR_COMPILER)
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
diff --git a/mk/wrapper/bsd.wrapper.mk b/mk/wrapper/bsd.wrapper.mk
index e5eac5ccd48..c811bc03ba3 100644
--- a/mk/wrapper/bsd.wrapper.mk
+++ b/mk/wrapper/bsd.wrapper.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.wrapper.mk,v 1.21 2005/02/15 03:18:50 jlam Exp $
+# $NetBSD: bsd.wrapper.mk,v 1.22 2005/02/15 07:43:43 grant Exp $
#
# Copyright (c) 2004 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -238,6 +238,15 @@ _WRAP_CMD_SINK.CXX= ${_WRAP_CMD_SINK.CC}
_WRAP_CMD_SINK.LD= ${_WRAP_CMD_SINK.CC}
.endif
+.if !empty(PKGSRC_COMPILER:Micc)
+_WRAP_CMD_SINK.CC= ${WRAPPER_TMPDIR}/cmd-sink-icc-cc
+_WRAP_CMD_SINK.CXX= ${_WRAP_CMD_SINK.CC}
+_WRAP_CACHE_BODY.CC= ${WRAPPER_TMPDIR}/cache-body-icc-cc
+_WRAP_CACHE_BODY.CXX= ${_WRAP_CACHE_BODY.CC}
+_WRAP_TRANSFORM.CC= ${WRAPPER_TMPDIR}/transform-icc-cc
+_WRAP_TRANSFORM.CXX= ${_WRAP_TRANSFORM.CC}
+.endif
+
.if !empty(PKGSRC_COMPILER:Mmipspro)
_WRAP_ARG_PP.CC= ${WRAPPER_TMPDIR}/arg-pp-mipspro-cc
_WRAP_CACHE_BODY.CC= ${WRAPPER_TMPDIR}/cache-body-mipspro-cc
@@ -484,6 +493,18 @@ ${WRAPPER_TMPDIR}/transform-ccc-cc: \
${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \
| ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET}
+${WRAPPER_TMPDIR}/cmd-sink-icc-cc: \
+ ${WRAPPER_SRCDIR}/cmd-sink-icc-cc
+ ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
+ ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \
+ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET}
+
+${WRAPPER_TMPDIR}/transform-icc-cc: \
+ ${WRAPPER_SRCDIR}/transform-icc-cc
+ ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
+ ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \
+ | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET}
+
${WRAPPER_TMPDIR}/transform-mipspro-cc: \
${WRAPPER_SRCDIR}/transform-mipspro-cc
${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
diff --git a/mk/wrapper/cmd-sink-icc-cc b/mk/wrapper/cmd-sink-icc-cc
new file mode 100644
index 00000000000..592c5127430
--- /dev/null
+++ b/mk/wrapper/cmd-sink-icc-cc
@@ -0,0 +1,59 @@
+# $NetBSD: cmd-sink-icc-cc,v 1.1 2005/02/15 07:43:44 grant Exp $
+#
+# Copyright (c) 2004 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Grant Beattie.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the NetBSD
+# Foundation, Inc. and its contributors.
+# 4. Neither the name of The NetBSD Foundation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+# all icc built dynamic libraries and executables need to be linked
+# with ${ICCBASE}/lib in the rpath, or statically linked against the
+# icc provided libraries. use the static linking method so binary
+# packages can be used on systems that do not have these libraries
+# available.
+arg=-static-libcxa
+$debug_log $wrapperlog " (cmd-sink-icc-cc) pop: $arg"
+. $buildcmd
+
+while ! queue_is_empty cmdbuf; do
+ pop_queue cmdbuf arg
+ case "$arg" in
+ -MT)
+ pop_queue cmdbuf arg2
+ $debug_log $wrapperlog " (cmd-sink-icc-cc) pop: $arg $arg2 [drop]"
+ ;;
+
+ *)
+ $debug_log $wrapperlog " (cmd-sink-icc-cc) pop: $arg"
+ . $buildcmd
+ ;;
+ esac
+done
diff --git a/mk/wrapper/transform-icc-cc b/mk/wrapper/transform-icc-cc
new file mode 100644
index 00000000000..a90f819d7d8
--- /dev/null
+++ b/mk/wrapper/transform-icc-cc
@@ -0,0 +1,68 @@
+# $NetBSD: transform-icc-cc,v 1.1 2005/02/15 07:43:44 grant Exp $
+#
+# Copyright (c) 2004 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Grant Beattie.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the NetBSD
+# Foundation, Inc. and its contributors.
+# 4. Neither the name of The NetBSD Foundation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+case $arg in
+######################################################################
+# ignore flags that icc doesn't understand.
+######################################################################
+-ffast-math|-fomit-frame-pointer|-pedantic|-pipe|-s|-MP|-OPT:*)
+ arg=
+ msg_log $wrapperlog " (transform-icc-cc) to: $arg"
+ addtocache=yes
+ ;;
+-finline-functions)
+ arg=-Ob2
+ msg_log $wrapperlog " (transform-icc-cc) to: $arg"
+ addtocache=yes
+ ;;
+-funroll-all-loops|-funroll-loops)
+ arg=-unroll
+ msg_log $wrapperlog " (transform-icc-cc) to: $arg"
+ addtocache=yes
+ ;;
+-O[4-9]|-O[12][0-9])
+ arg=-O3
+ msg_log $wrapperlog " (transform-icc-cc) to: $arg"
+ addtocache=yes
+ ;;
+-Wall|-Wl,*)
+ ;;
+-W*)
+ arg=
+ msg_log $wrapperlog " (transform-icc-cc) to: $arg"
+ addtocache=yes
+ ;;
+esac