-
Notifications
You must be signed in to change notification settings - Fork 10
/
configure.in
624 lines (544 loc) · 19.1 KB
/
configure.in
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
AC_INIT(SimulationRuntime/c/util/boolean_array.c)
AC_SUBST(date)
AC_SUBST(rmlc_bin)
AC_SUBST(rmlhome)
AC_SUBST(rmlinc)
AC_SUBST(omc_antlr_jar)
AC_SUBST(antlrinc)
AC_SUBST(antlrlib)
AC_SUBST(with_paradiseo_include)
AC_SUBST(with_paradiseo_lib)
AC_SUBST(with_qwt)
AC_SUBST(with_qwt_suffix)
AC_SUBST(LIBSOCKET)
AC_SUBST(LIBNSL)
AC_SUBST(LIBLPSOLVE55)
AC_SUBST(LPSOLVEINC)
AC_SUBST(USE_CORBA)
AC_SUBST(QT_USE_CORBA)
AC_SUBST(CORBA_QMAKE_INCLUDES)
AC_SUBST(CORBACFLAGS)
AC_SUBST(CORBALIBS)
AC_SUBST(IDLCMD)
AC_SUBST(IDLPYTHONCMD)
AC_SUBST(USE_MODPAR)
AC_SUBST(BOOSTHOME)
AC_SUBST(GENERATED_AUTOCONF_FILES)
AC_SUBST(RT_LDFLAGS)
AC_SUBST(SUNDIALS_LDFLAGS)
AC_SUBST(IPOPT_LDFLAGS)
AC_SUBST(IPOPT_CFLAGS)
AC_SUBST(QMAKE)
AC_SUBST(EXE)
AC_SUBST(RML_TRACE)
AC_SUBST(SOURCE_REVISION)
AC_SUBST(LIBF2C)
AC_SUBST(OMSHELL_TERMINAL)
AC_SUBST(MODELICA_SPEC_PLATFORM)
AC_SUBST(OPENMODELICA_SPEC_PLATFORM)
AC_SUBST(SQLITE3_LIBS)
AC_SUBST(OPENMP_CFLAGS)
AC_SUBST(MAKE)
AC_SUBST(LIBREADLINE)
AC_SUBST(LD_LAPACK)
AC_SUBST(PYTHON_INTERFACE)
AC_SUBST(WITH_SUNDIALS)
AC_SUBST(WITH_IPOPT)
FINAL_MESSAGES="\nConfigured OpenModelica successfully using the following options:"
if test -z "$MAKE"; then
MAKE=make
fi
if test x"$prefix" = xNONE; then
PREFIX=`pwd`/build
else
PREFIX=$prefix
fi
AC_PREFIX_DEFAULT($PREFIX)
prefix=$PREFIX
dnl Disables the default CFLAGS="-g -O2"
if test -z "$CFLAGS"; then
if test "Darwin" = `uname`; then
CFLAGS="-O3"
else
CFLAGS="-O3 -march=native"
fi
fi
if test "Darwin" != `uname`; then
if test "`uname -m`" = "x86_64"; then
AC_MSG_CHECKING([x86_64 CFLAGS])
if echo $CFLAGS | grep -q -- -fPIC; then
AC_MSG_RESULT([already got -fPIC])
else
CFLAGS+=" -fPIC"
AC_MSG_RESULT([adding -fPIC])
fi
fi
dnl Simulations spin forever unless -msse2 -mfpmath=sse is set
dnl Or if -ffloat-store is set
dnl With the new solver interface, this seems to work even with -mpfpath=387
#AC_MSG_CHECKING([for floating point bugs])
#if echo $CFLAGS | grep -q -- -ffloat-store; then
# AC_MSG_RESULT([have -ffloat-store])
#elif echo $CFLAGS | grep -q -- -msse2 && echo $CFLAGS | grep -q -- -mfpmath=sse; then
# AC_MSG_RESULT([have SSE2])
#else
# CFLAGS+=" -msse2 -mfpmath=sse"
# AC_MSG_RESULT([adding -msse2 -mfpmath=sse])
#fi
fi # End x86-specific CFLAGS
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_MAKE_SET
AC_PROG_LEX
dnl check for environment variables
AC_MSG_CHECKING([for \$RMLHOME])
if test ! -z "$RMLHOME" ; then
rmlhome=$RMLHOME
AC_MSG_RESULT([$RMLHOME])
AC_MSG_CHECKING([for rmlc])
if test -x $rmlhome/bin/rmlc ; then
rmlc_bin=$rmlhome/bin/rmlc
AC_MSG_RESULT([yes])
else
AC_MSG_ERROR([rmlc not found in \$rmlhome/bin])
fi
else
AC_MSG_RESULT([no])
AC_PATH_PROG(RMLC,rmlc)
if test -z $RMLC ; then
AC_MSG_ERROR([RML not installed])
fi
rmlhome=`dirname \`dirname $RMLC\``
rmlc_bin=$RMLC
fi
dnl Checks for libraries.
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(sys/time.h sqlite3.h, [], [AC_MSG_ERROR(Missing header files)])
AC_CHECK_HEADERS(f2c.h, [], [LIBF2C=libf2c/libf2c.a])
AC_MSG_CHECKING([for rml includefiles in $rmlhome])
if test ! -f "$rmlhome/include/plain/rml.h" ; then
AC_MSG_ERROR([rml headers not found])
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([yes])
fi
rmlinc=$rmlhome/include/plain/
AC_MSG_CHECKING([if the user wants RML -trace support])
RML_TRACE=",-ftrace"
AC_ARG_ENABLE(rml-trace, [ --enable-rml-trace[[=yes]] RML -trace support],[test "xno" = x"$enableval" && RML_TRACE=""])
if test -z "$RML_TRACE" ; then
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([yes])
fi
AC_MSG_CHECKING([for antlr.Tool support])
omc_antlr_jar=build/share/omc/java/antlr-3.1.3.jar
mkdir -p build/share/omc/java
cp SimulationRuntime/c/util/java_interface/antlr-3.1.3.jar $omc_antlr_jar
echo "" > $$grammar.g
if java -cp $omc_antlr_jar antlr.Tool $$grammar.g ; then
rm -f $$grammar.g
AC_MSG_RESULT([yes])
else
rm -f $$grammar.g
# AC_MSG_ERROR([no antlr.Tool support])
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([if the user wants to compile OMShell-terminal])
OMSHELL_TERMINAL="mosh"
AC_ARG_ENABLE(omshell-terminal, [ --enable-omshell-terminal[[=yes]] Enables compilation of OMShell-terminal],[test "xno" = x"$enableval" && OMSHELL_TERMINAL=""])
if test -z "$OMSHELL_TERMINAL" ; then
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([yes])
AC_CHECK_HEADER(readline/readline.h,,AC_MSG_ERROR([readline missing]))
AC_CHECK_HEADER(readline/history.h,,AC_MSG_ERROR([readline missing]))
AC_ARG_WITH(static-readline, [ --with-static-readline=DIR (default to dynamic linking; searches /usr if no other directory is provided)],[WANT_STATIC_READLINE="$withval"],[WANT_STATIC_READLINE="no"])
if test "$WANT_STATIC_READLINE" = "no"; then
LIBS=""
AC_SEARCH_LIBS(readline,readline,,[AC_MSG_ERROR([readline missing])])
LIBREADLINE=$LIBS
LIBS=""
else
if test "$WANT_STATIC_READLINE" = "yes"; then
READLINELIB=/usr/lib;
else
READLINELIB=$WANT_STATIC_READLINE/lib
fi
LIBS="-lncurses $READLINELIB/libreadline.a"
AC_MSG_CHECKING([for static readline $LIBS])
AC_LINK_IFELSE([AC_LANG_CALL([], [rl_message])], [LIBREADLINE=$LIBS], [AC_MSG_ERROR([failed])])
AC_MSG_RESULT([$LIBREADLINE])
LIBS=""
fi
fi
dnl Misc. headers
AC_CHECK_HEADER(expat.h,,AC_MSG_ERROR([expat missing]))
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
dnl Checks for library functions.
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(getcwd select strdup strerror)
dnl Check if scandir is available
AC_MSG_CHECKING([for scandir])
AC_TRY_LINK([
#include <dirent.h>
], [
int file_select_directories(const struct dirent *entry) {
return 0;
}
int main() {
char dir[]=".";
int count;
struct dirent **files;
scandir(dir, &files, file_select_directories, 0);
return 0;
}
], [AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_SCANDIR])],
[AC_MSG_RESULT([no])])
dnl check for lpsolve55
AC_ARG_WITH(static-lpsolve, [ --with-static-lpsolve=DIR (default to dynamic linking; searches /usr if no other directory is provided)],[WANT_STATIC_LPSOLVE="$withval"],[WANT_STATIC_LPSOLVE="no"])
if test "$WANT_STATIC_LPSOLVE" = "no"; then
LIBS=""
AC_SEARCH_LIBS(dlopen,dl)
AC_SEARCH_LIBS(sqrt,m)
AC_SEARCH_LIBS(colamd,colamd)
AC_SEARCH_LIBS(make_lp,[lpsolve55_pic lpsolve55],[],[AC_MSG_ERROR([lpsolve linking failed using $LIBS])])
LIBLPSOLVE55=$LIBS
LIBS=""
else
if test "$WANT_STATIC_LPSOLVE" = "yes"; then
LPLIB=/usr/lib;
else
LPLIB=$WANT_STATIC_LPSOLVE/lib
fi
LIBS=""
AC_SEARCH_LIBS(dlopen,dl)
AC_SEARCH_LIBS(sqrt,m)
LIBS="$LPLIB/liblpsolve55_pic.a $LPLIB/libcolamd.a $LIBS"
AC_MSG_CHECKING([for static lpsolve55])
AC_LINK_IFELSE([AC_LANG_CALL([], [make_lp])], [LIBLPSOLVE55=$LIBS], [AC_MSG_ERROR([failed])])
AC_MSG_RESULT([$LIBLPSOLVE55])
LIBS=""
fi
AC_CHECK_HEADER([lp_lib.h],[LPSOLVEINC=lp_lib.h],[
AC_CHECK_HEADER([lpsolve/lp_lib.h],[LPSOLVEINC=lpsolve/lp_lib.h],[AC_MSG_ERROR([failed to find lpsolve55 headers])])
])
dnl check for socket
AC_CHECK_FUNC(socket,[LIBSOCKET=""],
[AC_MSG_CHECKING([for libsocket]);
AC_CHECK_LIB(socket, socket,[AC_MSG_RESULT([yes]); LIBSOCKET="-lsocket"],[AC_MSG_ERROR([neither socket nor libsocket.a found])])
])
dnl check for gethostbyname
AC_CHECK_FUNC(gethostbyname,
[LIBNSL=""],
[AC_MSG_CHECKING([for libnsl]);
AC_CHECK_LIB(nsl,gethostbyname, [AC_MSG_RESULT([yes]); LIBNSL="-lnsl"],[AC_MSG_ERROR([neither gethostbyname nor libnsl.a found])])
])
AC_ARG_WITH(static-sqlite, [ --with-static-sqlite=FILE (default to dynamic linking)],[WANT_STATIC_SQLITE="$withval"],[WANT_STATIC_SQLITE="no"])
LIBS=""
AC_CHECK_LIB(sqlite3,sqlite3_libversion,[],[AC_MSG_ERROR([sqlite3 not found])])
if test "$WANT_STATIC_SQLITE" = "no"; then
SQLITE3_LIBS=$LIBS
elif test ! -f "$WANT_STATIC_SQLITE" ; then
AC_ERROR([File not found: $WANT_STATIC_SQLITE])
else
SQLITE3_LIBS=$WANT_STATIC_SQLITE
fi
# Cannot use AX_LAPACK since it assumes a Fortran compiler is used
AC_ARG_WITH(lapack, [ --with-lapack=[-llapack -lblas]],[LD_LAPACK="$withval"],[LD_LAPACK="-llapack -lblas"])
if test "$LD_LAPACK" = "yes"; then
LD_LAPACK="-llapack -lblas"
fi
LIBS="$LD_LAPACK"
AC_MSG_CHECKING([LAPACK flags])
AC_LINK_IFELSE([AC_LANG_CALL([], [dgesv_])],[AC_MSG_RESULT([ok])],[AC_MSG_ERROR([failed using $LD_LAPACK])])
AC_CHECK_HEADERS(kinsol/kinsol.h kinsol/kinsol_dense.h nvector/nvector_serial.h sundials/sundials_types.h sundials/sundials_math.h,[],[NO_SUNDIALS="yes"])
SUNDIALS_LDFLAGS="-lsundials_kinsol -lsundials_nvecserial -llapack"
LIBS=$SUNDIALS_LDFLAGS
AC_MSG_CHECKING([Sundials linking])
AC_LINK_IFELSE([AC_LANG_CALL([], [KINInit])],
[AC_MSG_RESULT([ok])],
[AC_MSG_RESULT([failed to link KINInit])])
if ! test "$NO_SUNDIALS" = "yes"; then
FINAL_MESSAGES="$FINAL_MESSAGES\nSimulations may use sundials suite: Yes"
WITH_SUNDIALS="#define WITH_SUNDIALS"
else
FINAL_MESSAGES="$FINAL_MESSAGES\nSimulations may use sundials suite: No"
WITH_SUNDIALS="/* Without Sundials */"
SUNDIALS_LDFLAGS=""
fi
LIBS=""
dnl should we use ipopt?
AC_ARG_WITH(ipopt, [ --with-ipopt=DIR use ipopt for initialization],
[
WANT_IPOPT="yes"
if test "$withval" = "yes"; then
AC_CHECK_HEADERS(coin/IpStdCInterface.h, [IPOPT_LDFLAGS="-lipopt -lcoinmumps"; IPOPT_CFLAGS=""], [NO_IPOPT="yes"])
else
IPOPT_DIR="$withval"
AC_CHECK_HEADERS($IPOPT_DIR/include/coin/IpStdCInterface.h, [AC_MSG_RESULT(ipopt directory: $IPOPT_DIR); IPOPT_LDFLAGS="-L'"$IPOPT_DIR"/lib' -lipopt -lcoinmumps"; IPOPT_CFLAGS="-I'"$IPOPT_DIR"/include'"], [NO_IPOPT="yes"])
fi
], [
WANT_IPOPT="no"
NO_IPOPT="yes"
])
if ! test "$NO_IPOPT" = "yes"; then
FINAL_MESSAGES="$FINAL_MESSAGES\nSimulations may use IPOPT: Yes"
WITH_IPOPT="#define WITH_IPOPT"
else
FINAL_MESSAGES="$FINAL_MESSAGES\nSimulations may use IPOPT: No"
WITH_IPOPT="/* Without IPOPT */"
IPOPT_CFLAGS=""
IPOPT_LDFLAGS=""
fi
dnl should we use corba?
WANT_ORBIT2="no"
WANT_MICO="no"
AC_ARG_WITH(MICO, [ --with-MICO=DIR use mico corba installed in DIR (or use mico-config)],[WANT_MICO="$withval"],[])
AC_ARG_WITH(omniORB, [ --with-omniORB=DIR use omniORB installed in DIR (recommended CORBA implementation)],[WANT_OMNIORB="$withval"],[WANT_OMNIORB="no"])
if test ! "$WANT_MICO" = "no"; then
if test "$WANT_MICO" = "yes"; then
MICO="mico-config";
IDLCMD="idl";
else
MICO="$WANT_MICO/bin/mico-config";
IDLCMD="$WANT_MICO/bin/idl";
fi
if test "$USE_CORBA" = "no"; then
AC_MSG_ERROR([failed to find mico-corba])
fi
AC_MSG_CHECKING([mico version])
if ! $MICO --version; then
AC_MSG_ERROR([failed to call $MICO])
fi
USE_CORBA="-DUSE_CORBA -DUSE_MICO"
QT_USE_CORBA="USE_MICO"
AC_MSG_CHECKING([mico settings])
CORBACFLAGS=-I`$MICO --prefix`/include -I.;
CORBA_QMAKE_INCLUDES=`$MICO --prefix`/include -I.;
CORBALIBS=`$MICO --libs`;
AC_MSG_RESULT([$CORBACFLAGS $USE_CORBA $QT_USE_CORBA])
DESIRED_CORBA="mico"
elif test ! "$WANT_ORBIT2" = "no"; then
if test "$WANT_ORBIT2" = "yes"; then
ORBIT2="orbit2-config";
else
ORBIT2="$withval/bin/orbit2-config";
fi
AC_CHECK_PROG(USE_CORBA,$ORBIT2,[-DUSE_CORBA -DUSE_ORBIT2],[no])
if test "$USE_CORBA" = "no"; then
AC_MSG_ERROR([failed to find orbit2])
fi
USE_CORBA="-DUSE_CORBA -DUSE_ORBIT"
QT_USE_CORBA="USE_ORBIT2"
CORBACFLAGS=`orbit2-config --cflags`;
# Don't have orbit2-config installed to verify
CORBA_QMAKE_INCLUDES=`orbit2-config --prefix`/include/;
CORBALIBS=`orbit2-config --libs`;
IDLCMD="orbit-idl-2";
DESIRED_CORBA="orbit2"
AC_MSG_ERROR([ORBIT2 is not supported yet])
elif test ! "$WANT_OMNIORB" = "no"; then
if test "$WANT_OMNIORB" = "yes"; then
WANT_OMNIORB="/usr";
IDLCMD="omniidl -bcxx -Wbh=.h -Wbs=.cc";
IDLPYTHONCMD="omniidl -bpython";
else
CORBA_QMAKE_INCLUDES="$WANT_OMNIORB/include";
CORBACFLAGS="-I$CORBA_QMAKE_INCLUDES";
AC_MSG_CHECKING([for $WANT_OMNIORB/bin/omniidl]);
if test -f "$WANT_OMNIORB/bin/omniidl"; then
AC_MSG_RESULT([ok])
else
AC_MSG_ERROR([not found])
fi
IDLCMD="$WANT_OMNIORB/bin/omniidl -bcxx -Wbh=.h -Wbs=.cc";
IDLPYTHONCMD="$WANT_OMNIORB/bin/omniidl -bpython";
fi
USE_CORBA="-DUSE_CORBA -DUSE_OMNIORB";
QT_USE_CORBA="USE_OMNIORB"
if test "Darwin" = `uname`; then
CORBALIBS="$WANT_OMNIORB/lib/libomniORB4.a $WANT_OMNIORB/lib/libomnithread.a -lpthread"
else
CORBALIBS="-L'$WANT_OMNIORB/lib' -lomniORB4 -lomnithread -lpthread"
fi
DESIRED_CORBA="omniorb"
PYTHON_INTERFACE="yes"
else
USE_CORBA="";
CORBACFLAGS="";
CORBALIBS="";
IDLCMD="";
DESIRED_CORBA="none"
fi
AC_MSG_CHECKING([for CORBA]);
AC_MSG_RESULT([$DESIRED_CORBA]);
AC_MSG_CHECKING([if the user wants to use the Python interface])
AC_ARG_ENABLE(python-interface, [ --enable-python-interface Python interface to omc. Enabled by default if omniORB is enabled.],[test "xno" = x"$enableval" && PYTHON_INTERFACE=""])
if test -z "$PYTHON_INTERFACE" ; then
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([yes])
fi
dnl Check for Qt
AC_CHECK_PROGS(QMAKE,qmake-qt4 qmake-mac qmake,"")
if test -n "$QMAKE"; then
AC_MSG_CHECKING([for qmake arguments])
if test "Darwin" = `uname`; then
echo "#!/bin/sh -x" > ./qmake.sh
echo "$QMAKE \$*" >> ./qmake.sh
echo 'MAKEFILE=`echo -- $* | grep -o "Makefile@<:@A-Z.a-z@:>@*"`' >> ./qmake.sh
echo 'if test -z "$MAKEFILE"; then MAKEFILE=Makefile; fi' >> ./qmake.sh
# echo 'echo $MAKEFILE' >> ./qmake.sh
echo 'cat $MAKEFILE | \
sed "s/-arch i386//g" | \
sed "s/-arch x86_64//g" | \
sed "s/-arch//g" > $MAKEFILE.fixed && \
mv $MAKEFILE.fixed $MAKEFILE' >> qmake.sh
QMAKE="sh `pwd`/qmake.sh"
fi
AC_MSG_RESULT([$QMAKE])
fi
if test -n "$QMAKE"; then
AC_MSG_CHECKING([for qwt])
AC_ARG_WITH(qwt, [ --with-qwt Compile plotting libraries using qwt5. Default searches PREFIX/include/{qwt5,qwt,qwt-qt4}], [], [with_qwt=yes])
if test x"$with_qwt" = "xyes"; then
with_qwt_checked=""
with_qwt_suffix=""
for f in {/usr,/opt,$PREFIX}/include/{qwt5,qwt,qwt-qt4}/; do
test -f "$f/qwt.h" && with_qwt="$f" || with_qwt_checked="$with_qwt_checked $f"
done
echo $with_qwt | grep -q -- -qt4 && with_qwt_suffix="-qt4"
with_qwt_res=$with_qwt
grep -q 'QWT_VERSION *0x05@<:@0-9@:>@\{4\}$' "$with_qwt/qwt_global.h" || with_qwt="bad"
fi
if test x"$with_qwt" = "xno"; then
QMAKE=""
AC_MSG_RESULT([disabled])
elif test x"$with_qwt" = "xyes"; then
AC_MSG_ERROR([not found (searched $with_qwt_checked)])
elif test x"$with_qwt" = "xbad"; then
AC_MSG_ERROR([$with_qwt_res/qwt_global.h is not a qwt5 header])
else
AC_MSG_RESULT($with_qwt)
fi
fi
if test -n "$QMAKE"; then
AC_MSG_CHECKING([for paradisEO])
AC_ARG_WITH(paradiseo, [ --with-paradiseo Required for OMOptim. Default searches {PREFIX,/usr,/opt} for {include,lib}/paradiseo], [], [with_paradiseo=yes])
if test -f "$with_paradiseo/paradiseo-eo/src/eo"; then
# User used a local paradiseo installation
with_paradiseo_include="$with_paradiseo/paradiseo-eo/src $with_paradiseo/paradiseo-mo/src $with_paradiseo/paradiseo-moeo/src $with_paradiseo/paradiseo-eo/src/utils $with_paradiseo/paradiseo-mo/src/utils $with_paradiseo/paradiseo-moeo/src/utils"
if test -d "$with_paradiseo/paradiseo-eo/build/lib"; then
paradiseo_build="build"
else
paradiseo_build=""
fi
with_paradiseo_lib="-L$with_paradiseo/paradiseo-eo/$paradiseo_build/lib -L$with_paradiseo/paradiseo-moeo/$paradiseo_build/lib"
AC_MSG_RESULT(stock version in: $with_paradiseo)
else
if test x"$with_paradiseo" = "xyes"; then
with_paradiseo_checked=""
for f in /{usr,opt,$PREFIX}; do
test -d "$f/include/paradiseo/" -a -d "$f/lib/paradiseo/" && with_paradiseo_include="$f/include/paradiseo/ $f/include/paradiseo/utils/" && with_paradiseo_lib="-L$f/lib/paradiseo/" && with_paradiseo="$f" || with_paradiseo_checked="$with_paradiseo_checked $f"
done
fi
if test x"$with_paradiseo" = "xno"; then
with_paradiseo=""
AC_MSG_RESULT([disabled])
elif test x"$with_paradiseo" = "xyes"; then
AC_MSG_ERROR([not found (searched $with_paradiseo_checked)])
else
AC_MSG_RESULT($with_paradiseo)
fi
fi
fi
if test "Darwin" = `uname`; then
EXE=".app"
else
EXE=""
fi
if test "Darwin" != `uname`; then
RT_LDFLAGS="-lrt"
else
RT_LDFLAGS="-liconv"
fi
dnl should we compile modpar
AC_ARG_WITH(MODPAR, [ --with-MODPAR Compile with automatic parallelization, requires boost],
[
USE_MODPAR="-DUSE_MODPAR"
], [
AC_MSG_RESULT([Not compiling ModPar]); USE_MODPAR=""; BOOSTHOME=""
])
AC_ARG_WITH(BOOST, [ --with-BOOST=DIR With BOOST library in DIR],
[
if test "$USE_MODPAR" = "-DUSE_MODPAR" ; then
AC_MSG_RESULT([enabling BOOST... BOOSTHOME="$withval"]);
BOOSTHOME="$withval";
else
AC_MSG_RESULT([ Warning, MODPAR requires BOOST, disabling MODPAR ] )
USE_MODPAR="";
BOOSTHOME="";
fi
], [
AC_MSG_RESULT([Not compiling with BOOST]); USE_MODPAR=""; BOOSTHOME=""
])
AC_MSG_CHECKING([for revision])
SOURCE_REVISION=""
test -f REVISION && SOURCE_REVISION=`head -n1 REVISION | grep -o @<:@0-9@:>@*`
test -z "$SOURCE_REVISION" && SOURCE_REVISION=`svn info 2>&1 | grep ^Revision: | cut -d\ -f2`
test -z "$SOURCE_REVISION" && SOURCE_REVISION="????"
AC_MSG_RESULT([$SOURCE_REVISION])
AC_MSG_CHECKING([for OpenModelica platform name])
# I don't really agree with the Modelica specification since "Intel 32-bit" is
# very unspecific.
# Also, they forgot about Mac users. We will just default to uname -sm and patch
# to Modelica Spec standards as well.
OPENMODELICA_SPEC_PLATFORM=`uname -sm | tr "@<:@:upper:@:>@ " "@<:@:lower:@:>@-"`
AC_MSG_RESULT([$OPENMODELICA_SPEC_PLATFORM])
AC_MSG_CHECKING([for Modelica platform name])
if test "$OPENMODELICA_SPEC_PLATFORM" = "linux-x86_64" -o "$OPENMODELICA_SPEC_PLATFORM" = "linux-i.86"; then
MODELICA_SPEC_PLATFORM=`echo $OPENMODELICA_SPEC_PLATFORM | sed "s/linux-x86_64/linux64/" | sed "s/linux-i.86/linux32/"`
else
MODELICA_SPEC_PLATFORM=$OPENMODELICA_SPEC_PLATFORM
fi
AC_MSG_RESULT([$MODELICA_SPEC_PLATFORM])
date=`date "+%Y-%m-%d %H:%M:%S"`
GENERATED_AUTOCONF_FILES="Makefile \
Compiler/Makefile Compiler/omc_release/Makefile Compiler/omc_debug/Makefile \
Compiler/omc_profiler/Makefile Compiler/runtime/Makefile \
Compiler/modpar/Makefile \
Compiler/runtime/config.unix.h \
PythonInterface/Makefile \
PythonInterface/OMPython/OMConfig.py \
Parser/Makefile \
OMNotebook/OMNotebookGUI/OMNotebook.config \
OMNotebook/OMNotebookGUI/Makefile.unix \
OMShell/OMShellGUI/OMShell.config \
OMShell/OMShellGUI/Makefile.unix \
OMEdit/OMEditGUI/Makefile.unix \
OMEdit/OMEditGUI/OMEdit.config \
OMPlot/OMPlotGUI/Makefile.unix \
OMPlot/OMPlotGUI/OMPlotGUI.config \
OMOptim/build/Makefile.unix \
OMOptim/build/OMOptim.config \
OMOptim/OMOptimBasis/build/Makefile.unix \
OMOptim/OMOptimBasis/build/OMOptimBasis.config \
testsuite/bootstrapping/LinkMain.makefile \
SimulationRuntime/fmi/import/Makefile \
SimulationRuntime/c/Makefile \
SimulationRuntime/c/ModelicaExternalC/Makefile \
SimulationRuntime/c/simulation/libf2c/makefile.u \
SimulationRuntime/interactive/Makefile \
mosh/src/Makefile \
"
AC_CONFIG_COMMANDS([config.unix.h.fix],[./configure-post.sh $ac_cs_config])
AC_OUTPUT(${GENERATED_AUTOCONF_FILES})
echo -e "$FINAL_MESSAGES"