Thu May 19 22:37:55 2011 UTC ()
Apply the patch from my own pkg/42480.


(alnsn)
diff -r1.7 -r1.8 pkgsrc/mk/compiler/icc.mk

cvs diff -r1.7 -r1.8 pkgsrc/mk/compiler/icc.mk (expand / switch to unified diff)

--- pkgsrc/mk/compiler/icc.mk 2009/06/02 22:32:49 1.7
+++ pkgsrc/mk/compiler/icc.mk 2011/05/19 22:37:55 1.8
@@ -1,51 +1,59 @@ @@ -1,51 +1,59 @@
1# $NetBSD: icc.mk,v 1.7 2009/06/02 22:32:49 joerg Exp $ 1# $NetBSD: icc.mk,v 1.8 2011/05/19 22:37:55 alnsn Exp $
2# 2#
3# This is the compiler definition for the Intel compilers. 3# This is the compiler definition for the Intel compilers.
4# 4#
5# User-settable variables: 5# User-settable variables:
6# 6#
7# ICCBASE 7# ICCBASE
8# The base directory where the compiler is installed. 8# The base directory where the compiler is installed.
9# 9#
10 10
11.if !defined(COMPILER_ICC_MK) 11.if !defined(COMPILER_ICC_MK)
12COMPILER_ICC_MK= defined 12COMPILER_ICC_MK= defined
13 13
14.include "../../mk/bsd.prefs.mk" 14.include "../../mk/bsd.prefs.mk"
15 15
16ICCBASE?= /opt/intel_cc_80 16ICCBASE?= /opt/intel_cc_80
17 17
18# LANGUAGES.<compiler> is the list of supported languages by the 18# LANGUAGES.<compiler> is the list of supported languages by the
19# compiler. 19# compiler.
20# 20#
21LANGUAGES.icc= # empty 21LANGUAGES.icc= # empty
22 22
23_ICC_DIR= ${WRKDIR}/.icc 23_ICC_DIR= ${WRKDIR}/.icc
24_ICC_VARS= # empty 24_ICC_VARS= # empty
 25
25.if exists(${ICCBASE}/bin/icc) 26.if exists(${ICCBASE}/bin/icc)
26LANGUAGES.icc+= c 27LANGUAGES.icc+= c
27_ICC_VARS+= CC 28_ICC_VARS+= CC
28_ICC_CC= ${_ICC_DIR}/bin/icc 29_ICC_CC= ${_ICC_DIR}/bin/icc
29_ALIASES.CC= cc 30_ALIASES.CC= cc
30CCPATH= ${ICCBASE}/bin/icc 31CCPATH= ${ICCBASE}/bin/icc
31PKG_CC:= ${_ICC_CC} 32PKG_CC:= ${_ICC_CC}
 33_ICC_VARS+= CPP
 34_ICC_CPP= ${_ICC_DIR}/bin/cpp
 35PKG_CPP:= ${_ICC_CPP}
 36.endif
 37
 38.if exists(${ICCBASE}/bin/icpc)
32LANGUAGES.icc+= c++ 39LANGUAGES.icc+= c++
33_ICC_VARS+= CXX 40_ICC_VARS+= CXX
34_ICC_CXX= ${_ICC_DIR}/bin/icpc 41_ICC_CXX= ${_ICC_DIR}/bin/icpc
35_ALIASES.CXX= CC c++ 42_ALIASES.CXX= CC c++
36CXXPATH= ${ICCBASE}/bin/icpc 43CXXPATH= ${ICCBASE}/bin/icpc
37PKG_CXX:= ${_ICC_CXX} 44PKG_CXX:= ${_ICC_CXX}
38.endif 45.endif
 46
