-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
1591 lines (1428 loc) · 46.6 KB
/
configure.ac
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
# Autoconf source file for the Parma Polyhedra Library.
# Copyright (C) 2001-2010 Roberto Bagnara <[email protected]>
# Copyright (C) 2010-2017 BUGSENG srl (http://bugseng.com)
#
# This file is part of the Parma Polyhedra Library (PPL).
#
# The PPL is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
#
# The PPL is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
#
# For the most up-to-date information see the Parma Polyhedra Library
# site: http://bugseng.com/products/ppl/ .
# Process this file with Autoconf to produce a configure script.
# Every other copy of the package version number gets its value from here.
AC_INIT([the Parma Polyhedra Library], [1.3pre1], [[email protected]], [ppl])
# Minimum Autoconf version required.
AC_PREREQ(2.61)
# Make sure the sources are there.
AC_CONFIG_SRCDIR(src/Polyhedron_public.cc)
# Specify the location of additional local Autoconf macros.
AC_CONFIG_MACRO_DIR([m4])
# Determine the system type and set output variables to the names of
# the canonical system types.
AC_CANONICAL_HOST
# Use Automake.
AM_INIT_AUTOMAKE([foreign no-define dist-bzip2 dist-zip dist-xz tar-ustar silent-rules 1.11])
AC_SUBST(VERSION)
# Version number machinery.
changequote(<<, >>)dnl
if test -n "`expr $VERSION : '\([0-9]*\)\.[0-9]*\.[0-9]*'`"
then
PPL_VERSION_MAJOR=`expr $VERSION : '\([0-9]*\)\.[0-9]*\.[0-9]*'`
PPL_VERSION_MINOR=`expr $VERSION : '[0-9]*\.\([0-9]*\)\.[0-9]*'`
PPL_VERSION_REVISION=`expr $VERSION : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
PPL_VERSION_BETA=`expr $VERSION : '[0-9]*\.[0-9]*\.[0-9]*pre\([0-9]*\)'`
else
PPL_VERSION_MAJOR=`expr $VERSION : '\([0-9]*\)\.[0-9]*'`
PPL_VERSION_MINOR=`expr $VERSION : '[0-9]*\.\([0-9]*\)'`
PPL_VERSION_REVISION=0
PPL_VERSION_BETA=`expr $VERSION : '[0-9]*\.[0-9]*pre\([0-9]*\)'`
fi
if test -z "$PPL_VERSION_BETA"
then
PPL_VERSION_BETA=0
fi
changequote([, ])dnl
AC_SUBST(PPL_VERSION_MAJOR)
AC_SUBST(PPL_VERSION_MINOR)
AC_SUBST(PPL_VERSION_REVISION)
AC_SUBST(PPL_VERSION_BETA)
AC_DEFINE_UNQUOTED(PPL_CONFIGURE_OPTIONS, "$ac_configure_args", [This contains the options with which `configure' was invoked.])
PPL_CONFIGURE_OPTIONS="\"$ac_configure_args\""
AC_SUBST(CONFIGURE_OPTIONS)
# Generate a configuration header file.
AC_CONFIG_HEADER([config.h])
ISODATE=`date +%Y-%m-%d`
AC_SUBST(ISODATE)
AH_TOP([
/* BEGIN ppl-config.h */
#ifndef PPL_ppl_config_h
#define PPL_ppl_config_h 1
/* Unique (nonzero) code for the IEEE 754 Half Precision
floating point format. */
#define PPL_FLOAT_IEEE754_HALF 1
/* Unique (nonzero) code for the IEEE 754 Single Precision
floating point format. */
#define PPL_FLOAT_IEEE754_SINGLE 2
/* Unique (nonzero) code for the IEEE 754 Double Precision
floating point format. */
#define PPL_FLOAT_IEEE754_DOUBLE 3
/* Unique (nonzero) code for the IEEE 754 Quad Precision
floating point format. */
#define PPL_FLOAT_IEEE754_QUAD 4
/* Unique (nonzero) code for the Intel Double-Extended
floating point format. */
#define PPL_FLOAT_INTEL_DOUBLE_EXTENDED 5
])
AH_BOTTOM([
#if defined(PPL_NDEBUG) && !defined(NDEBUG)
# define NDEBUG PPL_NDEBUG
#endif
/* In order for the definition of `int64_t' to be seen by Comeau C/C++,
we must make sure <stdint.h> is included before <sys/types.hh> is
(even indirectly) included. Moreover we need to define
__STDC_LIMIT_MACROS before the first inclusion of <stdint.h>
in order to have the macros defined also in C++. */
#ifdef PPL_HAVE_STDINT_H
# ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS 1
# endif
# include <stdint.h>
#endif
#ifdef PPL_HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#define PPL_U(x) x
#endif /* !defined(PPL_ppl_config_h) */
/* END ppl-config.h */
])
# C compiler.
AC_ARG_WITH(cc,
AS_HELP_STRING([--with-cc=XXX], [use XXX as the C compiler]),
CC=$with_cc)
# C++ compiler.
AC_ARG_WITH(cxx,
AS_HELP_STRING([--with-cxx=XXX], [use XXX as the C++ compiler]),
CXX=$with_cxx)
# Checks for programs.
# Note that AC_PROG_CC must precede the first use of $GCC and AC_PROG_CXX
# must precede the first use of $GXX. Note also that we do not allow
# AC_PROG_CC and AC_PROG_CXX to affect CFLAGS and CXXFLAGS.
save_CFLAGS="$CFLAGS"
AC_PROG_CC
CFLAGS="$save_CFLAGS"
AM_CONDITIONAL(GCC, test x"$GCC" = xyes)
# The Intel C compiler masquerades as gcc, but we want to know.
if test x"$GCC" = xyes
then
AC_MSG_CHECKING([whether we are actually using the Intel C compiler])
AC_LANG_PUSH(C)
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#ifndef __INTEL_COMPILER
choke me
#endif
]])],
AC_MSG_RESULT(yes)
ICC=yes,
AC_MSG_RESULT(no)
ICC=no,
AC_MSG_RESULT(no)
ICC=no)
AC_LANG_POP(C)
fi
AM_CONDITIONAL(ICC, test x"$ICC" = xyes)
# The clang compiler masquerades as gcc, but we want to know.
if test x"$GCC" = xyes
then
AC_MSG_CHECKING([whether we are actually using clang])
AC_LANG_PUSH(C)
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#ifndef __clang__
choke me
#endif
]])],
AC_MSG_RESULT(yes)
CLANG=yes,
AC_MSG_RESULT(no)
CLANG=no,
AC_MSG_RESULT(no)
CLANG=no)
AC_LANG_POP(C)
fi
# The llvm-gcc compiler masquerades as gcc, but we want to know.
if test x"$GCC" = xyes
then
AC_MSG_CHECKING([whether we are actually using llvm-gcc])
AC_LANG_PUSH(C)
save_CFLAGS="$CFLAGS"
CFLAGS="-fplugin-arg-dragonegg-emit-ir -S"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
int main() {
return 0;
}
]])],
AC_MSG_RESULT(yes)
LLVM_GCC=yes,
AC_MSG_RESULT(no)
LLVM_GCC=no,
AC_MSG_RESULT(no)
LLVM_GCC=no)
CFLAGS="$save_CFLAGS"
AC_LANG_POP(C)
fi
save_CXXFLAGS="$CXXFLAGS"
AC_PROG_CXX
CXXFLAGS="$save_CXXFLAGS"
# The Intel C++ compiler masquerades as g++, but we want to know.
if test x"$GXX" = xyes
then
AC_MSG_CHECKING([whether we are actually using the Intel C++ compiler])
AC_LANG_PUSH(C++)
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#ifndef __INTEL_COMPILER
choke me
#endif
]])],
AC_MSG_RESULT(yes)
ICPC=yes,
AC_MSG_RESULT(no)
ICPC=no,
AC_MSG_RESULT(no)
ICPC=no)
AC_LANG_POP(C++)
fi
# The clang++ compiler masquerades as g++, but we want to know.
if test x"$GXX" = xyes
then
AC_MSG_CHECKING([whether we are actually using clang++])
AC_LANG_PUSH(C++)
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#ifndef __clang__
choke me
#endif
]])],
AC_MSG_RESULT(yes)
CLANGXX=yes,
AC_MSG_RESULT(no)
CLANGXX=no,
AC_MSG_RESULT(no)
CLANGXX=no)
AC_LANG_POP(C++)
fi
# The llvm-++ compiler masquerades as g++, but we want to know.
if test x"$GXX" = xyes
then
AC_MSG_CHECKING([whether we are actually using llvm-g++])
AC_LANG_PUSH(C++)
save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="-fplugin-arg-dragonegg-emit-ir -S"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
int main() {
return 0;
}
]])],
AC_MSG_RESULT(yes)
LLVM_GXX=yes,
AC_MSG_RESULT(no)
LLVM_GXX=no,
AC_MSG_RESULT(no)
LLVM_GXX=no)
CXXFLAGS="$save_CXXFLAGS"
AC_LANG_POP(C++)
fi
AC_PROG_FGREP
AC_PROG_EGREP
AC_PROG_SED
AC_PROG_CXXCPP
AC_PROG_MAKE_SET
AC_PROG_INSTALL
# Compilation flags.
COMP_FLAGS=""
OPT_FLAGS=""
enableval=yes
AC_MSG_CHECKING([whether to compile with debug info])
AC_ARG_ENABLE(debugging,
AS_HELP_STRING([--enable-debugging], [compile with debugging information]))
case "${enableval}" in
yes)
AC_MSG_RESULT(yes)
OPT_FLAGS="-g"
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_ERROR([bad value ${enableval} for --enable-debugging, needs yes or no])
;;
esac
AM_CONDITIONAL(DEBUGGING_ENABLED, test x"$enableval" = xyes)
enableval=no
AC_MSG_CHECKING([whether to compile for profiling])
AC_ARG_ENABLE(profiling,
AS_HELP_STRING([--enable-profiling], [compile for profiling]))
case "${enableval}" in
yes)
AC_MSG_RESULT(yes)
OPT_FLAGS="-g"
COMP_FLAGS="$COMP_FLAGS -pg -DPPL_PROFILING=1"
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_ERROR([bad value ${enableval} for --enable-profiling, needs yes or no])
;;
esac
enableval=no
AC_MSG_CHECKING([whether to compile for test coverage])
AC_ARG_ENABLE(coverage,
AS_HELP_STRING([--enable-coverage], [compile for test coverage]))
case "${enableval}" in
yes)
AC_MSG_RESULT(yes)
OPT_FLAGS="-g"
COMP_FLAGS="$COMP_FLAGS -fprofile-arcs -ftest-coverage"
extra_libraries="${extra_libraries} -lgcov"
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_ERROR([bad value ${enableval} for --enable-coverage, needs yes or no])
;;
esac
enableval=no
AC_MSG_CHECKING([whether to enable checking of run-time assertions])
AC_ARG_ENABLE(assertions,
AS_HELP_STRING([--enable-assertions], [check run-time assertions]))
case "${enableval}" in
yes)
AC_MSG_RESULT(yes)
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_ERROR([bad value ${enableval} for --enable-assertions, needs yes or no])
;;
esac
enable_assertions=${enableval}
enableval=no
AC_MSG_CHECKING([whether to enable even more run-time assertions])
AC_ARG_ENABLE(more-assertions,
AS_HELP_STRING([--enable-more-assertions],
[break the ABI to check even more run-time assertions]))
case "${enableval}" in
yes)
AC_MSG_RESULT(yes)
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_ERROR([bad value ${enableval} for --enable-more-assertions, needs yes or no])
;;
esac
enable_more_assertions=${enableval}
if test x"$enable_more_assertions" = xyes
then
enable_assertions=yes
AC_DEFINE(PPL_ABI_BREAKING_EXTRA_DEBUG, 1, [ABI-breaking extra assertions are enabled when this is defined.])
AC_DEFINE(_GLIBCXX_DEBUG, 1, [When defined and libstdc++ is used, it is used in debug mode.])
AC_DEFINE(_GLIBCXX_DEBUG_PEDANTIC, 1, [When defined and libstdc++ is used, it is used in pedantic debug mode.])
fi
if test x"$enable_assertions" = xno
then
AC_DEFINE(PPL_NDEBUG, 1, [Assertions are disabled when this is defined.])
debug_flag="-DNDEBUG=1"
fi
AM_CONDITIONAL(ASSERTIONS_ENABLED, test x"$enable_assertions" = xyes)
arch=no
enableval=standard
AC_MSG_CHECKING([whether to enable optimizations])
AC_ARG_ENABLE(optimization,
AS_HELP_STRING([--enable-optimization@<:@=LEVEL@:>@],
[enable compiler optimizations]))
case "${enableval}" in
sspeed)
AC_MSG_RESULT(sspeed)
OPT_FLAGS="$OPT_FLAGS -O3 -fomit-frame-pointer"
arch=yes
;;
speed)
AC_MSG_RESULT(speed)
OPT_FLAGS="$OPT_FLAGS -O3"
arch=yes
;;
size)
AC_MSG_RESULT(size)
OPT_FLAGS="$OPT_FLAGS -Os"
arch=yes
;;
standard | yes)
AC_MSG_RESULT(standard)
OPT_FLAGS="$OPT_FLAGS -O2"
;;
mild)
AC_MSG_RESULT(mild)
OPT_FLAGS="$OPT_FLAGS -O1"
;;
zero)
AC_MSG_RESULT(zero)
OPT_FLAGS="$OPT_FLAGS -O0"
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_ERROR([bad value ${enableval} for --enable-optimization, needs sspeed, speed, size, standard, mild, zero, yes or no])
;;
esac
enableval=$arch
AC_MSG_CHECKING([for which architecture to optimize])
AC_ARG_ENABLE(arch,
AS_HELP_STRING([--enable-arch@<:@=ARCH@:>@],
[optimize for architecture ARCH]))
case "${enableval}" in
yes)
m=`uname -m`
case $m in
i?86 | k6 | athlon)
AC_MSG_RESULT($m)
OPT_FLAGS="$OPT_FLAGS -march=$m"
;;
*)
AC_MSG_RESULT(default)
;;
esac
;;
no)
AC_MSG_RESULT(default)
;;
*)
AC_MSG_RESULT($enableval)
OPT_FLAGS="$OPT_FLAGS -march=$enableval"
;;
esac
enableval=default
use_fpmath=yes
fpmath_may_use_387=yes
fpmath_may_use_sse=yes
AC_MSG_CHECKING([whether to use (a specific) floating point arithmetic])
AC_ARG_ENABLE(fpmath,
AS_HELP_STRING([--enable-fpmath=INSTRUCTION_SET],
[select floating point arithmetic]))
case "${enableval}" in
sse)
AC_MSG_RESULT(sse)
OPT_FLAGS="$OPT_FLAGS -msse -mfpmath=sse"
# The SSE instruction set only supports single precision arithmetic:
# double and extended precision arithmetic is still done using 387.
;;
sse2)
AC_MSG_RESULT(sse2)
OPT_FLAGS="$OPT_FLAGS -msse2 -mfpmath=sse"
# SSE2 still does not support extended precision arithmetic.
;;
387)
AC_MSG_RESULT(387)
OPT_FLAGS="$OPT_FLAGS -mno-sse -mno-sse2 -mfpmath=387"
# Note that the -mno-sse* and -mfpmath options are only guaranteed
# to work with GCC.
if test x"$GCC" = xyes
then
fpmath_may_use_sse=no
fi
;;
sse+387)
AC_MSG_RESULT(sse+387)
OPT_FLAGS="$OPT_FLAGS -msse -mfpmath=sse,387"
;;
sse2+387)
AC_MSG_RESULT(sse2+387)
OPT_FLAGS="$OPT_FLAGS -msse2 -mfpmath=sse,387"
;;
default)
AC_MSG_RESULT(default)
;;
no)
AC_MSG_RESULT(no)
use_fpmath=no
;;
*)
AC_MSG_ERROR([bad value ${enableval} for --enable-fpmath, needs sse, sse2, 387, sse+387, sse2+387, default or no])
;;
esac
if test x"$fpmath_may_use_387" = xyes
then
AC_DEFINE(PPL_FPMATH_MAY_USE_387, 1, [Defined if floating point arithmetic may use the 387 unit.])
fi
if test x"$fpmath_may_use_sse" = xyes
then
AC_DEFINE(PPL_FPMATH_MAY_USE_SSE, 1, [Defined if floating point arithmetic may use the SSE instruction set.])
fi
# Disable all transformations and optimizations that assume default
# floating point rounding behavior.
if test x"$GXX" = xyes
then
if test x"$ICPC" = xyes
then
OPT_FLAGS="$OPT_FLAGS -fp-model strict -fp-speculation off"
else
# -frounding-math is not yet supported in clang++ or llvm-g++.
if test x"$CLANGXX" = xyes || test x"$LLVM_GXX" = xyes
then
if test x"$use_fpmath" = xyes
then
AC_MSG_WARN([CANNOT RELY ON DIRECTED ROUNDING:
*** DISABLED ALL ABSTRACTIONS BASED ON MACHINE FLOATING-POINT NUMBERS.
*** A compiler has been detected that does not provide support for
*** -frounding-math (or any other option with the same semantics).
*** Hence, we cannot rely on floating-point computations to happen
*** in agreement with the rounding direction(s) used by the PPL.])
use_fpmath=no
fi
else
OPT_FLAGS="$OPT_FLAGS -frounding-math"
fi
fi
fi
enableval=no
AC_MSG_CHECKING([whether to use precompiled headers])
AC_ARG_ENABLE(pch,
AS_HELP_STRING([--enable-pch],
[use precompiled headers, if available]))
case "${enableval}" in
yes)
AC_MSG_RESULT(yes)
COMP_FLAGS="$COMP_FLAGS -Winvalid-pch"
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_ERROR([bad value ${enableval} for --enable-pch, needs yes or no])
;;
esac
AM_CONDITIONAL(USE_PRECOMPILED_HEADERS, test x"$enableval" = xyes)
CFLAGS="$COMP_FLAGS $OPT_FLAGS $CFLAGS"
CXXFLAGS="$COMP_FLAGS $OPT_FLAGS $CXXFLAGS"
# System-dependent adjustments.
cygwin=no
mingw=no
darwin=no
solaris=no
x86_64=no
no_undefined=no
case "${host_cpu}" in
alpha*)
if test x"$GCC" = xyes
then
CFLAGS="$CFLAGS -mfp-rounding-mode=d -mieee-with-inexact"
CXXFLAGS="$CXXFLAGS -mfp-rounding-mode=d -mieee-with-inexact"
else
CFLAGS="$CFLAGS -fprm d -ieee_with_inexact"
CXXFLAGS="$CXXFLAGS -fprm d -ieee_with_inexact"
fi
;;
x86_64*)
x86_64=yes
;;
*)
;;
esac
case "${host_os}" in
cygwin*)
cygwin=yes
no_undefined=yes
shared_library_path_env_var=PATH
;;
darwin*)
darwin=yes
shared_library_path_env_var=DYLD_LIBRARY_PATH
;;
hpux*)
hpux=yes
shared_library_path_env_var=SHLIB_PATH
;;
mingw*)
mingw=yes
no_undefined=yes
shared_library_path_env_var=PATH
;;
solaris*)
solaris=yes
shared_library_path_env_var=LD_LIBRARY_PATH
;;
*)
shared_library_path_env_var=LD_LIBRARY_PATH
;;
esac
AM_CONDITIONAL(HOST_OS_CYGWIN, test x$cygwin = xyes)
AM_CONDITIONAL(HOST_OS_DARWIN, test x$darwin = xyes)
AM_CONDITIONAL(HOST_OS_HPUX, test x$hpux = xyes)
AM_CONDITIONAL(HOST_OS_MINGW, test x$mingw = xyes)
AM_CONDITIONAL(HOST_OS_SOLARIS, test x$solaris = xyes)
AM_CONDITIONAL(HOST_CPU_X86_64, test x$x86_64 = xyes)
AM_CONDITIONAL(NO_UNDEFINED, test x$no_undefined = xyes)
AC_MSG_RESULT([GMP mpz])
coefficient_kind=unbounded
coefficient_bits=0
coefficient_mnemonic=mpz
AM_CONDITIONAL(USE_GMP_INTEGERS, test x"$coefficient_kind" = xunbounded)
if test x"$coefficient_kind" = xunbounded
then
AC_DEFINE(PPL_COEFFICIENT_TYPE, mpz_class, [Use unbounded size integer as coefficient.])
AC_DEFINE(PPL_COEFFICIENT_BITS, 0, [This is zero because we are using the unbounded precision coefficients.])
AC_DEFINE(PPL_GMP_INTEGERS, 1, [Defined if the integral type to be used for coefficients is GMP's one.])
fi
# Allow additions to C compilation flags.
AC_ARG_WITH(cflags,
AS_HELP_STRING([--with-cflags=XXX],
[add XXX to the options for the C compiler]),
CFLAGS="$CFLAGS $with_cflags")
# Allow additions to C++ compilation flags.
AC_ARG_WITH(cxxflags,
AS_HELP_STRING([--with-cxxflags=XXX],
[add XXX to the options for the C++ compiler]),
CXXFLAGS="$CXXFLAGS $with_cxxflags")
# Checks for C typedefs, structures, compiler and architecture characteristics.
AC_LANG(C)
AC_C_CONST
AC_C_INLINE
AC_C_BIGENDIAN
AC_C_TYPEOF
# Checks for C type sizes.
AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
AC_CHECK_SIZEOF(size_t)
AC_CHECK_SIZEOF(float)
AC_CHECK_SIZEOF(double)
AC_CHECK_SIZEOF(long double)
# The following are required to validate an horrible kludge working
# around an horrible bug in <gprolog.h> (see
# http://www.cs.unipr.it/pipermail/ppl-devel/2008-August/012277.html).
AC_CHECK_SIZEOF([int*])
AC_CHECK_SIZEOF([fp], [], [typedef int *(*fp)();])
# Check for Perl.
AC_PATH_PROG([PERL], perl, no)
AC_SUBST([PERL])
AM_CONDITIONAL(HAVE_PERL, test x"$PERL" != xno)
# Use C++ for the remaining checks.
AC_LANG(C++)
# The PPL uses <cmath> for sqrt and other functions in several places.
AC_SEARCH_LIBS([sqrt], [m])
# Check whether for the C++ compiler the plain char type is signed.
AC_CXX_PLAIN_CHAR_IS_SIGNED
# Check whether the C++ compiler provides proper long doubles.
AC_CXX_PROVIDES_PROPER_LONG_DOUBLE
# Detect the binary format used by C++ floats.
AC_CXX_FLOAT_BINARY_FORMAT
# Detect the binary format used by C++ doubles.
AC_CXX_DOUBLE_BINARY_FORMAT
# Detect the binary format used by C++ long doubles.
AC_CXX_LONG_DOUBLE_BINARY_FORMAT
# Test if some floating-point type is supported.
if test $ac_supported_float = 1 \
|| test $ac_supported_double = 1 \
|| test $ac_supported_long_double = 1
then
supported_some_floating_point_type=yes
fi
AM_CONDITIONAL(SUPPORTED_SOME_FLOATING_POINT_TYPE,
test x$supported_some_floating_point_type = xyes)
# Check whether the C++ compiler supports zero-length arrays.
AC_CXX_SUPPORTS_ZERO_LENGTH_ARRAYS
# Check whether the IEEE inexact flag is supported in C++.
AC_CXX_SUPPORTS_IEEE_INEXACT_FLAG
# Check whether the C++ compiler supports __attribute__ ((weak)).
AC_CXX_SUPPORTS_ATTRIBUTE_WEAK
# Checks for header files.
AC_CHECK_HEADERS([fenv.h ieeefp.h getopt.h signal.h string.h strings.h sys/resource.h sys/time.h sys/types.h unistd.h])
# Checks for the availability of C library functions in C++.
AC_CHECK_DECLS([ffs],
,
,
[
#if defined(HAVE_STRINGS_H)
# include <strings.h>
#elif defined(HAVE_STRING_H)
# include <string.h>
#endif
])
AC_CHECK_DECLS([getenv,strtof,strtod,strtold,strtoll,strtoull], , , [#include <cstdlib>])
AC_CHECK_DECLS([fma,fmaf,fmal,rintf,rintl], , , [#include <cmath>])
# Checks for the availability of "fast" integral types.
AC_CHECK_TYPES([int_fast16_t,int_fast32_t,int_fast64_t,uint_fast16_t,uint_fast32_t,uint_fast64_t])
# Make sure uintptr_t is defined to an unsigned integer type wide enough
# to hold a pointer, if such a type exists.
AC_TYPE_UINTPTR_T
# Libtool.
LT_PREREQ([1.5.24])
LT_INIT([dlopen,win32-dll])
AM_CONDITIONAL(ENABLE_SHARED, test x"$enable_shared" = xyes)
AM_CONDITIONAL(ENABLE_STATIC, test x"$enable_static" = xyes)
# Make sure libtool is used for linking.
AC_USE_LIBTOOL
# Checks on the GMP library.
AC_CHECK_GMP
if test x"$have_gmp" = xno
then
AC_MSG_ERROR([Cannot find GMP version 4.1.3 or higher.
GMP is the GNU Multi-Precision library:
see http://www.swox.com/gmp/ for more information.
When compiling the GMP library, do not forget to enable the C++ interface:
add --enable-cxx to the configuration options.])
else
if test x"$have_gmpxx" = xno
then
AC_MSG_ERROR([GMP compiled without enabling the C++ interface.
GMP is the GNU Multi-Precision library:
see http://www.swox.com/gmp/ for more information.
When compiling the GMP library, do not forget to enable the C++ interface:
add --enable-cxx to the configuration options.])
fi
fi
AC_CHECK_MEMBERS([__mpz_struct._mp_alloc,
__mpz_struct._mp_size,
__mpz_struct._mp_d],
,
gmp_has_changes=yes,
[#include <gmp.h>])
if test x"$gmp_has_changed" = xyes
then
AC_MSG_ERROR([GMP HAS CHANGED:
*** The PPL exploits some implementation details of GMP that were current
*** until (at least) version 4.1.4 of GMP. You seem to be using a version
*** where these details have changed.
*** Please report this to [email protected].])
fi
extra_includes="${extra_includes}${extra_includes:+ }${gmp_include_options}"
extra_libraries="${extra_libraries}${extra_libraries:+ }${gmp_library_options}"
enableval=yes
AC_MSG_CHECKING([whether to build the ppl_lcdd program])
AC_ARG_ENABLE(ppl_lcdd,
AS_HELP_STRING([--enable-ppl_lcdd], [build the ppl_lcdd program]))
case "${enableval}" in
yes)
AC_MSG_RESULT(yes)
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_ERROR([bad value ${enableval} for --enable-ppl_lcdd, needs yes or no])
;;
esac
build_ppl_lcdd=$enableval
AM_CONDITIONAL(BUILD_PPL_LCDD, test x"$build_ppl_lcdd" = xyes)
enableval=yes
AC_MSG_CHECKING([whether to build the ppl_lpsol program])
AC_ARG_ENABLE(ppl_lpsol,
AS_HELP_STRING([--enable-ppl_lpsol], [build the ppl_lpsol program]))
case "${enableval}" in
yes)
AC_MSG_RESULT(yes)
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_ERROR([bad value ${enableval} for --enable-ppl_lpsol, needs yes or no])
;;
esac
build_ppl_lpsol=$enableval
AM_CONDITIONAL(BUILD_PPL_LPSOL, test x"$build_ppl_lpsol" = xyes)
enableval=yes
AC_MSG_CHECKING([whether to build the ppl_pips program])
AC_ARG_ENABLE(ppl_pips,
AS_HELP_STRING([--enable-ppl_pips], [build the ppl_pips program]))
case "${enableval}" in
yes)
AC_MSG_RESULT(yes)
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_ERROR([bad value ${enableval} for --enable-ppl_pips, needs yes or no])
;;
esac
build_ppl_pips=$enableval
AM_CONDITIONAL(BUILD_PPL_PIPS, test x"$build_ppl_pips" = xyes)
enableval=yes
AC_MSG_CHECKING([whether to build the PPL documentation])
AC_ARG_ENABLE(documentation,
AS_HELP_STRING([--enable-documentation], [build the PPL documentation]))
case "${enableval}" in
yes)
AC_MSG_RESULT(yes)
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_ERROR([bad value ${enableval} for --enable-documentation, needs yes or no])
;;
esac
build_documentation=$enableval
AM_CONDITIONAL(BUILD_DOCUMENTATION, test x"$build_documentation" = xyes)
# Define lists of available interfaces: lowercase and blank-separated.
non_prolog_interfaces="cxx c ocaml java"
prolog_interfaces="ciao_prolog gnu_prolog sicstus_prolog swi_prolog xsb_prolog yap_prolog"
available_interfaces="${non_prolog_interfaces} ${prolog_interfaces}"
# This is the list of interfaces that are enabled by default.
default_interfaces=${available_interfaces}
enableval=not_specified
AC_MSG_CHECKING([which interfaces are enabled])
AC_ARG_ENABLE(interfaces,
AS_HELP_STRING([--enable-interfaces=INTERFACES],
[enable some or all the library interfaces]))
case x"${enableval}" in
xyes | x)
AC_MSG_ERROR([--enable-interfaces needs at least one argument chosen among ${available_interfaces}, none and all])
;;
xnone | xno)
for interface in ${available_interfaces}
do
eval ${interface}_interface_enabled=no
done
AC_MSG_RESULT(none)
;;
xall)
for interface in ${available_interfaces}
do
eval ${interface}_interface_enabled=yes
done
AC_MSG_RESULT([${available_interfaces}])
;;
*)
if test x"${enableval}" = xnot_specified
then
enableval=${default_interfaces}
fi
# Make the list blank-separated and lowercase; turn "c++" into "cxx".
required_interfaces=`echo "${enableval}" | sed -e 's/-/_/g' -e 's/[[ ,]][[ ,]]*/ /g' -e 's/c++/cxx/g' | tr '[[:upper:]]' '[[:lower:]]'`
# Check that the specified interfaces exist.
for interface in ${required_interfaces}
do
case " ${available_interfaces} " in
*\ ${interface}\ *)
;;
*)
AC_MSG_ERROR([unknown interface ${interface}: must be one of ${available_interfaces}])
;;
esac
done
# Initialize the enabled variable for each interface.
for interface in ${available_interfaces}
do
case " ${required_interfaces} " in
*\ ${interface}\ *)
eval ${interface}_interface_enabled=yes
enabled_interfaces="${enabled_interfaces}${enabled_interfaces:+ }${interface}"
;;
*)
eval ${interface}_interface_enabled=no
;;
esac
done
AC_MSG_RESULT([${enabled_interfaces}])
;;
esac
if test x${cxx_interface_enabled} = xyes
then
build_cxx_interface=yes
fi
AM_CONDITIONAL(BUILD_CXX_INTERFACE, test x$build_cxx_interface = xyes)
if test x${c_interface_enabled} = xyes
then
build_c_interface=yes
fi
AM_CONDITIONAL(BUILD_C_INTERFACE, test x$build_c_interface = xyes)
# Checks for systems for which the interface is enabled.
# Allow to specify the Java SDK installation directory.
AC_ARG_WITH(java,
AS_HELP_STRING([--with-java=DIR], [use the Java SDK installed in DIR]),
java_dir=$with_java)
case "${host_os}" in
# On Darwin the JDK, if present, is installed in /Library/Java/Home .
darwin*)
if test "x$java_dir" = x
then
java_dir="/Library/Java/Home"
fi
;;
# On modern Fedora systems the JDK is usually in /usr/lib/jvm/java .
linux*)
if test "x$java_dir" = x
then
java_dir="/usr/lib/jvm/java"
fi
;;
*)
;;
esac
if test "x$java_dir" != x
then
JAVAPREFIX="${java_dir}/bin"
fi
# Checks for Java.
if test x${java_interface_enabled} = xyes