2002-03-26 17:01:09 +00:00
# New ports collection makefile for: icc
# Date created: 24.Jan.2002
# Whom: netchild@FreeBSD.org
#
# $FreeBSD$
#
PORTNAME = icc
2004-01-11 15:32:07 +00:00
PORTVERSION = 8.0.055.p057
2002-08-20 10:01:58 +00:00
CATEGORIES = lang linux devel
2002-06-08 10:16:20 +00:00
MASTER_SITES =
2004-01-11 15:32:07 +00:00
DISTNAME = l_cc_p_${ PORTVERSION : C / \. p .+ $// }
2002-03-26 17:01:09 +00:00
MAINTAINER = netchild@FreeBSD.org
2003-03-28 10:45:57 +00:00
COMMENT = Intels C/C++ compiler, set up to produce native FreeBSD binaries
2002-03-26 17:01:09 +00:00
2004-01-11 15:32:07 +00:00
PATCHLEVEL = ${ PORTVERSION : C /(.+p)(.+) $/pe \2 / }
. i f ${PORTVERSION} != ${ PATCHLEVEL }
DISTFILES = ${ DISTNAME } ${ EXTRACT_SUFX } \
${ DISTNAME } _${ PATCHLEVEL } ${ EXTRACT_SUFX }
. e n d i f
2003-12-12 13:43:05 +00:00
EXTRACT_DEPENDS = rpm2cpio.pl:${ PORTSDIR } /archivers/rpm2cpio
2002-03-26 17:01:09 +00:00
RESTRICTED = Intel forbids any redistribution
2002-04-16 15:03:49 +00:00
NO_PACKAGE = ${ RESTRICTED }
NO_CDROM = ${ RESTRICTED }
2002-03-26 17:01:09 +00:00
ONLY_FOR_ARCHS = i386
2004-01-11 15:32:07 +00:00
CONFLICTS = linux_devtools*
2002-03-26 17:01:09 +00:00
2002-05-28 03:22:32 +00:00
USE_LINUX = yes
2002-08-20 10:01:58 +00:00
USE_REINPLACE = yes
2002-03-26 17:01:09 +00:00
NO_FILTER_SHLIBS = yes
2004-01-11 15:32:07 +00:00
COMPILERDIR = intel_cc_80
2003-01-11 17:21:41 +00:00
PLIST_SUB = COMPILERDIR = ${ COMPILERDIR }
2004-01-11 15:32:07 +00:00
PATCH_WRKSRC = ${ WRKSRC } /opt/${ COMPILERDIR }
2003-01-11 17:21:41 +00:00
MAN1 = icc.1
2004-01-11 15:32:07 +00:00
MLINKS = icc.1 icpc.1
MANPREFIX = ${ PREFIX } /${ COMPILERDIR } /
2002-08-20 10:01:58 +00:00
2002-06-08 10:16:20 +00:00
ICC_SITE = http://www.intel.com/software/products/compilers/
2002-03-26 17:01:09 +00:00
. i n c l u d e < b s d . p o r t . p r e . m k >
2003-10-22 13:21:30 +00:00
EXTRACT_AFTER_ARGS = | tar -xf - \
--exclude intel-isubh\* .rpm \
--exclude \* ia64.rpm \
--exclude flexlm64
2002-03-31 19:00:05 +00:00
ICCCFGVAL != ${ UNAME } -r | ${ SED } -e 's/\..*//'
2004-01-11 15:32:07 +00:00
BRANDELF ?= /usr/bin/brandelf
2003-03-28 10:45:57 +00:00
CPIO ?= /usr/bin/cpio
2002-11-08 15:59:38 +00:00
OBJCOPY ?= /usr/bin/objcopy
2004-01-11 15:32:07 +00:00
. f o r f i l e i n $ { D I S T F I L E S }
. i f ! e x i s t s ( $ { D I S T D I R } / $ { D I S T _ S U B D I R } / $ { f i l e } )
2003-10-11 10:59:45 +00:00
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 17:01:09 +00:00
. e n d i f
2004-01-11 15:32:07 +00:00
. e n d f o r
2002-03-26 17:01:09 +00:00
2004-01-11 15:32:07 +00: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 )
BROKEN = Cannot coexist with linux_devtools
2002-11-08 20:17:54 +00:00
. e n d i f
2002-03-26 17:01:09 +00:00
post-extract :
2003-01-11 17:21:41 +00:00
. f o r i i n \
2004-01-11 15:32:07 +00:00
intel-icc8-8.0-44.i386.rpm \
# intel-iidb7-7.3.1-85.i386.rpm
@cd ${ WRKSRC } && rpm2cpio.pl 2>/dev/null ${ i } | ${ CPIO } -idu --quiet
2002-03-26 17:01:09 +00:00
. e n d f o r
pre-patch :
2004-01-11 15:32:07 +00:00
# Apply patches from Intel.
. i f ${PORTVERSION} != ${ PATCHLEVEL }
@${ BRANDELF } -t Linux ${ WRKSRC } _${ PATCHLEVEL } /papply
@${ WRKSRC } _${ PATCHLEVEL } /papply ${ WRKSRC } _${ PATCHLEVEL } /icc.rtp \
${ WRKSRC } /opt/${ COMPILERDIR }
. e n d i f
# Remove files we do not neet on FreeBSD.
@for i in ` ${ CAT } ${ FILESDIR } /exclude` ; do \
${ RM } -rf ${ WRKSRC } /opt/${ COMPILERDIR } /$$ i; \
done
. i f d e f i n e d ( N O P O R T D O C S )
# Remove docs.
@for i in ` ${ CAT } ${ FILESDIR } /exclude_noportdocs` ; do \
${ RM } -rf ${ WRKSRC } /opt/${ COMPILERDIR } /$$ i; \
done
. e n d i f
# Allow everyone to use it.
2002-03-26 17:01:09 +00:00
@${ CHMOD } a+rx ${ WRKSRC } /opt
2004-01-11 15:32:07 +00:00
# Remove unneeded/unsafe access rights.
. f o r i i n d o c i n c l u d e l i b
@${ FIND } ${ WRKSRC } /opt/${ COMPILERDIR } /${ i } -type f -print0 | \
2003-11-13 13:30:42 +00:00
${ XARGS } -0 ${ CHMOD } a-x,g-w
2002-03-26 17:01:09 +00:00
. e n d f o r
2003-11-13 13:30:42 +00:00
@${ FIND } ${ WRKSRC } /opt -type d -print0 | ${ XARGS } -0 ${ CHMOD } go-w
2004-01-11 15:32:07 +00:00
@${ CHMOD } a-x ${ WRKSRC } /opt/${ COMPILERDIR } /bin/Errormatch.txt
2002-03-26 17:01:09 +00:00
post-patch :
2002-05-14 13:15:20 +00:00
# Correct some paths and patch some files
2004-01-11 15:32:07 +00: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
@${ REINPLACE_CMD } -i "" -e ' s:%%ICC_LOCALBASE%%:${ LOCALBASE } :g; \
s:\< INSTALLDIR\> :${ PREFIX } /${ COMPILERDIR } :g; \
s:man -w:manpath -q:g' ${ WRKSRC } /opt/${ COMPILERDIR } /bin/${ i }
@${ CHMOD } 755 ${ WRKSRC } /opt/${ COMPILERDIR } /bin/${ i }
2002-08-20 10:01:58 +00:00
. e n d f o r
2004-01-11 15:32:07 +00:00
. i f ${PORTVERSION} != ${ PATCHLEVEL }
@${ REINPLACE_CMD } -i "" -e \
's:\<installpackageid\>:${DISTNAME}_${PATCHLEVEL}:g' \
${ WRKSRC } /opt/${ COMPILERDIR } /doc/csupport
. e l s e
@${ REINPLACE_CMD } -i "" -e 's:\<installpackageid\>:${DISTNAME}:g' \
${ WRKSRC } /opt/${ COMPILERDIR } /doc/csupport
. e n d i f
@${ RM } ${ WRKSRC } /opt/${ COMPILERDIR } /include/*.orig
@${ RM } ${ WRKSRC } /opt/${ COMPILERDIR } /include/c++/*.orig
2002-11-08 15:59:38 +00:00
. f o r i i n i c c . o r i g i c p c . o r i g
2004-01-11 15:32:07 +00:00
@${ RM } ${ WRKSRC } /opt/${ COMPILERDIR } /bin/${ i }
2002-08-20 10:01:58 +00:00
. e n d f o r
2002-05-14 13:15:20 +00:00
# Provide a more FreeBSD'ish compile environment
2002-08-04 20:40:14 +00:00
. f o r i i n i c c . c f g i c p c . c f g
2004-01-11 15:32:07 +00:00
@${ ECHO } -e " -no-gcc\n-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 } \n\n " >>${ WRKSRC } /opt/${ COMPILERDIR } /bin/${ i }
2003-01-11 17:21:41 +00:00
. i f $ { O S V E R S I O N } > = 5 0 0 0 3 9
2004-01-11 15:32:07 +00:00
@${ ECHO } -e "-D__wchar_t=__ct_rune_t\n" >>${ WRKSRC } /opt/${ COMPILERDIR } /bin/${ i }
2003-01-11 17:21:41 +00:00
. e n d i f
2004-01-11 15:32:07 +00:00
@${ CHMOD } a-x,g-w ${ WRKSRC } /opt/${ COMPILERDIR } /bin/${ i }
2002-08-04 20:40:14 +00:00
. e n d f o r
2002-09-17 12:10:46 +00:00
# C++ hack for icpc
2004-01-11 15:32:07 +00:00
@${ ECHO } -e " \n-I ${ PREFIX } /include/stlport\n-Qoption,ld,-CPLUSPLUS\n " \
>>${ WRKSRC } /opt/${ COMPILERDIR } /bin/icpc.cfg
@cd ${ WRKSRC } /opt/${ COMPILERDIR } /bin/ && ${ LN } -s icc.cfg iccbin.cfg \
&& ${ LN } -s icpc.cfg icpcbin.cfg
# Hack while there's no support for icc in the stdarg.h and sys/cdefs.h.
@${ CP } ${ FILESDIR } /stdarg.h ${ WRKSRC } /opt/${ COMPILERDIR } /include
@${ MKDIR } ${ WRKSRC } /opt/${ COMPILERDIR } /include/sys
@${ CP } ${ FILESDIR } /cdefs.h ${ WRKSRC } /opt/${ COMPILERDIR } /include/sys
2002-09-17 12:10:46 +00:00
2003-10-22 13:21:30 +00:00
. i f ( $ { O S V E R S I O N } > = 4 7 0 1 0 1 & & $ { O S V E R S I O N } < 5 0 0 0 0 0 ) | | \
( ${ OSVERSION } >= 500042 )
OBJCOPY_OPS = --redefine-sym stdin = __stdinp \
--redefine-sym stdout = __stdoutp \
--redefine-sym stderr = __stderrp
. e n d i f
2002-09-17 12:10:46 +00:00
do-build :
2004-01-11 15:32:07 +00:00
# Use the Linux ABI for the binaries
. 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 o f m e r g e p r o f o r d e r t s e l e c t x i a r x i l d
@${ BRANDELF } -t Linux ${ WRKSRC } /opt/${ COMPILERDIR } /bin/${ i }
. e n d f o r
2002-09-22 13:05:51 +00:00
# Fix unresolved references
@cd ${ WRKSRC } && ${ CC } ${ CFLAGS } -c ${ FILESDIR } /assert_fail.c \
2002-11-08 15:59:38 +00:00
${ FILESDIR } /errno_location.c ${ FILESDIR } /mcount.S
2003-12-22 15:03:23 +00:00
. i f ( $ { O S V E R S I O N } < 5 0 2 1 0 1 )
2004-01-11 15:32:07 +00:00
@cd ${ WRKSRC } && ${ CC } ${ CFLAGS } -c ${ FILESDIR } /cxa_atexit.c
2003-12-22 15:03:23 +00:00
. e n d i f
2002-11-13 14:39:52 +00:00
. i f ( $ { O S V E R S I O N } < 4 7 0 1 0 1 ) | | \
( ${ OSVERSION } >= 500000 && ${ OSVERSION } < 500042 )
2003-01-11 17:21:41 +00:00
@${ CC } ${ CFLAGS } -c -o ${ WRKSRC } /stdin.o ${ FILESDIR } /stdin.c
@${ CC } ${ CFLAGS } -c -o ${ WRKSRC } /stdout.o ${ FILESDIR } /stdout.c
2002-11-08 15:59:38 +00:00
@${ CC } ${ CFLAGS } -c -o ${ WRKSRC } /stderr.o ${ FILESDIR } /stderr.c
2003-10-22 13:21:30 +00:00
. e n d i f
2004-01-11 15:32:07 +00: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 m t . a l i b u n w i n d . a
2003-08-22 11:20:38 +00:00
@${ OBJCOPY } --redefine-sym __sigsetjmp = sigsetjmp \
2003-10-22 13:21:30 +00:00
${ OBJCOPY_OPS } \
2004-01-11 15:32:07 +00:00
${ WRKSRC } /opt/${ COMPILERDIR } /lib/${ i }
2002-11-08 15:59:38 +00:00
. e n d f o r
2004-01-11 15:32:07 +00:00
@${ AR } q ${ WRKSRC } /opt/${ COMPILERDIR } /lib/libcxa.a ${ WRKSRC } /*.o
@${ AR } q ${ WRKSRC } /opt/${ COMPILERDIR } /lib/libcxaguard.a ${ WRKSRC } /*.o
2002-05-14 13:15:20 +00:00
# Some magic to be able to link
2004-01-11 15:32:07 +00:00
@${ MKDIR } ${ WRKSRC } /opt/${ COMPILERDIR } /bin/ldwrapper
2003-01-11 17:21:41 +00:00
@${ CC } ${ CFLAGS } -o \
2004-01-11 15:32:07 +00:00
${ WRKSRC } /opt/${ COMPILERDIR } /bin/ldwrapper/ld \
2003-01-11 17:21:41 +00:00
${ FILESDIR } /ld.c
2004-01-11 15:32:07 +00:00
@${ STRIP_CMD } ${ WRKSRC } /opt/${ COMPILERDIR } /bin/ldwrapper/ld
@${ CHMOD } 755 ${ WRKSRC } /opt/${ COMPILERDIR } /bin/ldwrapper/ld
2002-03-26 17:01:09 +00:00
do-install :
2003-03-28 10:45:57 +00:00
@cd ${ WRKSRC } /opt && ${ FIND } . -print | \
${ CPIO } -pdu -R ${ BINOWN } :${ BINGRP } --quiet ${ PREFIX }
2002-03-26 17:01:09 +00:00
post-install :
2004-01-11 15:32:07 +00:00
@${ ECHO_CMD } " ${ PKGNAME } is now installed in ${ PREFIX } / ${ COMPILERDIR } , to use it you have to "
2002-05-13 13:58:21 +00:00
@${ ECHO_CMD } " put your license into your \$ ${ INTEL_FLEXLM_LICENSE } (default: "
2004-01-11 15:32:07 +00:00
@${ ECHO_CMD } " ${ PREFIX } / ${ COMPILERDIR } /licenses) directory and add "
@${ ECHO_CMD } " ${ PREFIX } / ${ COMPILERDIR } /bin to your PATH. "
2002-07-14 16:31:40 +00:00
@${ ECHO_CMD }
2002-09-20 12:16:25 +00:00
@${ ECHO_CMD } "In order to be able to compile C++ source with icpc you have to install"
2003-12-22 15:03:23 +00:00
@${ ECHO_CMD } "devel/stlport-icc."
2002-09-20 12:16:25 +00:00
@${ ECHO_CMD }
@${ ECHO_CMD } "If you use icc on a Pentium 4 make sure you have 'options CPU_ENABLE_SSE'"
@${ ECHO_CMD } "in your kernel config (have a look at http://www.FreeBSD.org/handbook/"
@${ ECHO_CMD } "if you do not know how to do this), else icc will hang forever."
@${ ECHO_CMD }
2002-11-08 20:17:54 +00:00
@${ ECHO_CMD } "WARNING: If you use icc while having linux_devtools installed, icc will use"
@${ ECHO_CMD } "the wrong includes and therefore will generate bogus (not working) binaries!"
2003-02-10 14:04:11 +00:00
@${ ECHO_CMD }
@${ ECHO_CMD } "If you encounter further problems with icc please consult the errata at"
@${ ECHO_CMD } "http://support.intel.com/support/performancetools/c/C_Compiler_Errata.htm"
@${ ECHO_CMD } "first."
2003-08-15 13:00:08 +00:00
@${ ECHO_CMD }
@${ ECHO_CMD } "Call for benchmarks:"
@${ ECHO_CMD } "Intel is interested to see some benchmark numbers which compare gcc with icc."
@${ ECHO_CMD } "If you have a CPU produced by Intel and are able to do benchmarks with"
@${ ECHO_CMD } "either your own source or with one of our major ports (e.g. with"
@${ ECHO_CMD } "a webserver, a mailserver, a database system, an important graphics"
@${ ECHO_CMD } "suite/program or some important math tool, ...) please try to spend some time"
@${ ECHO_CMD } " to do a benchmark and send me ( ${ MAINTAINER } ) the result. You should "
@${ ECHO_CMD } "include your system specs (CPU: speed/model, RAM: amount/speed, used disks"
@${ ECHO_CMD } "(if necessary), chipset/mainboard type, ...), the version of the used"
@${ ECHO_CMD } "software (OS, gcc, icc, ...), non default tuning options (kernel, sysctl) and"
@${ ECHO_CMD } "the used compiler switches. If you don't use some 'standard' benchmark"
@${ ECHO_CMD } "(e.g. the official MySQL benchmark, or the performance test suite of your"
@${ ECHO_CMD } "prefered scripting language), please include a description about the"
@${ ECHO_CMD } "benchmark too."
@${ ECHO_CMD }
2003-11-10 21:32:11 +00:00
@${ ECHO_CMD } "Please use FreeBSD as the name of your OS in communications with the support,"
@${ ECHO_CMD } "the larger the FreeBSD userbase is, the more work gets done on FreeBSD"
@${ ECHO_CMD } "specific issues by Intel. And please thank them for the FreeBSD support,"
@${ ECHO_CMD } "they are already spending some time to improve icc on FreeBSD."
@${ ECHO_CMD }
2003-08-15 13:00:08 +00:00
@${ ECHO_CMD } "To read the entire post install message again, just run"
@${ ECHO_CMD } "'make post-install | less'."
2002-03-26 17:01:09 +00:00
. i n c l u d e < b s d . p o r t . p o s t . m k >