1 |
# |
---|
2 |
# mexopts.sh Shell script for configuring MEX-file creation script, |
---|
3 |
# mex. |
---|
4 |
# |
---|
5 |
# usage: Do not call this file directly; it is sourced by the |
---|
6 |
# mex shell script. Modify only if you don't like the |
---|
7 |
# defaults after running mex. No spaces are allowed |
---|
8 |
# around the '=' in the variable assignment. |
---|
9 |
# |
---|
10 |
# SELECTION_TAGs occur in template option files and are used by MATLAB |
---|
11 |
# tools, such as mex and mbuild, to determine the purpose of the contents |
---|
12 |
# of an option file. These tags are only interpreted when preceded by '#' |
---|
13 |
# and followed by ':'. |
---|
14 |
# |
---|
15 |
#SELECTION_TAG_MEX_OPT: Template Options file for building MEXfiles using the native compiler |
---|
16 |
# |
---|
17 |
# Copyright (c) 1984-1998 by The MathWorks, Inc. |
---|
18 |
# All Rights Reserved. |
---|
19 |
# $Revision: 1.40 $ $Date: 1997/12/05 20:18:39 $ |
---|
20 |
#---------------------------------------------------------------------------- |
---|
21 |
# |
---|
22 |
case "$Arch" in |
---|
23 |
Undetermined) |
---|
24 |
#---------------------------------------------------------------------------- |
---|
25 |
# Change this line if you need to specify the location of the MATLAB |
---|
26 |
# root directory. The cmex script needs to know where to find utility |
---|
27 |
# routines so that it can determine the architecture; therefore, this |
---|
28 |
# assignment needs to be done while the architecture is still |
---|
29 |
# undetermined. |
---|
30 |
#---------------------------------------------------------------------------- |
---|
31 |
MATLAB="$MATLAB" |
---|
32 |
;; |
---|
33 |
alpha) |
---|
34 |
#---------------------------------------------------------------------------- |
---|
35 |
CC='cc' |
---|
36 |
CFLAGS='-ieee -std1' |
---|
37 |
CLIBS='' |
---|
38 |
COPTIMFLAGS='-O2 -DNDEBUG' |
---|
39 |
CDEBUGFLAGS='-g' |
---|
40 |
# |
---|
41 |
FC='f77' |
---|
42 |
FFLAGS='-shared' |
---|
43 |
FLIBS='-lUfor -lfor -lFutil' |
---|
44 |
FOPTIMFLAGS='-O2' |
---|
45 |
FDEBUGFLAGS='-g' |
---|
46 |
# |
---|
47 |
LD='ld' |
---|
48 |
LDFLAGS="-expect_unresolved '*' -shared -hidden -exported_symbol $ENTRYPOINT -exported_symbol mexVersion" |
---|
49 |
LDOPTIMFLAGS='' |
---|
50 |
LDDEBUGFLAGS='' |
---|
51 |
#---------------------------------------------------------------------------- |
---|
52 |
;; |
---|
53 |
hp700) |
---|
54 |
#---------------------------------------------------------------------------- |
---|
55 |
CC='cc' |
---|
56 |
CFLAGS='+z -D_HPUX_SOURCE -Aa +DA1.1' |
---|
57 |
CLIBS='' |
---|
58 |
COPTIMFLAGS='-O -DNDEBUG' |
---|
59 |
CDEBUGFLAGS='-g' |
---|
60 |
# |
---|
61 |
FC='f77' |
---|
62 |
FFLAGS='+z +DA1.1' |
---|
63 |
FLIBS='' |
---|
64 |
FOPTIMFLAGS='-O' |
---|
65 |
FDEBUGFLAGS='-g' |
---|
66 |
# |
---|
67 |
LD='ld' |
---|
68 |
LDFLAGS="-b +e $ENTRYPOINT +e mexVersion" |
---|
69 |
LDOPTIMFLAGS='' |
---|
70 |
LDDEBUGFLAGS='' |
---|
71 |
#---------------------------------------------------------------------------- |
---|
72 |
;; |
---|
73 |
ibm_rs) |
---|
74 |
#---------------------------------------------------------------------------- |
---|
75 |
CC='cc' |
---|
76 |
CFLAGS='-qlanglvl=ansi' |
---|
77 |
CLIBS='-lm' |
---|
78 |
COPTIMFLAGS='-O -DNDEBUG' |
---|
79 |
CDEBUGFLAGS='-g' |
---|
80 |
# |
---|
81 |
FC='f77' |
---|
82 |
FFLAGS='' |
---|
83 |
FLIBS="$MATLAB/extern/lib/ibm_rs/fmex1.o -lm" |
---|
84 |
FOPTIMFLAGS='-O' |
---|
85 |
FDEBUGFLAGS='-g' |
---|
86 |
# |
---|
87 |
LD='cc' |
---|
88 |
LDFLAGS="-bI:$MATLAB/extern/lib/ibm_rs/exp.ibm_rs -bE:$MATLAB/extern/lib/ibm_rs/$MAPFILE -bM:SRE -e $ENTRYPOINT" |
---|
89 |
LDOPTIMFLAGS='-s' |
---|
90 |
LDDEBUGFLAGS='' |
---|
91 |
#---------------------------------------------------------------------------- |
---|
92 |
;; |
---|
93 |
lnx86) |
---|
94 |
#---------------------------------------------------------------------------- |
---|
95 |
CC='gcc' |
---|
96 |
CFLAGS='' |
---|
97 |
CLIBS='' |
---|
98 |
COPTIMFLAGS='-O -DNDEBUG' |
---|
99 |
CDEBUGFLAGS='-g' |
---|
100 |
# |
---|
101 |
# Use these flags for using f2c and gcc for Fortan MEX-Files |
---|
102 |
# |
---|
103 |
FC='f2c' |
---|
104 |
FOPTIMFLAGS='' |
---|
105 |
FFLAGS='' |
---|
106 |
FDEBUGFLAGS='-g' |
---|
107 |
FLIBS='-lf2c -Wl,--defsym,MAIN__=mexfunction_' |
---|
108 |
# |
---|
109 |
# Use these flags for using the Absoft F77 Fortran Compiler |
---|
110 |
# |
---|
111 |
# FC='f77' |
---|
112 |
# FOPTIMFLAGS='' |
---|
113 |
# FFLAGS='-f -N1 -N9 -N70' |
---|
114 |
# FDEBUGFLAGS='-gg' |
---|
115 |
# FLIBS='-lf77' |
---|
116 |
# |
---|
117 |
LD='gcc' |
---|
118 |
LDFLAGS='-shared -rdynamic' |
---|
119 |
LDOPTIMFLAGS='' |
---|
120 |
LDDEBUGFLAGS='' |
---|
121 |
#---------------------------------------------------------------------------- |
---|
122 |
;; |
---|
123 |
sgi) |
---|
124 |
#---------------------------------------------------------------------------- |
---|
125 |
CC='cc' |
---|
126 |
CFLAGS='-32' |
---|
127 |
CLIBS='' |
---|
128 |
COPTIMFLAGS='-O -DNDEBUG' |
---|
129 |
CDEBUGFLAGS='-g' |
---|
130 |
# |
---|
131 |
FC='f77' |
---|
132 |
FFLAGS='-32' |
---|
133 |
FLIBS='' |
---|
134 |
FOPTIMFLAGS='-O' |
---|
135 |
FDEBUGFLAGS='-g' |
---|
136 |
# |
---|
137 |
LD='ld' |
---|
138 |
LDFLAGS="-32 -shared -U -exported_symbol $ENTRYPOINT -exported_symbol mexVersion" |
---|
139 |
LDOPTIMFLAGS='' |
---|
140 |
LDDEBUGFLAGS='' |
---|
141 |
;; |
---|
142 |
#---------------------------------------------------------------------------- |
---|
143 |
sgi64) |
---|
144 |
# R8000 only: The default action of mex is to generate full MIPS IV |
---|
145 |
# (R8000) instruction set. |
---|
146 |
#---------------------------------------------------------------------------- |
---|
147 |
CC='cc' |
---|
148 |
CFLAGS='-ansi -mips4 -64' |
---|
149 |
CLIBS='' |
---|
150 |
COPTIMFLAGS='-O -DNDEBUG' |
---|
151 |
CDEBUGFLAGS='-g' |
---|
152 |
# |
---|
153 |
FC='f77' |
---|
154 |
FFLAGS='-mips4 -64' |
---|
155 |
FLIBS='' |
---|
156 |
FOPTIMFLAGS='-O' |
---|
157 |
FDEBUGFLAGS='-g' |
---|
158 |
# |
---|
159 |
LD='ld' |
---|
160 |
LDFLAGS="-mips4 -64 -shared -U -Bsymbolic -exported_symbol $ENTRYPOINT -exported_symbol mexVersion" |
---|
161 |
LDOPTIMFLAGS='' |
---|
162 |
LDDEBUGFLAGS='' |
---|
163 |
;; |
---|
164 |
#---------------------------------------------------------------------------- |
---|
165 |
sol2) |
---|
166 |
#---------------------------------------------------------------------------- |
---|
167 |
CC='cc' |
---|
168 |
CFLAGS='-dalign' |
---|
169 |
CLIBS='' |
---|
170 |
COPTIMFLAGS='-O -DNDEBUG' |
---|
171 |
CDEBUGFLAGS='-g' |
---|
172 |
# |
---|
173 |
FC='f77' |
---|
174 |
FFLAGS='-dalign' |
---|
175 |
FLIBS='' |
---|
176 |
FOPTIMFLAGS='-O' |
---|
177 |
FDEBUGFLAGS='-g' |
---|
178 |
# |
---|
179 |
LD='/usr/ccs/bin/ld' |
---|
180 |
LDFLAGS="-G -M $MATLAB/extern/lib/sol2/$MAPFILE" |
---|
181 |
LDOPTIMFLAGS='' |
---|
182 |
LDDEBUGFLAGS='' |
---|
183 |
#---------------------------------------------------------------------------- |
---|
184 |
;; |
---|
185 |
sun4) |
---|
186 |
#---------------------------------------------------------------------------- |
---|
187 |
# A dry run of the appropriate compiler is done in the mex script to |
---|
188 |
# generate the correct library list. Use -v option to see what |
---|
189 |
# libraries are actually being linked in. |
---|
190 |
#---------------------------------------------------------------------------- |
---|
191 |
CC='acc' |
---|
192 |
CFLAGS='-DMEXSUN4' |
---|
193 |
CLIBS="$MATLAB/extern/lib/sun4/libmex.a -lm" |
---|
194 |
COPTIMFLAGS='-O -DNDEBUG' |
---|
195 |
CDEBUGFLAGS='-g' |
---|
196 |
# |
---|
197 |
FC='f77' |
---|
198 |
FFLAGS='' |
---|
199 |
FLIBS="$MATLAB/extern/lib/sun4/libmex.a -lm" |
---|
200 |
FOPTIMFLAGS='-O' |
---|
201 |
FDEBUGFLAGS='-g' |
---|
202 |
# |
---|
203 |
LD='ld' |
---|
204 |
LDFLAGS='-d -r -u _mex_entry_pt -u _mexFunction' |
---|
205 |
LDOPTIMFLAGS='-x' |
---|
206 |
LDDEBUGFLAGS='' |
---|
207 |
#---------------------------------------------------------------------------- |
---|
208 |
;; |
---|
209 |
esac |
---|
210 |
############################################################################# |
---|
211 |
# |
---|
212 |
# Architecture independent lines: |
---|
213 |
# |
---|
214 |
# Set and uncomment any lines which will apply to all architectures. |
---|
215 |
# |
---|
216 |
#---------------------------------------------------------------------------- |
---|
217 |
# CC="$CC" |
---|
218 |
# CFLAGS="$CFLAGS" |
---|
219 |
# COPTIMFLAGS="$COPTIMFLAGS" |
---|
220 |
# CDEBUGFLAGS="$CDEBUGFLAGS" |
---|
221 |
# CLIBS="$CLIBS" |
---|
222 |
# |
---|
223 |
# FC="$FC" |
---|
224 |
# FFLAGS="$FFLAGS" |
---|
225 |
# FOPTIMFLAGS="$FOPTIMFLAGS" |
---|
226 |
# FDEBUGFLAGS="$FDEBUGFLAGS" |
---|
227 |
# FLIBS="$FLIBS" |
---|
228 |
# |
---|
229 |
# LD="$LD" |
---|
230 |
# LDFLAGS="$LDFLAGS" |
---|
231 |
# LDOPTIMFLAGS="$LDOPTIMFLAGS" |
---|
232 |
# LDDEBUGFLAGS="$LDDEBUGFLAGS" |
---|
233 |
#---------------------------------------------------------------------------- |
---|
234 |
############################################################################# |
---|