aboutsummaryrefslogtreecommitdiffstats
path: root/lang/icc/files/patch-bin__icpc
blob: 7ea91465461ae12fe0e6e0863a0093296a8e20f6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
--- bin/icpc.orig   Sun Mar  6 15:46:09 2005
+++ bin/icpc    Sun Mar  6 15:48:12 2005
@@ -1,5 +1,17 @@
 #!/bin/sh
 
+ICC_LOCALBASE=%%ICC_LOCALBASE%%
+export ICC_LOCALBASE
+
+GXX_ROOT=${GXX_ROOT:-<INSTALLDIR>/lib}
+export GXX_ROOT
+
+GXX_INCLUDE=${GXX_INCLUDE:-%%GXX_INCLUDE%%}
+if [ ! -z "$GXX_INCLUDE" ]
+then
+ export GXX_INCLUDE
+fi
+
 if [ -z "$INTEL_LICENSE_FILE" ]
 then
  INTEL_LICENSE_FILE="<INSTALLDIR>/licenses";
@@ -24,11 +36,43 @@
 fi
 export PATH;
 
-export -n IA32ROOT; unset IA32ROOT;
-
 if [ $# != 0 ]
 then
- exec -a "<INSTALLDIR>/bin/icpc" <INSTALLDIR>/bin/icpcbin "$@";
+ i=0
+ argc=$#
+ while [ $i -lt $argc ] ; do
+  val1=$1
+  shift
+  val2=${val1#"-openmp"}
+  if [ ${#val1} -gt ${#val2} ] ; then
+   echo "Sorry, option '$val1' is not supported on FreeBSD."
+   exit 1
+  fi
+  val2=${val1#"-par"}
+  if [ ${#val1} -gt ${#val2} ] ; then
+   echo "Sorry, option '$val1' is not supported on FreeBSD."
+   exit 1
+  fi
+  if [ "${val1}" = "-cxxlib-icc" ] ; then
+   set -- "$@" "-I${ICC_LOCALBASE}/include/stlport"
+   set -- "$@" "-Qoption,ld,-CPLUSPLUS"
+  fi
+  if [ "${val1}" = "-Kpic" ] || [ "${val1}" = "-KPIC" ] || \
+   [ "${val1}" = "-fpic" ] || [ "${val1}" = "-fPIC" ] ; then
+   set -- "$@" "-Qoption,ld,-PIC"
+  fi
+  if [ "${val1}" = "-mt" ] ; then
+   unset val1
+   set -- "$@" "-Qoption,ld,-MT"
+  fi
+  if [ "${val1}" = "-pipe" ] ; then
+    unset val1
+    set -- "$@"
+  fi
+  set -- "$@" "$val1"
+  i=$(($i+1))
+ done
+ exec <INSTALLDIR>/bin/icpcbin "$@";
 else
- exec -a "<INSTALLDIR>/bin/icpc" <INSTALLDIR>/bin/icpcbin;
+ exec <INSTALLDIR>/bin/icpcbin;
 fi