-
Notifications
You must be signed in to change notification settings - Fork 210
/
configure.ac
3363 lines (2954 loc) · 92.2 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
AC_PREREQ(2.59)
#
# configure.ac
#
# This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
# project.
#
# Copyright (C) 1998-2024 OpenLink Software
#
# This project 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; only version 2 of the License, dated June 1991.
#
# This program 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 St, Fifth Floor, Boston, MA 02110-1301 USA
#
##########################################################################
## ##
## Initializing ##
## ##
##########################################################################
m4_define(vos_major, [7])
m4_define(vos_minor, [2])
m4_define(vos_patch, [15])
m4_define(vos_devel, [-dev])
AC_INIT([Virtuoso Open Source Edition (Column Store)],
vos_major.vos_minor.vos_patch[]vos_devel,
[virtuoso-opensource])
AC_CONFIG_SRCDIR([libsrc/Dk.h])
AC_CONFIG_AUX_DIR([binsrc/config])
AC_CONFIG_MACRO_DIR([binsrc/config])
AC_CONFIG_HEADER([libsrc/Dk/config.h])
#
# Version variables
#
VOS_MAJOR="vos_major"
VOS_MINOR="vos_minor"
VOS_PATCH="vos_patch"
dnl
dnl You may need to change the next macro for older versions of automake:
dnl
dnl AM_INIT_AUTOMAKE([1.6])
dnl AM_INIT_AUTOMAKE([1.7])
dnl AM_INIT_AUTOMAKE([1.8])
dnl AM_INIT_AUTOMAKE([1.9 tar-ustar])
dnl AM_INIT_AUTOMAKE([1.16 tar-ustar subdir-objects])
dnl
AM_INIT_AUTOMAKE([1.9 tar-ustar])
AM_MAINTAINER_MODE
##########################################################################
## ##
## Check if makeconfig supports silent build rules ##
## ##
##########################################################################
m4_ifdef([AM_SILENT_RULES],
[AM_SILENT_RULES([yes])
])
##########################################################################
## ##
## Check system type ##
## ##
##########################################################################
AC_CANONICAL_HOST
AC_SUBST(host_cpu)
AC_SUBST(host_vendor)
AC_SUBST(host_os)
##########################################################################
## ##
## Save configuration for later reuse ##
## ##
##########################################################################
echo creating config.nice
rm -f config.nice
cat >config.nice<<CONFIG_NICE_EOF
#!${SHELL-/bin/sh}
#
# Created by configure for $PACKAGE_STRING
#
# Environment
CONFIG_NICE_EOF
for var in SHELL CFLAGS CXXFLAGS CPPFLAGS LDFLAGS INCLUDES LIBS CC CXX
do
eval val=\$$var
if test -n "$val"
then
echo "$var=\"$val\"; export $var" >> config.nice
fi
done
echo "" >> config.nice
echo ${SHELL} "\"$0\" \\" >> config.nice
eval "set -- $ac_configure_args"
for arg
do
echo "\"$arg\" \\" >> config.nice
done
echo '"$@"' >> config.nice
chmod +x config.nice
##########################################################################
## ##
## Set Layout for Virtuoso ##
## ##
##########################################################################
AC_PREFIX_DEFAULT(/usr/local/virtuoso-opensource)
AC_MSG_CHECKING(for Virtuoso installation layout)
AC_ARG_WITH(layout, [dnl
AC_HELP_STRING([--with-layout=LAYOUT], [Choose installation layout])dnl
],
[ case "${withval}" in
yes|no) VIRTUOSO_LAYOUT=unset ;;
*) VIRTUOSO_LAYOUT=${withval} ;;
esac
], [VIRTUOSO_LAYOUT=unset])
#
# Defaults for Layout
#
case ${VIRTUOSO_LAYOUT} in
unset) # No Layout set
virtuoso_layout="default"
vaddir=$datadir/virtuoso/vad
docdir=$datadir/virtuoso/doc
htmldocdir=$datadir/virtuoso/doc/html
pdfdocdir=$datadir/virtuoso/doc/pdf
demodir=$localstatedir/lib/virtuoso/demo
dbdir=$localstatedir/lib/virtuoso/db
httprootdir=$localstatedir/lib/virtuoso/vsp
hostingdir=$libdir/virtuoso/hosting
clidir=$libdir/virtuoso/cli
;;
[[Gg]][[Nn]][[Uu]]) # GNU
virtuoso_layout="GNU"
test "x$prefix" = xNONE && prefix=/usr/local
vaddir=$datadir/virtuoso/vad
docdir=$datadir/virtuoso/doc
htmldocdir=$datadir/virtuoso/doc/html
pdfdocdir=$datadir/virtuoso/doc/pdf
demodir=$localstatedir/lib/virtuoso/demo
dbdir=$localstatedir/lib/virtuoso/db
httprootdir=$localstatedir/lib/virtuoso/vsp
hostingdir=$libdir/virtuoso/hosting
clidir=$libdir/virtuoso/cli
;;
[[Dd]][[Ee]][[Bb]][[Ii]][[Aa]][[Nn]]) # Debian
virtuoso_layout="Debian"
if test "x$prefix" = "xNONE"
then
prefix=/usr
localstatedir=/var
fi
VIRTPKGDIR=virtuoso-opensource-$VOS_MAJOR
vaddir=$datadir/$VIRTPKGDIR/vad
docdir=$datadir/doc/$VIRTPKGDIR
htmldocdir=$datadir/doc/$VIRTPKGDIR/html
pdfdocdir=$datadir/doc/$VIRTPKGDIR/pdf
demodir=$localstatedir/lib/$VIRTPKGDIR/demo
dbdir=$localstatedir/lib/$VIRTPKGDIR/db
httprootdir=$localstatedir/lib/$VIRTPKGDIR/vsp
hostingdir=$libdir/$VIRTPKGDIR/hosting
clidir=$libdir/cli/$VIRTPKGDIR/
;;
[[Gg]][[Ee]][[Nn]][[Tt]][[Oo]][[Oo]]) # Gentoo
virtuoso_layout="Gentoo"
if test "x$prefix" = "xNONE"
then
prefix=/usr
localstatedir=/var
fi
VIRTPKGDIR=virtuoso-$VOS_MAJOR
vaddir=$datadir/$VIRTPKGDIR/vad
docdir=$datadir/doc/$VIRTPKGDIR
htmldocdir=$datadir/doc/$VIRTPKGDIR/html
pdfdocdir=$datadir/doc/$VIRTPKGDIR/pdf
demodir=$localstatedir/lib/$VIRTPKGDIR/demo
dbdir=$localstatedir/lib/$VIRTPKGDIR/db
httprootdir=$localstatedir/lib/$VIRTPKGDIR/vsp
hostingdir=$libdir/$VIRTPKGDIR/hosting
clidir=$libdir/$VIRTPKGDIR/cli
;;
[[Rr]][[Ee]][[Dd]][[Hh]][[Aa]][[Tt]]) # RedHat
virtuoso_layout=RedHat
if test "x$prefix" = "xNONE"
then
prefix=/usr
localstatedir=/var
fi
vaddir=$datadir/virtuoso/vad
docdir=$datadir/doc/virtuoso
htmldocdir=$datadir/doc/virtuoso/html
pdfdocdir=$datadir/doc/virtuoso/pdf
demodir=$localstatedir/lib/virtuoso/demo
dbdir=$localstatedir/lib/virtuoso/db
httprootdir=$localstatedir/lib/virtuoso/vsp
hostingdir=$libdir/virtuoso/hosting
clidir=$libdir/virtuoso/cli
;;
[[Oo]][[Pp]][[Ee]][[Nn]][[Ss]][[Uu]][[Ss]][[Ee]]) # openSUSE
virtuoso_layout=openSUSE
if test "x$prefix" = "xNONE"
then
prefix=/usr
localstatedir=/var
fi
vaddir=$datadir/virtuoso/vad
docdir=$datadir/doc/packages/virtuoso
htmldocdir=$datadir/doc/packages/virtuoso/html
pdfdocdir=$datadir/doc/packages/virtuoso/pdf
demodir=$localstatedir/lib/virtuoso/demo
dbdir=$localstatedir/lib/virtuoso/db
httprootdir=$localstatedir/lib/virtuoso/vsp
hostingdir=$libdir/virtuoso/hosting
clidir=$libdir/virtuoso/cli
;;
[[Ff]][[Rr]][[Ee]][[Ee]][[Bb]][[Ss]][[Dd]]) # FreeBSD
virtuoso_layout=FreeBSD
if test "x$prefix" = "xNONE"
then
prefix=/usr
localstatedir=/var
fi
vaddir=$datadir/virtuoso/vad
docdir=$datadir/virtuoso/doc
htmldocdir=$datadir/virtuoso/doc/html
pdfdocdir=$datadir/virtuoso/doc/pdf
demodir=$localstatedir/lib/virtuoso/demo
dbdir=$localstatedir/lib/virtuoso/db
httprootdir=$localstatedir/lib/virtuoso/vsp
hostingdir=$libdir/virtuoso/hosting
clidir=$libdir/virtuoso/cli
;;
[[Oo]][[Pp]][[Tt]]) # /opt
virtuoso_layout=opt
test "x$prefix" = xNONE && prefix=/opt/virtuoso-opensource
vaddir='${prefix}/vad'
docdir='${prefix}/doc'
htmldocdir='${prefix}/doc/html'
pdfdocdir='${prefix}/doc/pdf'
demodir='${prefix}/demo'
dbdir='${prefix}/database'
httprootdir='${prefix}/vsp'
hostingdir='${prefix}/hosting'
clidir='${prefix}/lib'
;;
[[Oo]][[Pp]][[Ee]][[Nn]][[Ll]][[Ii]][[Nn]][[Kk]]) # OpenLink
virtuoso_layout=openlink
test "x$prefix" = xNONE && prefix=/usr/local/virtuoso-opensource
vaddir='${prefix}/vad'
docdir='${prefix}/doc'
htmldocdir='${prefix}/doc/html'
pdfdocdir='${prefix}/doc/pdf'
demodir='${prefix}/demo'
dbdir='${prefix}/database'
httprootdir='${prefix}/vsp'
hostingdir='${prefix}/hosting'
clidir='${prefix}/lib'
;;
*) # UNKNOWN
AC_MSG_RESULT(unknown)
echo ""
echo "AC_HELP_STRING([Supported layouts:], [Debian FreeBSD GNU OpenLink opt RedHat])"
echo ""
AC_MSG_ERROR([unable to continue])
;;
esac
AC_MSG_RESULT([${virtuoso_layout}])
AC_SUBST(dbdir)
AC_SUBST(demodir)
AC_SUBST(docdir)
AC_SUBST(hostingdir)
AC_SUBST(htmldocdir)
AC_SUBST(httprootdir)
AC_SUBST(pdfdocdir)
AC_SUBST(vaddir)
AC_SUBST(clidir)
##########################################################################
## ##
## Set TOP variable for OpenLink Source Tree ##
## ##
##########################################################################
TOP=`pwd`
LIBDIR=$TOP/lib
BINDIR=$TOP/bin
INCDIR=$TOP/include
#OPLDIR=$TOP/openlink
AC_SUBST(TOP)
AC_SUBST(LIBDIR)
AC_SUBST(BINDIR)
AC_SUBST(INCDIR)
#AC_SUBST(OPLDIR)
##########################################################################
## ##
## Check C compiler and features ##
## ##
##########################################################################
AC_PROG_CC
AC_PROG_CXX
AC_PROG_CC_C_O
AC_LANG_C
AC_PROG_LD
AC_SUBST(LD)
AC_PROG_CPP
AC_PATH_PROG(JAVACPP, [cpp], [/lib/cpp], [/usr/bin:/lib:$PATH])
##########################################################################
## ##
## Various UNIX version specific checks ##
## ##
##########################################################################
AC_AIX
AC_ISC_POSIX
AC_MINIX
##########################STAGING area####################################
##########################STAGING area####################################
##########################################################################
## ##
## Check specific C constructions ##
## ##
##########################################################################
dnl AC_C_CROSS dnl this has been merged into AC_PROG_CC
AC_C_BIGENDIAN
AC_C_CONST dnl this used to be AC_CONST
AC_C_INLINE
AC_C_CHAR_UNSIGNED
AC_C_LONG_DOUBLE
##########################################################################
## ##
## Check lengths C datatypes ##
## ##
##########################################################################
AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(unsigned)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
AC_CHECK_SIZEOF(float)
AC_CHECK_SIZEOF(double)
AC_CHECK_SIZEOF(long double)
AC_CHECK_SIZEOF(char *)
AC_CHECK_SIZEOF(void *)
dnl AC_CHECK_SIZEOF(void(*)()) dnl Could not be checked this way
dnl OBSOLETE AC_INT_16_BITS dnl now checked by AC_CHECK_SIZE(int)
#
# Check if this is a 64bit build
#
if test "x$ac_cv_sizeof_void_p" != 'x8'
then
AC_ERROR([The current version of $PACKAGE_NAME can only be built on 64bit platforms])
fi
##########################################################################
## ##
## Check for various programms ##
## ##
##########################################################################
## Force install-sh to be accessed via an absolute path:
ac_install_sh="$TOP/$ac_install_sh"
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LN_S
## We favor yacc above bizon or byacc, therefor we do not use AC_PROG_YACC
AC_PROG_YACC
## AC_CHECK_PROGS(YACC, yacc byacc 'bison -l', yacc)
AC_PATH_PROG(HTMLDOC, htmldoc)
AM_CONDITIONAL(WITH_HTMLDOC, test "x$HTMLDOC" != "x")
AM_PROG_LEX
AC_PATH_PROG(FLEX, flex, flex)
AC_PATH_PROG(GAWK, gawk, gawk)
AC_PATH_PROG(GPERF, gperf, gperf)
AC_PATH_PROG(PERL, perl, perl)
AM_PATH_PYTHON([2.7.5])
AC_PATH_PROG(RUBY, ruby, ruby)
#AC_DECL_YYTEXT
##########################################################################
## ##
## Use the new LibTool GNU package ##
## ##
##########################################################################
LT_INIT dnl was AC_PROG_LIBTOOL
#
# Use our own libtool so we can perform Universal builds
#
case $host in
*-darwin14*)
;;
*-darwin*)
LIBTOOL='$(SHELL) $(top_srcdir)/bin/libtool.macosx'
;;
esac
##########################################################################
## ##
## Check various headers ##
## ##
##########################################################################
AC_HEADER_STDC dnl this used to be AC_STDC_HEADERS
AC_HEADER_DIRENT dnl this used to be AC_DIR_HEADER
AC_HEADER_MAJOR
AC_HEADER_STAT dnl this used to be AC_STAT_MACROS_BROKEN
AC_HEADER_TIME dnl this used to be AC_TIME_WITH_SYS_TIME
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(unistd.h limits.h sys/param.h fcntl.h string.h memory.h \
sys/timeb.h sys/sockio.h sys/resource.h \
malloc.h sys/select.h sys/time.h wchar.h wctype.h \
pwd.h grp.h sys/mman.h execinfo.h)
##########################################################################
## ##
## Check various typedefs in include headers ##
## ##
##########################################################################
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T dnl this used to be AC_PID_T
AC_TYPE_SIGNAL dnl this used to be AC_RETSIGTYPE
AC_TYPE_SIZE_T dnl this used to be AC_SIZE_T
AC_TYPE_UID_T
##########################################################################
## ##
## Check various structs in include headers ##
## ##
##########################################################################
AC_STRUCT_ST_BLKSIZE
AC_STRUCT_ST_BLOCKS
AC_STRUCT_ST_RDEV
AC_STRUCT_TM
AC_CHECK_TYPES(ptrdiff_t)
dnl AC_STRUCT_TIMEZONE dnl this used to be AC_TIMEZONE
##########################################################################
## ##
## Check other structs in include headers ##
## ##
##########################################################################
#AC_DECL_SYS_SIGLIST
#AC_EGREP_HEADER(tm_gmtoff, time.h, AC_DEFINE(HAVE_TM_GMTOFF))
#AC_EGREP_HEADER(tm_tzadj, time.h, AC_DEFINE(HAVE_TM_TZADJ))
AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff,
[AC_TRY_COMPILE([#include <sys/types.h>
#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_gmtoff;],
ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)])
if test "$ac_cv_struct_tm_gmtoff" = yes; then
AC_DEFINE(HAVE_TM_GMTOFF,1, [Define if struct tm contains tm_gmtoff] )
fi
AC_CACHE_CHECK([for tm_tzadj in struct tm], ac_cv_struct_tm_tzadj,
[AC_TRY_COMPILE([#include <sys/types.h>
#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_tzadj;],
ac_cv_struct_tm_tzadj=yes, ac_cv_struct_tm_tzadj=no)])
if test "$ac_cv_struct_tm_tzadj" = yes; then
AC_DEFINE(HAVE_TM_TZADJ,1, [Define if struct tm contains tm_tzadj] )
fi
##########################################################################
## ##
## Check libraries ##
## ##
##########################################################################
# The following three (nsl,inet,socket) are needed on Sequent;
# the order of checking must be this. Most SVR4 platforms will
# need -lsocket and -lnsl. However on SGI IRIX 5, these exist but
# broken. I see no elegant solution (probably CHECK_LIB should be
# fixed to only add the library if the given entry point is not
# satisfied without it).
if test "$ac_sys_system" != IRIX
then
AC_CHECK_LIB(nsl, t_open, [VLIBS="-lnsl $VLIBS"]) # SVR4
AC_CHECK_LIB(inet, gethostbyname, [VLIBS="-linet $VLIBS"], [], -lnsl) # Sequent
AC_CHECK_LIB(socket, socket, [VLIBS="-lsocket $VLIBS"], [], $VLIBS) # SVR4 sockets
fi
AC_CHECK_LIB(m, cos, [VLIBS="-lm $VLIBS"]) # complex math
##########################################################################
## ##
## Check various functions ##
## ##
##########################################################################
#AC_FUNC_ALLOCA dnl this used to be AC_ALLOCA
#AC_FUNC_CLOSEDIR_VOID
#AC_FUNC_GETMNTENT
#AC_FUNC_GETPGRP
AC_FUNC_MEMCMP
#AC_FUNC_MMAP
AC_FUNC_SETVBUF_REVERSED dnl this used to be AC_SETVBUF_REVERSED
#AC_FUNC_STRCOLL
#AC_FUNC_STRFTIME
#AC_FUNC_UTIME_NULL
AC_FUNC_FORK
#AC_FUNC_VPRINTF
#AC_FUNC_WAIT3
AC_FUNC_CHOWN
AC_FUNC_STRERROR_R
dnl not used AC_FUNC_GETLOADAVG
##########################################################################
## ##
## Check other functions ##
## ##
##########################################################################
AC_CHECK_FUNCS(getpagesize gettimeofday strtok_r ftruncate fchmod fsync ftime localtime_r gmtime_r syslog)
AC_CHECK_FUNCS(snprintf vsnprintf)
AC_CHECK_FUNCS(cwprintf fgetws fputws fwprintf iswdigit iswlower iswspace iswupper putwc putwchar putws)
AC_CHECK_FUNCS(swprintf swscanf towlower towupper wcscasecmp wcscat wcschr wcscmp wcscpy wcsdup wcsicmp)
AC_CHECK_FUNCS(wcslen wcsncasecmp wcsncat wcsncmp wcsncpy wcsnicmp wcsrchr wcsstr wexecvp wfopen wgetenv)
AC_CHECK_FUNCS(wperror wprintf wtoi wtol wgetpass wgetpassphrase)
AC_CHECK_FUNCS(getpwnam getgrnam chmod getpwuid getgrgid setuid)
AC_CHECK_FUNCS(putenv setenv)
AC_CHECK_FUNCS(strerror)
AC_CHECK_FUNCS(strdup)
AC_CHECK_FUNCS(getrusage)
AC_CHECK_FUNCS(memmove memmem memcpy)
AC_CHECK_FUNCS(mkstemp64 mkstemp)
AC_CHECK_FUNCS(strftime stpcpy)
AC_CHECK_FUNCS(gethrtime)
AC_MSG_CHECKING(for sys_errlist)
AC_TRY_LINK([
#include <stdio.h>
#include <errno.h>
], [
void *err = (void *) sys_errlist;
], [
AC_DEFINE([HAVE_SYS_ERRLIST], 1, [if having SYS_ERRLIST])
AC_MSG_RESULT(yes)
], [
AC_MSG_RESULT(no)
])
AC_CACHE_CHECK([whether va_copy exists], ac_cv_have_va_copy, [
AC_TRY_LINK(
[#include <stdarg.h>
va_list x,y;],
[va_copy(x,y);],
[ ac_cv_have_va_copy="yes" ],
[ ac_cv_have_va_copy="no" ]
)
])
if test "x$ac_cv_have_va_copy" = "xyes" ; then
AC_DEFINE(HAVE_VA_COPY, 1, [Define if va_copy exists])
fi
AC_CACHE_CHECK([whether __va_copy exists], ac_cv_have___va_copy, [
AC_TRY_LINK(
[#include <stdarg.h>
va_list x,y;],
[__va_copy(x,y);],
[ ac_cv_have___va_copy="yes" ],
[ ac_cv_have___va_copy="no" ]
)
])
if test "x$ac_cv_have___va_copy" = "xyes" ; then
AC_DEFINE(HAVE___VA_COPY, 1, [Define if __va_copy exists])
fi
##########################################################################
## ##
##check for clock_gettime which may require an extra library ##
## ##
##########################################################################
AC_SEARCH_LIBS(clock_gettime, [rt posix4], [
AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Define to 1 if you have the clock_gettime function.])
])
##########################################################################
## ##
##check for presense of flock & the constants LOCK_EX and LOCK_UN ##
## ##
##########################################################################
AC_MSG_CHECKING(for flock in <sys/file.h>)
AC_TRY_LINK([
#include <sys/file.h>
], [
return (flock (0, LOCK_EX) || flock (0, LOCK_UN));
], [
AC_DEFINE(HAVE_FLOCK_IN_SYS_FILE, 1, [Define to 1 if you have flock defined into <sys/file.h> header file])
AC_MSG_RESULT(yes)], AC_MSG_RESULT(no))
##########################################################################
## ##
## Check OS capabilities ##
## ##
##########################################################################
AC_SYS_INTERPRETER
AC_SYS_LONG_FILE_NAMES
AC_SYS_RESTARTABLE_SYSCALLS
##########################################################################
## ##
## OPENLINK SOFTWARE OWN TESTS ##
## ##
##########################################################################
##########################################################################
## ##
## Default C compiler flags ##
## ##
##########################################################################
CCOPT=""
CCDEFS=""
CCWARN=""
CCDEBUG=""
CCLIBS=""
AC_CHECKING([default compiler values])
if eval "${CC-cc} $CFLAGS $AM_LDFLAGS -o binsrc/config/ccdefs binsrc/config/ccdefs.c" ; then
eval `binsrc/config/ccdefs`
fi
AC_ARG_WITH(debug, [dnl
AC_HELP_STRING([--with-debug], [debugging code])dnl
], [ with_debug="$withval" ],
[ with_debug="no" ])
if test "x$with_debug" = "xyes"; then
changequote({,})
CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9s]*//g'`
CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9s]*//g'`
changequote([,])
CCOPT="-g"
AM_LDFLAGS="-g"
CCDEBUG=""
else
AM_LDFLAGS="-s"
fi
#AC_CHECKING(for suspicious C compiler)
#AC_TRY_COMPILE([ ], [struct { long l; void *d; } *x;
# (char *) x += 1; ], [ ] , [CCDEFS="$CCDEFS -DSUSPICIOUS_C_COMPILER"])
AC_SUBST(CCDEBUG)
AC_SUBST(CCWARN)
AC_SUBST(CCDEFS)
AC_SUBST(CCOPT)
AC_SUBST(CCLIBS)
AC_MSG_CHECKING([for uuid_t])
AC_TRY_COMPILE(
[
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
],
[
uuid_t x;
],
[
AC_DEFINE(UUID_T_DEFINED, 1, [Define to 1 if you have uuid_t defined])
AC_MSG_RESULT([yes])
],
[
AC_MSG_RESULT([no])
])
##########################################################################
## ##
## Configure Virtuoso extensions ##
## ##
##########################################################################
AC_SUBST(BUILD_OPTS)
BUILD_OPTS=""
srvrlibs=""
clntlibs=""
AC_ARG_ENABLE(xml, [dnl
AC_HELP_STRING([--enable-xml], [enable XML extension (default)])
AC_HELP_STRING([--disable-xml], [disable XML extension])dnl
], [
case "${enableval}" in
yes) with_xml="yes";;
no) AC_MSG_ERROR(Xml extension required for Virtuoso) ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-xml) ;;
esac
],
[ with_xml="yes" ]
)
if test "$with_xml" = "yes"; then
BUILD_OPTS="$BUILD_OPTS xml"
AC_DEFINE(BIF_XML, 1, [XML support])
libxml_file=$LIBDIR/libxml.la
ccincl="$ccincl -I$TOP/libsrc/Xml.new"
fi
AC_SUBST(libxml_file)
AC_SUBST(CCOPT)
##########################################################################
# #
# Kerberos client #
# #
##########################################################################
AC_ARG_ENABLE(krb, [dnl
AC_HELP_STRING([--enable-krb(=DIR)], [enable Kerberos extension])
AC_HELP_STRING([--disable-krb], [disable Kerberos extension (default)])dnl
], [
case "${enableval}" in
yes) with_krb="yes";;
no) with_krb="no";;
/*) with_krb="${enableval}";;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-krb) ;;
esac
],
[ with_krb="no" ]
)
if test "$with_krb" != "no"; then
libkrb="-lkrb5 -lcom_err -lgssapi_krb5 -lk5crypto -lkrb5"
krbinc=""
if test "$with_krb" != "yes"; then
libkrb="-L$with_krb/lib $libkrb"
krbinc="-I$with_krb/include"
fi
AC_CHECK_LIB(krb5,krb5_init_context,
[
with_krb="yes"
],
[
with_krb="no"
],
[ $libkrb ])
fi
if test "$with_krb" != "no"; then
save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$krbinc $CPPFLAGS"
AC_CHECK_HEADERS(krb5.h gssapi/gssapi.h gssapi/gssapi_generic.h gssapi/gssapi_krb5.h,,
[
with_krb="no"
])
CPPFLAGS=$save_CPPFLAGS
fi
if test "$with_krb" != "no"; then
AC_DEFINE(_KERBEROS, 1, "Kerberos support")
AC_DEFINE(GSSAPI, 1, "Kerberos mode")
BUILD_OPTS="$BUILD_OPTS krb"
if test "$with_krb" != "yes"; then
ccincl="$ccincl -I$with_krb/include"
fi
srvrlibs="$srvrlibs $libkrb"
fi
AM_CONDITIONAL(WITH_KERBEROS, test "x$with_krb" != "xno" )
##########################################################################
# #
# OpenSSL #
# #
##########################################################################
AC_ARG_ENABLE(openssl, [dnl
AC_HELP_STRING([--enable-openssl(=DIR)], [enable OpenSSL support (default)])
AC_HELP_STRING([--disable-openssl], [disable OpenSSL support])dnl
], [
case "${enableval}" in
yes) openssl_dir="/usr" ;;
no) openssl_dir="no" ;;
/*) openssl_dir="${enableval}" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-openssl) ;;
esac
],
[ openssl_dir="/usr" ]
)
if test "x$openssl_dir" = "xno"
then
openssl_VERSION=""
openssl_CFLAGS=""
openssl_LDFLAGS=""
elif test "x$openssl_dir" = "x/usr"
then
openssl_VERSION=`openssl version`
openssl_CFLAGS=""
openssl_LDFLAGS="-lssl -lcrypto"
else
openssl_VERSION=`$openssl_dir/bin/openssl version`
openssl_CFLAGS="-I$openssl_dir/include"
openssl_LDFLAGS="-L$openssl_dir/lib -lssl -lcrypto"
fi
if test "$with_krb" = "no"
then
openssl_CFLAGS="$openssl_CFLAGS -DOPENSSL_NO_KRB5"
fi
if test "x$openssl_dir" != "xno"
then
save_CFLAGS="$CFLAGS"
save_LIBS="$LIBS"
CFLAGS="$CFLAGS $openssl_CFLAGS"
LIBS="$LIBS $openssl_LDFLAGS"
case $host in
*-solaris*)
LIBS="$LIBS -lsocket"
;;
*-sunos*)
LIBS="$LIBS -lsocket"
;;
*-linux*)
LIBS="$LIBS -ldl -lpthread"
;;
esac
AC_MSG_CHECKING([OpenSSL version])
AC_TRY_COMPILE([
#include <openssl/opensslv.h>
], [
#if OPENSSL_VERSION_NUMBER < 0x0090801fL
#error OpenSSL version too old
#endif
],[
AC_MSG_RESULT([>= 0.9.8e])
],[
AC_MSG_ERROR([OpenSSL version 0.9.8e or greater is required.])
])
AC_MSG_CHECKING([OpenSSL version])
AC_TRY_COMPILE([
#include <openssl/opensslv.h>
],[
#ifdef LIBRESSL_VERSION_NUMBER
/* LibreSSL defines OPENSSL_VERSION_NUMBER 0x20000000L but uses a compatible API to OpenSSL v1.0.x */
#elif OPENSSL_VERSION_NUMBER < 0x1020000fL
/* OpenSSL versions 0.9.8e - 1.1.1 are supported */
#elif OPENSSL_VERSION_NUMBER < 0x30400000L
/* OpenSSL versions 3.0.x - 3.3.x are supported */
#else
#error OpenSSL version too new
#endif
],[
AC_MSG_RESULT([$openssl_VERSION is supported])
],[
AC_MSG_ERROR([$openssl_VERSION is currently not supported.])
])
AC_MSG_CHECKING([usability of the OpenSSL header files and library in ${openssl_dir}])
AC_TRY_RUN([
#include <openssl/rsa.h>
#include <openssl/crypto.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/bio.h>
#include <openssl/asn1.h>
#include <openssl/pkcs12.h>
#include <openssl/rand.h>
#include <stdio.h>
#include <string.h>
int
main ()
{
SSL_METHOD *ssl_server_method = NULL;
SSL_CTX *ssl_server_ctx = NULL;
unsigned char tmp[1024];
SSL_load_error_strings();
ERR_load_X509_strings();
ERR_load_PKCS12_strings();
#ifndef WIN32
RAND_bytes (tmp, sizeof(tmp));
RAND_add (tmp, sizeof(tmp), (double)(sizeof(tmp)));
#endif
SSLeay_add_ssl_algorithms();
PKCS12_PBE_add ();
ssl_server_method = SSLv23_client_method();
ssl_server_ctx = SSL_CTX_new (ssl_server_method);
if (!ssl_server_ctx)
{
ERR_print_errors_fp(stderr);
return(-1);
}
return 0;
}],
[
AC_MSG_RESULT(good)
BUILD_OPTS="$BUILD_OPTS ssl"
ccincl="$ccincl $openssl_CFLAGS"
srvrlibs="$srvrlibs $openssl_LDFLAGS"
clntlibs="$clntlibs $openssl_LDFLAGS"
AC_DEFINE(_SSL, 1, [OpenSSL])
],
[
AC_MSG_ERROR([bad. Check config.log for details])
])
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
fi
AC_SUBST(openssl_CFLAGS)
AC_SUBST(openssl_LDFLAGS)
##########################################################################
# #
# OpenLDAP #
# #
##########################################################################
AC_ARG_ENABLE(openldap, [dnl
AC_HELP_STRING([--enable-openldap(=DIR)], [enable OpenLDAP support (default)])
AC_HELP_STRING([--disable-openldap], [disable OpenLDAP support])dnl
], [
case "${enableval}" in
yes) with_ldap="yes" ;;
no) with_ldap="no" ;;