2013-04-29 10:57:12 +02:00
# Created by: netchild@FreeBSD.org
2002-03-26 18:01:09 +01:00
PORTNAME = icc
2006-06-21 14:28:56 +02:00
PORTVERSION = 8.1.038
2014-09-14 19:21:26 +02:00
PORTREVISION = 2
2002-08-20 12:01:58 +02:00
CATEGORIES = lang linux devel
2014-09-14 19:21:26 +02:00
MASTER_SITES = #empty
2004-12-12 18:12:26 +01:00
DISTNAME = l_cc_pc_${ PORTVERSION : C /p.+ $// }
2014-09-07 15:37:06 +02:00
DISTFILES = ${ DISTNAME } ${ EXTRACT_SUFX }
2002-03-26 18:01:09 +01:00
2006-12-17 16:14:27 +01:00
# netchild@FreeBSD.org is willing to review patches and to provide background
# infos regarding this port
2017-02-24 02:52:10 +01:00
MAINTAINER = ports@FreeBSD.org
2021-03-22 11:17:43 +01:00
COMMENT = Intel C/C++ compiler, set up to produce native FreeBSD binaries
2002-03-26 18:01:09 +01:00
2021-04-27 14:02:27 +02:00
LICENSE = EPL LGPL21 INTEL
2014-09-14 19:21:26 +02:00
LICENSE_COMB = multi
2021-04-27 14:02:27 +02:00
LICENSE_NAME_INTEL = Intel
LICENSE_TEXT_INTEL = Intel forbids any redistribution.
LICENSE_PERMS_INTEL = auto-accept
2014-09-14 19:21:26 +02:00
2016-04-01 16:08:37 +02:00
EXTRACT_DEPENDS = rpm2cpio.pl:archivers/rpm2cpio
2014-09-07 15:37:06 +02:00
2016-09-05 21:23:42 +02:00
USES = linux
USE_LINUX = base
2004-01-11 16:32:07 +01:00
PATCHLEVEL = ${ PORTVERSION : C /(.+p)(.+) $/pe \2 / }
. i f ${PORTVERSION} != ${ PATCHLEVEL }
2014-09-14 19:21:26 +02:00
DISTFILES += ${ DISTNAME } ${ PATCHLEVEL } ${ EXTRACT_SUFX }
2016-09-05 21:23:42 +02:00
USE_LINUX += base:patch
2004-01-11 16:32:07 +01:00
. e n d i f
2014-09-14 19:21:26 +02:00
ONLY_FOR_ARCHS = i386
2002-03-26 18:01:09 +01:00
2014-09-14 19:21:26 +02:00
USE_LDCONFIG = yes
2002-03-26 18:01:09 +01:00
2004-01-11 16:32:07 +01:00
COMPILERDIR = intel_cc_80
2003-01-11 18:21:41 +01:00
PLIST_SUB = COMPILERDIR = ${ COMPILERDIR }
2004-01-11 16:32:07 +01:00
PATCH_WRKSRC = ${ WRKSRC } /opt/${ COMPILERDIR }
2003-01-11 18:21:41 +01:00
2014-09-07 15:37:06 +02:00
OPTIONS_DEFINE = DOCS
2014-09-14 19:21:26 +02:00
DOCS = BEA_License_Agreement.txt Disclaimer.txt flex_ug.pdf
ICC_SITE = https://software.intel.com/en-us/intel-compilers/
2002-08-20 12:01:58 +02:00
2014-09-14 19:21:26 +02:00
SUB_FILES = pkg-message
SUB_LIST += PKGNAME = ${ PKGNAME } \
COMPILERDIR = ${ COMPILERDIR } \
MAINTAINER = ${ MAINTAINER }
2002-06-08 12:16:20 +02:00
2002-03-26 18:01:09 +01:00
. i n c l u d e < b s d . p o r t . p r e . m k >
2013-04-29 10:57:12 +02:00
EXTRACT_AFTER_ARGS = --exclude cdt-\* .zip \
2004-11-03 00:27:26 +01:00
--exclude eclipse-platform\* .zip \
--exclude intel-icc_ide\* .rpm \
2004-01-19 15:13:32 +01:00
--exclude intel-iidb\* .rpm \
2003-10-22 15:21:30 +02:00
--exclude intel-isubh\* .rpm \
2004-11-03 00:27:26 +01:00
--exclude sdp-core-\* .zip \
2003-10-22 15:21:30 +02:00
--exclude \* ia64.rpm \
--exclude flexlm64
2014-09-07 15:37:06 +02:00
ICCCFGVAL_CMD = ${ UNAME } -r | ${ SED } -e 's/\..*//'
2002-03-31 21:00:05 +02:00
2004-11-16 21:14:47 +01:00
GCCCOMPATVER = 340
GXXINCLUDE = /usr/include/c++/${ GCCCOMPATVER : C /([0-9])([0-9]).+/ \1 . \2 / }
2004-03-13 11:33:18 +01:00
2014-09-07 15:37:06 +02:00
. f o r f i n $ { D I S T F I L E S }
2014-09-14 19:21:26 +02:00
. i f ! e x i s t s ( $ { D I S T D I R } / $ { f } )
IGNORE = go to Intel Premier Support \( https://premier.intel.com/\) to obtain ${ DISTFILES } . Product updates such as this compiler are posted regularly on Premier Support. You must have a license to obtain access to Premier Support. If you do not already have a license go to ${ ICC_SITE } to review licensing options \( evaluation, commercial, and free non-commercial\) and obtain a license. Put ${ DISTFILES } into ${ DISTDIR } and run make again
2002-03-26 18:01:09 +01:00
. e n d i f
2004-01-11 16:32:07 +01:00
. e n d f o r
2002-03-26 18:01:09 +01:00
2004-01-11 16:32:07 +01:00
. i f e x i s t s ( $ { L I N U X B A S E } / b o o t / k e r n e l . h )
2016-11-14 12:26:59 +01:00
BROKEN = cannot coexist with linux_devtools
2002-11-08 21:17:54 +01:00
. e n d i f
2002-03-26 18:01:09 +01:00
post-extract :
2014-09-14 19:21:26 +02:00
cd ${ WRKSRC } && rpm2cpio.pl 2>/dev/null *.rpm | ${ CPIO } -idu --quiet
2002-03-26 18:01:09 +01:00
2004-01-19 15:13:32 +01:00
intel-patch : extract
2004-01-11 16:32:07 +01:00
# Apply patches from Intel.
. i f ${PORTVERSION} != ${ PATCHLEVEL }
2014-09-14 19:21:26 +02:00
${ BRANDELF } -t Linux ${ WRKSRC } _${ PATCHLEVEL } /papply
${ WRKSRC } _${ PATCHLEVEL } /papply ${ WRKSRC } _${ PATCHLEVEL } /icc.rtp \
2004-01-11 16:32:07 +01:00
${ WRKSRC } /opt/${ COMPILERDIR }
. e n d i f
2004-01-19 15:13:32 +01:00
pre-patch : intel -patch
2014-09-14 19:21:26 +02:00
# Remove files we do not need on FreeBSD.
for i in ` ${ CAT } ${ FILESDIR } /exclude` ; do \
2016-10-21 14:51:40 +02:00
${ RM } -r ${ WRKSRC } /opt/${ COMPILERDIR } /$$ i; done
2014-09-07 15:37:06 +02:00
.if ! ${PORT_OPTIONS : MDOCS }
2004-01-11 16:32:07 +01:00
# Remove docs.
2014-09-14 19:21:26 +02:00
for i in ` ${ CAT } ${ FILESDIR } /exclude_noportdocs` ; do \
2016-10-21 14:51:40 +02:00
${ RM } -r ${ WRKSRC } /opt/${ COMPILERDIR } /$$ i; done
2004-01-11 16:32:07 +01:00
. e n d i f
# Remove unneeded/unsafe access rights.
. f o r i i n d o c i n c l u d e l i b
2014-09-14 19:21:26 +02:00
${ FIND } ${ WRKSRC } /opt/${ COMPILERDIR } /${ i } -type f -print0 | \
2004-01-30 13:41:19 +01:00
${ XARGS } -0 ${ CHMOD } a-x,og-w
2002-03-26 18:01:09 +01:00
. e n d f o r
2014-09-14 19:21:26 +02:00
${ FIND } ${ WRKSRC } /opt -type d -print0 | ${ XARGS } -0 ${ CHMOD } go-w
${ CHMOD } a-x ${ WRKSRC } /opt/${ COMPILERDIR } /bin/Errormatch.txt
2002-03-26 18:01:09 +01:00
post-patch :
2002-05-14 15:15:20 +02:00
# Correct some paths and patch some files
2004-01-11 16:32:07 +01:00
. f o r i i n i c c i c c v a r s . c s h i c c v a r s . s h i c p c
2014-09-14 19:21:26 +02:00
${ REINPLACE_CMD } -i "" -e ' s:%%ICC_LOCALBASE%%:${ LOCALBASE } :g; \
2004-01-11 16:32:07 +01:00
s:\< INSTALLDIR\> :${ PREFIX } /${ COMPILERDIR } :g; \
2004-11-16 21:14:47 +01:00
s:%%GXX_INCLUDE%%:${ GXXINCLUDE } :g; \
2004-01-11 16:32:07 +01:00
s:man -w:manpath -q:g' ${ WRKSRC } /opt/${ COMPILERDIR } /bin/${ i }
2014-09-14 19:21:26 +02:00
${ CHMOD } 755 ${ WRKSRC } /opt/${ COMPILERDIR } /bin/${ i }
2002-08-20 12:01:58 +02:00
. e n d f o r
2004-01-11 16:32:07 +01:00
. i f ${PORTVERSION} != ${ PATCHLEVEL }
2014-09-14 19:21:26 +02:00
${ REINPLACE_CMD } -i "" -e \
2004-01-11 16:32:07 +01:00
's:\<installpackageid\>:${DISTNAME}_${PATCHLEVEL}:g' \
${ WRKSRC } /opt/${ COMPILERDIR } /doc/csupport
. e l s e
2014-09-14 19:21:26 +02:00
${ REINPLACE_CMD } -i "" -e 's:\<installpackageid\>:${DISTNAME}:g' \
2004-01-11 16:32:07 +01:00
${ WRKSRC } /opt/${ COMPILERDIR } /doc/csupport
. e n d i f
2014-09-14 19:21:26 +02:00
${ RM } ${ WRKSRC } /opt/${ COMPILERDIR } /include/*.orig
${ RM } ${ WRKSRC } /opt/${ COMPILERDIR } /include/c++/*.orig
2002-11-08 16:59:38 +01:00
. f o r i i n i c c . o r i g i c p c . o r i g
2014-09-14 19:21:26 +02:00
${ RM } ${ WRKSRC } /opt/${ COMPILERDIR } /bin/${ i }
2002-08-20 12:01:58 +02:00
. e n d f o r
2002-05-14 15:15:20 +02:00
# Provide a more FreeBSD'ish compile environment
2002-08-04 22:40:14 +02:00
. f o r i i n i c c . c f g i c p c . c f g
2014-09-14 19:21:26 +02:00
${ ECHO_CMD } -e " -Qlocation,ld, ${ PREFIX } / ${ COMPILERDIR } /bin/ldwrapper\n\n-wr1125\n-we140\n\n-Ulinux\n-U__linux__\n-U__linux\n-U__gnu_linux__\n\n-D__FreeBSD__= $$ ( ${ ICCCFGVAL_CMD } )\n\n " >>${ WRKSRC } /opt/${ COMPILERDIR } /bin/${ i }
${ ECHO_CMD } -e "-D__wchar_t=__ct_rune_t\n" >>${ WRKSRC } /opt/${ COMPILERDIR } /bin/${ i }
${ ECHO_CMD } -e "-restrict\n" >>${ WRKSRC } /opt/${ COMPILERDIR } /bin/${ i }
${ CHMOD } a-x,g-w ${ WRKSRC } /opt/${ COMPILERDIR } /bin/${ i }
2002-08-04 22:40:14 +02:00
. e n d f o r
2002-09-17 14:10:46 +02:00
# C++ hack for icpc
2014-09-14 19:21:26 +02:00
${ ECHO_CMD } -e " -gcc-version= ${ GCCCOMPATVER } \n-cxxlib-gcc\n " \
2004-11-16 21:14:47 +01:00
>>${ WRKSRC } /opt/${ COMPILERDIR } /bin/icpc.cfg
2014-09-14 19:21:26 +02:00
cd ${ WRKSRC } /opt/${ COMPILERDIR } /bin/ && ${ LN } -s icc.cfg iccbin.cfg \
2004-01-11 16:32:07 +01:00
&& ${ LN } -s icpc.cfg icpcbin.cfg
2002-09-17 14:10:46 +02:00
2003-10-22 15:21:30 +02:00
OBJCOPY_OPS = --redefine-sym stdin = __stdinp \
--redefine-sym stdout = __stdoutp \
--redefine-sym stderr = __stderrp
2002-09-17 14:10:46 +02:00
do-build :
2004-03-13 11:33:18 +01:00
# Use the Linux ABI for the binaries
2004-11-03 00:27:26 +01:00
. f o r i i n c o d e c o v i c c b i n i c c f i l t i c p c b i n i c p i m c p c o m p r e l i n k p r o f m e r g e \
proforder profrun pronto_tool tselect xiar xild
2014-09-14 19:21:26 +02:00
${ BRANDELF } -t Linux ${ WRKSRC } /opt/${ COMPILERDIR } /bin/${ i }
2004-01-11 16:32:07 +01:00
. e n d f o r
2002-09-22 15:05:51 +02:00
# Fix unresolved references
2014-09-14 19:21:26 +02:00
cd ${ WRKSRC } && ${ CC } ${ CFLAGS } -c ${ FILESDIR } /assert_fail.c \
2002-11-08 16:59:38 +01:00
${ FILESDIR } /errno_location.c ${ FILESDIR } /mcount.S
2004-11-03 00:27:26 +01:00
. f o r i i n l i b c x a . a l i b c x a g u a r d . a l i b i m f . a l i b i r c . a l i b i r c _ s . a l i b s v m l . a \
libunwind.a
2014-09-14 19:21:26 +02:00
${ OBJCOPY } --redefine-sym __sigsetjmp = sigsetjmp \
2003-10-22 15:21:30 +02:00
${ OBJCOPY_OPS } \
2004-01-11 16:32:07 +01:00
${ WRKSRC } /opt/${ COMPILERDIR } /lib/${ i }
2002-11-08 16:59:38 +01:00
. e n d f o r
2014-09-14 19:21:26 +02:00
${ AR } cr ${ WRKSRC } /opt/${ COMPILERDIR } /lib/libiccfbsd.a ${ WRKSRC } /*.o
2002-05-14 15:15:20 +02:00
# Some magic to be able to link
2014-09-14 19:21:26 +02:00
${ MKDIR } ${ WRKSRC } /opt/${ COMPILERDIR } /bin/ldwrapper
${ CC } ${ CFLAGS } -o \
2004-01-11 16:32:07 +01:00
${ WRKSRC } /opt/${ COMPILERDIR } /bin/ldwrapper/ld \
2003-01-11 18:21:41 +01:00
${ FILESDIR } /ld.c
2014-09-14 19:21:26 +02:00
${ STRIP_CMD } ${ WRKSRC } /opt/${ COMPILERDIR } /bin/ldwrapper/ld
${ CHMOD } 755 ${ WRKSRC } /opt/${ COMPILERDIR } /bin/ldwrapper/ld
2004-11-03 00:27:26 +01:00
# Make ICC happy with regards to crtbegin.o, crtend.o and libgcc.a which it
# expects to find in GXX_ROOT.
2014-09-07 15:37:06 +02:00
. f o r f i n c r t b e g i n . o c r t e n d . o l i b g c c . a
2014-09-14 19:21:26 +02:00
cd ${ WRKSRC } /opt/${ COMPILERDIR } /lib && ${ LN } -s /usr/lib/${ f } ${ f }
2004-11-03 00:27:26 +01:00
. e n d f o r
2005-02-18 22:21:49 +01:00
# The static linking case expects a crtbeginT.o. Based upon inspection of
# /usr/src/contrib/gnu/crtstuff.c it seems it's the same as crtbegin.o.
2014-09-14 19:21:26 +02:00
cd ${ WRKSRC } /opt/${ COMPILERDIR } /lib && ${ LN } -s crtbegin.o crtbeginT.o
2002-03-26 18:01:09 +01:00
do-install :
2014-09-14 19:21:26 +02:00
cd ${ WRKSRC } /opt && ${ FIND } . -print | \
2014-09-07 15:37:06 +02:00
${ CPIO } -pdu --quiet ${ STAGEDIR } ${ PREFIX }
2002-03-26 18:01:09 +01:00
2014-09-14 19:21:26 +02:00
${ MV } ${ STAGEDIR } ${ PREFIX } /${ COMPILERDIR } /man/man1/icc.1 ${ STAGEDIR } ${ MAN1PREFIX } /man/man1
2016-10-21 14:51:40 +02:00
${ RM } -r ${ STAGEDIR } ${ PREFIX } /${ COMPILERDIR } /man
2014-09-14 19:21:26 +02:00
.if ${PORT_OPTIONS : MDOCS }
${ MKDIR } ${ STAGEDIR } ${ DOCSDIR }
cd ${ WRKSRC } && ${ INSTALL_DATA } ${ DOCS } ${ STAGEDIR } ${ DOCSDIR }
${ MV } ${ STAGEDIR } ${ PREFIX } /${ COMPILERDIR } /doc/* ${ STAGEDIR } ${ DOCSDIR }
2016-10-21 14:51:40 +02:00
${ RM } -r ${ STAGEDIR } ${ PREFIX } /${ COMPILERDIR } /doc
2014-09-14 19:21:26 +02:00
. e l s e
${ MKDIR } ${ STAGEDIR } ${ DOCSDIR }
${ MV } ${ STAGEDIR } ${ PREFIX } /${ COMPILERDIR } /doc/* ${ STAGEDIR } ${ DOCSDIR }
2016-10-21 14:51:40 +02:00
${ RM } -r ${ STAGEDIR } ${ PREFIX } /${ COMPILERDIR } /doc
2014-09-14 19:21:26 +02:00
. e n d i f
2002-03-26 18:01:09 +01:00
. i n c l u d e < b s d . p o r t . p o s t . m k >