pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/42480: generate cpp wrapper for the Intel C++ compiler



>Number:         42480
>Category:       pkg
>Synopsis:       generate cpp wrapper for the Intel C++ compiler
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 19 20:40:00 +0000 2009
>Originator:     Alexander Nasonov
>Release:        NetBSD 5.99.22
>Organization:
>Environment:
NetBSD aa1nb.lan 5.99.22 NetBSD 5.99.22 (GENERIC) #1: Sat Dec 12 19:53:52 GMT 
2009  
root%aa1nb.lan@localhost:/home/alnsn/src/netbsd-current/src/sys/arch/i386/compile/obj/GENERIC
 i386
>Description:
The attached patch adds a wrapper for the 'icc -E'. For a correctness sake, it 
also adds a check for icpc existence before adding c++ to a list of languages.
>How-To-Repeat:

>Fix:
Index: mk/compiler/icc.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/compiler/icc.mk,v
retrieving revision 1.7
diff -u -r1.7 icc.mk
--- mk/compiler/icc.mk  2 Jun 2009 22:32:49 -0000       1.7
+++ mk/compiler/icc.mk  19 Dec 2009 19:43:16 -0000
@@ -22,6 +22,7 @@
 
 _ICC_DIR=              ${WRKDIR}/.icc
 _ICC_VARS=             # empty
+
 .if exists(${ICCBASE}/bin/icc)
 LANGUAGES.icc+=                c
 _ICC_VARS+=            CC
@@ -29,6 +30,12 @@
 _ALIASES.CC=           cc
 CCPATH=                        ${ICCBASE}/bin/icc
 PKG_CC:=               ${_ICC_CC}
+_ICC_VARS+=            CPP
+_ICC_CPP=              ${_ICC_DIR}/bin/cpp
+PKG_CPP:=              ${_ICC_CPP}
+.endif
+
+.if exists(${ICCBASE}/bin/icpc)
 LANGUAGES.icc+=                c++
 _ICC_VARS+=            CXX
 _ICC_CXX=              ${_ICC_DIR}/bin/icpc
@@ -36,6 +43,7 @@
 CXXPATH=               ${ICCBASE}/bin/icpc
 PKG_CXX:=              ${_ICC_CXX}
 .endif
+
 _COMPILER_STRIP_VARS+= ${_ICC_VARS}
 
 # icc passes rpath directives to the linker using "-Wl,-R".
@@ -75,6 +83,23 @@
 CONFIGURE_ENV+=                ac_cv___attribute__=yes
 .endif
 
+override-tools: ${_ICC_CPP}
+${_ICC_CPP}:
+       ${RUN}${MKDIR} ${.TARGET:H}
+       ${RUN}                                          \
+       (${ECHO} '#!${TOOLS_SHELL}';                    \
+        ${ECHO} 'for o in "$$@"'; ${ECHO} 'do';        \
+        ${ECHO} ' case "$$o"'; ${ECHO} ' in';          \
+        ${ECHO} ' -undef) undef=1;;'; ${ECHO} ' esac'; \
+        ${ECHO} 'done';                                \
+        ${ECHO} 'if [ -n "$$undef" ]'; ${ECHO} 'then'; \
+        ${ECHO} 'exec ${ICCBASE}/bin/icc -E -Uunix "$$@"';     \
+        ${ECHO} 'else';                                \
+        ${ECHO} 'exec ${ICCBASE}/bin/icc -E "$$@"';    \
+        ${ECHO} 'fi'                                   \
+       ) > ${.TARGET}
+       ${RUN}${CHMOD} +x ${.TARGET}
+
 # Create compiler driver scripts in ${WRKDIR}.
 .for _var_ in ${_ICC_VARS}
 .  if !target(${_ICC_${_var_}})



Home | Main Index | Thread Index | Old Index