2002-03-26 18:01:09 +01:00
# New ports collection makefile for: icc
# Date created: 24.Jan.2002
# Whom: netchild@FreeBSD.org
#
# $FreeBSD$
#
PORTNAME = icc
2004-11-16 21:14:47 +01:00
PORTVERSION = 8.1.024
2002-08-20 12:01:58 +02:00
CATEGORIES = lang linux devel
2002-06-08 12:16:20 +02:00
MASTER_SITES =
2004-11-16 21:14:47 +01:00
DISTNAME = l_cc_pu_${ PORTVERSION : C /p.+ $// }
2002-03-26 18:01:09 +01:00
MAINTAINER = netchild@FreeBSD.org
2003-03-28 11:45:57 +01:00
COMMENT = Intels C/C++ compiler, set up to produce native FreeBSD binaries
2002-03-26 18:01:09 +01:00
2004-01-11 16:32:07 +01:00
PATCHLEVEL = ${ PORTVERSION : C /(.+p)(.+) $/pe \2 / }
2004-02-01 14:37:13 +01:00
DISTFILES = ${ DISTNAME } ${ EXTRACT_SUFX }
2004-01-11 16:32:07 +01:00
. i f ${PORTVERSION} != ${ PATCHLEVEL }
2004-02-01 14:37:13 +01:00
DISTFILES += ${ DISTNAME } _${ PATCHLEVEL } ${ EXTRACT_SUFX }
2004-11-16 21:14:47 +01:00
#PATCH_DEPENDS= ${LINUXBASE}/etc/redhat-release:${PORTSDIR}/emulators/linux_base
PATCH_DEPENDS = ${ LINUXBASE } /lib/libc-2.3.2.so:${ PORTSDIR } /emulators/linux_base-8
2004-01-11 16:32:07 +01:00
. e n d i f
2003-12-12 14:43:05 +01:00
EXTRACT_DEPENDS = rpm2cpio.pl:${ PORTSDIR } /archivers/rpm2cpio
2002-03-26 18:01:09 +01:00
RESTRICTED = Intel forbids any redistribution
2002-04-16 17:03:49 +02:00
NO_PACKAGE = ${ RESTRICTED }
NO_CDROM = ${ RESTRICTED }
2002-03-26 18:01:09 +01:00
ONLY_FOR_ARCHS = i386
2004-01-11 16:32:07 +01:00
CONFLICTS = linux_devtools*
2002-03-26 18:01:09 +01:00
2004-11-03 00:27:26 +01:00
#USE_LINUX= yes
RUN_DEPENDS = ${ LINUXBASE } /lib/libc-2.3.2.so:${ PORTSDIR } /emulators/linux_base-8
2002-08-20 12:01:58 +02:00
USE_REINPLACE = yes
2002-03-26 18:01:09 +01:00
NO_FILTER_SHLIBS = yes
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
MAN1 = icc.1
2004-01-11 16:32:07 +01:00
MLINKS = icc.1 icpc.1
MANPREFIX = ${ PREFIX } /${ COMPILERDIR } /
2002-08-20 12:01:58 +02:00
2002-06-08 12:16:20 +02:00
ICC_SITE = http://www.intel.com/software/products/compilers/
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 >
2003-10-22 15:21:30 +02:00
EXTRACT_AFTER_ARGS = | tar -xf - \
2004-11-03 00:27:26 +01:00
--exclude cdt-\* .zip \
--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
2002-03-31 21:00:05 +02:00
ICCCFGVAL != ${ UNAME } -r | ${ SED } -e 's/\..*//'
2004-03-13 11:33:18 +01:00
. i f ( $ { O S V E R S I O N } < 5 0 2 1 0 8 )
2004-11-16 21:14:47 +01:00
PLIST_SUB += MACHINE__TYPES_H = "@comment " STDARG_H = "" SYS_CDEFS_H = ""
2004-03-13 11:33:18 +01:00
. e l s e
PLIST_SUB += STDARG_H = "@comment " SYS_CDEFS_H = "@comment "
2004-11-16 21:14:47 +01:00
. i f $ { O S V E R S I O N } < 5 0 2 1 2 6
GCCCOMPATVER = 330
. e n d i f
. i f $ { O S V E R S I O N } > = 5 0 2 1 2 6
GCCCOMPATVER = 340
. e n d i f
GXXINCLUDE = /usr/include/c++/${ GCCCOMPATVER : C /([0-9])([0-9]).+/ \1 . \2 / }
PLIST_SUB += MACHINE__TYPES_H = ""
2004-03-13 11:33:18 +01:00
. e n d i f
2004-01-11 16:32:07 +01: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 12:59:45 +02: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 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 )
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 :
2004-01-19 15:13:32 +01: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 }
@${ BRANDELF } -t Linux ${ WRKSRC } _${ PATCHLEVEL } /papply
@${ WRKSRC } _${ PATCHLEVEL } /papply ${ WRKSRC } _${ PATCHLEVEL } /icc.rtp \
${ WRKSRC } /opt/${ COMPILERDIR }
. e n d i f
2004-01-19 15:13:32 +01:00
pre-patch : intel -patch
2004-01-11 16:32:07 +01: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 18:01:09 +01:00
@${ CHMOD } a+rx ${ WRKSRC } /opt
2004-01-11 16:32:07 +01: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 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
2003-11-13 14:30:42 +01:00
@${ FIND } ${ WRKSRC } /opt -type d -print0 | ${ XARGS } -0 ${ CHMOD } go-w
2004-01-11 16:32:07 +01:00
@${ 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
@${ REINPLACE_CMD } -i "" -e ' s:%%ICC_LOCALBASE%%:${ LOCALBASE } :g; \
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 }
@${ 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 }
@${ 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 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
2004-01-11 16:32:07 +01: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
2004-11-16 21:14:47 +01: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 } \n\n " >>${ WRKSRC } /opt/${ COMPILERDIR } /bin/${ i }
2004-03-13 11:33:18 +01:00
. i f ( $ { O S V E R S I O N } > = 5 0 0 0 3 9 )
2004-02-01 14:37:13 +01:00
@${ ECHO_CMD } -e "-D__wchar_t=__ct_rune_t\n" >>${ WRKSRC } /opt/${ COMPILERDIR } /bin/${ i }
2004-03-13 11:33:18 +01: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 }
2004-11-16 21:14:47 +01:00
. e l s e
@${ ECHO_CMD } -e "-no-gcc\n" >>${ WRKSRC } /opt/${ COMPILERDIR } /bin/${ i }
2003-01-11 18:21:41 +01:00
. e n d i f
2004-01-11 16:32:07 +01:00
@${ 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
2004-11-16 21:14:47 +01:00
. i f ( $ { O S V E R S I O N } > = 5 0 2 1 0 8 )
@${ ECHO_CMD } -e " -gcc-version= ${ GCCCOMPATVER } \n-cxxlib-gcc\n " \
>>${ WRKSRC } /opt/${ COMPILERDIR } /bin/icpc.cfg
. e l s e
2004-02-01 14:37:13 +01:00
@${ ECHO_CMD } -e " \n-I ${ PREFIX } /include/stlport\n-Qoption,ld,-CPLUSPLUS\n " \
2004-01-11 16:32:07 +01:00
>>${ WRKSRC } /opt/${ COMPILERDIR } /bin/icpc.cfg
2004-11-16 21:14:47 +01:00
. e n d i f
2004-01-11 16:32:07 +01:00
@cd ${ WRKSRC } /opt/${ COMPILERDIR } /bin/ && ${ LN } -s icc.cfg iccbin.cfg \
&& ${ LN } -s icpc.cfg icpcbin.cfg
2004-03-13 11:33:18 +01:00
. i f ( $ { O S V E R S I O N } < 5 0 2 1 0 8 )
2004-11-16 21:14:47 +01:00
# Hack while there's no support for ICC in the stdarg.h and sys/cdefs.h.
2004-01-11 16:32:07 +01: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-11-16 21:14:47 +01:00
. e l s e
# Work around bug for ICC support in src/sys/i386/include/_types.h.
@${ MKDIR } ${ WRKSRC } /opt/${ COMPILERDIR } /include/machine
@${ CP } ${ FILESDIR } /_types.h ${ WRKSRC } /opt/${ COMPILERDIR } /include/machine
2004-03-13 11:33:18 +01:00
. e n d i f
2002-09-17 14:10:46 +02:00
2003-10-22 15:21:30 +02: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 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
2004-01-11 16:32:07 +01:00
@${ BRANDELF } -t Linux ${ WRKSRC } /opt/${ COMPILERDIR } /bin/${ i }
. e n d f o r
2002-09-22 15:05:51 +02:00
# Fix unresolved references
@cd ${ WRKSRC } && ${ CC } ${ CFLAGS } -c ${ FILESDIR } /assert_fail.c \
2002-11-08 16:59:38 +01:00
${ FILESDIR } /errno_location.c ${ FILESDIR } /mcount.S
2003-12-22 16:03:23 +01:00
. i f ( $ { O S V E R S I O N } < 5 0 2 1 0 1 )
2004-01-11 16:32:07 +01:00
@cd ${ WRKSRC } && ${ CC } ${ CFLAGS } -c ${ FILESDIR } /cxa_atexit.c
2003-12-22 16:03:23 +01:00
. e n d i f
2002-11-13 15:39:52 +01: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 18:21:41 +01:00
@${ CC } ${ CFLAGS } -c -o ${ WRKSRC } /stdin.o ${ FILESDIR } /stdin.c
@${ CC } ${ CFLAGS } -c -o ${ WRKSRC } /stdout.o ${ FILESDIR } /stdout.c
2002-11-08 16:59:38 +01:00
@${ CC } ${ CFLAGS } -c -o ${ WRKSRC } /stderr.o ${ FILESDIR } /stderr.c
2003-10-22 15:21:30 +02:00
. e n d i f
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
2003-08-22 13:20:38 +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
2004-11-16 21:14:47 +01: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
2004-01-11 16:32:07 +01:00
@${ MKDIR } ${ WRKSRC } /opt/${ COMPILERDIR } /bin/ldwrapper
2003-01-11 18:21:41 +01:00
@${ 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
2004-01-11 16:32:07 +01: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.
. f o r f i l e 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
@cd ${ WRKSRC } /opt/${ COMPILERDIR } /lib && ${ LN } -s /usr/lib/${ file } ${ file }
. e n d f o r
2002-03-26 18:01:09 +01:00
do-install :
2003-03-28 11:45:57 +01:00
@cd ${ WRKSRC } /opt && ${ FIND } . -print | \
${ CPIO } -pdu -R ${ BINOWN } :${ BINGRP } --quiet ${ PREFIX }
2002-03-26 18:01:09 +01:00
post-install :
2004-11-16 21:14:47 +01:00
@${ ECHO } " ${ PKGNAME } is now installed in ${ PREFIX } / ${ COMPILERDIR } , to use it you have to put your license into your \$ ${ INTEL_FLEXLM_LICENSE } (default: ${ PREFIX } / ${ COMPILERDIR } /licenses) directory and add ${ PREFIX } / ${ COMPILERDIR } /bin to your PATH. " | fmt
2004-02-01 14:37:13 +01:00
@${ ECHO }
2004-11-16 21:14:47 +01:00
@${ ECHO } "On FreeBSD 5 with __FreeBSD_version >= 502108 icpc is set up to use the GNU libstdc++ from the base as STL by default. Alternatively you can use the \"-cxxlib-icc\" option with icpc to use devel/stlport-icc as STL instead. In order to be able to compile C++ source with icpc on FreeBSD 4 or FreeBSD 5 with __FreeBSD_version < 502108 you have to install devel/stlport-icc. No further options to icpc to use devel/stlport-icc are required there." | fmt
2004-02-01 14:37:13 +01:00
@${ ECHO }
2004-11-16 21:14:47 +01:00
@${ ECHO } "If you use icc on a Pentium 4 you may have to use 'options CPU_ENABLE_SSE' (depending on the OS version, if in doubt try if it works) in your kernel config (have a look at http://www.FreeBSD.org/handbook/ if you do not know how to do this), else icc will hang forever." | fmt
2004-02-01 14:37:13 +01:00
@${ ECHO }
2004-11-16 21:14:47 +01:00
@${ ECHO } "WARNING: If you use icc while having linux_devtools installed, icc will use the wrong includes and therefore will generate bogus (not working) binaries!" | fmt
2004-02-01 14:37:13 +01:00
@${ ECHO }
2004-11-16 21:14:47 +01:00
@${ ECHO } "If you encounter further problems with icc please consult the errata at http://support.intel.com/support/performancetools/c/C_Compiler_Errata.htm first." | fmt
2004-02-01 14:37:13 +01:00
@${ ECHO }
@${ ECHO } "Call for benchmarks:"
2004-11-16 21:14:47 +01:00
@${ ECHO } " Intel is interested to see some benchmark numbers which compare gcc with icc. If you have a CPU produced by Intel and are able to do benchmarks with either your own source or with one of our major ports (e.g. with a webserver, a mailserver, a database system, an important graphics suite/program or some important math tool, ...) please try to spend some time to do a benchmark and send me ( ${ MAINTAINER } ) the result. You should include your system specs (CPU: speed/model, RAM: amount/speed, used disks (if necessary), chipset/mainboard type, ...), the version of the used software (OS, gcc, icc, ...), non default tuning options (kernel, sysctl) and the used compiler switches. If you don't use some 'standard' benchmark (e.g. the official MySQL benchmark, or the performance test suite of your prefered scripting language), please include a description about the benchmark too. " | fmt
2004-02-01 14:37:13 +01:00
@${ ECHO }
2004-11-16 21:14:47 +01:00
@${ ECHO } "Please use FreeBSD as the name of your OS in communications with the support, the larger the FreeBSD userbase is, the more work gets done on FreeBSD specific issues by Intel. And please thank them for the FreeBSD support, they are already spending some time to improve icc on FreeBSD." | fmt
2004-02-01 14:37:13 +01:00
@${ ECHO }
2004-11-16 21:14:47 +01:00
@${ ECHO } "To read the entire post install message again, just run 'make post-install | less'." | fmt
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 >