-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
executable file
·2458 lines (2271 loc) · 67.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
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
dnl
dnl Process this file with autoconf to produce a configure script.
dnl
AC_PREREQ([2.50])
dnl VARIABLES EXPORTED
dnl
dnl ARCH
dnl
dnl DefHeapSpace= Default DB space
dnl DefStackSpace= Default global+local
dnl DefTrailSpace= Default trail
dnl
dnl CPLINT
dnl
dnl CPLINT_LIBS=
dnl CPLINT_LIBS=
dnl CPLINT_LDFLAGS=
dnl CPLINT_SHLIB_LD=
dnl
dnl ENVIRONMENT to run YAP before Install is complete
dnl PRE_INSTALL_ENV= prefix to run YAP after libYap.so and yap are available
dnl but before make install
dnl INSTALL_ENV= prefix to run YAP while doing make install
dnl
dnl EXEC_SUFFIX=suffix for executable (.exe)
dnl
dnl INSTALL_DLLS= we can do dynamic linking
dnl SO= suffix for loadable binary (.so,.dll,.o)
dnl MERGE_DLL_OBJS= we need to merge several .o files into a single dll.
dnl
dnl CXXFLAGS= C++-flags
dnl SHLIB_FLAGS= C-flags used to compile a file that will be loaded dynamically
dnl DO_SECOND_LD= call a separate dll ld
dnl YAPLIB_LD= construct libYap.DLL
dnl SHLIB_LD= dll ld (C)
dnl SHLIB_CXX_LD= dll ld (C++)
dnl SHLIB_CFLAGS= cflags to use when constructing a DLL
dnl SHLIB_CXX_CFLAGS= c++flags to use when constructing a DLL
dnl YAPLIB_CFLAGS=flags to construct libYap
dnl EXTRA_LIBS_FOR_DLLS= libs that are required when lding a so
dnl EXTRA_LIBS_FOR_SWIDLLS= libs that are required when lding a SWI so
AC_INIT(console/yap.c)
AC_CONFIG_HEADER(config.h)
AC_CONFIG_HEADER(YapTermConfig.h)
dnl store the environment's compilation flags
mycflags="$CFLAGS"
AC_PROG_CC
AC_PROG_CXX
AC_PROG_AWK
AC_SUBST(GCC)
AC_SUBST(C_INTERF_FLAGS)
AC_SUBST(C_PARSER_FLAGS)
AC_LANG(C)
AC_CANONICAL_SYSTEM
AC_DEFINE_UNQUOTED(HOST_ALIAS,"${target}")
case "$target_cpu" in
i*86*)
YAP_TARGET=i386
;;
x86*)
YAP_TARGET=amd64
;;
sparc*)
YAP_TARGET=sparc
;;
*)
YAP_TARGET=unknown
;;
esac
dnl Gecode support
AC_CHECK_HEADER(gecode/support/config.hpp,
have_gecode=yes, have_gecode=no)
AC_ARG_ENABLE(gecode,
[ --enable-gecode install gecode library],
[use_gecode="$enableval"
if test "$use_gecode" = yes; then
if test "$have_gecode" = no; then
AC_MSG_ERROR([cannot enable gecode: gecode library not found])
fi
fi], use_gecode=$have_gecode)
AC_MSG_CHECKING([if dynamic arrays are supported])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[void foo(int n) { int a[n]; a[1]=0; }]],[[foo(3);]])
],[
AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_DYNARRAY],[1],[Define if dynamic arrays are supported])
],[
AC_MSG_RESULT([no])
])
GECODE_VERSION=unknown-gecode-version
GECODE_EXTRALIBS="-lgecodesupport -lgecodekernel -lgecodeint -lgecodeset -lgecodesearch"
AC_SUBST(GECODE_VERSION)
AC_SUBST(GECODE_EXTRALIBS)
if test "$use_gecode" = yes; then
AC_MSG_CHECKING([gecode version])
AC_RUN_IFELSE([AC_LANG_PROGRAM([[
#include "gecode/support/config.hpp"
#include <stdio.h>
]],[[
FILE* out = fopen("conftest.out","w");
fprintf(out,"%s\n",GECODE_VERSION);
fclose(out);
return 0;
]])],[GECODE_VERSION=$(cat conftest.out)
AC_MSG_RESULT([$GECODE_VERSION])],
[AC_MSG_ERROR([cannot determine gecode version])])
case "$target_os" in
*darwin*)
AC_MSG_CHECKING([if -framework gecode is required])
AC_LANG_PUSH([C++])
saved_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -framework gecode"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include "gecode/int.hh"
]],[[
Gecode::Exception e("","");
return 0;
]])],[GECODE_EXTRALIBS="-framework gecode"
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
AC_LANG_POP()
CXXFLAGS="$saved_CXXFLAGS"
;;
esac
fi
AC_ARG_ENABLE(tabling,
[ --enable-tabling support tabling ],
tabling="$enableval", tabling=yes)
AC_ARG_ENABLE(or-parallelism,
[ --enable-or-parallelism support or-parallelism as: copy,sba,a-cow,threads ],
orparallelism="$enableval", orparallelism=no)
AC_ARG_ENABLE(rational-trees,
[ --enable-rational-trees support infinite rational trees ],
rationaltrees="$enableval" , rationaltrees=yes)
AC_ARG_ENABLE(coroutining,
[ --enable-coroutining support co-routining, attributed variables and constraints],
rationaltrees="$enableval";coroutining="$enableval", coroutining=yes)
AC_ARG_ENABLE(depth-limit,
[ --enable-depth-limit support depth-bound computation ],
depthlimit="$enableval", depthlimit=yes)
AC_ARG_ENABLE(wam-profile,
[ --enable-wam-profile support low level profiling of abstract machine ],
wamprofile="$enableval", wamprofile=no)
AC_ARG_ENABLE(low-level-tracer,
[ --enable-low-level-tracer support support for procedure-call tracing ],
lowleveltracer="$enableval", lowleveltracer=no)
AC_ARG_ENABLE(threads,
[ --enable-threads support system threads ],
threads="$enableval", threads=no)
AC_ARG_ENABLE(bddlib,
[ --enable-bddlib dynamic bdd library ],
dynamic_bdd="$enableval", dynamic_bdd=no)
AC_ARG_ENABLE(pthread-locking,
[ --enable-pthread-locking use pthread locking primitives for internal locking (requires threads) ],
pthreadlocking="$enableval", pthreadlocking=no)
AC_ARG_ENABLE(max-performance,
[ --enable-max-performance try using the best flags for specific architecture ],
maxperformance="$enableval", maxperformance=no)
AC_ARG_ENABLE(max-memory,
[ --enable-max-memory try using the best flags for using the memory to the most ],
maxmemory="$enableval", maxmemory=yes)
AC_ARG_ENABLE(debug-yap,
[ --enable-debug-yap enable C-debugging for YAP ],
debugyap="$enableval", debugyap=no)
AC_ARG_ENABLE(eam,
[ --enable-eam enable EAM on YAP ],
eam="$enableval", eam=no)
AC_ARG_ENABLE(cygwin,
[ --enable-cygwin use cygwin library in WIN32 ],
cygwin="$enableval", cygwin=no)
AC_ARG_ENABLE(prism,
[ --enable-prism use PRISM system in YAP ],
prism="$enableval", prism=yes)
AC_ARG_ENABLE(dynamic_loading,
[ --enable-dynamic-loading compile YAP as a DLL ],
dynamic_loading="$enableval", dynamic_loading=no)
AC_ARG_ENABLE(static_compilation,
[ --enable-static-compilation compile YAP statically ],
static_compilation="$enableval", static_compilation=no)
AC_ARG_ENABLE(use-malloc,
[ --enable-use-malloc use malloc to allocate memory ],
use_malloc="$enableval", use_malloc=yes)
AC_ARG_ENABLE(condor,
[ --enable-condor allow YAP to be used from condor ],
use_condor="$enableval", use_condor=no)
AC_ARG_ENABLE(chr,
[ --enable-chr install chr library ],
use_chr="$enableval", use_chr=yes)
AC_ARG_ENABLE(clpqr,
[ --enable-clpqr install clpqr library ],
use_clpqr="$enableval", use_clpqr=yes)
AC_ARG_ENABLE(win64,
[ --enable-win64 compile YAP for win64 ],
target_win64="$enableval", target_win64=no)
AC_ARG_ENABLE(april,
[ --enable-april compile Yap to support April ILP system],
use_april="$enableval", use_april=no)
AC_ARG_ENABLE(dlcompat,
[ --enable-dlcompat use dlcompat library for dynamic loading on Mac OS X],
use_dlcompat="$enableval", use_dlcompat=no)
AC_ARG_ENABLE(cplint,
[ --enable-cplint[=DIR] enable the cplint library using the CUDD library in DIR/lib],
yap_cv_cplint=$enableval, yap_cv_cplint=no)
AC_ARG_ENABLE(clpbn-bp,
[ --enable-clpbn-bp enable belief propagation solver in CLPBN. ],
yap_cv_clpbn_bp="$enableval", yap_cv_clpbn_bp=no)
AC_ARG_WITH(gmp,
[ --with-gmp[=DIR] use GNU Multiple Precision in DIR],
if test "$withval" = yes; then
yap_cv_gmp=yes
elif test "$withval" = no; then
yap_cv_gmp=no
else
yap_cv_gmp=$with_gmp
LDFLAGS="$LDFLAGS -L${yap_cv_gmp}/lib"
LIBS="$LIBS -L${yap_cv_gmp}/lib"
CPPFLAGS="$CPPFLAGS -I${yap_cv_gmp}/include"
CFLAGS="$CFLAGS -I${yap_cv_gmp}/include"
fi,
[yap_cv_gmp=yes])
AC_ARG_WITH(R,
[ --with-R[=DIR] interface to R language],
if test "$withval" = yes; then
yap_cv_R=yes
elif test "$withval" = no; then
yap_cv_R=no
else
yap_cv_R=$with_R
fi,
[yap_cv_R=no])
dnl best test we could do.
AC_ARG_WITH(minisat,
[ --enable-minisat use minisat interface],
if test "$withval" = yes; then
yap_cv_minisat=yes
elif test "$withval" = no; then
yap_cv_minisat=no
else
yap_cv_minisat="$GXX"
fi,
[yap_cv_minisat=yes])
AC_ARG_WITH(cudd,
[ --with-cudd[=DIR] use CUDD package in DIR],
yap_cv_cudd="$withval",
[yap_cv_cudd=no])
AC_ARG_ENABLE(myddas,
[ --enable-myddas[[=DIR]] enable the MYDDAS library],
if test "$enableval" = yes; then
yap_cv_myddas=/usr
elif test "$enableval" = no; then
yap_cv_myddas=no
else
yap_cv_myddas=$enable_myddas
LDFLAGS="$LDFLAGS -L${yap_cv_myddas}/lib "
CPPFLAGS="$CPPFLAGS -I${yap_cv_myddas}/include "
fi,
[yap_cv_myddas=/usr])
AC_ARG_ENABLE(myddas-stats,
[ --enable-myddas-stats enable the MYDDAS library statistics support],
if test "$yap_cv_myddas" = no; then
myddasstats=no
else
myddasstats="$enableval"
fi, myddasstats=no)
AC_ARG_ENABLE(myddas-top-level,
[ --enable-myddas-top-level enable the MYDDAS top-level support to MySQL],
if test "$yap_cv_myddas" = no; then
myddastoplevel=no
else
myddastoplevel="$enableval"
fi, myddastoplevel=no)
AC_ARG_WITH(java,
[ --with-java=JAVA_HOME use Java instalation in JAVA_HOME],
if test "$withval" = yes; then
yap_cv_java="$JAVA_HOME"
dynamic_loading=yes
maxmemory=yes
dnl threads=yes
elif test "$withval" = no; then
yap_cv_java=no
else
yap_cv_java=$with_java
dynamic_loading=yes
maxmemory=yes
dnl threads=yes
fi,
[yap_cv_java=no])
AC_ARG_WITH(readline,
[ --with-readline[=DIR] use GNU Readline Library in DIR],
if test "$withval" = yes; then
yap_cv_readline=yes
elif test "$withval" = no; then
yap_cv_readline=no
else
yap_cv_readline=$with_readline
LDFLAGS="$LDFLAGS -L${yap_cv_readline}/lib"
CPPFLAGS="-I${yap_cv_readline}/include $CPPFLAGS"
fi,
[yap_cv_readline=yes])
AC_ARG_WITH(matlab,
[ --with-matlab[=DIR] use MATLAB package in DIR],
if test "$withval" = yes; then
yap_cv_matlab=yes
elif test "$withval" = no; then
yap_cv_matlab=no
else
yap_cv_matlab=$with_matlab
MATLAB_INCLUDE="-I${yap_cv_matlab}/extern/include"
fi,
[yap_cv_matlab=no])
AC_ARG_WITH(mpi,
[ --with-mpi[=DIR] use MPI library in DIR],
if test "$withval" = yes; then
dnl handle UBUNTU systems
yap_cv_mpi=yes
elif test "$withval" = no; then
yap_cv_mpi=no
else
yap_cv_mpi=$with_mpi
LDFLAGS="$LDFLAGS -L${yap_cv_mpi}/lib"
CPPFLAGS="$CPPFLAGS -I${yap_cv_mpi}/include"
fi,
[yap_cv_mpi=no])
AC_ARG_WITH(mpe,
[ --with-mpe[=DIR] use MPE library in DIR],
if test "$withval" = yes; then
yap_cv_mpe=yes
elif test "$withval" = no; then
yap_cv_mpe=no
else
yap_cv_mpe=$with_mpe
LDFLAGS="$LDFLAGS -L${yap_cv_mpe}/lib"
CPPFLAGS="$CPPFLAGS -I${yap_cv_mpe}/include"
fi,
[yap_cv_mpe=no])
AC_ARG_WITH(lam,
[ --with-lam[=DIR] use LAM MPI library in DIR],
if test "$withval" = yes; then
yap_cv_lam=yes
elif test "$withval" = no; then
yap_cv_lam=no
else
yap_cv_lam=$with_lam
LDFLAGS="$LDFLAGS -L${yap_cv_lam}/lib"
CPPFLAGS="$CPPFLAGS -I${yap_cv_lam}/include"
fi,
[yap_cv_lam=no])
AC_ARG_WITH(heap-space,
[ --with-heap-space[=space] default heap size in Kbytes],
if test "$withval" = yes; then
yap_cv_heap_space=0
elif test "$withval" = no; then
yap_cv_heap_space=0
else
yap_cv_heap_space=$withval
fi,
[yap_cv_heap_space=0])
AC_ARG_WITH(stack-space,
[ --with-stack-space[=space] default stack size in Kbytes],
if test "$withval" = yes; then
yap_cv_stack_space=0
elif test "$withval" = no; then
yap_cv_stack_space=0
else
yap_cv_stack_space=$withval
fi,
[yap_cv_stack_space=0])
AC_ARG_WITH(trail-space,
[ --with-trail-space[=space] default trail size in Kbytes],
if test "$withval" = yes; then
yap_cv_trail_space=0
elif test "$withval" = no; then
yap_cv_trail_space=0
else
yap_cv_trail_space=$withval
fi,
[yap_cv_trail_space=0])
AC_ARG_WITH(max-workers,
[ --with-max-workers[=integer] maximum number of or-parallel processes],
if test "$withval" = yes; then
yap_cv_max_workers="(8*SIZEOF_INT_P)"
elif test "$withval" = no; then
yap_cv_max_workers="1"
else
yap_cv_max_workers=$withval
fi,
[yap_cv_max_workers="(8*SIZEOF_INT_P)"])
AC_ARG_WITH(max-threads,
[ --with-max-threads[=integer] maximum number of or-parallel processes],
if test "$withval" = yes; then
yap_cv_max_threads="1024"
elif test "$withval" = no; then
yap_cv_max_threads="1"
else
yap_cv_max_threads=$withval
fi,
[yap_cv_max_threads="1024"])
AC_ARG_WITH(junit, [ --with-junit=PATH Specify location of the junit JAR file],
[case "$withval" in
yes) JUNIT=/usr/share/java/junit.jar
;;
no) JUNIT=""
;;
*) JUNIT="$withval"
;;
esac])
AC_DEFINE(MinHeapSpace, (1000*SIZEOF_INT_P))
AC_DEFINE(MinStackSpace,(300*SIZEOF_INT_P))
AC_DEFINE(MinTrailSpace,( 48*SIZEOF_INT_P))
AC_DEFINE_UNQUOTED(DefHeapSpace,$yap_cv_heap_space)
AC_DEFINE_UNQUOTED(DefStackSpace,$yap_cv_stack_space)
AC_DEFINE_UNQUOTED(DefTrailSpace,$yap_cv_trail_space)
AC_SUBST(DefHeapSpace)
AC_SUBST(DefStackSpace)
AC_SUBST(DefTrailSpace)
if test "$orparallelism" = no
then
AC_DEFINE(MAX_WORKERS,1)
else
AC_DEFINE_UNQUOTED(MAX_WORKERS,$yap_cv_max_workers)
if test "$orparallelism" = copy -o "$orparallelism" = yes
then
use_malloc="no"
fi
tabling="no"
fi
if test "$threads" = no
then
AC_DEFINE(MAX_THREADS,1)
else
AC_DEFINE_UNQUOTED(MAX_THREADS,$yap_cv_max_threads)
fi
if test "$yap_cv_prism" = no
then
INSTALL_PRISM="@# "
else
INSTALL_PRISM=""
fi
dnl condor does not like dynamic linking on Linux, DEC, and HP-UX platforms.
if test "$yap_cv_matlab" = no
then
INSTALL_MATLAB="@# "
elif test "$yap_cv_matlab" = yes
then
INSTALL_MATLAB=""
else
case "$target_cpu" in
i*86*)
LDFLAGS="$LDFLAGS -L${yap_cv_matlab}/bin/glnx86"
;;
x86*)
LDFLAGS="$LDFLAGS -L${yap_cv_matlab}/bin/glnxa64"
;;
sparc*)
LDFLAGS="$LDFLAGS -L${yap_cv_matlab}/bin/sol2"
;;
esac
INSTALL_MATLAB=""
fi
AC_LANG_PUSH([C++])
my_save_cxxflags="$CXXFLAGS"
CXXFLAGS=-std=c++0x
AC_MSG_CHECKING([whether CXX supports -std-c++0x])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
[AC_MSG_RESULT([yes])]
[yap_cv_clpbn_bp=yes],
[AC_MSG_RESULT([no])]
)
CXXFLAGS="$my_save_cxxflags"
AC_LANG_POP()
if test "$yap_cv_clpbn_bp" = no
then
ENABLE_CLPBN_BP="@# "
else
ENABLE_CLPBN_BP=""
fi
if test "$yap_cv_cudd" = no
then
ENABLE_CUDD="@# "
ENABLE_BDDLIB="@# "
else
if test "$dynamic_bdd" = yes
then
ENABLE_BDDLIB=""
else
ENABLE_BDDLIB="@# "
fi
ENABLE_CUDD=""
fi
dnl condor universe does not like dynamic linking on Linux, DEC, and HP-UX platforms.
if test "$use_condor" = yes
then
static_compilation="yes"
use_malloc="yes"
CC="condor_compile $CC"
CXX="condor_compile $CXX"
dnl no readline with condor.
yap_cv_readline="no"
AC_DEFINE(SUPPORT_CONDOR, 1)
dnl and it disables minisat
yap_cv_minisat=no
STATIC_MODE=""
else
static_compilation="no"
STATIC_MODE="# "
fi
dnl Compilation Flags
if test "$GCC" = "yes"
then
if test "$debugyap" = "yes"
then
CXXFLAGS="-O -g -Wall $CXXFLAGS"
C_INTERF_FLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS"
CFLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS"
else
CXXFLAGS="-O3 -fomit-frame-pointer -Wall $CXXFLAGS"
C_INTERF_FLAGS="-O3 -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS"
C_PARSER_FLAGS="-O3 -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS"
CFLAGS="-O3 -fomit-frame-pointer -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS"
case "`$CC --version < /dev/null`" in
*3.4*) CFLAGS="-fno-gcse -fno-crossjumping $CFLAGS" ;;
esac
case "$target_cpu" in
i*86*)
CFLAGS="-DBP_FREE $CFLAGS"
CXXFLAGS="-DBP_FREE $CXXFLAGS"
;;
sparc*)
case "$target_os" in
*solaris[2-9]*) dnl
CFLAGS="-mno-app-regs -DOPTIMISE_ALL_REGS_FOR_SPARC=1 $CFLAGS"
CXXFLAGS="-mno-app-regs -DOPTIMISE_ALL_REGS_FOR_SPARC=1 $CXXFLAGS"
;;
esac
;;
esac
if test "$tcpu"; then
target_cpu=$tcpu
fi
if test "$maxperformance" = "yes"
then
case "$target_cpu" in
athlon)
CFLAGS="-march=athlon $CFLAGS"
CXXFLAGS="-march=athlon $CXXFLAGS"
;;
i686*)
CFLAGS="-march=i686 $CFLAGS"
CXXFLAGS="-march=i686 $CXXFLAGS"
;;
i586*)
CFLAGS="-march=i586 $CFLAGS"
CXXFLAGS="-march=i586 $CXXFLAGS"
;;
i486*)
CFLAGS="-march=i486 $CFLAGS"
CXXFLAGS="-march=i486 $CXXFLAGS"
;;
esac
fi
fi
if test "$CC" = "sslittle-na-sstrix-gcc"
then
RANLIB="sslittle-na-sstrix-ranlib"
AR="sslittle-na-sstrix-ar"
PRE_INSTALL_ENV="sim-fast"
INSTALL_ENV="sim-fast"
fi
else
case "$target_cpu" in
i?86*)
if test "$CC" = "lcc"
then
CFLAGS="-A -A $CFLAGS"
elif test "$CC" = "cl"
then
CXXFLAGS="-/nologo $CXXFLAGS"
CFLAGS="/nologo $CFLAGS"
CPP="/nologo /E"
fi
;;
hppa*)
if test "$CC" = "cc" -o $CC = c89
then
if test "$debugyap" = "yes"
then
CXXFLAGS="-Ae -g -O $CXXFLAGS"
CFLAGS="-Ae -g -O $CFLAGS"
else
CXXFLAGS="-Ae +O3 +Onolimit $CXXFLAGS"
CFLAGS="-Ae +O3 +Onolimit $CFLAGS"
fi
fi
dnl LDFLAGS="+e UserCPredicate $LDFLAGS"
;;
esac
C_INTERF_FLAGS="$CFLAGS"
C_PARSER_FLAGS="$CFLAGS"
fi
dnl Checks for programs.
AC_PROG_LN_S
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_CHECK_TOOL(INDENT,indent,:)
AC_CHECK_TOOL(AR,ar,:)
AC_CHECK_TOOL(MPI_CC,mpicc,${CC})
AC_PATH_PROG(INSTALL_INFO,install-info,true,$PATH:/sbin:/usr/sbin:/usr/etc:/usr/local/sbin)
AC_PATH_PROG(SHELL,sh)
dnl Check for libraries.
dnl mingw does not get along well with libm
dnl cygnus and mingw32 also need wsock32 to use sockets.
dnl
if test "$target_os" = "cygwin" -o "$target_os" = "mingw32"
then
INSTALL_COMMAND=install_win32
EXTRA_INCLUDES_FOR_WIN32="-I\$(srcdir)/packages/PLStream/windows"
if test "$cygwin" = "no" -o "$target_os" = "mingw32"
then
if test "$target_win64" = yes
then
dnl configure messes up badly on this.
target_cpu=x86_64
YAP_TARGET=amd64
AC_CHECK_LIB(ws2_32,main)
AC_CHECK_LIB(comdlg32,main)
AC_CHECK_LIB(shell32,main)
EXTRA_LIBS_FOR_DLLS="-lws2_32"
elif test "$target_os" = "cygwin"
then
CC="${CC} -mno-cygwin"
CXX="${CXX} -mno-cygwin"
AC_CHECK_LIB(comdlg32,main)
AC_CHECK_LIB(wsock32,main)
AC_CHECK_LIB(shell32,main)
else
AC_CHECK_LIB(wsock32,main)
AC_CHECK_LIB(comdlg32,main)
AC_CHECK_LIB(shell32,main)
fi
EXTRA_LIBS_FOR_DLLS="\$(abs_top_builddir)/yap.dll $EXTRA_LIBS_FOR_DLLS"
AC_CHECK_LIB(psapi,main)
yap_cv_readline=no
CLIB_NETLIBS="-lws2_32 -lpsapi -lgdi32"
if test "$prefix" = "NONE"
then
if test "$target_win64" = yes
then
prefix="\${SYSTEMDRIVE}/Yap64"
CLIB_NETLIBS="-lws2_32 -lwsock32 -lpsapi -lgdi32"
else
prefix="\${SYSTEMDRIVE}/Yap"
fi
fi
ENABLE_WINCONSOLE=""
else
ENABLE_WINCONSOLE="#"
LIBS="-lcygwin"
EXTRA_LIBS_FOR_DLLS="\$(abs_top_builddir)/yap.dll"
EXTRA_INCLUDES_FOR_WIN32="-I\$(srcdir)/packages/PLStream/windows"
fi
else
INSTALL_COMMAND="install_unix"
ENABLE_WINCONSOLE="#"
AC_CHECK_LIB(m,sin)
AC_CHECK_LIB(socket,socket)
dnl X/Open Networking is sometimes a separate library
AC_CHECK_LIB(xnet,getsockname)
AC_CHECK_LIB(stdc++,main)
AC_CHECK_LIB(nsl,main,
have_nsl=yes
,
have_nsl=no)
AC_CHECK_LIB(crypt,main)
AC_CHECK_LIB(nss_files,main)
AC_CHECK_LIB(nss_dns,main)
AC_CHECK_LIB(resolv,main)
fi
if test "$yap_cv_readline" != "no"
then
AC_CHECK_LIB([ncurses], [main],[
LIBS="$LIBS -lncurses"
])
AC_CHECK_LIB([readline], [main],[
AC_DEFINE([HAVE_LIBREADLINE], [1],[Define if you have libreadline])
LIBS="$LIBS -lreadline"
],
[if test "x$with_readline" != xcheck; then
AC_MSG_FAILURE(
[--with-readline was given, but test for readline failed])
fi
])
fi
if test "$yap_cv_gmp" != "no"
then
AC_CHECK_LIB(gmp,main)
fi
if test "$yap_cv_R" = "no"; then
REAL_TARGET="dummy"
ENABLE_REAL="@# "
elif test -e "$srcdir"/packages/real/Makefile.in ; then
REAL_TARGET="ritf"
ENABLE_REAL=""
AC_CHECK_PROGS(REXE, R, "none")
if test "$yap_cv_R" = "yes"
then
case "$target_os" in
*darwin*)
REAL_INCLUDES="-I/Library/Frameworks/R.framework/Headers"
REAL_LIBS="-framework R -L /Library/Frameworks/R.framework/Libraries -lR"
;;
*cygwin*|*mingw*)
REAL_INCLUDES="$($REXE CMD config --cppflags | grep -v ^WARNING)"
REAL_LIBS="$($REXE CMD config --ldflags | grep -v ^WARNING)"
;;
**)
dnl R is spread all over the place
dnl one of the two may work (Fedora/Ubuntu)
if test -n "$R_HOME" ; then
REAL_INCLUDES="-I$R_HOME/include"
elif test "$YAP_TARGET" = amd64 -a -d /usr/lib64/R/include ; then
REAL_INCLUDES="-I/usr/lib64/R/include"
elif test -d /usr/include/R; then
REAL_INCLUDES="-I/usr/include/R"
elif test -d /usr/share/R/include; then
REAL_INCLUDES="-I/usr/share/R/include"
else
REAL_INCLUDES="$($REXE CMD config --cppflags | grep -v ^WARNING)"
fi
if test -n "$R_HOME" ; then
REAL_LIBS="-L $R_HOME/lib -lR"
elif test "$YAP_TARGET" = amd64 -a -d /usr/lib64/R/lib; then
REAL_LIBS="-L /usr/lib64/R/lib -lR"
elif test -d /usr/lib/R; then
REAL_LIBS="-L /usr/lib/R/lib -lR"
else
REAL_LIBS="$($REXE CMD config --ldflags | grep -v ^WARNING)"
fi
;;
esac
else
case "$target_os" in
*cygwin*|*mingw*)
REAL_INCLUDES="-I\"$yap_cv_R/include\""
if test "$YAP_TARGET" = i386; then
REAL_LIBS="\"$yap_cv_R/bin/i386/R.dll\""
else
REAL_LIBS="\"$yap_cv_R/bin/x64/R.dll\""
fi
;;
*)
REAL_INCLUDES="-I$yap_cv_R/include"
REAL_LIBS="-L $yap_cv_R/lib -lR"
;;
esac
fi
else
REAL_TARGET="dummy"
ENABLE_REAL="@# "
fi
dnl if test "$yap_cv_cudd" != "no"
dnl then
dnl AC_CHECK_LIB(cudd,Cudd_Init)
dnl fi
if test "$yap_cv_myddas" != "no"
then
dnl check for mysql
AC_SEARCH_LIBS(mysql_init, [mysqlclient], [yap_cv_mysql="yes"], [yap_cv_mysql="no"])
if test "$yap_cv_mysql" = yes
then
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_MYSQL"
fi
dnl check for odbc
case "$target_os" in
*darwin*)
LIBS="$LIBS -framework CoreFoundation"
;;
**)
;;
esac
AC_SEARCH_LIBS(SQLAllocHandle, [odbc], [yap_cv_odbc="yes"], [yap_cv_odbc="no"])
if test "$yap_cv_odbc" = yes
then
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_ODBC"
fi
if test "$myddasstats" = "yes"
then
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_STATS"
fi
if test "$myddastoplevel" = "yes"
then
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_TOP_LEVEL"
fi
fi
if test "$yap_cv_cudd" != no; then
oldlibs="$LIBS"
if test "$yap_cv_cudd" != "NONE"; then
if test -d "$yap_cv_cudd"/include/cudd; then
CUDD_CPPFLAGS="-I $yap_cv_cudd/include/cudd"
else
CUDD_CPPFLAGS="-I $yap_cv_cudd/include"
fi
cudd_dir="$yap_cv_cudd"
elif test -e /usr/include/cudd; then
CUDD_CPPFLAGS="-I /usr/include/cudd"
cudd_dir="$yap_cv_cudd"
elif test "$prefix" != "NONE"; then
if test -d "$prefix"/include/cudd; then
CUDD_CPPFLAGS="-I $prefix/include/cudd"
else
CUDD_CPPFLAGS="-I $prefix/include"
fi
cudd_dir="$prefix"
else
if test -d /usr/local/include/cudd; then
CUDD_CPPFLAGS="-I /usr/local/include/cudd"
fi
cudd_dir=/usr/local
fi
dnl cudd can be most everywhere
if test -d "$cudd_dir/lib64/cudd" -a "$YAP_TARGET" = amd64; then
LIBS="$LIBS -L $cudd_dir/lib64/cudd"
elif test -d "$cudd_dir/lib64" -a "$YAP_TARGET" = amd64; then
LIBS="$LIBS -L $cudd_dir/lib64"
elif test -d "$cudd_dir/lib/cudd"; then
LIBS="$LIBS -L $cudd_dir/lib/cudd"
elif test -d "$cudd_dir/lib"; then
LIBS="$LIBS -L $cudd_dir/lib"
fi
if test -d "$cudd_dir/util"; then
LIBS="$LIBS -L $cudd_dir/util"
fi
AC_SEARCH_LIBS(util_print_cpu_stats, [cuddutil util])
if test -d "$cudd_dir/st"; then
LIBS="$LIBS -L $cudd_dir/st"
fi
AC_SEARCH_LIBS(st_insert, [cuddst st])
if test -d "$cudd_dir/epd"; then
LIBS="$LIBS -L $cudd_dir/epd"
fi
AC_SEARCH_LIBS(EpdAdd, [epd])
if test -d "$cudd_dir/mtr"; then
LIBS="$LIBS -L $cudd_dir/mtr"
fi
AC_SEARCH_LIBS(Mtr_InitTree, [mtr])
if test -d "$cudd_dir/cudd"; then
LIBS="$LIBS -L $cudd_dir/cudd"
fi
AC_SEARCH_LIBS(Cudd_Init, [cudd], [cudd_installed="yes"], [cudd_installed="no"])
if test "$cudd_installed" = yes; then
CUDD_LDFLAGS="$LIBS"
else
cat << EOF
##################################################################
# ERROR: Could not find cudd library. Either I don't have the
# correct path, or CUDD is installed in some strange way
##################################################################
EOF
fi
LIBS="$oldlibs"
fi
if test "$threads" = yes
then
AC_CHECK_LIB(pthread,pthread_create)
AC_CHECK_HEADERS(pthread.h)
AC_CHECK_FUNCS(pthread_mutexattr_setkind_np pthread_mutexattr_settype)
if test "$pthreadlocking" = yes
then
AC_DEFINE(USE_PTHREAD_LOCKING, 1)
fi
use_malloc=yes
fi
if test ! -z "$GCC"; then
COFLAGS="${COFLAGS--O2 -cc-options,-fno-strict-aliasing}"
CWFLAGS="${CWFLAGS--Wall}"
else
COFLAGS="${COFLAGS--O}"
CWFLAGS="${CWFLAGS-}"
fi
CMFLAGS=-fpic
CIFLAGS=-I.
if test "$use_gecode" = no; then
ENABLE_GECODE="@# "
else
ENABLE_GECODE=""
fi
AC_SUBST(ENABLE_GECODE)
if test "$use_prism" = no; then
ENABLE_PRISM="@# "
else
ENABLE_PRISM=""
fi
AC_SUBST(ENABLE_PRISM)
if test "$use_chr" = no; then
ENABLE_CHR="@# "
elif test -e "$srcdir"/packages/chr/Makefile.in; then
ENABLE_CHR=""
else
ENABLE_CHR="@# "
fi
if test "$use_clpqr" = no; then
ENABLE_CLPQR="@# "
elif test -e "$srcdir"/packages/clpqr/Makefile.in; then
ENABLE_CLPQR=""
else
ENABLE_CLPQR="@# "
fi
if test -e "$srcdir"/packages/clib/Makefile.in; then
ENABLE_CLIB=""
else
ENABLE_CLIB="@# "
fi
if test -e "$srcdir"/packages/http/Makefile.in; then
ENABLE_HTTP=""
else
ENABLE_HTTP="@# "
fi
if test -e "$srcdir"/packages/pldoc/Makefile.in; then
ENABLE_PLDOC=""
else
ENABLE_PLDOC="@# "
fi
if test -e "$srcdir"/packages/plunit/Makefile.in; then
ENABLE_PLUNIT=""
else
ENABLE_PLUNIT="@# "
fi
if test -e "$srcdir"/packages/R/Makefile.in; then
ENABLE_R=""