39_COMPILER_STRIP_VARS+= ${_ICC_VARS} 47_COMPILER_STRIP_VARS+= ${_ICC_VARS}
40 48
41# icc passes rpath directives to the linker using "-Wl,-R". 49# icc passes rpath directives to the linker using "-Wl,-R".
42_LINKER_RPATH_FLAG= -Wl,-R 50_LINKER_RPATH_FLAG= -Wl,-R
43 51
44# icc passes rpath directives to the linker using "-Wl,-R". 52# icc passes rpath directives to the linker using "-Wl,-R".
45_COMPILER_RPATH_FLAG= -Wl,-R 53_COMPILER_RPATH_FLAG= -Wl,-R
46 54
47.if exists(${CCPATH}) 55.if exists(${CCPATH})
48CC_VERSION_STRING!= ${CCPATH} -V 2>&1 | ${GREP} '^Intel' 56CC_VERSION_STRING!= ${CCPATH} -V 2>&1 | ${GREP} '^Intel'
49_CC_VERSION!= ${CCPATH} -v 2>&1 || ${TRUE} 57_CC_VERSION!= ${CCPATH} -v 2>&1 || ${TRUE}
50CC_VERSION= Intel C++ Compiler ${_CC_VERSION} 58CC_VERSION= Intel C++ Compiler ${_CC_VERSION}
51.else 59.else
@@ -65,26 +73,43 @@ _LANGUAGES.icc+= ${LANGUAGES.icc:M${_lan @@ -65,26 +73,43 @@ _LANGUAGES.icc+= ${LANGUAGES.icc:M${_lan
65.if !empty(_LANGUAGES.icc) 73.if !empty(_LANGUAGES.icc)
66PREPEND_PATH+= ${_ICC_DIR}/bin 74PREPEND_PATH+= ${_ICC_DIR}/bin
67.endif 75.endif
68 76
69# icc supports __attribute__, but the GNU configure test uses a nested 77# icc supports __attribute__, but the GNU configure test uses a nested
70# function, which icc does not support. #undef'ing __attribute__ has the 78# function, which icc does not support. #undef'ing __attribute__ has the
71# unfortunate side-effect of breaking many of the Linux header files, which 79# unfortunate side-effect of breaking many of the Linux header files, which
72# cannot be compiled properly without __attribute__. The test must be 80# cannot be compiled properly without __attribute__. The test must be
73# overridden so that __attribute__ is assumed supported by the compiler. 81# overridden so that __attribute__ is assumed supported by the compiler.
74.if defined(GNU_CONFIGURE) 82.if defined(GNU_CONFIGURE)
75CONFIGURE_ENV+= ac_cv___attribute__=yes 83CONFIGURE_ENV+= ac_cv___attribute__=yes
76.endif 84.endif
77 85
 86override-tools: ${_ICC_CPP}
 87${_ICC_CPP}:
 88 ${RUN}${MKDIR} ${.TARGET:H}
 89 ${RUN} \
 90 (${ECHO} '#!${TOOLS_SHELL}'; \
 91 ${ECHO} 'for o in "$$@"'; ${ECHO} 'do'; \
 92 ${ECHO} ' case "$$o"'; ${ECHO} ' in'; \
 93 ${ECHO} ' -undef) undef=1;;'; ${ECHO} ' esac'; \
 94 ${ECHO} 'done'; \
 95 ${ECHO} 'if [ -n "$$undef" ]'; ${ECHO} 'then'; \
 96 ${ECHO} 'exec ${ICCBASE}/bin/icc -E -Uunix "$$@"'; \
 97 ${ECHO} 'else'; \
 98 ${ECHO} 'exec ${ICCBASE}/bin/icc -E "$$@"'; \
 99 ${ECHO} 'fi' \
 100 ) > ${.TARGET}
 101 ${RUN}${CHMOD} +x ${.TARGET}
 102
78# Create compiler driver scripts in ${WRKDIR}. 103# Create compiler driver scripts in ${WRKDIR}.
79.for _var_ in ${_ICC_VARS} 104.for _var_ in ${_ICC_VARS}
80. if !target(${_ICC_${_var_}}) 105. if !target(${_ICC_${_var_}})
81override-tools: ${_ICC_${_var_}} 106override-tools: ${_ICC_${_var_}}
82${_ICC_${_var_}}: 107${_ICC_${_var_}}:
83 ${RUN}${MKDIR} ${.TARGET:H} 108 ${RUN}${MKDIR} ${.TARGET:H}
84. if !empty(COMPILER_USE_SYMLINKS:M[Yy][Ee][Ss]) 109. if !empty(COMPILER_USE_SYMLINKS:M[Yy][Ee][Ss])
85 ${RUN}${RM} -f ${.TARGET} 110 ${RUN}${RM} -f ${.TARGET}
86 ${RUN}${LN} -s ${ICCBASE}/bin/${.TARGET:T} ${.TARGET} 111 ${RUN}${LN} -s ${ICCBASE}/bin/${.TARGET:T} ${.TARGET}
87. else 112. else
88 ${RUN} \ 113 ${RUN} \
89 (${ECHO} '#!${TOOLS_SHELL}'; \ 114 (${ECHO} '#!${TOOLS_SHELL}'; \
90 ${ECHO} 'exec ${ICCBASE}/bin/${.TARGET:T} "$$@"'; \ 115 ${ECHO} 'exec ${ICCBASE}/bin/${.TARGET:T} "$$@"'; \