forked from Singular/Singular
-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.in
862 lines (789 loc) · 24.6 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
dnl Process this file with autoconf to produce a configure script
AC_INIT(kernel/matpol.h)
AC_PREFIX_DEFAULT(`pwd`)
pwd=`pwd`
dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
dnl Version business -- set these here
dnl
# make them to env variables
# pass them indirectly to subsequent configures
SINGULAR_MAJOR_VERSION=3
SINGULAR_MINOR_VERSION=1
SINGULAR_SUB_VERSION=7
VERSION_SEP="-"
SINGULAR_SHORT_VERSION="${SINGULAR_MAJOR_VERSION}${VERSION_SEP}${SINGULAR_MINOR_VERSION}"
SINGULAR_VERSION="${SINGULAR_SHORT_VERSION}${VERSION_SEP}${SINGULAR_SUB_VERSION}"
SINGULAR_RPM_VERSION="${SINGULAR_MAJOR_VERSION}.${SINGULAR_MINOR_VERSION}.${SINGULAR_SUB_VERSION}"
VERSION_DATE="Aug 2013"
SINGULAR_ROOT_DIR=$pwd
export SINGULAR_MINOR_VERSION
export SINGULAR_MAJOR_VERSION
export SINGULAR_SUB_VERSION
export SINGULAR_VERSION
export SINGULAR_RPM_VERSION
export VERSION_DATE
export SINGULAR_ROOT_DIR
dnl substitue them into the Makefiles
AC_SUBST(SINGULAR_VERSION)
AC_SUBST(VERSION_DATE)
AC_SUBST(SINGULAR_SHORT_VERSION)
AC_SUBST(SINGULAR_RPM_VERSION)
AC_SUBST(SINGULAR_ROOT_DIR)
dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
dnl Makefiles to output
dnl
# determine Makefiles to output
OUTPUT_MAKEFILES="Makefile"
if test "$enable_gfanlib" = yes -o "$enable_polymake" = yes; then
OUTPUT_MAKEFILES="$OUTPUT_MAKEFILES callgfanlib/Makefile"
fi
if test -d "doc"; then
OUTPUT_MAKEFILES="$OUTPUT_MAKEFILES doc/Makefile doc/version.texi doc/uname.texi"
fi
if test -d "emacs"; then
OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" emacs/Makefile"
fi
if test -d "IntegerProgramming"; then
OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" IntegerProgramming/Makefile"
fi
if test -d "Plural"; then
OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" Plural/Makefile"
fi
if test -d "InstallShield"; then
OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" InstallShield/Makefile InstallShield/Etc/Makefile InstallShield/Cygwin/Makefile InstallShield/Singular/Makefile InstallShield/Xemacs/Makefile"
fi
dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
dnl determine singuname
dnl
AC_MSG_CHECKING(uname for singular)
AC_CACHE_VAL(ac_cv_singuname,
ac_cv_singuname="unknown"
if test -r "singuname.sh"; then
if (/bin/sh singuname.sh >/dev/null 2>&1) then
ac_cv_singuname=`/bin/sh singuname.sh`
fi
fi
)
AC_MSG_RESULT($ac_cv_singuname)
if test "$ac_cv_singuname" = unknown; then
AC_MSG_WARN(Unknown architecture: Check singuname.sh)
fi
SINGUNAME=$ac_cv_singuname
AC_SUBST(SINGUNAME)
SING_UNAME=`echo $SINGUNAME | tr '-' '_' `
AC_SUBST(SING_UNAME)
dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
dnl compiler stuff
dnl is needed to check for libs and headers, later on
dnl
dnl we do not want to have "-g -O" for CFLAGS
if test "${CXXFLAGS+set}" != set; then
ac_cxxflags_set=no
CXXFLAGS="-O"
fi
if test "${CFLAGS+set}" != set; then
CFLAGS="-O"
ac_cflags_set=no
fi
dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
dnl compiler stuff
dnl is needed to check for libs and headers, later on
dnl
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_AIX
AC_PROG_CXX
SING_CC=${CC}; export SING_CC
SING_CXX=${CXX}; export SING_CXX
# check whether the compiler accepts -pipe
AC_MSG_CHECKING(whether compiler accepts -pipe)
temp_cflags=${CFLAGS}
CFLAGS="${CFLAGS} -pipe"
AC_CACHE_VAL(ac_cv_cxx_have_pipe,
AC_TRY_COMPILE(,,ac_cv_cxx_have_pipe=yes,ac_cv_cxx_have_pipe=no)
)
AC_MSG_RESULT(${ac_cv_cxx_have_pipe})
CFLAGS=${temp_cflags}
if test "${ac_cv_cxx_have_pipe}" != yes; then
PIPE=
else
PIPE="-pipe"
fi
AC_SUBST(PIPE)
AC_CHECK_PROGS(PERL, perl5 perl)
AC_CHECK_PROGS(UUDECODE, uudecode "uudeview -i",${pwd}/warn_not_found.sh uudecode)
AC_CHECK_PROGS(GUNZIP, gunzip, ${pwd}/warn_not_found.sh gunzip)
# don't use GZIP this breaks configure
AC_CHECK_PROGS(MYGZIP, gzip, ${pwd}/warn_not_found.sh gzip)
AC_CHECK_PROG(LATEX2HTML, latex2html, latex2html)
AC_PROG_LN_S
if test -r "${pwd}/mkinstalldirs"; then
MKINSTALLDIRS=${pwd}/mkinstalldirs
AC_SUBST(MKINSTALLDIRS)
else
AC_MSG_ERROR(mkinstalldirs not foind in ${pwd})
fi
dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
dnl Set exec_prefix, bindir, libdir, includedir to some sensible values
dnl
# expand prefix and pass it to subsequent configures
if test "x$prefix" = xNONE; then
prefix=${ac_default_prefix}
ac_configure_args="$ac_configure_args --prefix=${prefix}"
fi
# expand exec_prefix
if test "x$exec_prefix" = xNONE; then
exec_prefix=${prefix}/${ac_cv_singuname}
ac_configure_args="$ac_configure_args --exec_prefix=${exec_prefix}"
fi
# expand bindir
if test "x$bindir" = 'x${exec_prefix}/bin'; then
bindir="${exec_prefix}"
ac_configure_args="$ac_configure_args --bindir=${bindir}"
fi
# expand libdir
if test "x$libdir" = 'x${exec_prefix}/lib'; then
libdir="${exec_prefix}/lib"
ac_configure_args="$ac_configure_args --libdir=${libdir}"
fi
# expand includedir
if test "x$includedir" = 'x${prefix}/include'; then
includedir="${exec_prefix}/include"
ac_configure_args="$ac_configure_args --includedir=${includedir}"
fi
# construct name of installed Singular executable
SINGULAR=${bindir}/Singular-${SINGULAR_MAJOR_VERSION}${VERSION_SEP}${SINGULAR_MINOR_VERSION}${VERSION_SEP}${SINGULAR_SUB_VERSION}
export SINGULAR
AC_SUBST(SINGULAR)
dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
dnl Check for various libraries and headers
dnl
dnl After this part, the variables 'ac_<package>_ok' is 'yes'
dnl if '<package>' is already existent on the system, otherwise
dnl undefined.
dnl
# add -I to CPPFLAGS and -L to LDFLAGS, just to be sure
LDFLAGS="-L${libdir} ${LDFLAGS}"
CPPFLAGS="-I${includedir} ${CPPFLAGS}"
# check for AIX
AC_MSG_CHECKING(whether _AIX is defined)
AC_CACHE_VAL(ac_cv_is_aix,
AC_EGREP_CPP(yes,
[#ifdef _AIX
yes
#endif
], ac_cv_is_aix=yes, ac_cv_is_aix=no, 1))
if test "$ac_cv_is_aix" = yes; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_CHECK_LIB(m, atof)
AC_CHECK_LIB(bsd, socket)
AC_CHECK_LIB(socket, listen)
AC_CHECK_LIB(nsl, gethostbyname)
AC_CHECK_LIB(gmp, main)
AC_CHECK_LIB(MP, IMP_PutGmpInt)
AC_CHECK_LIB(MPT, MPT_GetTree)
AC_CHECK_LIB(singcf, atof)
AC_CHECK_LIB(singfac, atof)
AC_CHECK_LIB(omalloc, omTestAddr)
AC_CHECK_LIB(omalloc_ndebug, main)
AC_CHECK_HEADERS(gmp.h MP.h MPT.h factory.h factor.h omalloc.h)
if test "$ac_cv_lib_gmp_main" = yes && \
test "$ac_cv_header_gmp_h" = yes; then
ac_gmp_ok=yes
fi
if test "$ac_cv_lib_MP_IMP_PutGmpInt" = yes && \
test "$ac_cv_lib_MPT_MPT_GetTree" && \
test "$ac_cv_header_MP_h" = yes && \
test "$ac_cv_header_MPT_h" = yes; then
ac_MP_ok=yes
fi
if test "$ac_cv_lib_singcf_atof" = yes && \
test "$ac_cv_header_factory_h" = yes; then
ac_factory_ok=yes
fi
if test "$ac_cv_lib_singfac_atof" = yes && \
test "$ac_cv_header_factor_h" = yes; then
ac_libfac_ok=yes
fi
if test "$ac_cv_lib_omalloc_omTestAddr" = yes && \
test "$ac_cv_lib_omalloc_ndebug_main" = yes && \
test "$ac_cv_header_omalloc_c" = yes && \
test "$ac_cv_header_omalloc_h" = yes; then
ac_cv_omalloc_ok=yes
fi
dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
dnl Check command line arguments
dnl
DOC2TEX_EXAMPLE_EXCLUSIONS=""
AC_SUBST(DOC2TEX_EXAMPLE_EXCLUSIONS)
AC_ARG_WITH(tmpdir, \
[ --with-tmpdir=DIR use DIR as temporary directory])
AC_ARG_ENABLE(omalloc, \
[ --enable-PACKAGE configure and/or build PACKAGE
--disable-PACKAGE do not configure and/or build PACKAGE
where PACKAGE can be:
omalloc omalloc memory managment])
AC_ARG_ENABLE(gfanlib, \
[ gfanlib gfanlib])
AC_ARG_ENABLE(polymake, \
[ polymake polymake])
AC_ARG_ENABLE(MP, \
[ MP Multi Protocol library])
AC_ARG_ENABLE(factory, \
[ factory polynomial factorization library])
AC_ARG_ENABLE(libfac, \
[ libfac char set and modp poly factorization library])
AC_ARG_ENABLE(sgroup, \
[ sgroup numerical semigroup computations])
AC_ARG_ENABLE(Singular, \
[ Singular CAS for Polynomial Computations])
AC_ARG_ENABLE(IntegerProgramming, \
[ IntegerProgramming IntegerProgramming])
AC_ARG_ENABLE(countedref, \
[ countedref Enable autoloading of reference counted types])
AC_ARG_ENABLE(Plural, \
[ Plural Plural])
AC_ARG_ENABLE(Texinfo, \
[ Texinfo Texinfo for info, texi2dvi, makeinfo])
AC_ARG_ENABLE(Texi2html, \
[ Texi2html Texinfo to HTML converter])
AC_ARG_ENABLE(doc, \
[ doc Singular documentation])
AC_ARG_ENABLE(emacs, \
[ emacs emacs completion files])
AC_ARG_WITH(MP,\
[ --with-PACKAGE use PACKAGE, provide dependent functionality
--without-PACKAGE do not use PACKAGE, disable dependent functionality
where PACKAGE can be:
MP Multi Protocol library])
AC_ARG_WITH(factory, \
[ factory polynomial factorization library])
AC_ARG_WITH(libfac, \
[ libfac char set and modp poly factorization library])
AC_ARG_WITH(gmp, \
[ --with-apint=PACKAGE use PACKAGE for arbitary integer arithmetic
where PACKAGE can be gmp
All additional --enable and --with options are passed to subsequent calls
to configure of the packages to be built. See also configure --help in
these packages (resp. subdirs). ])
dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
dnl Check what to use as tmp dir
dnl
AC_MSG_CHECKING(which tmp dir to use)
if test "${with_tmpdir+set}" = set && test -d ${with_tmpdir}; then
if (echo "${with_tmpdir}" | egrep "\." >/dev/null 2>&1)
then
TMP_DIR="${pwd}/tmp"
else
TMP_DIR=${with_tmpdir}
fi
else
TMP_DIR="${pwd}/tmp"
fi
AC_MSG_RESULT($TMP_DIR)
AC_SUBST(TMP_DIR)
dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
dnl Check whether or not to configure and build various packages
dnl
AC_MSG_CHECKING(whether to configure and build omalloc)
if test "${enable_omalloc+set}" != set; then
if test "$ac_cv_omalloc_ok" = yes; then
enable_omalloc=no
fi
enable_omalloc_not_set=yes
fi
if test "$enable_omalloc" = no; then
if test "$ac_cv_omalloc_ok" != yes; then
AC_MSG_ERROR(can not build without omalloc)
fi
AC_MSG_RESULT(no)
else
if test -d omalloc; then
AC_MSG_RESULT(yes)
if test "$enable_omalloc_not_set" = yes; then
ac_configure_args="$ac_configure_args --enable-omalloc --with-external-config_h='$pwd/Singular/omSingularConfig.h' --with-track-custom"
fi
CONFIG_SUBDIRS="$CONFIG_SUBDIRS omalloc"
BUILD1_SUBDIRS="$BUILD1_SUBDIRS omalloc"
if test "${with_malloc+set}" != set; then
case "$ac_cv_singuname" in
# under windows, it is best to use the provided malloc
ix86-Win*)
with_malloc=system
ac_configure_args="$ac_configure_args --with-malloc=system"
;;
PowerMacintosh-darwin*)
with_malloc=system
ac_configure_args="$ac_configure_args --with-malloc=system"
;;
esac
fi
else
AC_MSG_ERROR(need omalloc subdir)
fi
fi
# Check whether we have gmp
if test "$ac_gmp_ok" != yes; then
AC_MSG_ERROR(can not find gmp)
fi
#AC_MSG_CHECKING(whether to configure and build MP lib)
# requires: sizeof(long)==4
AC_CHECK_SIZEOF(long,4)
if test "$ac_cv_sizeof_long" != 4; then
with_MP=no
fi
AC_MSG_CHECKING(whether to configure and build MP lib)
if test "$enable_MP" != yes && test "$enable_MP" != no; then
if test "$with_MP" != no && test "$ac_MP_ok" != yes && test -d MP && \
(test "$ac_gmp_ok" = yes); then
AC_MSG_RESULT(yes)
enable_MP=yes
CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP"
BUILD1_SUBDIRS="$BUILD1_SUBDIRS MP"
ac_configure_args="$ac_configure_args --enable-MP"
else
AC_MSG_RESULT(no)
enable_MP=no
fi
elif test "$enable_MP" = yes; then
if test ! -d MP; then
AC_MSG_RESULT(no)
AC_MSG_ERROR(can not build MP without MP directory)
fi
if test "$ac_gmp_ok" = yes; then
AC_MSG_RESULT(yes)
CONFIG_SUBDIRS="$CONFIG_SUBDIRS MP"
BUILD1_SUBDIRS="$BUILD1_SUBDIRS MP"
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(can not build MP without gmp)
fi
else
AC_MSG_RESULT(no)
fi
# need MP code to be compiled with -fPIC, should not hurt anybody else
if test "$enable_MP" = yes && test "${with_extra_cflags+set}" != set; then
ac_configure_args="$ac_configure_args --with-extra_cflags=-fPIC"
fi
AC_MSG_CHECKING(whether to configure and build NTL lib)
if test "$enable_NTL" != yes && test "$enable_NTL" != no; then
if test "$with_NTL" != no && test "$ac_NTL_ok" != yes && \
test -d ntl; then
enable_NTL=yes
AC_MSG_RESULT(yes)
CONFIG_SUBDIRS="$CONFIG_SUBDIRS ntl"
BUILD1_SUBDIRS="$BUILD1_SUBDIRS ntl"
ac_configure_args="$ac_configure_args --enable-NTL"
AC_LANG_CPLUSPLUS
AC_CHECK_HEADERS(iostream.h iostream)
AC_LANG_RESTORE
else
enable_NTL=no
AC_MSG_RESULT(no)
fi
elif test "$enable_NTL" = yes; then
if test -d ntl; then
AC_MSG_RESULT(yes)
CONFIG_SUBDIRS="$CONFIG_SUBDIRS ntl"
BUILD1_SUBDIRS="$BUILD1_SUBDIRS ntl"
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(can not build NTL without ntl directory)
fi
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(whether to configure and build factory lib)
if test "$enable_factory" != yes && test "$enable_factory" != no; then
if test "$with_factory" != no && test "$ac_factory_ok" != yes && \
test -d factory; then
enable_factory=yes
AC_MSG_RESULT(yes)
CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory"
BUILD1_SUBDIRS="$BUILD1_SUBDIRS factory"
ac_configure_args="$ac_configure_args --enable-factory"
else
enable_factory=no
AC_MSG_RESULT(no)
fi
elif test "$enable_factory" = yes; then
if test -d factory; then
AC_MSG_RESULT(yes)
CONFIG_SUBDIRS="$CONFIG_SUBDIRS factory"
BUILD1_SUBDIRS="$BUILD1_SUBDIRS factory"
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(can not build factory without factory directory)
fi
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(whether to configure and build libfac lib)
if test "$enable_libfac" != yes && test "$enable_libfac" != no; then
if test "$with_libfac" != no && test "$ac_libfac_ok" != yes && \
test -d libfac && \
(test "$ac_factory_ok" = yes || test "$enable_factory" = yes); then
enable_libfac=yes
AC_MSG_RESULT(yes)
CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac"
BUILD1_SUBDIRS="$BUILD1_SUBDIRS libfac"
ac_configure_args="$ac_configure_args --enable-libfac"
else
enable_libfac=no
AC_MSG_RESULT(no)
fi
elif test "$enable_libfac" = yes; then
if test ! -d libfac; then
AC_MSG_RESULT(no)
AC_MSG_ERROR(can not build libfac without libfac directory)
fi
if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
AC_MSG_RESULT(yes)
CONFIG_SUBDIRS="$CONFIG_SUBDIRS libfac"
BUILD1_SUBDIRS="$BUILD1_SUBDIRS libfac"
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(Can not build libfac without factory)
fi
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(whether to configure and build gfan lib)
if test "$enable_gfanlib" = yes -o "$enable_polymake" = yes; then
if test -d gfanlib; then
if test -d callgfanlib; then
AC_MSG_RESULT(yes)
CONFIG_SUBDIRS="$CONFIG_SUBDIRS gfanlib callgfanlib"
BUILD1_SUBDIRS="$BUILD1_SUBDIRS gfanlib callgfanlib"
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(missing gfanlib interface)
fi
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(missing gfanlib)
fi
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(whether to configure and build polymake interface)
if test "$enable_polymake" = yes; then
if test -d callpolymake; then
CONFIG_SUBDIRS="$CONFIG_SUBDIRS callpolymake"
BUILD1_SUBDIRS="$BUILD1_SUBDIRS callpolymake"
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(missing callpolymake folder)
fi
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(whether to configure and build sgroup lib)
dnl
dnl only sgroup if explicietely requested
dnl if test "$enable_sgroup" != yes && test "$enable_sgroup" != no; then
dnl if test "$with_sgroup" != no && test "$ac_sgroup_ok" != yes && \
dnl test -d sgroup && \
dnl (test "$ac_MP_ok" = yes || test "$enable_MP" = yes); then
dnl enable_sgroup=yes
dnl AC_MSG_RESULT(yes)
dnl CONFIG_SUBDIRS="$CONFIG_SUBDIRS sgroup"
dnl ac_configure_args="$ac_configure_args --enable-sgroup"
dnl else
dnl enable_sgroup=no
dnl AC_MSG_RESULT(no)
dnl fi
dnl elif test "$enable_sgroup" = yes; then
if test "$enable_sgroup" = yes; then
if test ! -d sgroup; then
AC_MSG_RESULT(no)
AC_MSG_ERROR(can not build sgroup without sgroup directory)
fi
if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
AC_MSG_RESULT(yes)
CONFIG_SUBDIRS="$CONFIG_SUBDIRS sgroup"
BUILD1_SUBDIRS="$BUILD1_SUBDIRS sgroup"
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(Can not build sgroup without MP)
fi
else
AC_MSG_RESULT(no)
fi
BUILD_SUBDIRS="$CONFIG_SUBDIRS"
AC_MSG_CHECKING(whether to configure and build Singular)
if test "$enable_Singular" != yes && test "$enable_Singular" != no; then
if test "$with_Singular" != no && test -d Singular; then
enable_Singular=yes
AC_MSG_RESULT(yes)
CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular"
BUILD_SUBDIRS="$BUILD_SUBDIRS kernel Singular"
BUILD1_SUBDIRS="$BUILD1_SUBDIRS kernel Singular"
ac_configure_args="$ac_configure_args --enable-Singular"
else
enable_Singular=no
AC_MSG_RESULT(no)
fi
elif test "$enable_Singular" = yes; then
if test -d Singular; then
AC_MSG_RESULT(yes)
CONFIG_SUBDIRS="$CONFIG_SUBDIRS Singular"
BUILD_SUBDIRS="$BUILD_SUBDIRS kernel Singular"
BUILD1_SUBDIRS="$BUILD1_SUBDIRS kernel Singular"
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(can not build Singular without Singular directory)
fi
else
AC_MSG_RESULT(no)
fi
# test if IntegerProgramming should be built:
AC_MSG_CHECKING(whether to build IntegerProgramming)
if test "$enable_IntegerProgramming" != no && test -d "IntegerProgramming"; then
BUILD_SUBDIRS="$BUILD_SUBDIRS IntegerProgramming"
BUILD1_SUBDIRS="$BUILD1_SUBDIRS IntegerProgramming"
AC_MSG_RESULT(yes)
if test "$enable_IntegerProgramming" != yes; then
ac_configure_args="$ac_configure_args --enable-IntegerProgramming"
fi
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(whether to build Plural)
if test "$enable_Plural" != no || test "$with_Plural" != no; then
AC_MSG_RESULT(yes)
if test "$enable_Plural" != yes; then
ac_configure_args="$ac_configure_args --enable-Plural"
fi
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(whether to configure and build Texinfo)
if test "$enable_Texinfo" != no && test -d Texinfo; then
AC_MSG_RESULT(yes)
enable_texinfo=yes
CONFIG_SUBDIRS="$CONFIG_SUBDIRS Texinfo"
BUILD_SUBDIRS="$BUILD_SUBDIRS Texinfo"
TEXI2PDF=${bindir}/texi2pdf
MAKEINFO="${bindir}/makeinfo"
TEXINDEX=${bindir}/texindex
AC_SUBST(TEXI2PDF)
AC_SUBST(MAKEINFO)
AC_SUBST(TEXINDEX)
if test "$enable_Texinfo" != yes; then
ac_configure_args="$ac_configure_args --enable-Texinfo"
fi
else
AC_MSG_RESULT(no)
AC_MSG_WARN(Building of doc might fail. Need Texinfo)
enable_texinfo=no
AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, ${pwd}/warn_not_found.sh makeinfo)
AC_CHECK_PROG(TEXINDEX, texindex, texindex, ${pwd}/warn_not_found.sh texindex)
AC_CHECK_PROG(TEXI2PDF, texi2pdf, texi2pdf, ${pwd}/warn_not_found.sh texi2pdf)
fi
AC_MSG_CHECKING(whether to configure and build Texi2html)
if test "$enable_Texi2html" != no && test -d Texi2html; then
AC_MSG_RESULT(yes)
CONFIG_SUBDIRS="$CONFIG_SUBDIRS Texi2html"
BUILD_SUBDIRS="$BUILD_SUBDIRS Texi2html"
if test "$enable_Texi2html" != yes; then
ac_configure_args="$ac_configure_args --enable-Texi2html"
fi
TEXI2HTML=${bindir}/texi2html
AC_SUBST(TEXI2HTML)
else
AC_MSG_RESULT(no)
AC_CHECK_PROG(TEXI2HTML, texi2html, texi2html)
fi
if test "${UUDECODE+set}" != set; then
AC_MSG_WARN(uudecode not found. HTML doc generation will fail)
fi
if test "${TEXI2HTML+set}" != set; then
AC_MSG_WARN(texi2html not found. HTML doc generation will fail)
fi
if test "$ac_cv_prog_LATEX2HTML" = latex2html; then
TEXI2HTML_OPTS="-l2h"
fi
AC_SUBST(TEXI2HTML_OPTS)
AC_MSG_CHECKING(whether to build doc)
if test "$enable_doc" != no && test -d doc; then
AC_MSG_RESULT(yes)
BUILD_SUBDIRS="$BUILD_SUBDIRS doc"
if test "$enable_doc" != yes; then
enable_doc=yes
ac_configure_args="$ac_configure_args --enable-doc"
fi
else
enable_doc=no
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(whether to build emacs)
if test "$enable_doc" = yes && test "$enable_emacs" != no && test -d emacs; then
AC_MSG_RESULT(yes)
BUILD_SUBDIRS="$BUILD_SUBDIRS emacs"
if test "$enable_emacs" != yes; then
ac_configure_args="$ac_configure_args --enable-emacs"
fi
else
AC_MSG_RESULT(no)
fi
dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
dnl Check whether or not to use various packages
dnl
AC_MSG_CHECKING(which apint package to use)
if test "$with_apint" = gmp; then
if test "$ac_gmp_ok" = yes; then
AC_MSG_RESULT(gmp)
else
AC_MSG_RESULT(none)
AC_MSG_ERROR(can not use with gmp without finding it)
fi
elif test "$ac_gmp_ok" = yes; then
AC_MSG_RESULT(gmp)
ac_configure_args="$ac_configure_args --with-apint=gmp"
else
AC_MSG_ERROR(gmp required)
fi
AC_MSG_CHECKING(whether to use with MP)
if test "$with_MP" = yes; then
if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(none)
AC_MSG_ERROR(can not use with MP without finding or building it)
fi
elif test "$with_MP" = no; then
AC_MSG_RESULT(no)
elif test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
AC_MSG_RESULT(yes)
ac_configure_args="$ac_configure_args --with-MP"
else
AC_MSG_RESULT(no)
ac_configure_args="$ac_configure_args --without-MP"
DOC2TEX_EXAMPLE_EXCLUSIONS="$DOC2TEX_EXAMPLE_EXCLUSIONS -exclude MP"
fi
AC_MSG_CHECKING(whether to use with factory)
if test "$with_factory" = yes; then
if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(none)
AC_MSG_ERROR(can not use with factory without finding or building it)
fi
elif test "$with_factory" = no; then
AC_MSG_RESULT(no)
elif test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
AC_MSG_RESULT(yes)
ac_configure_args="$ac_configure_args --with-factory"
else
AC_MSG_RESULT(no)
ac_configure_args="$ac_configure_args --without-factory"
fi
AC_MSG_CHECKING(whether to use with libfac)
if test "$with_libfac" = yes; then
if test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(none)
AC_MSG_ERROR(can not use with libfac without finding or building it)
fi
elif test "$with_libfac" = no; then
AC_MSG_RESULT(no)
elif test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then
AC_MSG_RESULT(yes)
ac_configure_args="$ac_configure_args --with-libfac"
else
AC_MSG_RESULT(no)
ac_configure_args="$ac_configure_args --without-libfac"
fi
AC_MSG_CHECKING(whether to use with Singular)
if test "$with_Singular" != no && test "$with_Singular" != yes; then
if test "$enable_Singular" = yes; then
with_Singular=yes
else
with_Singular=no
fi
ac_configure_args="$ac_configure_args --with-Singular=$with_Singular"
fi
if test "$with_Singular" != no; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
dnl Check for known subdirs
dnl
SUBDIRS=""
if test -d omalloc; then
SUBDIRS="$SUBDIRS omalloc"
fi
if test -d MP; then
SUBDIRS="$SUBDIRS MP"
fi
if test -d ntl; then
SUBDIRS="$SUBDIRS ntl"
fi
if test -d factory; then
SUBDIRS="$SUBDIRS factory"
fi
if test -d libfac; then
SUBDIRS="$SUBDIRS libfac"
fi
if test -d sgroup; then
SUBDIRS="$SUBDIRS sgroup"
fi
if test -d kernel; then
SUBDIRS="$SUBDIRS kernel"
fi
if test -d IntegerProgramming; then
SUBDIRS="$SUBDIRS IntegerProgramming"
fi
if test -d Singular; then
SUBDIRS="$SUBDIRS Singular"
fi
if test -d Texinfo; then
SUBDIRS="$SUBDIRS Texinfo"
fi
if test -d Texi2html; then
SUBDIRS="$SUBDIRS Texi2html"
fi
if test -d doc; then
SUBDIRS="$SUBDIRS doc"
fi
if test -d emacs; then
SUBDIRS="$SUBDIRS emacs"
fi
dnl if test -d rpm; then
dnl SUBDIRS="$SUBDIRS rpm"
dnl fi
if test -d dyn_modules; then
SUBDIRS="$SUBDIRS dyn_modules"
fi
if test -d "dyn_modules"; then
dnl OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" dyn_modules/Makefile"
CONFIG_SUBDIRS=$CONFIG_SUBDIRS" dyn_modules"
BUILD_SUBDIRS=$BUILD_SUBDIRS" dyn_modules"
fi
AC_MSG_CHECKING(whether to use libsvd)
if test "$with_svd" = yes; then
AC_MSG_RESULT(yes)
dnl OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" dyn_modules/Makefile"
CONFIG_SUBDIRS=$CONFIG_SUBDIRS" svd"
BUILD_SUBDIRS=$BUILD_SUBDIRS" svd"
else
AC_MSG_RESULT(no)
fi
dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
dnl Enough -- wrap it up
dnl
AC_PROG_MAKE_SET
AC_SUBST(SUBDIRS)
AC_SUBST(BUILD_SUBDIRS)
AC_SUBST(BUILD1_SUBDIRS)
AC_SUBST(CONFIG_SUBDIRS)
AC_CONFIG_SUBDIRS($CONFIG_SUBDIRS)
AC_OUTPUT(${OUTPUT_MAKEFILES})