| @@ -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) |
12 | COMPILER_ICC_MK= defined | | 12 | COMPILER_ICC_MK= defined |
13 | | | 13 | |
14 | .include "../../mk/bsd.prefs.mk" | | 14 | .include "../../mk/bsd.prefs.mk" |
15 | | | 15 | |
16 | ICCBASE?= /opt/intel_cc_80 | | 16 | ICCBASE?= /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 | # |
21 | LANGUAGES.icc= # empty | | 21 | LANGUAGES.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) |
26 | LANGUAGES.icc+= c | | 27 | LANGUAGES.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 |
30 | CCPATH= ${ICCBASE}/bin/icc | | 31 | CCPATH= ${ICCBASE}/bin/icc |
31 | PKG_CC:= ${_ICC_CC} | | 32 | PKG_CC:= ${_ICC_CC} |
| | | 33 | _ICC_VARS+= CPP |
| | | 34 | _ICC_CPP= ${_ICC_DIR}/bin/cpp |
| | | 35 | PKG_CPP:= ${_ICC_CPP} |
| | | 36 | .endif |
| | | 37 | |
| | | 38 | .if exists(${ICCBASE}/bin/icpc) |
32 | LANGUAGES.icc+= c++ | | 39 | LANGUAGES.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++ |
36 | CXXPATH= ${ICCBASE}/bin/icpc | | 43 | CXXPATH= ${ICCBASE}/bin/icpc |
37 | PKG_CXX:= ${_ICC_CXX} | | 44 | PKG_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}) |
48 | CC_VERSION_STRING!= ${CCPATH} -V 2>&1 | ${GREP} '^Intel' | | 56 | CC_VERSION_STRING!= ${CCPATH} -V 2>&1 | ${GREP} '^Intel' |
49 | _CC_VERSION!= ${CCPATH} -v 2>&1 || ${TRUE} | | 57 | _CC_VERSION!= ${CCPATH} -v 2>&1 || ${TRUE} |
50 | CC_VERSION= Intel C++ Compiler ${_CC_VERSION} | | 58 | CC_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) |
66 | PREPEND_PATH+= ${_ICC_DIR}/bin | | 74 | PREPEND_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) |
75 | CONFIGURE_ENV+= ac_cv___attribute__=yes | | 83 | CONFIGURE_ENV+= ac_cv___attribute__=yes |
76 | .endif | | 84 | .endif |
77 | | | 85 | |
| | | 86 | override-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_}}) |
81 | override-tools: ${_ICC_${_var_}} | | 106 | override-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} "$$@"'; \ |