aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormaho <maho@FreeBSD.org>2004-01-19 21:44:47 +0800
committermaho <maho@FreeBSD.org>2004-01-19 21:44:47 +0800
commitbd5ef1d5768af815d7c112c61016483d1bcdfb1e (patch)
tree2101aa4ce2a59d12292b45a520fe85d1e7aed6ee
parent0c2796e389488ec2a3d5137873100b317807553c (diff)
downloadfreebsd-ports-graphics-bd5ef1d5768af815d7c112c61016483d1bcdfb1e.tar.gz
freebsd-ports-graphics-bd5ef1d5768af815d7c112c61016483d1bcdfb1e.tar.zst
freebsd-ports-graphics-bd5ef1d5768af815d7c112c61016483d1bcdfb1e.zip
update to ifc to 7.1.038.
Submitted by: Masakazu HIGAKI <higamasa@dream.com>
-rw-r--r--lang/ifc/Makefile35
-rw-r--r--lang/ifc/distinfo2
-rw-r--r--lang/ifc/files/cpio-exclude75
-rw-r--r--lang/ifc/files/ld.c375
-rw-r--r--lang/ifc/files/linux_file.c148
-rw-r--r--lang/ifc/files/patch-ia32::bin::ifc45
-rw-r--r--lang/ifc/pkg-plist4
-rw-r--r--lang/ifc7/Makefile35
-rw-r--r--lang/ifc7/distinfo2
-rw-r--r--lang/ifc7/files/cpio-exclude75
-rw-r--r--lang/ifc7/files/ld.c375
-rw-r--r--lang/ifc7/files/linux_file.c148
-rw-r--r--lang/ifc7/files/patch-ia32::bin::ifc45
-rw-r--r--lang/ifc7/pkg-plist4
14 files changed, 478 insertions, 890 deletions
diff --git a/lang/ifc/Makefile b/lang/ifc/Makefile
index fe5fb1b265b..38000221be3 100644
--- a/lang/ifc/Makefile
+++ b/lang/ifc/Makefile
@@ -6,8 +6,7 @@
#
PORTNAME= ifc
-PORTVERSION= 7.1.033
-PORTREVISION= 1
+PORTVERSION= 7.1.038
CATEGORIES= lang linux devel
MASTER_SITES=
DISTNAME= l_fc_pc_${PORTVERSION}
@@ -16,7 +15,7 @@ EXTRACT_SUFX= .tar
MAINTAINER= maho@FreeBSD.org
COMMENT= Intel's Fortran compiler, set up to produce native FreeBSD objects
-BUILD_DEPENDS= rpm2cpio.pl:${PORTSDIR}/archivers/rpm2cpio
+EXTRACT_DEPENDS= rpm2cpio.pl:${PORTSDIR}/archivers/rpm2cpio
RESTRICTED= Intel forbids any redistribution
NO_PACKAGE= ${RESTRICTED}
@@ -40,6 +39,10 @@ IFC_SITE= http://www.intel.com/software/products/compilers/
.include <bsd.port.pre.mk>
+EXTRACT_AFTER_ARGS= | tar -xf - \
+ --exclude \*ia64.rpm \
+ --exclude flexlm64
+
IFCCFGVAL!= ${UNAME} -r | ${SED} -e 's/\..*//'
CPIO?= /usr/bin/cpio
@@ -63,11 +66,9 @@ post-extract:
${FILESDIR}/cpio-exclude_noportdocs >>${WRKDIR}/cpio-exclude
.endif
.for i in \
- intel-ifc7-7.1-34.i386.rpm
-# intel-iidb7-7.2.2-64.i386.rpm \
-# intel-efc7-7.1-34.ia64.rpm \
-# intel-eidb7-7.2.2-64.ia64.rpm
- @cd ${WRKSRC} ; rpm2cpio.pl 2>/dev/null ${i} | \
+ intel-ifc7-7.1-40.i386.rpm
+# intel-iidb7-7.2.2-78.i386.rpm
+ @cd ${WRKSRC} && rpm2cpio.pl 2>/dev/null ${i} | \
${CPIO} -idfuE ${WRKDIR}/cpio-exclude --quiet
.endfor
@@ -88,7 +89,8 @@ pre-patch:
post-patch:
# Correct some paths and patch some files
.for i in ia32/bin/ifc ia32/bin/ifcvars.csh ia32/bin/ifcvars.sh
- @${REINPLACE_CMD} -i "" -e 's:@@PREFIX@@:${PREFIX}:g; s@\<INSTALLDIR\>@${PREFIX}/intel@g; s@man -w@manpath -q@g' \
+ @${REINPLACE_CMD} -i "" -e 's:%%ICC_LOCALBASE%%:${LOCALBASE}:g; \
+ s@\<INSTALLDIR\>@${PREFIX}/intel@g; s@man -w@manpath -q@g' \
${WRKSRC}/opt/intel/${COMPILERDIR}/${i}
@${CHMOD} 755 ${WRKSRC}/opt/intel/${COMPILERDIR}/${i}
.endfor
@@ -103,6 +105,9 @@ post-patch:
-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}
+.if ${OSVERSION} < 500016
+ @${ECHO} -e "-Qoption,ld,-MT\n" >>${WRKSRC}/opt/intel/${COMPILERDIR}/ia32/bin/${i}
+.endif
@${CHMOD} a-x,g-w ${WRKSRC}/opt/intel/${COMPILERDIR}/ia32/bin/${i}
.endfor
@cd ${WRKSRC}/opt/intel/${COMPILERDIR}/ia32/bin/ && ${LN} -s ifc.cfg ifcbin.cfg
@@ -117,10 +122,14 @@ OBJCOPY_OPS= --redefine-sym stdin=__stdinp \
do-build:
# Fix unresolved references
@cd ${WRKSRC} && ${CC} ${CFLAGS} -c ${FILESDIR}/assert_fail.c \
- ${FILESDIR}/cxa_atexit.c ${FILESDIR}/cxa_finalize.c \
- ${FILESDIR}/linux_file.c ${FILESDIR}/sysconf.c \
+ ${FILESDIR}/linux_file.c ${FILESDIR}/linux_stat.c \
${FILESDIR}/mmap.c ${FILESDIR}/pthread.c \
+ ${FILESDIR}/sysconf.c \
${FILESDIR}/errno_location.c ${FILESDIR}/mcount.S
+.if ( ${OSVERSION} < 502101 )
+ @cd ${WRKSRC} && ${CC} ${CFLAGS} -c ${FILESDIR}/cxa_atexit.c \
+ ${FILESDIR}/cxa_finalize.c
+.endif
.if ( ${OSVERSION} < 470101 ) || \
( ${OSVERSION} >= 500000 && ${OSVERSION} < 500042 )
@${CC} ${CFLAGS} -c -o ${WRKSRC}/stdin.o ${FILESDIR}/stdin.c
@@ -134,13 +143,13 @@ do-build:
${OBJCOPY_OPS} \
${WRKSRC}/opt/intel/${COMPILERDIR}/ia32/lib/${i}
.endfor
- @(cd ${WRKSRC}; ${AR} x /usr/lib/libcompat.a ftime.o)
+ @cd ${WRKSRC} && ${AR} x /usr/lib/libcompat.a ftime.o
@${AR} q ${WRKSRC}/opt/intel/${COMPILERDIR}/ia32/lib/libcxa.a ${WRKSRC}/*.o
.for i in BINDF90 PEPCF90 CEPCF90 POSF90 IEPCF90
@${OBJCOPY} --strip-symbol=stat \
--strip-symbol=fstat \
--strip-symbol=lstat \
- --redefine-sym lseek=Lseek \
+ --redefine-sym lseek=l_lseek \
--redefine-sym lseek64=lseek \
--redefine-sym open64=open \
--redefine-sym creat64=creat \
diff --git a/lang/ifc/distinfo b/lang/ifc/distinfo
index 60f15566056..2f670485850 100644
--- a/lang/ifc/distinfo
+++ b/lang/ifc/distinfo
@@ -1 +1 @@
-MD5 (l_fc_pc_7.1.033.tar) = 9a52e48a5f162e63a12852836b897663
+MD5 (l_fc_pc_7.1.038.tar) = 446e7610179ff8b959b805f564cb477f
diff --git a/lang/ifc/files/cpio-exclude b/lang/ifc/files/cpio-exclude
index 02ad5edc881..593324f84ca 100644
--- a/lang/ifc/files/cpio-exclude
+++ b/lang/ifc/files/cpio-exclude
@@ -1,69 +1,4 @@
*/opt/intel/%%COMPILERDIR%%/ia32/bin/uninstall
-*/opt/intel/%%COMPILERDIR%%/ia32/include/algorithm
-*/opt/intel/%%COMPILERDIR%%/ia32/include/bitset
-*/opt/intel/%%COMPILERDIR%%/ia32/include/complex
-*/opt/intel/%%COMPILERDIR%%/ia32/include/deque
-*/opt/intel/%%COMPILERDIR%%/ia32/include/fstream
-*/opt/intel/%%COMPILERDIR%%/ia32/include/fstream.h
-*/opt/intel/%%COMPILERDIR%%/ia32/include/functional
-*/opt/intel/%%COMPILERDIR%%/ia32/include/hash_map
-*/opt/intel/%%COMPILERDIR%%/ia32/include/hash_set
-*/opt/intel/%%COMPILERDIR%%/ia32/include/iomanip
-*/opt/intel/%%COMPILERDIR%%/ia32/include/iomanip.h
-*/opt/intel/%%COMPILERDIR%%/ia32/include/ios
-*/opt/intel/%%COMPILERDIR%%/ia32/include/iosfwd
-*/opt/intel/%%COMPILERDIR%%/ia32/include/iostream
-*/opt/intel/%%COMPILERDIR%%/ia32/include/iostream.h
-*/opt/intel/%%COMPILERDIR%%/ia32/include/istream
-*/opt/intel/%%COMPILERDIR%%/ia32/include/iterator
-*/opt/intel/%%COMPILERDIR%%/ia32/include/limits
-*/opt/intel/%%COMPILERDIR%%/ia32/include/list
-*/opt/intel/%%COMPILERDIR%%/ia32/include/locale
-*/opt/intel/%%COMPILERDIR%%/ia32/include/map
-*/opt/intel/%%COMPILERDIR%%/ia32/include/memory
-*/opt/intel/%%COMPILERDIR%%/ia32/include/numeric
-*/opt/intel/%%COMPILERDIR%%/ia32/include/ostream
-*/opt/intel/%%COMPILERDIR%%/ia32/include/queue
-*/opt/intel/%%COMPILERDIR%%/ia32/include/set
-*/opt/intel/%%COMPILERDIR%%/ia32/include/slist
-*/opt/intel/%%COMPILERDIR%%/ia32/include/sstream
-*/opt/intel/%%COMPILERDIR%%/ia32/include/stack
-*/opt/intel/%%COMPILERDIR%%/ia32/include/stdexcept
-*/opt/intel/%%COMPILERDIR%%/ia32/include/stdiostream.h
-*/opt/intel/%%COMPILERDIR%%/ia32/include/stl.h
-*/opt/intel/%%COMPILERDIR%%/ia32/include/stream.h
-*/opt/intel/%%COMPILERDIR%%/ia32/include/streambuf
-*/opt/intel/%%COMPILERDIR%%/ia32/include/string
-*/opt/intel/%%COMPILERDIR%%/ia32/include/strstream
-*/opt/intel/%%COMPILERDIR%%/ia32/include/strstream.h
-*/opt/intel/%%COMPILERDIR%%/ia32/include/utility
-*/opt/intel/%%COMPILERDIR%%/ia32/include/valarray
-*/opt/intel/%%COMPILERDIR%%/ia32/include/vector
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xcomplex
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xdebug
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xhash
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xiosbase
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xlocale
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xlocinfo
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xlocinfo.h
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xlocmes
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xlocmon
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xlocnum
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xloctime
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xmemory
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xstring
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xtree
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xutility
-*/opt/intel/%%COMPILERDIR%%/ia32/include/ymath.h
-*/opt/intel/%%COMPILERDIR%%/ia32/lib/libcprts.so
-*/opt/intel/%%COMPILERDIR%%/ia32/lib/libcprts.so.3
-*/opt/intel/%%COMPILERDIR%%/ia32/lib/libguide.so
-*/opt/intel/%%COMPILERDIR%%/ia32/lib/libguide_stats.so
-*/opt/intel/%%COMPILERDIR%%/ia32/lib/libunwind.so
-*/opt/intel/%%COMPILERDIR%%/ia32/lib/libunwind.so.3
-*/opt/intel/%%COMPILERDIR%%/ia32/lib/libimf.so
-*/opt/intel/%%COMPILERDIR%%/ia32/lib/libintrins.so
-*/opt/intel/%%COMPILERDIR%%/ia32/lib/libintrins.so.3
*/opt/intel/%%COMPILERDIR%%/ia32/lib/libCEPCF90.so
*/opt/intel/%%COMPILERDIR%%/ia32/lib/libCEPCF90.so.3
*/opt/intel/%%COMPILERDIR%%/ia32/lib/libF90.so
@@ -74,4 +9,12 @@
*/opt/intel/%%COMPILERDIR%%/ia32/lib/libPEPCF90.so.3
*/opt/intel/%%COMPILERDIR%%/ia32/lib/libPOSF90.so
*/opt/intel/%%COMPILERDIR%%/ia32/lib/libPOSF90.so.3
-*/opt/intel/%%COMPILERDIR%%/man/man1/efc.1
+*/opt/intel/%%COMPILERDIR%%/ia32/lib/libcprts.so
+*/opt/intel/%%COMPILERDIR%%/ia32/lib/libcprts.so.3
+*/opt/intel/%%COMPILERDIR%%/ia32/lib/libguide.so
+*/opt/intel/%%COMPILERDIR%%/ia32/lib/libguide_stats.so
+*/opt/intel/%%COMPILERDIR%%/ia32/lib/libimf.so
+*/opt/intel/%%COMPILERDIR%%/ia32/lib/libintrins.so
+*/opt/intel/%%COMPILERDIR%%/ia32/lib/libintrins.so.3
+*/opt/intel/%%COMPILERDIR%%/ia32/lib/libunwind.so
+*/opt/intel/%%COMPILERDIR%%/ia32/lib/libunwind.so.3
diff --git a/lang/ifc/files/ld.c b/lang/ifc/files/ld.c
index 119a3db7350..e1fbb6f26ef 100644
--- a/lang/ifc/files/ld.c
+++ b/lang/ifc/files/ld.c
@@ -28,143 +28,71 @@
* Based on a shell-script written by Dan Nelson <dnelson@allantgroup.com>
* with some modifications by Alexander Leidinger <netchild@FreeBSD.org>.
*
- * $FreeBSD: /tmp/pcvs/ports/lang/ifc/files/ld.c,v 1.3 2003-10-08 00:04:36 maho Exp $
*/
-/* Uses code marked: */
-
-/* OpenBSD: mailwrapper.c,v 1.6 1999/12/17 05:06:28 mickey Exp */
-/* NetBSD: mailwrapper.c,v 1.3 1999/05/29 18:18:15 christos Exp */
-/* FreeBSD: src/usr.sbin/mailwrapper/mailwrapper.c,v 1.8 2002/07/11 18:27:55 alfred Exp */
-
-/*
- * Copyright (c) 1998
- * Perry E. Metzger. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgment:
- * This product includes software developed for the NetBSD Project
- * by Perry E. Metzger.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: /tmp/pcvs/ports/lang/ifc/files/ld.c,v 1.4 2004-01-19 13:44:47 maho Exp $");
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-
-#if defined (__FreeBSD__) && __FreeBSD__ >= 2
- #include <osreldate.h>
-#else
- #error "Won't work here."
-#endif
+#include <osreldate.h>
#define PATH_LD "/usr/bin/ld"
+#define LDW_CPP (1<<0)
+#define LDW_DYN (1<<1)
+#define LDW_GPROF (1<<2)
+#define LDW_PIC (1<<3)
+#define LDW_THR (1<<4)
+#define LDW_LGCC (1<<5)
+
struct arglist {
- size_t argc, maxc;
- char **argv;
+ size_t argc;
+ const char **argv;
};
-static void initarg(struct arglist *al);
-static void addarg(struct arglist *al, const char *arg, int copy);
-static void freearg(struct arglist *al, int copy);
+static void addarg(struct arglist *al, const char *arg);
int main(int argc, char *argv[], char *envp[]);
static void
-initarg(struct arglist *al)
+addarg(struct arglist *al, const char *arg)
{
+ const char **argv2;
- al->argc = 0;
- al->maxc = 10;
- if ((al->argv = malloc(al->maxc * sizeof(char *))) == NULL)
- err(1, NULL);
-}
+ argv2 = realloc(al->argv, (al->argc + 1) * sizeof(al->argv[0]));
-static void
-addarg(struct arglist *al, const char *arg, int copy)
-{
- char **argv2;
-
- if (al->argc == al->maxc) {
- al->maxc <<= 1;
-
- if ((argv2 = realloc(al->argv,
- al->maxc * sizeof(char *))) == NULL) {
- if (al->argv)
- free(al->argv);
- al->argv = NULL;
- err(1, NULL);
- } else {
- al->argv = argv2;
- }
- }
- if (copy) {
- if ((al->argv[al->argc++] = strdup(arg)) == NULL)
- err(1, NULL);
- } else {
- al->argv[al->argc++] = (char *)arg;
- }
-}
+ if (argv2 == NULL)
+ err(1, NULL);
-static
-void freearg(struct arglist *al, int copy)
-{
- size_t i;
+ al->argv = argv2;
- if (copy)
- for (i = 0; i < al->argc; i++)
- free(al->argv[i]);
- free(al->argv);
+ al->argv[al->argc++] = arg;
}
int
main(int argc, char *argv[], char *envp[])
{
size_t i;
- int bootstrap, cpp, dynamic, pic, gprof, stlinserted, threaded;
- int f90 = 0;
- char *libc, *libc_r, *prefix;
- struct arglist al;
+ u_int flags;
+ const char *libc, *libthr, *icc_localbase;
+ struct arglist al = { 0, NULL };
+
+ flags = 0;
if (argc == 1)
errx(1, "no input files");
- if ((prefix = getenv("PREFIX")) == NULL)
- errx(1, "can't get PREFIX");
-
- initarg(&al);
- bootstrap = cpp = dynamic = pic = gprof = stlinserted = threaded = 0;
+ if ((icc_localbase = getenv("ICC_LOCALBASE")) == NULL)
+ errx(1, "can't get ICC_LOCALBASE");
#ifdef DEBUG
printf("input: ");
#endif
-#define ARGCMP(x) !strcmp(argv[i], (x))
-#define ARGCMPB(x, y) (strlen(x) + strlen(y) == strlen(argv[i]) && \
- !strncmp(argv[i], (x), strlen(x)) && \
- !strncmp(argv[i] + strlen(x), (y), strlen(y)))
+#define ARGCMP(i, x) !strcmp(argv[i], (x))
/*
* XXX This doesn't deal with whitespace but a) the output of the
@@ -176,123 +104,108 @@ main(int argc, char *argv[], char *envp[])
printf("%s ", argv[i]);
#endif
- if (ARGCMP("-CPLUSPLUS")) {
- cpp++;
+ if (ARGCMP(i, "-CPLUSPLUS")) {
+ flags |= LDW_CPP;
continue;
}
- if (ARGCMP("-BOOTSTRAPSTLPORT")) {
- bootstrap++;
- continue;
- }
-
- if (ARGCMP("-MT")) {
- threaded++;
+ if (ARGCMP(i, "-MT")
+/* ifc8 */
+ || ARGCMP(i, "-lpthread")) {
+/* ifc8 */
+ flags |= LDW_THR;
continue;
}
- if (ARGCMP("-PIC")) {
- pic++;
+ if (ARGCMP(i, "-PIC")) {
+ flags |= LDW_PIC;
continue;
}
/*
+ * Check if the compiler wants us to do dynamic linking, i.e.
+ * the compiler was called with -shared or without -static.
* If the compiler was called with -static we shouldn't see
* "--dynamic-linker" here.
* Note: According to ld(1) this is "--dynamic-linker" but
* ICC passes "-dynamic-linker" to it.
*/
- if (ARGCMP("--dynamic-linker") || ARGCMP("-dynamic-linker")) {
- dynamic++;
- continue;
- }
- if (ARGCMP("-shared")) {
- dynamic++;
- continue;
- }
-
- /*
- * Just link libstlport_icc* once when compiling the stlport
- * tests.
- */
- if (!strncmp(argv[i], "-lstlport_icc",
- strlen("-lstlport_icc"))) {
- stlinserted++;
+ if (ARGCMP(i, "--dynamic-linker") ||
+ ARGCMP(i, "-dynamic-linker") || ARGCMP(i, "-shared")) {
+ flags |= LDW_DYN;
continue;
}
/*
- * If IFC, do not use libstlport_icc.
+ * Link against libc_p when "-qp" or "-p" were given,
+ * "/usr/lib/gcrt1.o" indicates this.
*/
- if (!strcmp(argv[i], "-lF90")) {
- f90++;
+ if (ARGCMP(i, "/usr/lib/gcrt1.o")) {
+ flags |= LDW_GPROF;
continue;
}
- /*
- * Link against libc_p when "-qp" or "-p" were given,
- * "/usr/lib/gcrt1.o" indicates this.
- */
- if (ARGCMP("/usr/lib/gcrt1.o")) {
- gprof++;
+ if (ARGCMP(i, "-lgcc")) {
+ flags |= LDW_LGCC;
continue;
}
}
/*
- * Use the appropriate libs for libc and libc_r when linking static
+ * Allow the user to specify an alternative threads library
+ * implementation, such as -lthr, or whatever.
+ */
+#if __FreeBSD_version >= 500016
+ if ((libthr = getenv("PTHREAD_LIBS")) == NULL)
+#endif
+ libthr = "-lc_r";
+ /*
+ * Use the appropriate libs for libc and libthr when linking static
* and "-KPIC" or "-pg" where given.
*/
- if (!dynamic && (pic || gprof)) {
+ if (!(flags & LDW_DYN) && flags & (LDW_PIC | LDW_GPROF)) {
/*
* Let libc_p win above libc_pic when both, "-KPIC" and "-pg",
* where given, GCC does the same.
*/
- if (!gprof) {
- libc = strdup("-lc_pic");
- libc_r = strdup("-lc_r");
- } else {
- libc = strdup("-lc_p");
- libc_r = strdup("-lc_r_p");
+ if (!(flags & LDW_GPROF))
+ libc = "-lc_pic";
+ else {
+ char *p;
+ libc = "-lc_p";
+ asprintf(&p, "%s_p", libthr);
+ if (p == NULL)
+ err(1, NULL);
+ libthr = p;
}
- } else {
- libc = strdup("-lc");
- libc_r = strdup("-lc_r");
- }
+ } else
+ libc = "-lc";
#ifdef DEBUG
- printf("\ncpp: %s bootstrap: %s dynamic: %s gprof: %s pic: %s "
- "threaded: %s\n", cpp ? "YES" : "NO", bootstrap ? "YES" : "NO",
- dynamic ? "YES" : "NO", gprof ? "YES" : "NO", pic ? "YES" : "NO",
- threaded ? "YES" : "NO");
+ printf("\n");
#endif
- if (bootstrap && !cpp)
- errx(1, "-BOOTSTRAPSTLPORT is only valid in combination with "
- "-CPLUSPLUS");
-
for (i = 0; i < argc; i++) {
- if (ARGCMP("-CPLUSPLUS") || ARGCMP("-BOOTSTRAPSTLPORT") ||
- ARGCMP("-MT") || ARGCMP("-PIC"))
+ if (ARGCMP(i, "-CPLUSPLUS") || ARGCMP(i, "-MT") ||
+/* ifc8 */
+ ARGCMP(i, "-lpthread") ||
+/* ifc8 */
+ ARGCMP(i, "-PIC"))
continue;
/* prepend "-melf_i386" to the commandline */
if (i == 0) {
- addarg(&al, argv[0], 1);
+ addarg(&al, argv[0]);
#if __FreeBSD_version < 500042
- addarg(&al, "-melf_i386", 1);
+ addarg(&al, "-melf_i386");
#else
- addarg(&al, "-melf_i386_fbsd", 1);
+ addarg(&al, "-melf_i386_fbsd");
#endif
continue;
}
- /* Don't add obsolete flag "-Qy". */
- if (ARGCMP("-Qy"))
- continue;
-
- /* Libunwind is only needed when compiling C++ source. */
- if (!cpp && !f90 && ARGCMP("-lunwind"))
+ /* Don't add obsolete flag "-Qy", don't add libgcc_s. */
+ if (ARGCMP(i, "-Qy") || ARGCMP(i, "-lgcc_s"))
continue;
/*
@@ -300,119 +213,107 @@ main(int argc, char *argv[], char *envp[])
* shipping with ICC has unresolvable glibc dependencies
* in both, the static and the dynamic, versions.
*/
- if (ARGCMP("-lcprts")) {
- if (cpp && !bootstrap && !stlinserted) {
+ if (ARGCMP(i, "-lcprts")) {
+ if (flags & LDW_CPP && !(flags & LDW_LGCC)) {
addarg(&al,
- dynamic ? "-Bdynamic" : "-Bstatic", 1);
- addarg(&al, "-lstlport_icc", 1);
- stlinserted++;
+ flags & LDW_DYN ? "-Bdynamic" : "-Bstatic");
+ addarg(&al, "-lstlport_icc");
}
continue;
}
/*
- * Link against libc_r when compiling multi-threaded or C++
- * code (libcxa and libunwind depend on libc_r when compiling
- * C++ source).
+ * Link against libthr when compiling multi-threaded or C++
+ * code (libcxa and libunwind depend on a threads library
+ * when compiling C++ source).
*/
- if (ARGCMP("-lc")) {
+ if (ARGCMP(i, "-lc")) {
if (al.argc > 0 &&
- strncmp(al.argv[al.argc - 1], "-B", strlen("-B")))
+ strncmp(al.argv[al.argc - 1], "-B", 2))
addarg(&al,
- dynamic ? "-Bdynamic" : "-Bstatic", 1);
-#if __FreeBSD_version < 500016
- if (cpp || f90 || threaded) {
- addarg(&al, libc_r, 0);
-#else
- if (cpp || threaded) {
- addarg(&al, libc, 0);
+ flags & LDW_DYN ? "-Bdynamic" : "-Bstatic");
+ if (flags & (LDW_CPP | LDW_THR)) {
+ addarg(&al, libthr);
+#if __FreeBSD_version >= 500016
addarg(&al,
- dynamic ? "-Bdynamic" : "-Bstatic", 1);
- addarg(&al, libc_r, 0);
+ flags & LDW_DYN ? "-Bdynamic" : "-Bstatic");
+ addarg(&al, libc);
#endif
- } else {
- addarg(&al, libc, 0);
- }
+ } else
+ addarg(&al, libc);
continue;
}
/* Switch Linux stuff to FreeBSD counterparts. */
- if (ARGCMP("/lib/ld-linux.so.2")) {
+ if (ARGCMP(i, "/lib/ld-linux.so.2")) {
#if __FreeBSD_version >= 501105
- addarg(&al, "/libexec/ld-elf.so.1", 1);
+ addarg(&al, "/libexec/ld-elf.so.1");
#else
- addarg(&al, "/usr/libexec/ld-elf.so.1", 1);
+ addarg(&al, "/usr/libexec/ld-elf.so.1");
#endif
continue;
}
- if (ARGCMP("-L/usr/lib")) {
- char *temp;
-
- if ((temp = (char *) malloc(strlen("-L") +
- strlen(prefix) + strlen("/lib") + 1)) == NULL)
- err(1, NULL);
-
- addarg(&al, "-L/usr/libexec/elf", 1);
- addarg(&al, "-L/usr/libexec", 1);
- addarg(&al, "-L/usr/lib", 1);
- snprintf(temp, strlen("-L") + strlen(prefix) +
- strlen("/lib") + 1, "-L%s/lib", prefix);
- addarg(&al, temp, 1);
- free(temp);
+ if (ARGCMP(i, "-L/usr/lib")) {
+ addarg(&al, "-L/usr/libexec/elf");
+ addarg(&al, "-L/usr/libexec");
+ addarg(&al, "-L/usr/lib");
+ if (flags & LDW_CPP && !(flags & LDW_LGCC)) {
+ char *p;
+ asprintf(&p, "-L%s/lib", icc_localbase);
+ if (p == NULL)
+ err(1, NULL);
+ addarg(&al, p);
+ }
continue;
}
/*
- * Force libcxa and libunwind to static linkage, since the
- * dynamic versions have glibc dependencies.
+ * Force libcxa, libcxaguard and libunwind to static linkage,
+ * since the dynamic versions have glibc dependencies.
* Don't add superfluous -Bdynamic.
*/
- if (ARGCMP("-Bdynamic") && i < argc - 1) {
- if (!strcmp(argv[i + 1], "-lcxa") ||
- ((cpp || f90) && !strcmp(argv[i + 1], "-lunwind"))) {
- addarg(&al, "-Bstatic", 1);
+ if (ARGCMP(i, "-Bdynamic") && i < argc - 1) {
+ if (ARGCMP(i + 1, "-lcxa") ||
+ ARGCMP(i + 1, "-lcxaguard") ||
+ ARGCMP(i + 1, "-lunwind")) {
+ addarg(&al, "-Bstatic");
continue;
}
- if (!strcmp(argv[i + 1], "-lcprts") ||
- !strcmp(argv[i + 1], "-lunwind"))
+ if (ARGCMP(i + 1, "-lcprts") ||
+ ARGCMP(i + 1, "-lgcc_s"))
continue;
}
/* Don't add superfluous -Bstatic. */
- if (ARGCMP("-Bstatic") && i < argc - 1 &&
- (!strcmp(argv[i + 1], "-lcprts") ||
- (!cpp && !f90 && !strcmp(argv[i + 1], "-lunwind"))))
+ if (ARGCMP(i, "-Bstatic") && i < argc - 1 &&
+ (ARGCMP(i + 1, "-lcprts") || ARGCMP(i + 1, "-lgcc_s") ||
+ ARGCMP(i + 1, "-lunwind")))
continue;
/*
* Sanity check if every lib is prepended by a linkage option,
* add if missing.
*/
- if (!strncmp(argv[i], "-l", strlen("-l")) && al.argc > 0 &&
- strncmp(al.argv[al.argc - 1], "-B", strlen("-B"))) {
- if (!strcmp(argv[i], "-lcxa") ||
- !strcmp(argv[i], "-limf") ||
- !strcmp(argv[i], "-lirc") ||
- !strcmp(argv[i], "-lircmt") ||
- !strcmp(argv[i], "-lunwind"))
- addarg(&al, "-Bstatic", 1);
+ if (!strncmp(argv[i], "-l", 2) && al.argc > 0 &&
+ strncmp(al.argv[al.argc - 1], "-B", 2)) {
+ if (ARGCMP(i, "-lcxa") || ARGCMP(i, "-lcxaguard") ||
+ ARGCMP(i, "-limf") || ARGCMP(i, "-lirc") ||
+ ARGCMP(i, "-lircmt") || ARGCMP(i, "-lunwind"))
+ addarg(&al, "-Bstatic");
else
addarg(&al,
- dynamic ? "-Bdynamic" : "-Bstatic", 1);
+ flags & LDW_DYN ? "-Bdynamic" : "-Bstatic");
- addarg(&al, argv[i], 1);
+ addarg(&al, argv[i]);
continue;
}
/* default */
- addarg(&al, argv[i], 1);
+ addarg(&al, argv[i]);
}
-#undef ARGCMP
-#undef ARGCMPB
-
- /* Still something to do ? */
+ /* Still something to do? */
if (al.argc == 1)
errx(1, "no input files");
@@ -425,13 +326,11 @@ main(int argc, char *argv[], char *envp[])
printf("\n");
#endif
- addarg(&al, NULL, 0);
-
- /* Launch the real linker */
- if (execve(PATH_LD, al.argv, envp) == -1)
- err(1, "execing %s", PATH_LD);
+ addarg(&al, NULL);
- freearg(&al, 1);
+ /* Launch the real linker. */
+ if (execve(PATH_LD, (char **)al.argv, envp) == -1)
+ err(1, "execing " PATH_LD);
exit (1);
}
diff --git a/lang/ifc/files/linux_file.c b/lang/ifc/files/linux_file.c
index 61f5acd3271..cff6d293291 100644
--- a/lang/ifc/files/linux_file.c
+++ b/lang/ifc/files/linux_file.c
@@ -25,111 +25,61 @@
*
* $FreeBSD$
*/
-
#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-/* This matches struct stat64 in glibc2.1, hence the absolutely
- * insane amounts of padding around dev_t's.
- */
-struct stat64 {
- unsigned short st_dev;
- unsigned char __pad0[10];
-
-#define STAT64_HAS_BROKEN_ST_INO 1
- unsigned long __st_ino;
-
- unsigned int st_mode;
- unsigned int st_nlink;
-
- unsigned long st_uid;
- unsigned long st_gid;
-
- unsigned short st_rdev;
- unsigned char __pad3[10];
-
- long long st_size;
- unsigned long st_blksize;
-
- unsigned long st_blocks; /* Number 512-byte blocks allocated. */
- unsigned long __pad4; /* future possible st_blocks high bits */
-
- unsigned long st_atime_;
- unsigned long __pad5;
-
- unsigned long st_mtime_;
- unsigned long __pad6;
-
- unsigned long st_ctime_;
- unsigned long __pad7; /* will be high 32 bits of ctime someday */
-
- unsigned long long st_ino;
-};
-
-
-struct stat64 stat2stat64(struct stat sb) {
- static struct stat64 sb64;
-
- sb64.st_dev = sb.st_dev;
- sb64.st_ino = sb.st_ino;
- sb64.st_mode = sb.st_mode;
- sb64.st_nlink = sb.st_nlink;
- sb64.st_uid = sb.st_uid;
- sb64.st_gid = sb.st_gid;
- sb64.st_rdev = sb.st_rdev;
- sb64.st_size = sb.st_size;
- sb64.st_blksize = sb.st_blksize;
- sb64.st_blocks = sb.st_blocks;
- sb64.st_atime_ = sb.st_atime;
- sb64.st_mtime_ = sb.st_mtime;
- sb64.st_ctime_ = sb.st_ctime;
-
- return sb64;
-}
-
-
-int __fxstat64 (int __ver, int __fildes, struct stat64 *__stat_buf) {
- struct stat sb;
- int result;
-
- result = fstat (__fildes, &sb);
- *__stat_buf = stat2stat64(sb);
- return result;
-}
-
-
-int __xstat64 (int __ver, __const char *__filename,
- struct stat64 *__stat_buf) {
- struct stat sb;
- int result;
-
- result = stat (__filename, &sb);
- *__stat_buf = stat2stat64(sb);
- return result;
+#include <fcntl.h>
+#include <stdarg.h>
+
+#define LINUX_O_RDONLY 00
+#define LINUX_O_WRONLY 01
+#define LINUX_O_RDWR 02
+#define LINUX_O_CREAT 0100
+#define LINUX_O_EXCL 0200
+#define LINUX_O_NOCTTY 0400
+#define LINUX_O_TRUNC 01000
+#define LINUX_O_APPEND 02000
+#define LINUX_O_NONBLOCK 04000
+#define LINUX_O_NDELAY LINUX_O_NONBLOCK
+#define LINUX_O_SYNC 010000
+#define LINUX_FASYNC 020000
+
+int l_open(const char *path, int flags, ...) {
+ va_list args;
+ mode_t mode;
+ int bsd_flags, error;
+
+ bsd_flags = 0;
+
+ if (flags & LINUX_O_RDONLY ) bsd_flags |= O_RDONLY;
+ if (flags & LINUX_O_WRONLY ) bsd_flags |= O_WRONLY;
+ if (flags & LINUX_O_RDWR ) bsd_flags |= O_RDWR;
+ if (flags & LINUX_O_NDELAY ) bsd_flags |= O_NONBLOCK;
+ if (flags & LINUX_O_APPEND ) bsd_flags |= O_APPEND;
+ if (flags & LINUX_O_SYNC ) bsd_flags |= O_FSYNC;
+ if (flags & LINUX_O_NONBLOCK) bsd_flags |= O_NONBLOCK;
+ if (flags & LINUX_FASYNC ) bsd_flags |= O_ASYNC;
+ if (flags & LINUX_O_CREAT ) bsd_flags |= O_CREAT;
+ if (flags & LINUX_O_TRUNC ) bsd_flags |= O_TRUNC;
+ if (flags & LINUX_O_EXCL ) bsd_flags |= O_EXCL;
+ if (flags & LINUX_O_NOCTTY ) bsd_flags |= O_NOCTTY;
+
+ if (bsd_flags & O_CREAT) {
+ va_start (args, flags);
+ mode = (mode_t) va_arg(args, int);
+ return open(path, bsd_flags, mode);
+ va_end (args);
+ } else
+ return open(path, bsd_flags);
}
-
-#include <stdio.h>
-
-void __xstat() {
- fprintf(stderr, __FILE__ ": __xstat() is dummy.\n");
-};
-void __fxstat() {
- fprintf(stderr, __FILE__ ": __fxstat() is dummy.\n");
-};
-void __lxstat() {
- fprintf(stderr, __FILE__ ": __lxstat() is dummy.\n");
-};
-void __lxstat64() {
- fprintf(stderr, __FILE__ ": __lxstat64() is dummy.\n");
-};
-
-
typedef int32_t l_long;
typedef l_long l_off_t;
-l_off_t Lseek(int fildes, l_off_t offset, int whence)
+l_off_t l_lseek(int fildes, l_off_t offset, int whence)
{
return (l_off_t) lseek(fildes, (off_t) offset, whence);
}
+
+int l_ftruncate(int fildes, l_off_t length)
+{
+ return ftruncate(fildes, (off_t) length);
+}
diff --git a/lang/ifc/files/patch-ia32::bin::ifc b/lang/ifc/files/patch-ia32::bin::ifc
index a6b53f5bbd7..30a47cf2e8d 100644
--- a/lang/ifc/files/patch-ia32::bin::ifc
+++ b/lang/ifc/files/patch-ia32::bin::ifc
@@ -1,38 +1,35 @@
---- ia32/bin/ifc.orig Sat Apr 5 20:48:18 2003
-+++ ia32/bin/ifc Sat Apr 5 20:53:32 2003
-@@ -1,34 +1,61 @@
+--- ia32/bin/ifc.orig Sun Jan 18 17:29:47 2004
++++ ia32/bin/ifc Sun Jan 18 17:34:08 2004
+@@ -1,6 +1,9 @@
#!/bin/sh
-+PREFIX=@@PREFIX@@
-+export PREFIX;
+-if [ -z INTEL_LICENSE_FILE ]
++ICC_LOCALBASE=%%ICC_LOCALBASE%%
++export ICC_LOCALBASE;
+
- if [ -z INTEL_LICENSE_FILE ]
++if [ -z "$INTEL_LICENSE_FILE" ]
then
--INTEL_LICENSE_FILE=<INSTALLDIR>/licenses;
-+INTEL_LICENSE_FILE=${PREFIX}/intel/licenses;
+ INTEL_LICENSE_FILE=<INSTALLDIR>/licenses;
else
--INTEL_LICENSE_FILE=$INTEL_LICENSE_FILE:<INSTALLDIR>/licenses;
-+INTEL_LICENSE_FILE=$INTEL_LICENSE_FILE:${PREFIX}/intel/licenses;
+@@ -8,7 +11,7 @@
fi
export INTEL_LICENSE_FILE;
- if [ -z LD_LIBRARY_PATH ]
+-if [ -z LD_LIBRARY_PATH ]
++if [ -z "$LD_LIBRARY_PATH" ]
then
-- LD_LIBRARY_PATH=<INSTALLDIR>/compiler70/ia32/lib;
-+ LD_LIBRARY_PATH=${PREFIX}/intel/compiler70/ia32/lib;
+ LD_LIBRARY_PATH=<INSTALLDIR>/compiler70/ia32/lib;
else
-- LD_LIBRARY_PATH=<INSTALLDIR>/compiler70/ia32/lib:$LD_LIBRARY_PATH
-+ LD_LIBRARY_PATH=${PREFIX}/intel/compiler70/ia32/lib:$LD_LIBRARY_PATH
+@@ -16,7 +19,7 @@
fi
export LD_LIBRARY_PATH;
- if [ -z PATH ]
+-if [ -z PATH ]
++if [ -z "$PATH" ]
then
-- PATH=<INSTALLDIR>/compiler70/ia32/bin;
-+ PATH=${PREFIX}/intel/compiler70/ia32/bin;
+ PATH=<INSTALLDIR>/compiler70/ia32/bin;
else
-- PATH=<INSTALLDIR>/compiler70/ia32/bin:$PATH;
-+ PATH=${PREFIX}/intel/compiler70/ia32/bin:$PATH;
+@@ -24,11 +27,31 @@
fi
export PATH;
@@ -60,15 +57,11 @@
+ [ "${val1}" = "-fpic" ] || [ "${val1}" = "-fPIC" ] ; then
+ set -- "$@" "-Qoption,ld,-PIC"
+ fi
-+ if [ "${val1}" = "-mt" ] ; then
-+ unset val1
-+ set -- "$@" "-Qoption,ld,-MT"
-+ fi
+ set -- "$@" "$val1"
+ i=$(($i+1))
+ done
-+ exec ${PREFIX}/intel/compiler70/ia32/bin/ifcbin "$@";
++ exec <INSTALLDIR>/compiler70/ia32/bin/ifcbin "$@";
else
- exec -a "<INSTALLDIR>/compiler70/ia32/bin/ifc" <INSTALLDIR>/compiler70/ia32/bin/ifcbin;
-+ exec ${PREFIX}/intel/compiler70/ia32/bin/ifcbin;
++ exec <INSTALLDIR>/compiler70/ia32/bin/ifcbin;
fi
diff --git a/lang/ifc/pkg-plist b/lang/ifc/pkg-plist
index d547417301c..841463e3736 100644
--- a/lang/ifc/pkg-plist
+++ b/lang/ifc/pkg-plist
@@ -1300,5 +1300,5 @@ intel/%%COMPILERDIR%%/ia32/lib/libunwind.a
%%PORTDOCS%%@dirrm intel/%%COMPILERDIR%%/training/templ_im
%%PORTDOCS%%@dirrm intel/%%COMPILERDIR%%/training
@dirrm intel/%%COMPILERDIR%%
-@dirrm intel/licenses
-@dirrm intel
+@unexec rmdir %D/intel/licenses >/dev/null 2>&1 || echo '*** license directory (%D/intel/licenses/) not removed, it may contain a license'
+@unexec rmdir %D/intel >/dev/null 2>&1 || true
diff --git a/lang/ifc7/Makefile b/lang/ifc7/Makefile
index fe5fb1b265b..38000221be3 100644
--- a/lang/ifc7/Makefile
+++ b/lang/ifc7/Makefile
@@ -6,8 +6,7 @@
#
PORTNAME= ifc
-PORTVERSION= 7.1.033
-PORTREVISION= 1
+PORTVERSION= 7.1.038
CATEGORIES= lang linux devel
MASTER_SITES=
DISTNAME= l_fc_pc_${PORTVERSION}
@@ -16,7 +15,7 @@ EXTRACT_SUFX= .tar
MAINTAINER= maho@FreeBSD.org
COMMENT= Intel's Fortran compiler, set up to produce native FreeBSD objects
-BUILD_DEPENDS= rpm2cpio.pl:${PORTSDIR}/archivers/rpm2cpio
+EXTRACT_DEPENDS= rpm2cpio.pl:${PORTSDIR}/archivers/rpm2cpio
RESTRICTED= Intel forbids any redistribution
NO_PACKAGE= ${RESTRICTED}
@@ -40,6 +39,10 @@ IFC_SITE= http://www.intel.com/software/products/compilers/
.include <bsd.port.pre.mk>
+EXTRACT_AFTER_ARGS= | tar -xf - \
+ --exclude \*ia64.rpm \
+ --exclude flexlm64
+
IFCCFGVAL!= ${UNAME} -r | ${SED} -e 's/\..*//'
CPIO?= /usr/bin/cpio
@@ -63,11 +66,9 @@ post-extract:
${FILESDIR}/cpio-exclude_noportdocs >>${WRKDIR}/cpio-exclude
.endif
.for i in \
- intel-ifc7-7.1-34.i386.rpm
-# intel-iidb7-7.2.2-64.i386.rpm \
-# intel-efc7-7.1-34.ia64.rpm \
-# intel-eidb7-7.2.2-64.ia64.rpm
- @cd ${WRKSRC} ; rpm2cpio.pl 2>/dev/null ${i} | \
+ intel-ifc7-7.1-40.i386.rpm
+# intel-iidb7-7.2.2-78.i386.rpm
+ @cd ${WRKSRC} && rpm2cpio.pl 2>/dev/null ${i} | \
${CPIO} -idfuE ${WRKDIR}/cpio-exclude --quiet
.endfor
@@ -88,7 +89,8 @@ pre-patch:
post-patch:
# Correct some paths and patch some files
.for i in ia32/bin/ifc ia32/bin/ifcvars.csh ia32/bin/ifcvars.sh
- @${REINPLACE_CMD} -i "" -e 's:@@PREFIX@@:${PREFIX}:g; s@\<INSTALLDIR\>@${PREFIX}/intel@g; s@man -w@manpath -q@g' \
+ @${REINPLACE_CMD} -i "" -e 's:%%ICC_LOCALBASE%%:${LOCALBASE}:g; \
+ s@\<INSTALLDIR\>@${PREFIX}/intel@g; s@man -w@manpath -q@g' \
${WRKSRC}/opt/intel/${COMPILERDIR}/${i}
@${CHMOD} 755 ${WRKSRC}/opt/intel/${COMPILERDIR}/${i}
.endfor
@@ -103,6 +105,9 @@ post-patch:
-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}
+.if ${OSVERSION} < 500016
+ @${ECHO} -e "-Qoption,ld,-MT\n" >>${WRKSRC}/opt/intel/${COMPILERDIR}/ia32/bin/${i}
+.endif
@${CHMOD} a-x,g-w ${WRKSRC}/opt/intel/${COMPILERDIR}/ia32/bin/${i}
.endfor
@cd ${WRKSRC}/opt/intel/${COMPILERDIR}/ia32/bin/ && ${LN} -s ifc.cfg ifcbin.cfg
@@ -117,10 +122,14 @@ OBJCOPY_OPS= --redefine-sym stdin=__stdinp \
do-build:
# Fix unresolved references
@cd ${WRKSRC} && ${CC} ${CFLAGS} -c ${FILESDIR}/assert_fail.c \
- ${FILESDIR}/cxa_atexit.c ${FILESDIR}/cxa_finalize.c \
- ${FILESDIR}/linux_file.c ${FILESDIR}/sysconf.c \
+ ${FILESDIR}/linux_file.c ${FILESDIR}/linux_stat.c \
${FILESDIR}/mmap.c ${FILESDIR}/pthread.c \
+ ${FILESDIR}/sysconf.c \
${FILESDIR}/errno_location.c ${FILESDIR}/mcount.S
+.if ( ${OSVERSION} < 502101 )
+ @cd ${WRKSRC} && ${CC} ${CFLAGS} -c ${FILESDIR}/cxa_atexit.c \
+ ${FILESDIR}/cxa_finalize.c
+.endif
.if ( ${OSVERSION} < 470101 ) || \
( ${OSVERSION} >= 500000 && ${OSVERSION} < 500042 )
@${CC} ${CFLAGS} -c -o ${WRKSRC}/stdin.o ${FILESDIR}/stdin.c
@@ -134,13 +143,13 @@ do-build:
${OBJCOPY_OPS} \
${WRKSRC}/opt/intel/${COMPILERDIR}/ia32/lib/${i}
.endfor
- @(cd ${WRKSRC}; ${AR} x /usr/lib/libcompat.a ftime.o)
+ @cd ${WRKSRC} && ${AR} x /usr/lib/libcompat.a ftime.o
@${AR} q ${WRKSRC}/opt/intel/${COMPILERDIR}/ia32/lib/libcxa.a ${WRKSRC}/*.o
.for i in BINDF90 PEPCF90 CEPCF90 POSF90 IEPCF90
@${OBJCOPY} --strip-symbol=stat \
--strip-symbol=fstat \
--strip-symbol=lstat \
- --redefine-sym lseek=Lseek \
+ --redefine-sym lseek=l_lseek \
--redefine-sym lseek64=lseek \
--redefine-sym open64=open \
--redefine-sym creat64=creat \
diff --git a/lang/ifc7/distinfo b/lang/ifc7/distinfo
index 60f15566056..2f670485850 100644
--- a/lang/ifc7/distinfo
+++ b/lang/ifc7/distinfo
@@ -1 +1 @@
-MD5 (l_fc_pc_7.1.033.tar) = 9a52e48a5f162e63a12852836b897663
+MD5 (l_fc_pc_7.1.038.tar) = 446e7610179ff8b959b805f564cb477f
diff --git a/lang/ifc7/files/cpio-exclude b/lang/ifc7/files/cpio-exclude
index 02ad5edc881..593324f84ca 100644
--- a/lang/ifc7/files/cpio-exclude
+++ b/lang/ifc7/files/cpio-exclude
@@ -1,69 +1,4 @@
*/opt/intel/%%COMPILERDIR%%/ia32/bin/uninstall
-*/opt/intel/%%COMPILERDIR%%/ia32/include/algorithm
-*/opt/intel/%%COMPILERDIR%%/ia32/include/bitset
-*/opt/intel/%%COMPILERDIR%%/ia32/include/complex
-*/opt/intel/%%COMPILERDIR%%/ia32/include/deque
-*/opt/intel/%%COMPILERDIR%%/ia32/include/fstream
-*/opt/intel/%%COMPILERDIR%%/ia32/include/fstream.h
-*/opt/intel/%%COMPILERDIR%%/ia32/include/functional
-*/opt/intel/%%COMPILERDIR%%/ia32/include/hash_map
-*/opt/intel/%%COMPILERDIR%%/ia32/include/hash_set
-*/opt/intel/%%COMPILERDIR%%/ia32/include/iomanip
-*/opt/intel/%%COMPILERDIR%%/ia32/include/iomanip.h
-*/opt/intel/%%COMPILERDIR%%/ia32/include/ios
-*/opt/intel/%%COMPILERDIR%%/ia32/include/iosfwd
-*/opt/intel/%%COMPILERDIR%%/ia32/include/iostream
-*/opt/intel/%%COMPILERDIR%%/ia32/include/iostream.h
-*/opt/intel/%%COMPILERDIR%%/ia32/include/istream
-*/opt/intel/%%COMPILERDIR%%/ia32/include/iterator
-*/opt/intel/%%COMPILERDIR%%/ia32/include/limits
-*/opt/intel/%%COMPILERDIR%%/ia32/include/list
-*/opt/intel/%%COMPILERDIR%%/ia32/include/locale
-*/opt/intel/%%COMPILERDIR%%/ia32/include/map
-*/opt/intel/%%COMPILERDIR%%/ia32/include/memory
-*/opt/intel/%%COMPILERDIR%%/ia32/include/numeric
-*/opt/intel/%%COMPILERDIR%%/ia32/include/ostream
-*/opt/intel/%%COMPILERDIR%%/ia32/include/queue
-*/opt/intel/%%COMPILERDIR%%/ia32/include/set
-*/opt/intel/%%COMPILERDIR%%/ia32/include/slist
-*/opt/intel/%%COMPILERDIR%%/ia32/include/sstream
-*/opt/intel/%%COMPILERDIR%%/ia32/include/stack
-*/opt/intel/%%COMPILERDIR%%/ia32/include/stdexcept
-*/opt/intel/%%COMPILERDIR%%/ia32/include/stdiostream.h
-*/opt/intel/%%COMPILERDIR%%/ia32/include/stl.h
-*/opt/intel/%%COMPILERDIR%%/ia32/include/stream.h
-*/opt/intel/%%COMPILERDIR%%/ia32/include/streambuf
-*/opt/intel/%%COMPILERDIR%%/ia32/include/string
-*/opt/intel/%%COMPILERDIR%%/ia32/include/strstream
-*/opt/intel/%%COMPILERDIR%%/ia32/include/strstream.h
-*/opt/intel/%%COMPILERDIR%%/ia32/include/utility
-*/opt/intel/%%COMPILERDIR%%/ia32/include/valarray
-*/opt/intel/%%COMPILERDIR%%/ia32/include/vector
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xcomplex
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xdebug
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xhash
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xiosbase
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xlocale
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xlocinfo
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xlocinfo.h
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xlocmes
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xlocmon
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xlocnum
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xloctime
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xmemory
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xstring
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xtree
-*/opt/intel/%%COMPILERDIR%%/ia32/include/xutility
-*/opt/intel/%%COMPILERDIR%%/ia32/include/ymath.h
-*/opt/intel/%%COMPILERDIR%%/ia32/lib/libcprts.so
-*/opt/intel/%%COMPILERDIR%%/ia32/lib/libcprts.so.3
-*/opt/intel/%%COMPILERDIR%%/ia32/lib/libguide.so
-*/opt/intel/%%COMPILERDIR%%/ia32/lib/libguide_stats.so
-*/opt/intel/%%COMPILERDIR%%/ia32/lib/libunwind.so
-*/opt/intel/%%COMPILERDIR%%/ia32/lib/libunwind.so.3
-*/opt/intel/%%COMPILERDIR%%/ia32/lib/libimf.so
-*/opt/intel/%%COMPILERDIR%%/ia32/lib/libintrins.so
-*/opt/intel/%%COMPILERDIR%%/ia32/lib/libintrins.so.3
*/opt/intel/%%COMPILERDIR%%/ia32/lib/libCEPCF90.so
*/opt/intel/%%COMPILERDIR%%/ia32/lib/libCEPCF90.so.3
*/opt/intel/%%COMPILERDIR%%/ia32/lib/libF90.so
@@ -74,4 +9,12 @@
*/opt/intel/%%COMPILERDIR%%/ia32/lib/libPEPCF90.so.3
*/opt/intel/%%COMPILERDIR%%/ia32/lib/libPOSF90.so
*/opt/intel/%%COMPILERDIR%%/ia32/lib/libPOSF90.so.3
-*/opt/intel/%%COMPILERDIR%%/man/man1/efc.1
+*/opt/intel/%%COMPILERDIR%%/ia32/lib/libcprts.so
+*/opt/intel/%%COMPILERDIR%%/ia32/lib/libcprts.so.3
+*/opt/intel/%%COMPILERDIR%%/ia32/lib/libguide.so
+*/opt/intel/%%COMPILERDIR%%/ia32/lib/libguide_stats.so
+*/opt/intel/%%COMPILERDIR%%/ia32/lib/libimf.so
+*/opt/intel/%%COMPILERDIR%%/ia32/lib/libintrins.so
+*/opt/intel/%%COMPILERDIR%%/ia32/lib/libintrins.so.3
+*/opt/intel/%%COMPILERDIR%%/ia32/lib/libunwind.so
+*/opt/intel/%%COMPILERDIR%%/ia32/lib/libunwind.so.3
diff --git a/lang/ifc7/files/ld.c b/lang/ifc7/files/ld.c
index e2fba2874d5..41cfc18bb43 100644
--- a/lang/ifc7/files/ld.c
+++ b/lang/ifc7/files/ld.c
@@ -28,143 +28,71 @@
* Based on a shell-script written by Dan Nelson <dnelson@allantgroup.com>
* with some modifications by Alexander Leidinger <netchild@FreeBSD.org>.
*
- * $FreeBSD: /tmp/pcvs/ports/lang/ifc7/files/Attic/ld.c,v 1.3 2003-10-08 00:04:36 maho Exp $
*/
-/* Uses code marked: */
-
-/* OpenBSD: mailwrapper.c,v 1.6 1999/12/17 05:06:28 mickey Exp */
-/* NetBSD: mailwrapper.c,v 1.3 1999/05/29 18:18:15 christos Exp */
-/* FreeBSD: src/usr.sbin/mailwrapper/mailwrapper.c,v 1.8 2002/07/11 18:27:55 alfred Exp */
-
-/*
- * Copyright (c) 1998
- * Perry E. Metzger. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgment:
- * This product includes software developed for the NetBSD Project
- * by Perry E. Metzger.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: /tmp/pcvs/ports/lang/ifc7/files/Attic/ld.c,v 1.4 2004-01-19 13:44:47 maho Exp $");
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-
-#if defined (__FreeBSD__) && __FreeBSD__ >= 2
- #include <osreldate.h>
-#else
- #error "Won't work here."
-#endif
+#include <osreldate.h>
#define PATH_LD "/usr/bin/ld"
+#define LDW_CPP (1<<0)
+#define LDW_DYN (1<<1)
+#define LDW_GPROF (1<<2)
+#define LDW_PIC (1<<3)
+#define LDW_THR (1<<4)
+#define LDW_LGCC (1<<5)
+
struct arglist {
- size_t argc, maxc;
- char **argv;
+ size_t argc;
+ const char **argv;
};
-static void initarg(struct arglist *al);
-static void addarg(struct arglist *al, const char *arg, int copy);
-static void freearg(struct arglist *al, int copy);
+static void addarg(struct arglist *al, const char *arg);
int main(int argc, char *argv[], char *envp[]);
static void
-initarg(struct arglist *al)
+addarg(struct arglist *al, const char *arg)
{
+ const char **argv2;
- al->argc = 0;
- al->maxc = 10;
- if ((al->argv = malloc(al->maxc * sizeof(char *))) == NULL)
- err(1, NULL);
-}
+ argv2 = realloc(al->argv, (al->argc + 1) * sizeof(al->argv[0]));
-static void
-addarg(struct arglist *al, const char *arg, int copy)
-{
- char **argv2;
-
- if (al->argc == al->maxc) {
- al->maxc <<= 1;
-
- if ((argv2 = realloc(al->argv,
- al->maxc * sizeof(char *))) == NULL) {
- if (al->argv)
- free(al->argv);
- al->argv = NULL;
- err(1, NULL);
- } else {
- al->argv = argv2;
- }
- }
- if (copy) {
- if ((al->argv[al->argc++] = strdup(arg)) == NULL)
- err(1, NULL);
- } else {
- al->argv[al->argc++] = (char *)arg;
- }
-}
+ if (argv2 == NULL)
+ err(1, NULL);
-static
-void freearg(struct arglist *al, int copy)
-{
- size_t i;
+ al->argv = argv2;
- if (copy)
- for (i = 0; i < al->argc; i++)
- free(al->argv[i]);
- free(al->argv);
+ al->argv[al->argc++] = arg;
}
int
main(int argc, char *argv[], char *envp[])
{
size_t i;
- int bootstrap, cpp, dynamic, pic, gprof, stlinserted, threaded;
- int f90 = 0;
- char *libc, *libc_r, *prefix;
- struct arglist al;
+ u_int flags;
+ const char *libc, *libthr, *icc_localbase;
+ struct arglist al = { 0, NULL };
+
+ flags = 0;
if (argc == 1)
errx(1, "no input files");
- if ((prefix = getenv("PREFIX")) == NULL)
- errx(1, "can't get PREFIX");
-
- initarg(&al);
- bootstrap = cpp = dynamic = pic = gprof = stlinserted = threaded = 0;
+ if ((icc_localbase = getenv("ICC_LOCALBASE")) == NULL)
+ errx(1, "can't get ICC_LOCALBASE");
#ifdef DEBUG
printf("input: ");
#endif
-#define ARGCMP(x) !strcmp(argv[i], (x))
-#define ARGCMPB(x, y) (strlen(x) + strlen(y) == strlen(argv[i]) && \
- !strncmp(argv[i], (x), strlen(x)) && \
- !strncmp(argv[i] + strlen(x), (y), strlen(y)))
+#define ARGCMP(i, x) !strcmp(argv[i], (x))
/*
* XXX This doesn't deal with whitespace but a) the output of the
@@ -176,123 +104,108 @@ main(int argc, char *argv[], char *envp[])
printf("%s ", argv[i]);
#endif
- if (ARGCMP("-CPLUSPLUS")) {
- cpp++;
+ if (ARGCMP(i, "-CPLUSPLUS")) {
+ flags |= LDW_CPP;
continue;
}
- if (ARGCMP("-BOOTSTRAPSTLPORT")) {
- bootstrap++;
- continue;
- }
-
- if (ARGCMP("-MT")) {
- threaded++;
+ if (ARGCMP(i, "-MT")
+/* ifc8 */
+ || ARGCMP(i, "-lpthread")) {
+/* ifc8 */
+ flags |= LDW_THR;
continue;
}
- if (ARGCMP("-PIC")) {
- pic++;
+ if (ARGCMP(i, "-PIC")) {
+ flags |= LDW_PIC;
continue;
}
/*
+ * Check if the compiler wants us to do dynamic linking, i.e.
+ * the compiler was called with -shared or without -static.
* If the compiler was called with -static we shouldn't see
* "--dynamic-linker" here.
* Note: According to ld(1) this is "--dynamic-linker" but
* ICC passes "-dynamic-linker" to it.
*/
- if (ARGCMP("--dynamic-linker") || ARGCMP("-dynamic-linker")) {
- dynamic++;
- continue;
- }
- if (ARGCMP("-shared")) {
- dynamic++;
- continue;
- }
-
- /*
- * Just link libstlport_icc* once when compiling the stlport
- * tests.
- */
- if (!strncmp(argv[i], "-lstlport_icc",
- strlen("-lstlport_icc"))) {
- stlinserted++;
+ if (ARGCMP(i, "--dynamic-linker") ||
+ ARGCMP(i, "-dynamic-linker") || ARGCMP(i, "-shared")) {
+ flags |= LDW_DYN;
continue;
}
/*
- * If IFC, do not use libstlport_icc.
+ * Link against libc_p when "-qp" or "-p" were given,
+ * "/usr/lib/gcrt1.o" indicates this.
*/
- if (!strcmp(argv[i], "-lF90")) {
- f90++;
+ if (ARGCMP(i, "/usr/lib/gcrt1.o")) {
+ flags |= LDW_GPROF;
continue;
}
- /*
- * Link against libc_p when "-qp" or "-p" were given,
- * "/usr/lib/gcrt1.o" indicates this.
- */
- if (ARGCMP("/usr/lib/gcrt1.o")) {
- gprof++;
+ if (ARGCMP(i, "-lgcc")) {
+ flags |= LDW_LGCC;
continue;
}
}
/*
- * Use the appropriate libs for libc and libc_r when linking static
+ * Allow the user to specify an alternative threads library
+ * implementation, such as -lthr, or whatever.
+ */
+#if __FreeBSD_version >= 500016
+ if ((libthr = getenv("PTHREAD_LIBS")) == NULL)
+#endif
+ libthr = "-lc_r";
+ /*
+ * Use the appropriate libs for libc and libthr when linking static
* and "-KPIC" or "-pg" where given.
*/
- if (!dynamic && (pic || gprof)) {
+ if (!(flags & LDW_DYN) && flags & (LDW_PIC | LDW_GPROF)) {
/*
* Let libc_p win above libc_pic when both, "-KPIC" and "-pg",
* where given, GCC does the same.
*/
- if (!gprof) {
- libc = strdup("-lc_pic");
- libc_r = strdup("-lc_r");
- } else {
- libc = strdup("-lc_p");
- libc_r = strdup("-lc_r_p");
+ if (!(flags & LDW_GPROF))
+ libc = "-lc_pic";
+ else {
+ char *p;
+ libc = "-lc_p";
+ asprintf(&p, "%s_p", libthr);
+ if (p == NULL)
+ err(1, NULL);
+ libthr = p;
}
- } else {
- libc = strdup("-lc");
- libc_r = strdup("-lc_r");
- }
+ } else
+ libc = "-lc";
#ifdef DEBUG
- printf("\ncpp: %s bootstrap: %s dynamic: %s gprof: %s pic: %s "
- "threaded: %s\n", cpp ? "YES" : "NO", bootstrap ? "YES" : "NO",
- dynamic ? "YES" : "NO", gprof ? "YES" : "NO", pic ? "YES" : "NO",
- threaded ? "YES" : "NO");
+ printf("\n");
#endif
- if (bootstrap && !cpp)
- errx(1, "-BOOTSTRAPSTLPORT is only valid in combination with "
- "-CPLUSPLUS");
-
for (i = 0; i < argc; i++) {
- if (ARGCMP("-CPLUSPLUS") || ARGCMP("-BOOTSTRAPSTLPORT") ||
- ARGCMP("-MT") || ARGCMP("-PIC"))
+ if (ARGCMP(i, "-CPLUSPLUS") || ARGCMP(i, "-MT") ||
+/* ifc8 */
+ ARGCMP(i, "-lpthread") ||
+/* ifc8 */
+ ARGCMP(i, "-PIC"))
continue;
/* prepend "-melf_i386" to the commandline */
if (i == 0) {
- addarg(&al, argv[0], 1);
+ addarg(&al, argv[0]);
#if __FreeBSD_version < 500042
- addarg(&al, "-melf_i386", 1);
+ addarg(&al, "-melf_i386");
#else
- addarg(&al, "-melf_i386_fbsd", 1);
+ addarg(&al, "-melf_i386_fbsd");
#endif
continue;
}
- /* Don't add obsolete flag "-Qy". */
- if (ARGCMP("-Qy"))
- continue;
-
- /* Libunwind is only needed when compiling C++ source. */
- if (!cpp && !f90 && ARGCMP("-lunwind"))
+ /* Don't add obsolete flag "-Qy", don't add libgcc_s. */
+ if (ARGCMP(i, "-Qy") || ARGCMP(i, "-lgcc_s"))
continue;
/*
@@ -300,119 +213,107 @@ main(int argc, char *argv[], char *envp[])
* shipping with ICC has unresolvable glibc dependencies
* in both, the static and the dynamic, versions.
*/
- if (ARGCMP("-lcprts")) {
- if (cpp && !bootstrap && !stlinserted) {
+ if (ARGCMP(i, "-lcprts")) {
+ if (flags & LDW_CPP && !(flags & LDW_LGCC)) {
addarg(&al,
- dynamic ? "-Bdynamic" : "-Bstatic", 1);
- addarg(&al, "-lstlport_icc", 1);
- stlinserted++;
+ flags & LDW_DYN ? "-Bdynamic" : "-Bstatic");
+ addarg(&al, "-lstlport_icc");
}
continue;
}
/*
- * Link against libc_r when compiling multi-threaded or C++
- * code (libcxa and libunwind depend on libc_r when compiling
- * C++ source).
+ * Link against libthr when compiling multi-threaded or C++
+ * code (libcxa and libunwind depend on a threads library
+ * when compiling C++ source).
*/
- if (ARGCMP("-lc")) {
+ if (ARGCMP(i, "-lc")) {
if (al.argc > 0 &&
- strncmp(al.argv[al.argc - 1], "-B", strlen("-B")))
+ strncmp(al.argv[al.argc - 1], "-B", 2))
addarg(&al,
- dynamic ? "-Bdynamic" : "-Bstatic", 1);
-#if __FreeBSD_version < 500016
- if (cpp || f90 || threaded) {
- addarg(&al, libc_r, 0);
-#else
- if (cpp || threaded) {
- addarg(&al, libc, 0);
+ flags & LDW_DYN ? "-Bdynamic" : "-Bstatic");
+ if (flags & (LDW_CPP | LDW_THR)) {
+ addarg(&al, libthr);
+#if __FreeBSD_version >= 500016
addarg(&al,
- dynamic ? "-Bdynamic" : "-Bstatic", 1);
- addarg(&al, libc_r, 0);
+ flags & LDW_DYN ? "-Bdynamic" : "-Bstatic");
+ addarg(&al, libc);
#endif
- } else {
- addarg(&al, libc, 0);
- }
+ } else
+ addarg(&al, libc);
continue;
}
/* Switch Linux stuff to FreeBSD counterparts. */
- if (ARGCMP("/lib/ld-linux.so.2")) {
+ if (ARGCMP(i, "/lib/ld-linux.so.2")) {
#if __FreeBSD_version >= 501105
- addarg(&al, "/libexec/ld-elf.so.1", 1);
+ addarg(&al, "/libexec/ld-elf.so.1");
#else
- addarg(&al, "/usr/libexec/ld-elf.so.1", 1);
+ addarg(&al, "/usr/libexec/ld-elf.so.1");
#endif
continue;
}
- if (ARGCMP("-L/usr/lib")) {
- char *temp;
-
- if ((temp = (char *) malloc(strlen("-L") +
- strlen(prefix) + strlen("/lib") + 1)) == NULL)
- err(1, NULL);
-
- addarg(&al, "-L/usr/libexec/elf", 1);
- addarg(&al, "-L/usr/libexec", 1);
- addarg(&al, "-L/usr/lib", 1);
- snprintf(temp, strlen("-L") + strlen(prefix) +
- strlen("/lib") + 1, "-L%s/lib", prefix);
- addarg(&al, temp, 1);
- free(temp);
+ if (ARGCMP(i, "-L/usr/lib")) {
+ addarg(&al, "-L/usr/libexec/elf");
+ addarg(&al, "-L/usr/libexec");
+ addarg(&al, "-L/usr/lib");
+ if (flags & LDW_CPP && !(flags & LDW_LGCC)) {
+ char *p;
+ asprintf(&p, "-L%s/lib", icc_localbase);
+ if (p == NULL)
+ err(1, NULL);
+ addarg(&al, p);
+ }
continue;
}
/*
- * Force libcxa and libunwind to static linkage, since the
- * dynamic versions have glibc dependencies.
+ * Force libcxa, libcxaguard and libunwind to static linkage,
+ * since the dynamic versions have glibc dependencies.
* Don't add superfluous -Bdynamic.
*/
- if (ARGCMP("-Bdynamic") && i < argc - 1) {
- if (!strcmp(argv[i + 1], "-lcxa") ||
- ((cpp || f90) && !strcmp(argv[i + 1], "-lunwind"))) {
- addarg(&al, "-Bstatic", 1);
+ if (ARGCMP(i, "-Bdynamic") && i < argc - 1) {
+ if (ARGCMP(i + 1, "-lcxa") ||
+ ARGCMP(i + 1, "-lcxaguard") ||
+ ARGCMP(i + 1, "-lunwind")) {
+ addarg(&al, "-Bstatic");
continue;
}
- if (!strcmp(argv[i + 1], "-lcprts") ||
- !strcmp(argv[i + 1], "-lunwind"))
+ if (ARGCMP(i + 1, "-lcprts") ||
+ ARGCMP(i + 1, "-lgcc_s"))
continue;
}
/* Don't add superfluous -Bstatic. */
- if (ARGCMP("-Bstatic") && i < argc - 1 &&
- (!strcmp(argv[i + 1], "-lcprts") ||
- (!cpp && !f90 && !strcmp(argv[i + 1], "-lunwind"))))
+ if (ARGCMP(i, "-Bstatic") && i < argc - 1 &&
+ (ARGCMP(i + 1, "-lcprts") || ARGCMP(i + 1, "-lgcc_s") ||
+ ARGCMP(i + 1, "-lunwind")))
continue;
/*
* Sanity check if every lib is prepended by a linkage option,
* add if missing.
*/
- if (!strncmp(argv[i], "-l", strlen("-l")) && al.argc > 0 &&
- strncmp(al.argv[al.argc - 1], "-B", strlen("-B"))) {
- if (!strcmp(argv[i], "-lcxa") ||
- !strcmp(argv[i], "-limf") ||
- !strcmp(argv[i], "-lirc") ||
- !strcmp(argv[i], "-lircmt") ||
- !strcmp(argv[i], "-lunwind"))
- addarg(&al, "-Bstatic", 1);
+ if (!strncmp(argv[i], "-l", 2) && al.argc > 0 &&
+ strncmp(al.argv[al.argc - 1], "-B", 2)) {
+ if (ARGCMP(i, "-lcxa") || ARGCMP(i, "-lcxaguard") ||
+ ARGCMP(i, "-limf") || ARGCMP(i, "-lirc") ||
+ ARGCMP(i, "-lircmt") || ARGCMP(i, "-lunwind"))
+ addarg(&al, "-Bstatic");
else
addarg(&al,
- dynamic ? "-Bdynamic" : "-Bstatic", 1);
+ flags & LDW_DYN ? "-Bdynamic" : "-Bstatic");
- addarg(&al, argv[i], 1);
+ addarg(&al, argv[i]);
continue;
}
/* default */
- addarg(&al, argv[i], 1);
+ addarg(&al, argv[i]);
}
-#undef ARGCMP
-#undef ARGCMPB
-
- /* Still something to do ? */
+ /* Still something to do? */
if (al.argc == 1)
errx(1, "no input files");
@@ -425,13 +326,11 @@ main(int argc, char *argv[], char *envp[])
printf("\n");
#endif
- addarg(&al, NULL, 0);
-
- /* Launch the real linker */
- if (execve(PATH_LD, al.argv, envp) == -1)
- err(1, "execing %s", PATH_LD);
+ addarg(&al, NULL);
- freearg(&al, 1);
+ /* Launch the real linker. */
+ if (execve(PATH_LD, (char **)al.argv, envp) == -1)
+ err(1, "execing " PATH_LD);
exit (1);
}
diff --git a/lang/ifc7/files/linux_file.c b/lang/ifc7/files/linux_file.c
index 61f5acd3271..cff6d293291 100644
--- a/lang/ifc7/files/linux_file.c
+++ b/lang/ifc7/files/linux_file.c
@@ -25,111 +25,61 @@
*
* $FreeBSD$
*/
-
#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-/* This matches struct stat64 in glibc2.1, hence the absolutely
- * insane amounts of padding around dev_t's.
- */
-struct stat64 {
- unsigned short st_dev;
- unsigned char __pad0[10];
-
-#define STAT64_HAS_BROKEN_ST_INO 1
- unsigned long __st_ino;
-
- unsigned int st_mode;
- unsigned int st_nlink;
-
- unsigned long st_uid;
- unsigned long st_gid;
-
- unsigned short st_rdev;
- unsigned char __pad3[10];
-
- long long st_size;
- unsigned long st_blksize;
-
- unsigned long st_blocks; /* Number 512-byte blocks allocated. */
- unsigned long __pad4; /* future possible st_blocks high bits */
-
- unsigned long st_atime_;
- unsigned long __pad5;
-
- unsigned long st_mtime_;
- unsigned long __pad6;
-
- unsigned long st_ctime_;
- unsigned long __pad7; /* will be high 32 bits of ctime someday */
-
- unsigned long long st_ino;
-};
-
-
-struct stat64 stat2stat64(struct stat sb) {
- static struct stat64 sb64;
-
- sb64.st_dev = sb.st_dev;
- sb64.st_ino = sb.st_ino;
- sb64.st_mode = sb.st_mode;
- sb64.st_nlink = sb.st_nlink;
- sb64.st_uid = sb.st_uid;
- sb64.st_gid = sb.st_gid;
- sb64.st_rdev = sb.st_rdev;
- sb64.st_size = sb.st_size;
- sb64.st_blksize = sb.st_blksize;
- sb64.st_blocks = sb.st_blocks;
- sb64.st_atime_ = sb.st_atime;
- sb64.st_mtime_ = sb.st_mtime;
- sb64.st_ctime_ = sb.st_ctime;
-
- return sb64;
-}
-
-
-int __fxstat64 (int __ver, int __fildes, struct stat64 *__stat_buf) {
- struct stat sb;
- int result;
-
- result = fstat (__fildes, &sb);
- *__stat_buf = stat2stat64(sb);
- return result;
-}
-
-
-int __xstat64 (int __ver, __const char *__filename,
- struct stat64 *__stat_buf) {
- struct stat sb;
- int result;
-
- result = stat (__filename, &sb);
- *__stat_buf = stat2stat64(sb);
- return result;
+#include <fcntl.h>
+#include <stdarg.h>
+
+#define LINUX_O_RDONLY 00
+#define LINUX_O_WRONLY 01
+#define LINUX_O_RDWR 02
+#define LINUX_O_CREAT 0100
+#define LINUX_O_EXCL 0200
+#define LINUX_O_NOCTTY 0400
+#define LINUX_O_TRUNC 01000
+#define LINUX_O_APPEND 02000
+#define LINUX_O_NONBLOCK 04000
+#define LINUX_O_NDELAY LINUX_O_NONBLOCK
+#define LINUX_O_SYNC 010000
+#define LINUX_FASYNC 020000
+
+int l_open(const char *path, int flags, ...) {
+ va_list args;
+ mode_t mode;
+ int bsd_flags, error;
+
+ bsd_flags = 0;
+
+ if (flags & LINUX_O_RDONLY ) bsd_flags |= O_RDONLY;
+ if (flags & LINUX_O_WRONLY ) bsd_flags |= O_WRONLY;
+ if (flags & LINUX_O_RDWR ) bsd_flags |= O_RDWR;
+ if (flags & LINUX_O_NDELAY ) bsd_flags |= O_NONBLOCK;
+ if (flags & LINUX_O_APPEND ) bsd_flags |= O_APPEND;
+ if (flags & LINUX_O_SYNC ) bsd_flags |= O_FSYNC;
+ if (flags & LINUX_O_NONBLOCK) bsd_flags |= O_NONBLOCK;
+ if (flags & LINUX_FASYNC ) bsd_flags |= O_ASYNC;
+ if (flags & LINUX_O_CREAT ) bsd_flags |= O_CREAT;
+ if (flags & LINUX_O_TRUNC ) bsd_flags |= O_TRUNC;
+ if (flags & LINUX_O_EXCL ) bsd_flags |= O_EXCL;
+ if (flags & LINUX_O_NOCTTY ) bsd_flags |= O_NOCTTY;
+
+ if (bsd_flags & O_CREAT) {
+ va_start (args, flags);
+ mode = (mode_t) va_arg(args, int);
+ return open(path, bsd_flags, mode);
+ va_end (args);
+ } else
+ return open(path, bsd_flags);
}
-
-#include <stdio.h>
-
-void __xstat() {
- fprintf(stderr, __FILE__ ": __xstat() is dummy.\n");
-};
-void __fxstat() {
- fprintf(stderr, __FILE__ ": __fxstat() is dummy.\n");
-};
-void __lxstat() {
- fprintf(stderr, __FILE__ ": __lxstat() is dummy.\n");
-};
-void __lxstat64() {
- fprintf(stderr, __FILE__ ": __lxstat64() is dummy.\n");
-};
-
-
typedef int32_t l_long;
typedef l_long l_off_t;
-l_off_t Lseek(int fildes, l_off_t offset, int whence)
+l_off_t l_lseek(int fildes, l_off_t offset, int whence)
{
return (l_off_t) lseek(fildes, (off_t) offset, whence);
}
+
+int l_ftruncate(int fildes, l_off_t length)
+{
+ return ftruncate(fildes, (off_t) length);
+}
diff --git a/lang/ifc7/files/patch-ia32::bin::ifc b/lang/ifc7/files/patch-ia32::bin::ifc
index a6b53f5bbd7..30a47cf2e8d 100644
--- a/lang/ifc7/files/patch-ia32::bin::ifc
+++ b/lang/ifc7/files/patch-ia32::bin::ifc
@@ -1,38 +1,35 @@
---- ia32/bin/ifc.orig Sat Apr 5 20:48:18 2003
-+++ ia32/bin/ifc Sat Apr 5 20:53:32 2003
-@@ -1,34 +1,61 @@
+--- ia32/bin/ifc.orig Sun Jan 18 17:29:47 2004
++++ ia32/bin/ifc Sun Jan 18 17:34:08 2004
+@@ -1,6 +1,9 @@
#!/bin/sh
-+PREFIX=@@PREFIX@@
-+export PREFIX;
+-if [ -z INTEL_LICENSE_FILE ]
++ICC_LOCALBASE=%%ICC_LOCALBASE%%
++export ICC_LOCALBASE;
+
- if [ -z INTEL_LICENSE_FILE ]
++if [ -z "$INTEL_LICENSE_FILE" ]
then
--INTEL_LICENSE_FILE=<INSTALLDIR>/licenses;
-+INTEL_LICENSE_FILE=${PREFIX}/intel/licenses;
+ INTEL_LICENSE_FILE=<INSTALLDIR>/licenses;
else
--INTEL_LICENSE_FILE=$INTEL_LICENSE_FILE:<INSTALLDIR>/licenses;
-+INTEL_LICENSE_FILE=$INTEL_LICENSE_FILE:${PREFIX}/intel/licenses;
+@@ -8,7 +11,7 @@
fi
export INTEL_LICENSE_FILE;
- if [ -z LD_LIBRARY_PATH ]
+-if [ -z LD_LIBRARY_PATH ]
++if [ -z "$LD_LIBRARY_PATH" ]
then
-- LD_LIBRARY_PATH=<INSTALLDIR>/compiler70/ia32/lib;
-+ LD_LIBRARY_PATH=${PREFIX}/intel/compiler70/ia32/lib;
+ LD_LIBRARY_PATH=<INSTALLDIR>/compiler70/ia32/lib;
else
-- LD_LIBRARY_PATH=<INSTALLDIR>/compiler70/ia32/lib:$LD_LIBRARY_PATH
-+ LD_LIBRARY_PATH=${PREFIX}/intel/compiler70/ia32/lib:$LD_LIBRARY_PATH
+@@ -16,7 +19,7 @@
fi
export LD_LIBRARY_PATH;
- if [ -z PATH ]
+-if [ -z PATH ]
++if [ -z "$PATH" ]
then
-- PATH=<INSTALLDIR>/compiler70/ia32/bin;
-+ PATH=${PREFIX}/intel/compiler70/ia32/bin;
+ PATH=<INSTALLDIR>/compiler70/ia32/bin;
else
-- PATH=<INSTALLDIR>/compiler70/ia32/bin:$PATH;
-+ PATH=${PREFIX}/intel/compiler70/ia32/bin:$PATH;
+@@ -24,11 +27,31 @@
fi
export PATH;
@@ -60,15 +57,11 @@
+ [ "${val1}" = "-fpic" ] || [ "${val1}" = "-fPIC" ] ; then
+ set -- "$@" "-Qoption,ld,-PIC"
+ fi
-+ if [ "${val1}" = "-mt" ] ; then
-+ unset val1
-+ set -- "$@" "-Qoption,ld,-MT"
-+ fi
+ set -- "$@" "$val1"
+ i=$(($i+1))
+ done
-+ exec ${PREFIX}/intel/compiler70/ia32/bin/ifcbin "$@";
++ exec <INSTALLDIR>/compiler70/ia32/bin/ifcbin "$@";
else
- exec -a "<INSTALLDIR>/compiler70/ia32/bin/ifc" <INSTALLDIR>/compiler70/ia32/bin/ifcbin;
-+ exec ${PREFIX}/intel/compiler70/ia32/bin/ifcbin;
++ exec <INSTALLDIR>/compiler70/ia32/bin/ifcbin;
fi
diff --git a/lang/ifc7/pkg-plist b/lang/ifc7/pkg-plist
index d547417301c..841463e3736 100644
--- a/lang/ifc7/pkg-plist
+++ b/lang/ifc7/pkg-plist
@@ -1300,5 +1300,5 @@ intel/%%COMPILERDIR%%/ia32/lib/libunwind.a
%%PORTDOCS%%@dirrm intel/%%COMPILERDIR%%/training/templ_im
%%PORTDOCS%%@dirrm intel/%%COMPILERDIR%%/training
@dirrm intel/%%COMPILERDIR%%
-@dirrm intel/licenses
-@dirrm intel
+@unexec rmdir %D/intel/licenses >/dev/null 2>&1 || echo '*** license directory (%D/intel/licenses/) not removed, it may contain a license'
+@unexec rmdir %D/intel >/dev/null 2>&1 || true