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-07-24 11:16:50 +00:00
PORTVERSION = 8.0.066p070.1
2002-08-20 10:01:58 +00:00
CATEGORIES = lang linux devel
2002-06-08 10:16:20 +00:00
MASTER_SITES =
2004-06-03 11:19:01 +00:00
DISTNAME = l_cc_pc_${ 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 / }
2004-02-01 13:37:13 +00:00
DISTFILES = ${ DISTNAME } ${ EXTRACT_SUFX }
2004-01-11 15:32:07 +00:00
. i f ${PORTVERSION} != ${ PATCHLEVEL }
2004-02-01 13:37:13 +00:00
DISTFILES += ${ DISTNAME } _${ PATCHLEVEL } ${ EXTRACT_SUFX }
2004-01-11 15:32:07 +00:00
. e n d i f
2003-12-12 13:43:05 +00:00
EXTRACT_DEPENDS = rpm2cpio.pl:${ PORTSDIR } /archivers/rpm2cpio
2004-03-13 10:33:18 +00:00
PATCH_DEPENDS = ${ LINUXBASE } /etc/redhat-release:${ PORTSDIR } /emulators/linux_base
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 - \
2004-01-19 14:13:32 +00:00
--exclude intel-iidb\* .rpm \
2003-10-22 13:21:30 +00:00
--exclude intel-isubh\* .rpm \
--exclude \* ia64.rpm \
--exclude flexlm64
2002-03-31 19:00:05 +00:00
ICCCFGVAL != ${ UNAME } -r | ${ SED } -e 's/\..*//'
2004-03-13 10:33:18 +00:00
. i f ( $ { O S V E R S I O N } < 5 0 2 1 0 8 )
PLIST_SUB += STDARG_H = "" SYS_CDEFS_H = ""
. e l s e
PLIST_SUB += STDARG_H = "@comment " SYS_CDEFS_H = "@comment "
. e n d i f
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 :
2004-01-19 14:13:32 +00:00
@cd ${ WRKSRC } && rpm2cpio.pl 2>/dev/null *.rpm | ${ CPIO } -idu --quiet
2002-03-26 17:01:09 +00:00
2004-01-19 14:13:32 +00:00
intel-patch : extract
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
2004-01-19 14:13:32 +00:00
pre-patch : intel -patch
2004-01-11 15:32:07 +00:00
# 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 | \
2004-01-30 12:41:19 +00:00
${ XARGS } -0 ${ CHMOD } a-x,og-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-02-01 13:37:13 +00:00
@${ ECHO_CMD } -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 }
2004-03-13 10:33:18 +00:00
. i f ( $ { O S V E R S I O N } > = 5 0 0 0 3 9 )
2004-02-01 13:37:13 +00:00
@${ ECHO_CMD } -e "-D__wchar_t=__ct_rune_t\n" >>${ WRKSRC } /opt/${ COMPILERDIR } /bin/${ i }
2004-03-13 10:33:18 +00:00
. e n d i f
. i f ( $ { O S V E R S I O N } > = 5 0 2 1 0 8 )
@${ ECHO_CMD } -e "-restrict\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-02-01 13:37:13 +00:00
@${ ECHO_CMD } -e " \n-I ${ PREFIX } /include/stlport\n-Qoption,ld,-CPLUSPLUS\n " \
2004-01-11 15:32:07 +00:00
>>${ 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.
2004-03-13 10:33:18 +00:00
. i f ( $ { O S V E R S I O N } < 5 0 2 1 0 8 )
2004-01-11 15:32:07 +00:00
@${ CP } ${ FILESDIR } /stdarg.h ${ WRKSRC } /opt/${ COMPILERDIR } /include
@${ MKDIR } ${ WRKSRC } /opt/${ COMPILERDIR } /include/sys
@${ CP } ${ FILESDIR } /cdefs.h ${ WRKSRC } /opt/${ COMPILERDIR } /include/sys
2004-03-13 10:33:18 +00:00
. e n d i f
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-03-13 10:33:18 +00:00
# Use the Linux ABI for the binaries
2004-01-11 15:32:07 +00: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 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-02-01 13:37:13 +00:00
@${ ECHO } " ${ PKGNAME } is now installed in ${ PREFIX } / ${ COMPILERDIR } , to use it you have to "
@${ ECHO } " put your license into your \$ ${ INTEL_FLEXLM_LICENSE } (default: "
@${ ECHO } " ${ PREFIX } / ${ COMPILERDIR } /licenses) directory and add "
@${ ECHO } " ${ PREFIX } / ${ COMPILERDIR } /bin to your PATH. "
@${ ECHO }
@${ ECHO } "In order to be able to compile C++ source with icpc you have to install"
@${ ECHO } "devel/stlport-icc."
@${ ECHO }
@${ ECHO } "If you use icc on a Pentium 4 make sure you have 'options CPU_ENABLE_SSE'"
@${ ECHO } "in your kernel config (have a look at http://www.FreeBSD.org/handbook/"
@${ ECHO } "if you do not know how to do this), else icc will hang forever."
@${ ECHO }
@${ ECHO } "WARNING: If you use icc while having linux_devtools installed, icc will use"
@${ ECHO } "the wrong includes and therefore will generate bogus (not working) binaries!"
@${ ECHO }
@${ ECHO } "If you encounter further problems with icc please consult the errata at"
@${ ECHO } "http://support.intel.com/support/performancetools/c/C_Compiler_Errata.htm"
@${ ECHO } "first."
@${ ECHO }
@${ ECHO } "Call for benchmarks:"
@${ ECHO } "Intel is interested to see some benchmark numbers which compare gcc with icc."
@${ ECHO } "If you have a CPU produced by Intel and are able to do benchmarks with"
@${ ECHO } "either your own source or with one of our major ports (e.g. with"
@${ ECHO } "a webserver, a mailserver, a database system, an important graphics"
@${ ECHO } "suite/program or some important math tool, ...) please try to spend some time"
@${ ECHO } " to do a benchmark and send me ( ${ MAINTAINER } ) the result. You should "
@${ ECHO } "include your system specs (CPU: speed/model, RAM: amount/speed, used disks"
@${ ECHO } "(if necessary), chipset/mainboard type, ...), the version of the used"
@${ ECHO } "software (OS, gcc, icc, ...), non default tuning options (kernel, sysctl) and"
@${ ECHO } "the used compiler switches. If you don't use some 'standard' benchmark"
@${ ECHO } "(e.g. the official MySQL benchmark, or the performance test suite of your"
@${ ECHO } "prefered scripting language), please include a description about the"
@${ ECHO } "benchmark too."
@${ ECHO }
@${ ECHO } "Please use FreeBSD as the name of your OS in communications with the support,"
@${ ECHO } "the larger the FreeBSD userbase is, the more work gets done on FreeBSD"
@${ ECHO } "specific issues by Intel. And please thank them for the FreeBSD support,"
@${ ECHO } "they are already spending some time to improve icc on FreeBSD."
@${ ECHO }
@${ ECHO } "To read the entire post install message again, just run"
@${ ECHO } "'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 >