2002-07-18 13:05:10 +00:00
# New ports collection makefile for: ifc
# Date created: Oct 30, 2001
# Whom: chat95@mbox.kyoto-inet.or.jp
2002-07-08 03:14:41 +00:00
#
# $FreeBSD$
#
2004-02-01 06:29:19 +00:00
PORTNAME = ifc7
2004-01-19 13:44:47 +00:00
PORTVERSION = 7.1.038
2002-11-18 09:27:32 +00:00
CATEGORIES = lang linux devel
MASTER_SITES =
2003-07-12 04:17:57 +00:00
DISTNAME = l_fc_pc_${ PORTVERSION }
2002-07-08 03:14:41 +00:00
EXTRACT_SUFX = .tar
2002-11-18 09:27:32 +00:00
MAINTAINER = maho@FreeBSD.org
2003-03-07 06:14:21 +00:00
COMMENT = Intel' s Fortran compiler, set up to produce native FreeBSD objects
2002-07-08 03:14:41 +00:00
2004-01-19 13:44:47 +00:00
EXTRACT_DEPENDS = rpm2cpio.pl:${ PORTSDIR } /archivers/rpm2cpio
2002-07-08 03:14:41 +00:00
2002-07-18 13:05:10 +00:00
RESTRICTED = Intel forbids any redistribution
2002-07-08 03:14:41 +00:00
NO_PACKAGE = ${ RESTRICTED }
NO_CDROM = ${ RESTRICTED }
2002-11-18 09:27:32 +00:00
ONLY_FOR_ARCHS = i386
2002-07-08 03:14:41 +00:00
2002-07-18 13:05:10 +00:00
USE_LINUX = yes
2002-11-18 09:27:32 +00:00
USE_REINPLACE = yes
2002-07-08 03:14:41 +00:00
NO_WRKSUBDIR = yes
NO_FILTER_SHLIBS = yes
2003-04-28 22:17:47 +00:00
COMPILERDIR = compiler70
PLIST_SUB = COMPILERDIR = ${ COMPILERDIR }
PATCH_WRKSRC = ${ WRKSRC } /opt/intel/${ COMPILERDIR }
MAN1 = ifc.1
MANPREFIX = ${ PREFIX } /intel/${ COMPILERDIR } /
2002-09-22 12:03:30 +00:00
2002-07-18 13:05:10 +00:00
IFC_SITE = http://www.intel.com/software/products/compilers/
2002-07-08 03:14:41 +00:00
. i n c l u d e < b s d . p o r t . p r e . m k >
2004-01-19 13:44:47 +00:00
EXTRACT_AFTER_ARGS = | tar -xf - \
--exclude \* ia64.rpm \
--exclude flexlm64
2003-04-28 22:17:47 +00:00
IFCCFGVAL != ${ UNAME } -r | ${ SED } -e 's/\..*//'
2002-11-18 09:27:32 +00:00
OBJCOPY ?= /usr/bin/objcopy
2002-07-18 13:05:10 +00:00
. 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 } / $ { D I S T N A M E } $ { E X T R A C T _ S U F X } )
2003-10-24 23:17:46 +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 ${ IFC_SITE } to review licensing options \(evaluation, commercial, and free non-commercial\) and obtain a license. Put ${ DISTFILES } into ${ DISTDIR } and run make again "
2002-07-08 03:14:41 +00:00
. e n d i f
2003-04-28 22:17:47 +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 ) #|| \
# exists(${PREFIX}/intel/compiler60/bin/icc) || \
# exists(${PREFIX}/intel/compiler70/bin/icc)
BROKEN = Cannot coexist with linux_devtools or icc
2002-11-08 20:28:25 +00:00
. e n d i f
2002-07-08 03:14:41 +00:00
post-extract :
2003-04-28 22:17:47 +00:00
@${ SED } 's:%%COMPILERDIR%%:${COMPILERDIR}:' ${ FILESDIR } /cpio-exclude \
>${ WRKDIR } /cpio-exclude
2002-11-18 09:27:32 +00:00
. i f d e f i n e d ( N O P O R T D O C S )
2003-04-28 22:17:47 +00:00
@${ SED } 's:%%COMPILERDIR%%:${COMPILERDIR}:' \
${ FILESDIR } /cpio-exclude_noportdocs >>${ WRKDIR } /cpio-exclude
2002-11-18 09:27:32 +00:00
. e n d i f
2003-04-28 22:17:47 +00:00
. f o r i i n \
2004-01-19 13:44:47 +00:00
intel-ifc7-7.1-40.i386.rpm
# intel-iidb7-7.2.2-78.i386.rpm
@cd ${ WRKSRC } && rpm2cpio.pl 2>/dev/null ${ i } | \
2003-04-28 22:17:47 +00:00
${ CPIO } -idfuE ${ WRKDIR } /cpio-exclude --quiet
2002-07-08 03:14:41 +00:00
. e n d f o r
pre-patch :
2002-07-18 13:05:10 +00:00
# Allow everyone to use it
2002-07-08 03:14:41 +00:00
@${ CHMOD } a+rx ${ WRKSRC } /opt
2002-11-18 09:27:32 +00:00
# Remove unneeded/unsafe access rights
2002-07-08 03:14:41 +00:00
. f o r i i n d o c s i a 3 2 / i n c l u d e i a 3 2 / l i b
2003-04-28 22:17:47 +00:00
@${ FIND } ${ WRKSRC } /opt/intel/${ COMPILERDIR } /${ i } -type f -print0 | \
2003-11-13 13:30:42 +00:00
${ XARGS } -0 ${ CHMOD } a-x,g-w
2002-07-08 03:14:41 +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
2002-07-18 13:05:10 +00:00
# Use the Linux ABI for the binaries
2003-04-28 22:17:47 +00:00
. f o r i i n i f c b i n f p p i c i d f 9 0 c o m p r o f m e r g e p r o f o r d e r x i a r x i l d
@brandelf -t Linux ${ WRKSRC } /opt/intel/${ COMPILERDIR } /ia32/bin/${ i }
2002-07-08 03:14:41 +00:00
. e n d f o r
post-patch :
2002-07-18 13:05:10 +00:00
# Correct some paths and patch some files
2003-04-28 22:17:47 +00:00
. f o r i i n i a 3 2 / b i n / i f c i a 3 2 / b i n / i f c v a r s . c s h i a 3 2 / b i n / i f c v a r s . s h
2004-01-19 13:44:47 +00:00
@${ REINPLACE_CMD } -i "" -e ' s:%%ICC_LOCALBASE%%:${ LOCALBASE } :g; \
s@\< INSTALLDIR\> @${ PREFIX } /intel@g; s@man -w@manpath -q@g' \
2003-04-28 22:17:47 +00:00
${ WRKSRC } /opt/intel/${ COMPILERDIR } /${ i }
@${ CHMOD } 755 ${ WRKSRC } /opt/intel/${ COMPILERDIR } /${ i }
. e n d f o r
@${ REINPLACE_CMD } -i "" -e 's:\<INSTALLTIMECOMBOPACKAGEID\>:${DISTNAME}:g' \
${ WRKSRC } /opt/intel/${ COMPILERDIR } /docs/fsupport
. f o r i i n i f c . o r i g
@${ RM } ${ WRKSRC } /opt/intel/${ COMPILERDIR } /ia32/bin/${ i }
2002-07-08 03:14:41 +00:00
. e n d f o r
2002-11-18 09:27:32 +00:00
# Provide a more FreeBSD'ish compile environment
. f o r i i n i f c . c f g
2003-04-28 22:17:47 +00:00
@${ REINPLACE_CMD } -i "" -e 's:-Xlinker -rpath -Xlinker <INSTALLDIR>/${COMPILERDIR}/ia32/lib::g' \
-e 's@\<INSTALLDIR\>@${PREFIX}/intel@g;' \
${ WRKSRC } /opt/intel/${ COMPILERDIR } /ia32/bin/${ i }
@${ ECHO } -e " -Qlocation,ld, ${ PREFIX } /intel/ ${ COMPILERDIR } /ia32/bin/ldwrapper\n\n-Ulinux\n-U__linux__\n-U__linux\n-U__gnu_linux__\n\n-D__FreeBSD__= ${ IFCCFGVAL } \n-D__ELF__=1\n " >>${ WRKSRC } /opt/intel/${ COMPILERDIR } /ia32/bin/${ i }
2004-01-19 13:44:47 +00:00
. i f $ { O S V E R S I O N } < 5 0 0 0 1 6
@${ ECHO } -e "-Qoption,ld,-MT\n" >>${ WRKSRC } /opt/intel/${ COMPILERDIR } /ia32/bin/${ i }
. e n d i f
2003-04-28 22:17:47 +00:00
@${ CHMOD } a-x,g-w ${ WRKSRC } /opt/intel/${ COMPILERDIR } /ia32/bin/${ i }
2002-11-18 09:27:32 +00:00
. e n d f o r
2003-04-28 22:17:47 +00:00
@cd ${ WRKSRC } /opt/intel/${ COMPILERDIR } /ia32/bin/ && ${ LN } -s ifc.cfg ifcbin.cfg
2002-11-18 09:27:32 +00:00
2003-10-24 23:17:46 +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-11-18 09:27:32 +00:00
do-build :
# Fix unresolved references
@cd ${ WRKSRC } && ${ CC } ${ CFLAGS } -c ${ FILESDIR } /assert_fail.c \
2004-01-19 13:44:47 +00:00
${ FILESDIR } /linux_file.c ${ FILESDIR } /linux_stat.c \
2003-04-28 22:17:47 +00:00
${ FILESDIR } /mmap.c ${ FILESDIR } /pthread.c \
2004-01-19 13:44:47 +00:00
${ FILESDIR } /sysconf.c \
2002-11-18 09:27:32 +00:00
${ FILESDIR } /errno_location.c ${ FILESDIR } /mcount.S
2004-01-19 13:44:47 +00:00
. i f ( $ { O S V E R S I O N } < 5 0 2 1 0 1 )
@cd ${ WRKSRC } && ${ CC } ${ CFLAGS } -c ${ FILESDIR } /cxa_atexit.c \
${ FILESDIR } /cxa_finalize.c
. e n d i f
2003-04-28 22:17:47 +00:00
. i f ( $ { O S V E R S I O N } < 4 7 0 1 0 1 ) | | \
2002-11-18 09:27:32 +00:00
( ${ OSVERSION } >= 500000 && ${ OSVERSION } < 500042 )
2003-04-28 22:17:47 +00:00
@${ CC } ${ CFLAGS } -c -o ${ WRKSRC } /stdin.o ${ FILESDIR } /stdin.c
@${ CC } ${ CFLAGS } -c -o ${ WRKSRC } /stdout.o ${ FILESDIR } /stdout.c
2002-11-18 09:27:32 +00:00
@${ CC } ${ CFLAGS } -c -o ${ WRKSRC } /stderr.o ${ FILESDIR } /stderr.c
2003-10-24 23:17:46 +00:00
. e n d i f
2002-11-18 09:27:32 +00:00
. f o r i i n l i b c x a . 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 \
libBINDF90.a libCEPCF90.a libF90.a libIEPCF90.a libPEPCF90.a \
libcprts.a libintrins.a libompstub.a
2003-10-08 00:04:36 +00:00
@${ OBJCOPY } --redefine-sym __sigsetjmp = sigsetjmp \
2003-10-24 23:17:46 +00:00
${ OBJCOPY_OPS } \
2003-04-28 22:17:47 +00:00
${ WRKSRC } /opt/intel/${ COMPILERDIR } /ia32/lib/${ i }
2002-11-18 09:27:32 +00:00
. e n d f o r
2004-01-19 13:44:47 +00:00
@cd ${ WRKSRC } && ${ AR } x /usr/lib/libcompat.a ftime.o
2003-04-28 22:17:47 +00:00
@${ AR } q ${ WRKSRC } /opt/intel/${ COMPILERDIR } /ia32/lib/libcxa.a ${ WRKSRC } /*.o
2002-11-18 09:27:32 +00:00
. f o r i i n B I N D F 9 0 P E P C F 9 0 C E P C F 9 0 P O S F 9 0 I E P C F 9 0
2003-04-28 22:17:47 +00:00
@${ OBJCOPY } --strip-symbol= stat \
--strip-symbol= fstat \
--strip-symbol= lstat \
2004-01-19 13:44:47 +00:00
--redefine-sym lseek = l_lseek \
2003-04-28 22:17:47 +00:00
--redefine-sym lseek64 = lseek \
--redefine-sym open64 = open \
--redefine-sym creat64 = creat \
--redefine-sym ftruncate64 = ftruncate \
--redefine-sym mmap = Mmap \
${ WRKSRC } /opt/intel/${ COMPILERDIR } /ia32/lib/lib${ i } .a
2002-11-18 09:27:32 +00:00
. e n d f o r
# Some magic to be able to link
2003-04-28 22:17:47 +00:00
@${ MKDIR } ${ WRKSRC } /opt/intel/${ COMPILERDIR } /ia32/bin/ldwrapper
@${ CC } ${ CFLAGS } -o \
${ WRKSRC } /opt/intel/${ COMPILERDIR } /ia32/bin/ldwrapper/ld \
${ FILESDIR } /ld.c
@${ STRIP_CMD } ${ WRKSRC } /opt/intel/${ COMPILERDIR } /ia32/bin/ldwrapper/ld
@${ CHMOD } 755 ${ WRKSRC } /opt/intel/${ COMPILERDIR } /ia32/bin/ldwrapper/ld
2002-07-08 03:14:41 +00:00
do-install :
2003-04-28 22:17:47 +00:00
@cd ${ WRKSRC } /opt && ${ FIND } . -print | \
${ CPIO } -pdu -R ${ BINOWN } :${ BINGRP } --quiet ${ PREFIX }
2002-07-08 03:14:41 +00:00
post-install :
@${ ECHO_CMD } " ${ PKGNAME } is now installed in ${ PREFIX } /intel, to use it you have to "
2002-11-18 09:27:32 +00:00
@${ ECHO_CMD } " put your license into your \$ ${ INTEL_FLEXLM_LICENSE } (default: "
@${ ECHO_CMD } " ${ PREFIX } /intel/licenses) directory and add "
2003-04-28 22:17:47 +00:00
@${ ECHO_CMD } " ${ PREFIX } /intel/ ${ COMPILERDIR } /ia32/bin to your PATH. "
2002-11-18 09:27:32 +00:00
@${ ECHO_CMD }
@${ ECHO_CMD } "If you use ifc 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 ifc will hang forever."
@${ ECHO_CMD }
2003-04-28 22:17:47 +00:00
@${ ECHO_CMD } "WARNING: If you use ifc while having linux_devtools installed, ifc will use"
@${ ECHO_CMD } "the wrong includes and therefore will generate bogus (not working) binaries!"
@${ ECHO_CMD }
@${ ECHO_CMD } "If you encounter further problems with ifc please consult the errata at"
@${ ECHO_CMD } "http://support.intel.com/support/performancetools/fortran/Fortran_Compiler_Errata.htm"
@${ ECHO_CMD } "first."
2002-07-08 03:14:41 +00:00
. i n c l u d e < b s d . p o r t . p o s t . m k >