forked from yath/cvsnt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
978 lines (877 loc) · 28.9 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
dnl configure.in for cvs
AC_INIT([cvsnt],[0],[tmh@nodomain.org])
AC_PROG_CC
$CC -o version_check $srcdir/src/version_check.c
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE($PACKAGE_NAME, `./version_check`)
AC_PREREQ(2.59)
AM_CONFIG_HEADER(config.h src/options.h)
AC_CONFIG_SRCDIR(config.h.in)
AC_CONFIG_MACRO_DIR([m4])
AM_MAINTAINER_MODE
AC_PROG_AWK
AC_PROG_CXX
AC_PROG_CPP
AC_REQUIRE_CPP
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_YACC
AC_PROG_LN_S
AC_DISABLE_STATIC
AX_CC_MAXOPT
CFLAGS="$CFLAGS $OPTFLAGS"
CXXFLAGS="$CXXFLAGS $OPTFLAGS"
LT_INIT([dlopen])
LTDL_INIT([recursive])
AC_SUBST(INCLTDL)
AC_SUBST(LIBLTDL)
AC_DEFINE_UNQUOTED(OS_VERSION,"$target_os",[Operating system version])
# FHS isn't really compatible with GNU, but we prefer FHS generally since the
# primary target is Linux - also many linux distros don't even *have* a /usr/etc
#
if test "$prefix" = "/usr" -o "$prefix" = "NONE"; then
if test "$sysconfdir" = "\${prefix}/etc"; then
sysconfdir="/etc"
fi
fi
# If Visibility support is available switch that on, to reduce the exported
# symbol space.
AC_ARG_ENABLE(visibility,
[ --enable-visibility Enable gcc visibility options],
[],
[enable_visibility="yes"])
if test x$enable_visibility = xyes; then
AC_MSG_CHECKING(whether GNUC visibility support)
AC_CACHE_VAL(ac_cv_fvisibility_ok,
[ac_save_cc="$CC"
CC="$CC -fvisibility=hidden"
AC_TRY_RUN([int main() { return 0; }],
ac_cv_fvisibility_ok=yes,
ac_cv_fvisibility_ok=no,
ac_cv_fvisibility_ok=no)
CC="$ac_save_cc"])
AC_MSG_RESULT($ac_cv_fvisibility_ok)
if test $ac_cv_fvisibility_ok = yes; then
AC_MSG_CHECKING(for GNUC visibility attribute)
GLIB_CHECK_COMPILE_WARNINGS([
void
__attribute__ ((visibility ("hidden")))
f_hidden (void)
{
}
void
__attribute__ ((visibility ("default")))
f_default (void)
{
}
int main (int argc, char **argv)
{
f_hidden();
f_default();
return 0;
}
],g_have_gnuc_visibility=yes,g_have_gnuc_visibility=no)
AC_MSG_RESULT($g_have_gnuc_visibility)
if test x$g_have_gnuc_visibility = xyes; then
AC_DEFINE(HAVE_GCC_VISIBILITY, 1, [supports GCC visibility attributes])
CFLAGS="$CFLAGS -fvisibility=hidden"
CXXFLAGS="$CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
fi
fi
fi
fi
dnl FIXME This is truly gross.
missing_dir=`cd $ac_aux_dir && pwd`
dnl FIXME I pulled this default list from sanity.sh. Perhaps these lists
dnl can be stored in one location?
glocs="$PATH:/usr/local/bin:/usr/contrib/bin:/usr/gnu/bin:/local/bin:/local/gnu/bin:/gnu/bin"
AC_PATH_PROGS(ROFF, groff roff, $missing_dir/missing roff, $glocs)
AC_PATH_PROG(PS2PDF, ps2pdf, $missing_dir/missing ps2pdf)
AC_PATH_PROG(TEXI2DVI, texi2dvi, $missing_dir/missing texi2dvi)
AC_SYS_INTERPRETER
if test X"$ac_cv_sys_interpreter" != X"yes" ; then
# silly trick to avoid problems in AC macros...
ac_msg='perl scripts using #! may not be invoked properly'
AC_MSG_WARN($ac_msg)
fi
AC_DEFINE_UNQUOTED(CVSNT_TARGET_CPU, ["$target_cpu"],[Define target_cpu])
AC_DEFINE_UNQUOTED(CVSNT_TARGET_VENDOR,["$target_vendor"],[Define target_vendor])
AC_DEFINE_UNQUOTED(CVSNT_TARGET_OS,["$target_os"],[Define target_os])
AC_DEFINE(_GNU_SOURCE,1,[Defined to enable GNU extensions])
AC_DEFINE(_LARGEFILE_SOURCE,1,[Defined to enable large files on some systems])
# BSD's logo is a devil for a reason, hey?
AC_CACHE_CHECK(for BSD VPATH bug in make, ccvs_cv_bsd_make_vpath_bug,
[if test ! -d ac_test_dir ; then
AC_TRY_COMMAND([mkdir ac_test_dir])
fi
cat >conftestmake <<EOF
VPATH = ac_test_dir
ac_test_target: ac_test_dep
echo BSD VPATH bug present >&2
ac_test_dep: ac_test_dep_dep
EOF
touch ac_test_dir/ac_test_dep_dep
touch ac_test_dir/ac_test_dep
touch ac_test_target
# Don't know why, but the following test doesn't work under FreeBSD 4.2
# without this sleep command
sleep 1
if AC_TRY_COMMAND([make -f conftestmake 2>&1 >/dev/null |grep ^BSD\ VPATH\ bug\ present\$ >/dev/null]) ; then
ccvs_cv_bsd_make_vpath_bug=yes
else
ccvs_cv_bsd_make_vpath_bug=no
fi
AC_TRY_COMMAND([rm -rf ac_test_dir ac_test_target conftestmake])])
# We also don't need to worry about the bug when $srcdir = $builddir
AM_CONDITIONAL(MAKE_TARGETS_IN_VPATH, \
test $ccvs_cv_bsd_make_vpath_bug = no \
|| test $srcdir = .)
AC_ISC_POSIX
if test "$ISC" = yes; then
CFLAGS="$CFLAGS -D_SYSV3"
fi
AC_ARG_WITH(ssl,
[ --with-ssl=DIRECTORY OpenSSL directory],
[CPPFLAGS="$CPPFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"]
,[])
AC_MSG_CHECKING(support for mdns)
AC_ARG_ENABLE(mdns,
[ --enable-mdns include MDNS support (default)
--disable-mdns don't include MDNS support],
[],
[enable_mdns="yes"])
AC_MSG_RESULT($enable_mdns)
if test x$enable_mdns = xyes; then
# mDNS support using Apple's Bonjour
saved_libs="$LIBS"
AC_CHECK_HEADER(dns_sd.h,
[AC_CHECK_LIB(dns_sd,
DNSServiceRegister)])
if test x$ac_cv_lib_dns_sd_DNSServiceRegister = xyes; then
DNS_SD_LIBS="$LIBS"
AC_SUBST(DNS_SD_LIBS)
AC_DEFINE(HAVE_DNS_SD, 1, [Use Bonjour/DNS-SD registration])
fi
LIBS="$saved_libs"
AM_CONDITIONAL(WITH_DNS_SD,test x$ac_cv_lib_dns_sd_DNSServiceRegister = xyes)
# mDNS support using Avahi
saved_libs="$LIBS"
AC_CHECK_HEADER(avahi-client/client.h,
[AC_CHECK_LIB(avahi-client,
avahi_client_new)])
if test x$ac_cv_lib_avahi_client_avahi_client_new = xyes; then
AVAHI_LIBS="$LIBS"
AC_SUBST(AVAHI_LIBS)
AC_DEFINE(HAVE_AVAHI, 1, [Use Avahi/DNS-SD registration])
fi
LIBS="$saved_libs"
AM_CONDITIONAL(WITH_AVAHI,test x$ac_cv_lib_avahi_client_avahi_client_new = xyes)
AM_CONDITIONAL(WITH_MINI_MDNS, true)
fi
AC_HEADER_STDC
AC_HEADER_DIRENT
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(errno.h unistd.h string.h memory.h utime.h fcntl.h ndbm.h \
limits.h sys/file.h grp.h stdio.h stdarg.h sys/un.h \
sys/param.h sys/select.h sys/time.h sys/timeb.h sys/socket.h \
io.h direct.h sys/bsdtypes.h sys/resource.h syslog.h glob.h \
paths.h getopt.h malloc.h stddef.h sys/uio.h \
security/pam_misc.h pam/pam_misc.h \
security/pam_appl.h pam/pam_appl.h \
netinet/in.h arpa/inet.h iconv.h libcharset.h locale.h localcharset.h langinfo.h \
regex.h pthread.h sys/times.h dns_sd.h \
termios.h sys/termios.h wchar.h idna.h)
AC_HEADER_STAT
AC_HEADER_TIME
AC_CHECK_SIZEOF(int,cross)
AC_CHECK_SIZEOF(long,cross)
AC_CHECK_SIZEOF(short,cross)
AC_TYPE_SIGNAL
AC_TYPE_UID_T
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_TYPE_PID_T
AC_TYPE_SOCKLEN_T
AC_CHECK_TYPES([ptrdiff_t], [], [],
[#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
#ifdef HAVE_STDDEF_H
#include <stddef.h>
#endif])
AC_CHECK_MEMBERS([struct stat.st_rdev])
AC_CHECK_MEMBERS([struct stat.st_blksize])
AC_CHECK_TYPE(ino_t,unsigned)
AC_CHECK_TYPE(loff_t,off_t)
AC_SYS_LARGEFILE
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_cv_pthread_cppflags=""
ac_cv_pthread_ldflags=""
AC_ARG_ENABLE(64bit,
[ --enable-64bit Use special flags for 64bit
--disable-64bit Use special flags for 32bit],
[],
[enable_64bit="no"])
case "${target_os}" in
solaris*)
CPPFLAGS="$CPPFLAGS -fPIC"
LDFLAGS="$LDFLAGS -lrt"
;;
darwin*)
LDFLAGS="$LDFLAGS -L`pwd`/osx"
CPPFLAGS="$CPPFLAGS -I`pwd`/cvsapi/mysql/mysql-3.23"
MSQ_LDFLAGS="-lz"
;;
*)
;;
esac
# Pass our args to subprojects
ac_configure_args="$ac_configure_args CFLAGS=\"$CFLAGS\" CXXFLAGS=\"$CXXFLAGS\" LDFLAGS=\"$LDFLAGS\" CPPFLAGS=\"$CPPFLAGS\""
dnl Special for gcc 2.95, which as a broken char_traits
AC_MSG_CHECKING([for broken char_traits])
AC_COMPILE_IFELSE(AC_LANG_SOURCE(
[#include <string>
struct test_char_traits : public std::char_traits<char>
{
static bool eq( char c1, char c2 ) { return c1==c2; }
};
]),
AC_MSG_RESULT(no),
[AC_DEFINE(char_traits,string_char_traits,[Defined to string_char_traits on gcc 2.95])
AC_MSG_RESULT(yes)])
dnl Special for gcc 2.95 - if wstring isn't there we must declare it ourselves
dnl Note that some libraries have things like __DEFINE_WSTRING macros... we don't
dnl use those as there's no standard for it
AC_MSG_CHECKING([for std::wstring])
AC_COMPILE_IFELSE(AC_LANG_SOURCE(
[#include <string>
int main(int argc, char *argv[])
{
std::wstring foo;
return 0;
}
]),
[AC_DEFINE(HAVE_WSTRING,,[Define if we have standard wstring])
AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))
AC_LANG_RESTORE
# Check for correct method of ac_copy
# Apparently from mozilla
dnl Does this platform require array notation to assign to a va_list?
dnl If cross-compiling, we assume va_list is "normal". If this breaks
dnl you, set ac_cv_valistisarray=true and maybe define HAVE_VA_LIST_AS_ARRAY
dnl also just to be sure.
AC_MSG_CHECKING(whether va_list assignments need array notation)
AC_CACHE_VAL(ac_cv_valistisarray,
[AC_TRY_RUN([#include <stdlib.h>
#include <stdarg.h>
void foo(int i, ...) {
va_list ap1, ap2;
va_start(ap1, i);
ap2 = ap1;
if (va_arg(ap2, int) != 123 || va_arg(ap1, int) != 123) { exit(1); }
va_end(ap1); va_end(ap2);
}
int main()
{ foo(0, 123); return(0); }],
[ac_cv_valistisarray=false],
[ac_cv_valistisarray=true],
[ac_cv_valistisarray=false])])
if test "$ac_cv_valistisarray" = true ; then
AC_DEFINE(HAVE_VA_LIST_AS_ARRAY,[],Defined if va_list is an array)
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
# Check for posix threads
ACX_PTHREAD([],[])
# Convert output to something that's remotely usable
PTHREAD_LIBS="$PTHREAD_CFLAGS $PTHREAD_LIBS"
PTHREAD_CPPFLAGS="$PTHREAD_CFLAGS"
AC_SUBST(PTHREAD_CPPFLAGS)
AC_SUBST(PTHREAD_LIBS)
AC_REPLACE_FUNCS(mkdir rename strstr dup2 strerror waitpid \
memmove strtoul daemon timegm getdelim getline \
ftruncate regcomp getopt_long)
AC_SEARCH_LIBS(libiconv_open, iconv_plug iconv,
[], [AC_SEARCH_LIBS(iconv_open, iconv_plug iconv)])
AC_CHECK_LIB(socket,getaddrinfo)
# Apparently the double underscore thing is a gccism (research puts it dating
# back to a HURD bug in 2002 that never got fixed).
# This line Based on gnupg configure.
AC_SEARCH_LIBS(res_query,resolv bind,,AC_SEARCH_LIBS(__res_query,resolv bind))
AC_SEARCH_LIBS(res_query, resolv)
AC_REPLACE_FUNCS(getaddrinfo getnameinfo inet_aton)
AC_CHECK_LIB(idn, idna_to_ascii_lz)
AC_PATH_PROG(XML2_CONFIG, xml2-config)
AC_MSG_CHECKING([for libxml2])
if test -x "$XML2_CONFIG"; then
LIBXML_CPPFLAGS="`$XML2_CONFIG --cflags`"
LIBXML_LIBS="`$XML2_CONFIG --libs`"
ac_cv_have_libxml="yes"
else
ac_cv_have_libxml="no"
fi
AC_MSG_RESULT($ac_cv_have_libxml)
if test x$ac_cv_have_libxml = xyes; then
AC_CHECK_LIB(xml2,[xmlSchemaValidCtxtGetParserCtxt],,[ac_cv_have_libxml=no])
fi
if test x$ac_cv_have_libxml = xno; then
AC_MSG_ERROR([requres libxml 2.7 or greater])
fi
CPPFLAGS="$CPPFLAGS $LIBXML_CPPFLAGS"
AC_SUBST(LIBXML_LIBS)
# Check for pcre posix library
saved_libs="$LIBS"
LIBS=""
AC_SEARCH_LIBS(pcre_compile, pcreposix, [AC_MSG_CHECKING([for PCRE posix library])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pcreposix.h>]], [[int i;]])],[ac_cv_have_pcre="yes"],[])
AC_MSG_RESULT($ac_cv_have_pcre)], ac_cv_have_pcre="no")
PCRE_LIBS="$LIBS"
LIBS="$saved_libs"
AC_SUBST(PCRE_LIBS)
if test x$ac_cv_have_pcre = xno; then
AC_MSG_ERROR([requires pcre])
fi
dnl Some implementations make the second argument of iconv non-const for no
dnl sane reason
AC_MSG_CHECKING([whether iconv uses const])
OLDCFLAGS="$CFLAGS"
# This is a gcc-ism but autoconf provides no other way of doing this.
CFLAGS="$CFLAGS -Werror"
AC_COMPILE_IFELSE(AC_LANG_SOURCE(
[#include <iconv.h>
int main()
{ iconv_t i; char *a="a"; size_t s; iconv(i,(const char**)&a,&s,&a,&s); return 0; }
]),
[AC_DEFINE(iconv_arg2_t,[const char **],[Second argument of iconv()])
AC_MSG_RESULT(yes)],
[AC_DEFINE(iconv_arg2_t,[char **])
AC_MSG_RESULT(no)])
CFLAGS="$OLDCFLAGS"
AC_CHECK_FUNCS(\
fchdir \
fchmod \
fsync \
ftime \
ftruncate \
getgroups \
getpagesize \
getpass \
getpassphrase \
gettimeofday \
initgroups \
mknod \
mkstemp \
mktemp \
putenv \
readlink \
sigaction \
sigblock \
sigprocmask \
sigsetmask \
sigvec \
snprintf \
tempnam \
timezone \
tzset \
vprintf \
wait3 \
strdup \
getaddrinfo \
inet_aton \
memchr \
strchr \
getopt \
iconv_open \
libiconv_open \
locale_charset \
nl_langinfo \
setlocale \
res_query
)
# we only need one of the following
AC_CHECK_FUNCS([\
nanosleep \
usleep \
select \
], [break])
AC_CHECK_FUNCS(fseeko,[AC_DEFINE(CVS_FSEEK,fseeko,[Define to OS specific seek routine])],[AC_DEFINE(CVS_FSEEK,fseek)])
AC_CHECK_FUNCS(ftello,[AC_DEFINE(CVS_FTELL,ftello,[Define to OS specific tell routine])],[AC_DEFINE(CVS_FTELL,ftell)])
dnl Mac OSX (at least) has a broken getopt(), so we don't use that
AC_MSG_CHECKING([for broken getopt()])
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <unistd.h>
int main(int argc, char *argv[])
{
optind = 0;
getopt(argc, argv, "");
return optind;
}
]])],[
AC_MSG_RESULT(yes)
AC_LIBOBJ(getopt_long)],[
AC_MSG_RESULT(no)
],[])
dnl
dnl Force lib/regex.c to use malloc instead of messing around with alloca
dnl and define the old re_comp routines that we use.
dnl
AC_DEFINE(REGEX_MALLOC,[],[Define to force lib/regex.c to use malloc instead of alloca.])
dnl
dnl AC_FUNC_FORK([]) is rather baroque. It seems to be rather more picky
dnl than, say, the Single Unix Specification (version 2), which simplifies
dnl a lot of cases by saying that the child process can't set any variables
dnl (thus avoiding problems with register allocation) or call any functions
dnl (thus avoiding problems with whether file descriptors are shared).
dnl It would be nice if we could just write to the Single Unix Specification.
dnl I think the only way to do redirection this way is by doing it in the
dnl parent, and then undoing it afterwards (analogous to windows-NT/run.c).
dnl That would appear to have a race condition if the user hits ^C (or
dnl some other signal) at the wrong time, as main_cleanup will try to use
dnl stdout/stderr. So maybe we are stuck with AC_FUNC_FORK([]).
dnl
AC_FUNC_FORK([])
AC_FUNC_CLOSEDIR_VOID
dnl
dnl Check for shadow password support.
dnl
dnl We used to try to determine whether shadow passwords were actually in
dnl use or not, but the code has been changed to work right reguardless,
dnl so we can go back to a simple check.
AC_SEARCH_LIBS(getspnam, sec gen, AC_DEFINE(HAVE_GETSPNAM,[],[Define if getspnam is supported]))
AC_FUNC_UTIME_NULL
AC_SYS_LONG_FILE_NAMES
AC_FUNC_FNMATCH
if test "$ac_cv_func_fnmatch_works" = no; then
AC_LIBOBJ(fnmatch)
fi
# Try to find connect and gethostbyname.
AC_CHECK_LIB(nsl, main,
AC_SEARCH_LIBS(connect, xnet socket inet, AC_DEFINE(HAVE_CONNECT,[],[Define if connect is supported]),, -lnsl),
AC_SEARCH_LIBS(connect, xnet socket inet, AC_DEFINE(HAVE_CONNECT,[],[Define if connect is supported])))
AC_SEARCH_LIBS(gethostbyname, netinet nsl)
AC_CHECK_FUNC(gethostname, ,[AC_LIBOBJ([hostname])])
saved_libs="$LIBS"
LIBS=""
AC_SEARCH_LIBS(zlibVersion, z, [AC_MSG_CHECKING([for zlib > 1.2.0])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <zlib.h>]], [[z_stream z; deflateBound(&z,99);]])],[ac_cv_have_zlib="yes"],[ac_cv_have_zlib="no"
LIBS="$saved_libs"])
AC_MSG_RESULT($ac_cv_have_zlib)], ac_cv_have_zlib="no")
ZLIB_LIBS="$LIBS"
LIBS="$saved_libs"
AC_SUBST(ZLIB_LIBS)
if test x$ac_cv_have_zlib = xno; then
AC_MSG_ERROR([requires zlib > 1.2.0])
fi
AM_CONDITIONAL(WITH_MDNS, test "$enable_mdns" = "yes")
if test "$enable_mdns" = "yes"; then
AC_DEFINE(HAVE_MDNS, [], Defined if MDNS is available)
fi
AC_MSG_CHECKING(support for sqlite)
AC_ARG_ENABLE(sqlite,
[ --enable-sqlite include SQLite support if available (default)
--disable-sqlite don't include SQLite support],
[],
[enable_sqlite="yes"])
AC_MSG_RESULT($enable_sqlite)
saved_libs="$LIBS"
LIBS=""
if test "$enable_sqlite" = "yes" ; then
AC_SEARCH_LIBS(sqlite3_open, sqlite3, [AC_MSG_CHECKING([for sqlite])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#ifdef HAVE_SQLITE3_H
#include <sqlite3.h>
#endif]], [[sqlite3_open(0,0);]])],[ac_cv_have_sqlite="yes"],[ac_cv_have_sqlite="no"
LIBS="$saved_libs"])
AC_MSG_RESULT($ac_cv_have_sqlite)],
ac_cv_have_sqlite="no")
else
ac_cv_have_sqlite="no"
fi
AM_CONDITIONAL(WITH_SQLITE, test "$ac_cv_have_sqlite" = "yes")
if test "$ac_cv_have_sqlite" = "yes"; then
AC_DEFINE(HAVE_SQLITE, [], Defined if SQLite is available)
fi
SQLITE_LIBS="$LIBS"
AC_SUBST(SQLITE_LIBS)
LIBS="$saved_libs"
AC_MSG_CHECKING(support for mysql 3.23)
AC_ARG_ENABLE(mysql,
[ --enable-mysql include mysql 3.23 support if available (default)
--disable-mysql don't include mysql support],
[],
[enable_mysql="yes"])
AC_MSG_RESULT($enable_mysql)
# Redhat has a broken mysql_config that puts quotes around everything...
# since gcc doesn't understand the quotes it means nothing works.
if test "$enable_mysql" = "yes"; then
# Check for mysql via mysql_config
AC_PATH_PROG(MYSQL_CONFIG, mysql_config)
if test -x "$MYSQL_CONFIG"; then
CPPFLAGS="$CPPFLAGS `$MYSQL_CONFIG --cflags | tr -d \'`"
MSQ_LDFLAGS="`$MYSQL_CONFIG --libs | tr -d \'`"
fi
fi
saved_libs="$LIBS"
LIBS="$MSQ_LDFLAGS"
if test "$enable_mysql" = "yes"; then
AC_SEARCH_LIBS(mysql_init, mysqlclient, [AC_MSG_CHECKING([for mysql])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#ifdef HAVE_MYSQL_H
#include <mysql.h>
#endif
#if (defined(MYSQL_VERSION_ID)) && (MYSQL_VERSION_ID >= 40000)
generate_an_error!!!
#endif
]], [[mysql_init(0);]])],[ac_cv_have_mysql="yes"],[ac_cv_have_mysql="no"
LIBS="$saved_libs"])
AC_MSG_RESULT($ac_cv_have_mysql)],
ac_cv_have_mysql="no")
else
ac_cv_have_mysql="no"
fi
AM_CONDITIONAL(WITH_MYSQL, test "$ac_cv_have_mysql" = "yes")
if test "$ac_cv_have_mysql" = "yes"; then
AC_DEFINE(HAVE_MYSQL, [] ,Defined if Mysql 3.23 is available)
fi
MYSQL_LIBS="$LIBS"
AC_SUBST(MYSQL_LIBS)
LIBS="$saved_libs"
AC_MSG_CHECKING(support for ODBC)
AC_ARG_ENABLE(odbc,
[ --enable-odbc include ODBC support if available (default)
--disable-odbc don't include ODBC support],
[],
[enable_odbc="yes"])
AC_MSG_RESULT($enable_odbc)
saved_libs="$LIBS"
LIBS=""
if test "$enable_odbc" = "yes"; then
AC_SEARCH_LIBS(SQLConnect, odbc iodbc, [AC_MSG_CHECKING([for ODBC])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sql.h>]], [[SQLConnect(0,0,0,0,0,0,0);]])],[ac_cv_have_odbc="yes"],[ac_cv_have_odbc="no"
LIBS="$saved_libs"])
AC_MSG_RESULT($ac_cv_have_odbc)],
ac_cv_have_odbc="no")
else
ac_cv_have_odbc="no"
fi
AM_CONDITIONAL(WITH_ODBC, test "$ac_cv_have_odbc" = "yes")
if test "$ac_cv_have_odbc" = "yes"; then
AC_DEFINE(HAVE_ODBC, [], Defined if ODBC is available)
fi
ODBC_LIBS="$LIBS"
AC_SUBST(ODBC_LIBS)
LIBS="$saved_libs"
#oracle_directory=$ORACLE_HOME
#AC_ARG_WITH(oracle,
#[ --with-oracle=DIRECTORY ORACLE_HOME directory],
#[oracle_directory="$withval"]
#,[])
#AC_MSG_CHECKING(support for Oracle)
#AC_ARG_ENABLE(oracle,
#[ --enable-oracle include Oracle support if available (default)
# --disable-oracle don't include Oracle support],
#[],
#[enable_oracle="yes"])
#AC_MSG_RESULT($enable_oracle)
#saved_libs="$LIBS"
#LIBS=""
#if test "$enable_oracle" = "yes"; then
# LDFLAGS="$LDFLAGS -L$oracle_directory/lib"
# CPPFLAGS="$CPPFLAGS -I$oracle_directory/rdbms/public -I$oracle_directory/rdbms/demo"
# AC_SEARCH_LIBS(OCIInitialize, clntsh, [AC_MSG_CHECKING([for Oracle OCI])
# AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <oci.h>]], [[OCIInitialize(0,0,0,0,0);]])],[ac_cv_have_oracle="yes"],[ac_cv_have_oracle="no"
# LIBS="$saved_libs"])
# AC_MSG_RESULT($ac_cv_have_oracle)],
# ac_cv_have_oracle="no")
#else
# ac_cv_have_oracle="no"
#fi
#AM_CONDITIONAL(WITH_ORACLE, test "$ac_cv_have_oracle" = "yes")
#if test "$ac_cv_have_oracle" = "yes"; then
# AC_DEFINE(HAVE_ORACLE, [], Defined if Oracle is available)
#fi
#ORACLE_LIBS="$LIBS"
#AC_SUBST(ORACLE_LIBS)
#LIBS="$saved_libs"
AC_MSG_CHECKING(support for Postgres)
AC_ARG_ENABLE(postgres,
[ --enable-postgres include postgres support if available (default)
--disable-postgres don't include postgres support],
[],
[enable_postgres="yes"])
AC_MSG_RESULT($enable_postgres)
if test "$enable_postgres" = "yes"; then
# Check for postgres via pg_config
AC_PATH_PROG(PG_CONFIG, pg_config)
if test -x "$PG_CONFIG"; then
CPPFLAGS="$CPPFLAGS -I`$PG_CONFIG --includedir`"
PG_LDFLAGS="-L`$PG_CONFIG --libdir`"
fi
fi
saved_libs="$LIBS"
LIBS="$PG_LDFLAGS"
if test "$enable_postgres" = "yes"; then
AC_SEARCH_LIBS(PQconnectdb, pq, [AC_MSG_CHECKING([for Postgres])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <libpq-fe.h>]], [[PQconnectdb(0);]])],[ac_cv_have_postgres="yes"],[ac_cv_have_postgres="no"
LIBS="$saved_libs"])
AC_MSG_RESULT($ac_cv_have_postgres)],
ac_cv_have_postgres="no")
else
ac_cv_have_postgres="no"
fi
AM_CONDITIONAL(WITH_POSTGRES, test "$ac_cv_have_postgres" = "yes")
if test "$ac_cv_have_postgres" = "yes"; then
AC_DEFINE(HAVE_POSTGRES, [], Defined if Postgres is available)
fi
POSTGRES_LIBS="$LIBS"
AC_SUBST(POSTGRES_LIBS)
LIBS="$saved_libs"
# Check for additional headers
AC_CHECK_HEADERS(sqlite3.h mysql.h libpq-fe.h sql.h sqlext.h)
AC_MSG_CHECKING([support for Mac HFS])
AC_ARG_ENABLE(hfs,
[ --enable-hfs include mac HFS support if available (default))
--disable-hfs don't include mac HFS support])
case $host_os in
darwin*)
if test "x$enable_hfs" != "xno"; then
acx_mac_hfs_support="yes"
else
acx_mac_hfs_support="no"
fi
;;
*)
acx_mac_hfs_support="no";
;;
esac
if test "x$acx_mac_hfs_support" = "xyes"; then
LIBS="$LIBS -framework CoreServices -framework ApplicationServices"
AC_DEFINE(MAC_HFS_STUFF,[],[Support for Mac HFS filesystem])
fi
AM_CONDITIONAL(WITH_MAC_HFS_SUPPORT, test "x$acx_mac_hfs_support" = "xyes" )
AC_MSG_RESULT($acx_mac_hfs_support)
saved_libs="$LIBS"
LIBS=""
ACX_WITH_GSSAPI
GSSAPI_LIBS="$LIBS"
AC_SUBST(GSSAPI_LIBS)
LIBS="$saved_libs"
saved_libs="$LIBS"
LIBS=""
AC_SEARCH_LIBS(ERR_get_error,crypto libeay32)
AC_SEARCH_LIBS(SSL_CTX_new, ssl ssleay32, [AC_MSG_CHECKING([for openssl])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <openssl/ssl.h>]], [[int i;]])],[ac_cv_have_ssl="yes"],[])
AC_MSG_RESULT($ac_cv_have_ssl)], ac_cv_have_ssl="no")
SSL_LIBS="$LIBS"
AC_SUBST(SSL_LIBS)
LIBS="$saved_libs"
AC_CHECK_HEADER(security/pam_appl.h)
AC_CHECK_HEADER(pam/pam_appl.h)
saved_libs="$LIBS"
LIBS=""
AC_SEARCH_LIBS(pam_open_session, pam,
[if test x$ac_cv_security_pam_appl_h=xyes -o x$ac_cv_pam_pam_appl_h=xyes; then
ac_cv_have_pam="yes"
fi],
[ac_cv_have_pam="no"])
PAM_LIBS="$LIBS"
AC_SUBST(PAM_LIBS)
LIBS="$saved_libs"
AC_MSG_CHECKING([for PAM availability])
AC_MSG_RESULT($ac_cv_have_pam)
AC_CHECK_LIB(crypt,crypt)
AC_ARG_WITH(config_dir,
[ --with-config-dir=DIRECTORY
Directory for config files (default SYSCONFDIR/cvsnt)],
cvs_config_dir=$withval,
cvs_config_dir="${sysconfdir}/cvsnt")
AC_SUBST(cvs_config_dir)
AC_ARG_WITH(protocol_dir,
[ --with-protocol-dir=DIRECTORY
Directory for protocol libraries (default LIBDIR/cvsnt)],
cvs_library_dir=$withval,
cvs_library_dir="${libdir}/cvsnt")
AC_SUBST(cvs_library_dir)
AC_MSG_CHECKING(support for PAM)
AC_ARG_ENABLE(pam,
[ --enable-pam include PAM support if available (default))
--disable-pam don't include PAM support],
[if test "$enable_pam" = "yes"; then
if test "$ac_cv_have_pam" = "yes"; then
AC_DEFINE(HAVE_PAM,,[Support for PAM authentication])
else
enable_pam="no"
fi
fi],
[if test "$ac_cv_have_pam" != "no"; then
AC_DEFINE(HAVE_PAM,,[Support for PAM authentication])
enable_pam="yes"
else
enable_pam="no"
fi])
AC_MSG_RESULT($enable_pam)
AM_CONDITIONAL(WITH_PAM, test "$enable_pam" = "yes")
AC_MSG_CHECKING(support for server)
AC_ARG_ENABLE(server,
[ --enable-server include code for running as a server (default)
--disable-server don't include server code],
[if test "$enable_server" = yes; then
AC_DEFINE(SERVER_SUPPORT,[],[Support CVS remote server])
fi],
[if test "$ac_cv_search_connect" != no; then
AC_DEFINE(SERVER_SUPPORT,[],[Support CVS remote server])
enable_server="yes"
fi])
AC_MSG_RESULT($enable_server)
AM_CONDITIONAL(INSTALL_SERVER, test "$enable_server" = "yes")
AC_MSG_CHECKING(support for pserver protocol)
AC_ARG_ENABLE(pserver,
[ --enable-pserver Enable :pserver: protocol (default)
--disable-pserver Disable :pserver: protocol],
acx_pserver=$enableval,
acx_pserver="yes")
AM_CONDITIONAL(PSERVER_PROTOCOL_SUPPORT, test "$acx_pserver" = "yes")
if test x$acx_pserver = xyes; then
AC_DEFINE(PSERVER_PROTOCOL_SUPPORT, [], [Support for :pserver:])
fi
AC_MSG_RESULT($acx_pserver)
AC_MSG_CHECKING(support for ext protocol)
AC_ARG_ENABLE(ext,
[ --enable-ext Enable :ext: protocol (default)
--disable-ext Disable :ext: protocol],
acx_ext=$enableval,
acx_ext="yes")
AM_CONDITIONAL(EXT_PROTOCOL_SUPPORT, test "$acx_ext" = "yes")
if test x$acx_ext = xyes; then
AC_DEFINE(EXT_PROTOCOL_SUPPORT, [], [Support for :ext:])
fi
AC_MSG_RESULT($acx_ext)
AC_MSG_CHECKING(support for fork protocol)
AC_ARG_ENABLE(fork,
[ --enable-fork Enable :fork: protocol
--disable-fork Disable :fork: protocol (default)],
acx_fork=$enableval,
acx_fork="no")
AM_CONDITIONAL(FORK_PROTOCOL_SUPPORT, test "$acx_fork" = "yes")
if test x$acx_fork = xyes; then
AC_DEFINE(FORK_PROTOCOL_SUPPORT, [], [Support for :fork:])
fi
AC_MSG_RESULT($acx_fork)
AC_MSG_CHECKING(support for rsh server protocol)
AC_ARG_ENABLE(rsh,
[ --enable-rsh Enable rsh :server: protocol (default)
--disable-rsh Disable rsh :server: protocol],
acx_rsh=$enableval,
acx_rsh="yes")
AM_CONDITIONAL(SERVER_PROTOCOL_SUPPORT, test "$acx_rsh" = "yes")
if test x$acx_rsh = xyes; then
AC_DEFINE(SERVER_PROTOCOL_SUPPORT, [], [Support for :server:])
fi
AC_MSG_RESULT($acx_rsh)
AC_MSG_CHECKING(support for gserver protocol)
AC_ARG_ENABLE(gserver,
[ --enable-gserver Enable :gserver: protocol (default)
--disable-gserve Disable :gserver: protocol],
acx_gserver=$enableval,
[if test "x$acx_gssapi_cv_gssapi" = "xno"; then
acx_gserver="no"
else
acx_gserver="yes"
fi])
AM_CONDITIONAL(GSERVER_PROTOCOL_SUPPORT, test "$acx_gserver" = "yes")
if test x$acx_gserver = xyes; then
AC_DEFINE(GSERVER_PROTOCOL_SUPPORT, [], [Support for :gserver:])
fi
AC_MSG_RESULT($acx_gserver)
AC_MSG_CHECKING(support for sserver protocol)
AC_ARG_ENABLE(sserver,
[ --enable-sserver Enable :sserver: protocol (default)
--disable-sserver Disable :sserver: protocol],
acx_sserver=$enableval,
[if test "$ac_cv_have_ssl" = yes; then
acx_sserver="yes"
else
acx_sserver="no"
fi])
AM_CONDITIONAL(SSERVER_PROTOCOL_SUPPORT, test $acx_sserver = "yes")
if test x$acx_sserver = xyes; then
AC_DEFINE(SSERVER_PROTOCOL_SUPPORT, [], [Support for :sserver:])
fi
AC_MSG_RESULT($acx_sserver)
#AC_MSG_CHECKING(support for sync protocol)
#AC_ARG_ENABLE(sync,
#[ --enable-sync Enable server synchronisation protocol (default)
# --disable-sync Disable server synchronisation protocol],
# acx_sync=$enableval,
#[if test "$ac_cv_have_ssl" = yes; then
# acx_sync="yes"
# else
# acx_sync="no"
#fi])
#AM_CONDITIONAL(SYNC_PROTOCOL_SUPPORT, test $acx_sync = "yes")
#if test x$acx_sync = xyes; then
# AC_DEFINE(SYNC_PROTOCOL_SUPPORT, [], [Support for server synchronisation])
#fi
#AC_MSG_RESULT($acx_sync)
AC_MSG_CHECKING(support for sspi protocol)
AC_ARG_ENABLE(sspi,
[ --enable-sspi Enable :sspi: protocol (default)
--disable-sspi Disable :sspi: protocol],
acx_sspi=$enableval,
acx_sspi="yes")
AM_CONDITIONAL(SSPI_PROTOCOL_SUPPORT, test $acx_sspi = "yes")
if test x$acx_sspi = xyes; then
AC_DEFINE(SSPI_PROTOCOL_SUPPORT, [], [Support for :sspi:])
AC_CONFIG_SUBDIRS(protocols/ntlm)
fi
AC_MSG_RESULT($acx_sspi)
AC_MSG_CHECKING(support for enum protocol)
AC_ARG_ENABLE(sspi,
[ --enable-enum Enable :enum: protocol (default)
--disable-enum Disable :enum: protocol],
acx_enum=$enableval,
acx_enum="yes")
AM_CONDITIONAL(ENUM_PROTOCOL_SUPPORT, test $acx_enum = "yes")
if test x$acx_enum = xyes; then
AC_DEFINE(ENUM_PROTOCOL_SUPPORT, [], [Support for remote enumerationi protocol])
fi
AC_MSG_RESULT($acx_enum)
AC_MSG_CHECKING(whether to compile RCS tools)
AC_ARG_ENABLE(rcs,
[ --enable-rcs Enable RCS compatibility tools
--disable-rcs Disable RCS compatibility tools (default)],
acx_rcs=$enableval, acx_rcs="no")
AM_CONDITIONAL(WITH_RCSTOOLS, test "$acx_rcs" = "yes")
AC_MSG_RESULT($acx_rcs)
test -f src/options.h && (
AC_MSG_WARN(saving ./src/options.h in ./src/options.h-SAVED)
AC_MSG_WARN(You may wish to check that local options have not been lost.)
AC_MSG_WARN(Do not re-run ./configure or ./config.status until you have....)
cp ./src/options.h ./src/options.h-SAVED
)
AC_CONFIG_FILES([Makefile \
diff/Makefile \
lib/Makefile \
cvsgui/Makefile \
cvsdelta/Makefile \
man/Makefile \
src/Makefile \
protocols/Makefile \
triggers/Makefile \
lockservice/Makefile \
rcs/Makefile \
cvsapi/Makefile \
cvsapi/db/Makefile \
cvsapi/mdns/Makefile \
cvstools/Makefile \
xdiff/Makefile \
mdnsclient/Makefile \
run_script/Makefile \
redhat/cvsnt.spec \
osx/Makefile])
AC_OUTPUT