-
Notifications
You must be signed in to change notification settings - Fork 176
/
configure.ac
1816 lines (1601 loc) · 60.7 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
dnl Licensed to the Apache Software Foundation (ASF) under one
dnl or more contributor license agreements. See the NOTICE file
dnl distributed with this work for additional information
dnl regarding copyright ownership. The ASF licenses this file
dnl to you under the Apache License, Version 2.0 (the
dnl "License"); you may not use this file except in compliance
dnl with the License. You may obtain a copy of the License at
dnl
dnl http://www.apache.org/licenses/LICENSE-2.0
dnl
dnl Unless required by applicable law or agreed to in writing,
dnl software distributed under the License is distributed on an
dnl "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
dnl KIND, either express or implied. See the License for the
dnl specific language governing permissions and limitations
dnl under the License.
dnl configure.ac: Autoconfiscation for Subversion
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
dnl Get the version of Subversion, using m4's esyscmd() command to do this
dnl at m4-time, since AC_INIT() requires it then.
AC_INIT([subversion],
[esyscmd($PYTHON build/getversion.py SVN subversion/include/svn_version.h)],
[https://subversion.apache.org/])
AC_CONFIG_SRCDIR(subversion/include/svn_types.h)
AC_CONFIG_AUX_DIR([build])
AC_MSG_NOTICE([Configuring Subversion ]AC_PACKAGE_VERSION)
AC_SUBST([abs_srcdir], ["`cd $srcdir && pwd`"])
AC_SUBST([abs_builddir], ["`pwd`"])
if test "$abs_srcdir" = "$abs_builddir"; then
canonicalized_srcdir=""
else
canonicalized_srcdir="$srcdir/"
fi
AC_SUBST([canonicalized_srcdir])
SWIG_LDFLAGS="$LDFLAGS"
AC_SUBST([SWIG_LDFLAGS])
# Generate config.nice early (before the arguments are munged)
SVN_CONFIG_NICE(config.nice)
# ==== Check for programs ====================================================
# Look for a C compiler (before anything can set CFLAGS)
CUSERFLAGS="$CFLAGS"
AC_PROG_CC
SVN_CC_MODE_SETUP
# Look for a C++ compiler (before anything can set CXXFLAGS)
CXXUSERFLAGS="$CXXFLAGS"
AC_PROG_CXX
dnl Select C++ language level for GNU-like compilers
dnl This is an advanced option for maintainers
AC_ARG_ENABLE([c++],
AS_HELP_STRING([--enable-c++=VER],
[Select C++ language standard for g++-like compilers]),
[
if test "$enableval" = "yes"; then
cxx_language_level=any
elif test "$enableval" = "no"; then
cxx_language_level=any
AC_MSG_WARN([--disable-c++ has no effect])
else
case "$enableval" in
[c++[0-9]*]) cxx_language_level="$enableval";;
[gnu++[0-9]*]) cxx_language_level="$enableval";;
[[0-9]*]) cxx_language_level="c++$enableval";;
[*]) cxx_language_level=undefined;;
esac
if test "$cxx_language_level" = undefined; then
AC_MSG_ERROR([--enable-c++ does not accept $enableval])
fi
fi
],
[
cxx_language_level=any
])
SVN_CXX_MODE_SETUP
# Look for a C pre-processor
AC_PROG_CPP
# Look for a good sed
# AC_PROG_SED was introduced in Autoconf 2.59b
m4_ifdef([AC_PROG_SED], [AC_PROG_SED], [SED="${SED:-sed}"])
# Grab target_cpu, so we can use it in the Solaris pkginfo file
AC_CANONICAL_TARGET
# Look for an extended grep
AC_PROG_EGREP
AC_PROG_LN_S
AC_PROG_INSTALL
# If $INSTALL is relative path to our fallback install-sh, then convert
# to an absolute path, as in some cases (e.g. Solaris VPATH build), libtool
# may try to use it from a changed working directory.
if test "$INSTALL" = "build/install-sh -c"; then
INSTALL="$abs_srcdir/$INSTALL"
fi
if test -z "$MKDIR"; then
MKDIR="$INSTALL -d"
fi
AC_SUBST([MKDIR])
# ==== Libraries, for which we may have source to build ======================
dnl verify apr version and set apr flags
dnl These regular expressions should not contain "\(" and "\)".
APR_VER_REGEXES=["1\.[4-9]\. 2\."]
SVN_LIB_APR($APR_VER_REGEXES)
if test `expr $apr_version : 2` -ne 0; then
dnl Bump the library so-version to 2 if using APR-2
dnl (Debian uses so-version 1 for APR-1-with-largefile)
svn_lib_ver=2
dnl APR-2 provides APRUTIL
apu_config=$apr_config
AC_SUBST(SVN_APRUTIL_INCLUDES)
AC_SUBST(SVN_APRUTIL_CONFIG, ["$apu_config"])
AC_SUBST(SVN_APRUTIL_LIBS)
SVN_APR_MAJOR_VERSION=2
else
svn_lib_ver=0
APU_VER_REGEXES=["1\.[3-9]\."]
SVN_LIB_APRUTIL($APU_VER_REGEXES)
SVN_APR_MAJOR_VERSION=1
fi
AC_SUBST(SVN_APR_MAJOR_VERSION)
SVN_LT_SOVERSION="-version-info $svn_lib_ver"
AC_SUBST(SVN_LT_SOVERSION)
AC_DEFINE_UNQUOTED(SVN_SOVERSION, $svn_lib_ver,
[Subversion library major version])
dnl Search for pkg-config
AC_PATH_PROG(PKG_CONFIG, pkg-config)
dnl Search for serf
SVN_LIB_SERF(1,3,4)
if test "$svn_lib_serf" = "yes"; then
AC_DEFINE([SVN_HAVE_SERF], 1,
[Defined if support for Serf is enabled])
fi
dnl Search for apr_memcache (only affects fs_fs)
SVN_LIB_APR_MEMCACHE
if test "$svn_lib_apr_memcache" = "yes"; then
AC_DEFINE(SVN_HAVE_MEMCACHE, 1,
[Defined if apr_memcache (standalone or in apr-util) is present])
fi
AC_ARG_ENABLE(apache-whitelist,
AS_HELP_STRING([--enable-apache-whitelist=VER],
[Whitelist a particular Apache version number,
typically used to enable the use of a old version
patched by a distribution.]),
[apache_whitelist_ver=$enableval],
[apache_whitelist_ver=no])
HTTPD_WHITELIST="$apache_whitelist_ver"
AC_SUBST(HTTPD_WHITELIST)
dnl Find Apache with a recent-enough magic module number
SVN_FIND_APACHE(20051115, $apache_whitelist_ver)
dnl Search for SQLite. If you change SQLITE_URL from a .zip to
dnl something else also update build/ac-macros/sqlite.m4 to reflect
dnl the correct command to unpack the downloaded file.
SQLITE_MINIMUM_VER="3.24.0"
SQLITE_RECOMMENDED_VER="3.39.4"
dnl Used to construct the SQLite download URL.
SQLITE_RECOMMENDED_VER_REL_YEAR="2022"
SQLITE_URL="https://www.sqlite.org/$SQLITE_RECOMMENDED_VER_REL_YEAR/sqlite-amalgamation-$(printf %d%02d%02d%02d $(echo ${SQLITE_RECOMMENDED_VER} | sed -e 's/\./ /g')).zip"
SVN_LIB_SQLITE(${SQLITE_MINIMUM_VER}, ${SQLITE_RECOMMENDED_VER},
${SQLITE_URL})
AC_ARG_ENABLE(sqlite-compatibility-version,
AS_HELP_STRING([--enable-sqlite-compatibility-version=X.Y.Z],
[Allow binary to run against SQLite as old as ARG]),
[sqlite_compat_ver=$enableval],[sqlite_compat_ver=no])
if test -n "$sqlite_compat_ver" && test "$sqlite_compat_ver" != no; then
SVN_SQLITE_VERNUM_PARSE([$sqlite_compat_ver],
[sqlite_compat_ver_num])
CFLAGS="-DSVN_SQLITE_MIN_VERSION='\"$sqlite_compat_ver\"' $CFLAGS"
CFLAGS="-DSVN_SQLITE_MIN_VERSION_NUMBER=$sqlite_compat_ver_num $CFLAGS"
fi
SVN_CHECK_FOR_ATOMIC_BUILTINS
if test "$svn_cv_atomic_builtins" = "yes"; then
AC_DEFINE(SVN_HAS_ATOMIC_BUILTINS, 1, [Define if compiler provides atomic builtins])
fi
dnl Set up a number of directories ---------------------
dnl Create SVN_BINDIR for proper substitution
if test "${bindir}" = '${exec_prefix}/bin'; then
if test "${exec_prefix}" = "NONE"; then
if test "${prefix}" = "NONE"; then
SVN_BINDIR="${ac_default_prefix}/bin"
else
SVN_BINDIR="${prefix}/bin"
fi
else
SVN_BINDIR="${exec_prefix}/bin"
fi
else
SVN_BINDIR="${bindir}"
fi
dnl fully evaluate this value. when we substitute it into our tool scripts,
dnl they will not have things such as ${bindir} available
SVN_BINDIR="`eval echo ${SVN_BINDIR}`"
AC_SUBST(SVN_BINDIR)
dnl provide ${bindir} in svn_private_config.h for use in compiled code
AC_DEFINE_UNQUOTED(SVN_BINDIR, "${SVN_BINDIR}",
[Defined to be the path to the installed binaries])
dnl This purposely does *not* allow for multiple parallel installs.
dnl However, it is compatible with most gettext usages.
localedir='${datadir}/locale'
AC_SUBST(localedir)
dnl For SVN_LOCALE_DIR, we have to expand it to something. See SVN_BINDIR.
if test "${prefix}" = "NONE" \
&& ( test "${datadir}" = '${prefix}/share' \
|| ( test "${datadir}" = '${datarootdir}' \
&& test "${datarootdir}" = '${prefix}/share' ) ); then
exp_localedir='${ac_default_prefix}/share/locale'
else
exp_localedir=$localedir
fi
SVN_EXPAND_VAR(svn_localedir, "${exp_localedir}")
AC_DEFINE_UNQUOTED(SVN_LOCALE_DIR, "${svn_localedir}",
[Defined to be the path to the installed locale dirs])
dnl Libtool has been broken for decades, incorrectly passing 'cru' to 'ar'
AR_FLAGS=${AR_FLAGS:-cr}
dnl Check for libtool -- we'll definitely need it for all our shared libs!
AC_MSG_NOTICE([configuring libtool now])
ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL])
AC_ARG_ENABLE(experimental-libtool,
AS_HELP_STRING([--enable-experimental-libtool],[Use APR's libtool]),
[experimental_libtool=$enableval],[experimental_libtool=no])
if test "$experimental_libtool" = "yes"; then
echo "using APR's libtool"
sh_libtool="`$apr_config --apr-libtool`"
LIBTOOL="$sh_libtool"
SVN_LIBTOOL="$sh_libtool"
else
sh_libtool="$abs_builddir/libtool"
SVN_LIBTOOL="\$(SHELL) \"$sh_libtool\""
fi
AC_SUBST(SVN_LIBTOOL)
dnl Determine the libtool version
changequote(, )dnl
lt_pversion=`$LIBTOOL --version 2>/dev/null|$SED -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'`
lt_version=`echo $lt_pversion|$SED -e 's/\([a-z]*\)$/.\1/'`
lt_major_version=`echo $lt_version | cut -d'.' -f 1`
changequote([, ])dnl
dnl set the default parameters
svn_enable_static=yes
svn_enable_shared=yes
dnl check for --enable-static option
AC_ARG_ENABLE(static,
AS_HELP_STRING([--enable-static],
[Build static libraries]),
[svn_enable_static="$enableval"], [svn_enable_static="yes"])
dnl check for --enable-shared option
AC_ARG_ENABLE(shared,
AS_HELP_STRING([--enable-shared],
[Build shared libraries]),
[svn_enable_shared="$enableval"], [svn_enable_shared="yes"])
if test "$svn_enable_static" = "yes" && test "$svn_enable_shared" = "yes" ; then
AC_MSG_NOTICE([building both shared and static libraries])
elif test "$svn_enable_static" = "yes" ; then
AC_MSG_NOTICE([building static libraries only])
LT_CFLAGS="-static $LT_CFLAGS"
LT_LDFLAGS="-static $LT_LDFLAGS"
elif test "$svn_enable_shared" = "yes" ; then
AC_MSG_NOTICE([building shared libraries only])
if test "$lt_major_version" = "1" ; then
LT_CFLAGS="-prefer-pic $LT_CFLAGS"
elif test "$lt_major_version" = "2" ; then
LT_CFLAGS="-shared $LT_CFLAGS"
fi
LT_LDFLAGS="-shared $LT_LDFLAGS"
else
AC_MSG_ERROR([cannot disable both shared and static libraries])
fi
dnl Check for --enable-all-static option
AC_ARG_ENABLE(all-static,
AS_HELP_STRING([--enable-all-static],
[Build completely static (standalone) binaries.]),
[
if test "$enableval" = "yes" ; then
LT_LDFLAGS="-all-static $LT_LDFLAGS"
elif test "$enableval" != "no" ; then
AC_MSG_ERROR([--enable-all-static doesn't accept argument])
fi
])
AC_SUBST(LT_CFLAGS)
AC_SUBST(LT_LDFLAGS)
AC_ARG_ENABLE(local-library-preloading,
AS_HELP_STRING([--enable-local-library-preloading],
[Enable preloading of locally built libraries in locally
built executables. This may be necessary for testing
prior to installation on some platforms. It does not
work on some platforms (Darwin, OpenBSD, ...).]),
[
if test "$enableval" != "no"; then
if test "$svn_enable_shared" = "yes"; then
TRANSFORM_LIBTOOL_SCRIPTS="transform-libtool-scripts"
else
AC_MSG_ERROR([--enable-local-library-preloading conflicts with --disable-shared])
fi
else
TRANSFORM_LIBTOOL_SCRIPTS=""
fi
], [
TRANSFORM_LIBTOOL_SCRIPTS=""
])
AC_SUBST(TRANSFORM_LIBTOOL_SCRIPTS)
dnl Check if -no-undefined is needed for the platform.
dnl It should always work but with libtool 1.4.3 on OS X it breaks the build.
dnl So we only turn it on for platforms where we know we really need it.
AC_MSG_CHECKING([whether libtool needs -no-undefined])
case $host in
*-*-cygwin*)
AC_MSG_RESULT([yes])
LT_NO_UNDEFINED="-no-undefined"
;;
*)
AC_MSG_RESULT([no])
LT_NO_UNDEFINED=""
;;
esac
AC_SUBST(LT_NO_UNDEFINED)
dnl Check for trang.
trang=yes
AC_ARG_WITH(trang,
AS_HELP_STRING([--with-trang=PATH],
[Specify the command to run the trang schema converter]),
[
trang="$withval"
])
if test "$trang" = "yes"; then
AC_PATH_PROG(TRANG, trang, none)
else
TRANG="$trang"
AC_SUBST(TRANG)
fi
dnl Check for doxygen
doxygen=yes
AC_ARG_WITH(doxygen,
AS_HELP_STRING([--with-doxygen=PATH],
[Specify the command to run doxygen]),
[
doxygen="$withval"
])
if test "$doxygen" = "yes"; then
AC_PATH_PROG(DOXYGEN, doxygen, none)
else
DOXYGEN="$doxygen"
AC_SUBST(DOXYGEN)
fi
dnl Check for libraries --------------------
dnl Expat -------------------
AC_ARG_WITH(expat,
AS_HELP_STRING([--with-expat=INCLUDES:LIB_SEARCH_DIRS:LIBS],
[Specify location of Expat]),
[svn_lib_expat="$withval"],
[svn_lib_expat="::expat"])
# APR-util accepts "builtin" as an argument to this option so if the user
# passed "builtin" pretend the user didn't specify the --with-expat option
# at all. Expat will (hopefully) be found in apr-util.
test "_$svn_lib_expat" = "_builtin" && svn_lib_expat="::expat"
AC_MSG_CHECKING([for Expat])
if test -n "`echo "$svn_lib_expat" | $EGREP ":.*:"`"; then
SVN_XML_INCLUDES=""
for i in [`echo "$svn_lib_expat" | $SED -e "s/\([^:]*\):.*/\1/"`]; do
SVN_XML_INCLUDES="$SVN_XML_INCLUDES -I$i"
done
SVN_XML_INCLUDES="${SVN_XML_INCLUDES## }"
for l in [`echo "$svn_lib_expat" | $SED -e "s/.*:\([^:]*\):.*/\1/"`]; do
LDFLAGS="$LDFLAGS -L$l"
done
for l in [`echo "$svn_lib_expat" | $SED -e "s/.*:\([^:]*\)/\1/"`]; do
SVN_XML_LIBS="$SVN_XML_LIBS -l$l"
done
SVN_XML_LIBS="${SVN_XML_LIBS## }"
old_CPPFLAGS="$CPPFLAGS"
old_LIBS="$LIBS"
CPPFLAGS="$CPPFLAGS $SVN_XML_INCLUDES"
LIBS="$LIBS $SVN_XML_LIBS"
AC_LINK_IFELSE([AC_LANG_SOURCE([[
#include <expat.h>
int main()
{XML_ParserCreate(NULL);}]])], svn_lib_expat="yes", svn_lib_expat="no")
LIBS="$old_LIBS"
if test "$svn_lib_expat" = "yes"; then
AC_MSG_RESULT([yes])
else
SVN_XML_INCLUDES=""
SVN_XML_LIBS=""
CPPFLAGS="$CPPFLAGS $SVN_APRUTIL_INCLUDES"
if test "$enable_all_static" != "yes"; then
SVN_APRUTIL_LIBS="$SVN_APRUTIL_LIBS `$apu_config --libs`"
fi
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <expat.h>
int main()
{XML_ParserCreate(NULL);}]])], svn_lib_expat="yes", svn_lib_expat="no")
if test "$svn_lib_expat" = "yes"; then
AC_MSG_RESULT([yes])
AC_MSG_WARN([Expat found amongst libraries used by APR-Util, but Subversion libraries might be needlessly linked against additional unused libraries. It can be avoided by specifying exact location of Expat in argument of --with-expat option.])
else
AC_MSG_RESULT([no])
AC_MSG_ERROR([Expat not found])
fi
fi
CPPFLAGS="$old_CPPFLAGS"
else
AC_MSG_RESULT([no])
if test "$svn_lib_expat" = "yes"; then
AC_MSG_ERROR([--with-expat option requires argument])
elif test "$svn_lib_expat" = "no"; then
AC_MSG_ERROR([Expat is required])
else
AC_MSG_ERROR([Invalid syntax of argument of --with-expat option])
fi
fi
AC_SUBST(SVN_XML_INCLUDES)
AC_SUBST(SVN_XML_LIBS)
dnl Berkeley DB -------------------
# Berkeley DB on SCO OpenServer needs -lsocket
AC_CHECK_LIB(socket, socket)
# Build the BDB filesystem library only if we have an appropriate
# version of Berkeley DB.
case "$host" in
powerpc-apple-darwin*)
# Berkeley DB 4.0 does not work on OS X.
SVN_FS_WANT_DB_MAJOR=4
SVN_FS_WANT_DB_MINOR=1
SVN_FS_WANT_DB_PATCH=25
;;
*)
SVN_FS_WANT_DB_MAJOR=4
SVN_FS_WANT_DB_MINOR=0
SVN_FS_WANT_DB_PATCH=14
;;
esac
db_alt_version="5.x"
# Look for libdb4.so first:
SVN_LIB_BERKELEY_DB($SVN_FS_WANT_DB_MAJOR, $SVN_FS_WANT_DB_MINOR,
$SVN_FS_WANT_DB_PATCH, [db4 db])
AC_DEFINE_UNQUOTED(SVN_FS_WANT_DB_MAJOR, $SVN_FS_WANT_DB_MAJOR,
[The desired major version for the Berkeley DB])
AC_DEFINE_UNQUOTED(SVN_FS_WANT_DB_MINOR, $SVN_FS_WANT_DB_MINOR,
[The desired minor version for the Berkeley DB])
AC_DEFINE_UNQUOTED(SVN_FS_WANT_DB_PATCH, $SVN_FS_WANT_DB_PATCH,
[The desired patch version for the Berkeley DB])
AC_SUBST(SVN_DB_INCLUDES)
AC_SUBST(SVN_DB_LIBS)
SVN_LIB_SASL
if test "$svn_lib_sasl" = "yes"; then
AC_DEFINE(SVN_HAVE_SASL, 1,
[Defined if Cyrus SASL v2 is present on the system])
fi
dnl Mac OS specific features -------------------
SVN_LIB_MACHO_ITERATE
SVN_LIB_MACOS_PLIST
SVN_LIB_MACOS_KEYCHAIN
dnl APR_HAS_DSO -------------------
AC_MSG_CHECKING([whether APR has support for DSOs])
old_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $SVN_APR_INCLUDES"
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
#include <apr.h>
#if !APR_HAS_DSO
#error
#endif]])],
APR_HAS_DSO="yes"
AC_MSG_RESULT([yes]),
APR_HAS_DSO="no"
AC_MSG_RESULT([no]))
CPPFLAGS="$old_CPPFLAGS"
dnl D-Bus (required for support for KWallet) -------------------
if test -n "$PKG_CONFIG"; then
AC_MSG_CHECKING([for D-Bus .pc file])
if $PKG_CONFIG --exists dbus-1; then
AC_MSG_RESULT([yes])
old_CPPFLAGS="$CPPFLAGS"
old_LIBS="$LIBS"
DBUS_CPPFLAGS="`$PKG_CONFIG --cflags dbus-1`"
AC_MSG_CHECKING([D-Bus version])
DBUS_VERSION="`$PKG_CONFIG --modversion dbus-1`"
AC_MSG_RESULT([$DBUS_VERSION])
# D-Bus 0.* requires DBUS_API_SUBJECT_TO_CHANGE
if test -n ["`echo "$DBUS_VERSION" | $EGREP '^0\.[[:digit:]]+'`"]; then
DBUS_CPPFLAGS="$DBUS_CPPFLAGS -DDBUS_API_SUBJECT_TO_CHANGE"
fi
DBUS_LIBS="`$PKG_CONFIG --libs dbus-1`"
CPPFLAGS="$CPPFLAGS $DBUS_CPPFLAGS"
LIBS="$LIBS $DBUS_LIBS"
AC_MSG_CHECKING([for D-Bus])
AC_LINK_IFELSE([AC_LANG_SOURCE([[
#include <dbus/dbus.h>
int main()
{dbus_bus_get(DBUS_BUS_SESSION, NULL);}]])], HAVE_DBUS="yes", HAVE_DBUS="no")
if test "$HAVE_DBUS" = "yes"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
CPPFLAGS="$old_CPPFLAGS"
LIBS="$old_LIBS"
else
AC_MSG_RESULT([no])
fi
fi
dnl GPG Agent -------------------
AC_ARG_WITH(gpg_agent,
AS_HELP_STRING([--without-gpg-agent],
[Disable support for GPG-Agent]),
[], [with_gpg_agent=yes])
AC_MSG_CHECKING([whether to support GPG-Agent])
if test "$with_gpg_agent" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE([SVN_HAVE_GPG_AGENT], [1],
[Is GPG Agent support enabled?])
else
AC_MSG_RESULT([no])
fi
AC_SUBST(SVN_HAVE_GPG_AGENT)
dnl GNOME Keyring -------------------
AC_ARG_WITH(old_gnome_keyring,
AS_HELP_STRING([--with-old-gnome-keyring],
[Enable old GNOME Keyring for auth credentials (prefer --with-gnome-keyring)]),
[with_old_gnome_keyring="$withval"],
[with_old_gnome_keyring=no])
found_old_gnome_keyring=no
AC_MSG_CHECKING([whether to look for old GNOME Keyring])
if test "$with_old_gnome_keyring" != "no"; then
AC_MSG_RESULT([yes])
case "$host" in
*-*-darwin*)
if test "$with_old_gnome_keyring" = "yes"; then
AC_MSG_ERROR([--with-old-gnome-keyring is not supported on Mac OS X.])
else
with_old_gnome_keyring=no
fi
;;
*)
if test "$svn_enable_shared" = "yes"; then
if test "$APR_HAS_DSO" = "yes"; then
if test -n "$PKG_CONFIG"; then
AC_MSG_CHECKING([for GLib and GNOME Keyring .pc files])
if $PKG_CONFIG --exists glib-2.0 gnome-keyring-1; then
AC_MSG_RESULT([yes])
old_CPPFLAGS="$CPPFLAGS"
SVN_GNOME_KEYRING_INCLUDES="`$PKG_CONFIG --cflags glib-2.0 gnome-keyring-1`"
CPPFLAGS="$CPPFLAGS $SVN_GNOME_KEYRING_INCLUDES"
AC_CHECK_HEADER(gnome-keyring.h, found_old_gnome_keyring=yes, found_old_gnome_keyring=no)
AC_MSG_CHECKING([for GNOME Keyring])
if test "$found_old_gnome_keyring" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE([SVN_HAVE_GNOME_KEYRING], [1],
[Is GNOME Keyring support enabled?])
CPPFLAGS="$old_CPPFLAGS"
SVN_GNOME_KEYRING_LIBS="`$PKG_CONFIG --libs glib-2.0 gnome-keyring-1`"
SVN_GNOME_KEYRING_PCLIBS="glib-2.0, gnome-keyring-1"
else
AC_MSG_RESULT([no])
if test "$with_old_gnome_keyring" = "yes"; then
AC_MSG_ERROR([cannot find GNOME Keyring])
fi
fi
else
AC_MSG_RESULT([no])
if test "$with_old_gnome_keyring" = "yes"; then
AC_MSG_ERROR([cannot find GLib and GNOME Keyring .pc files.])
else
with_old_gnome_keyring=no
fi
fi
else
if test "$with_old_gnome_keyring" = "yes"; then
AC_MSG_ERROR([cannot find pkg-config. GNOME Keyring requires this.])
else
with_old_gnome_keyring=no
fi
fi
else
if test "$with_old_gnome_keyring" = "yes"; then
AC_MSG_ERROR([APR does not have support for DSOs. GNOME Keyring requires this.])
else
with_old_gnome_keyring=no
fi
fi
else
if test "$with_old_gnome_keyring" = "yes"; then
AC_MSG_ERROR([--with-old-gnome-keyring conflicts with --disable-shared])
else
with_old_gnome_keyring=no
fi
fi
;;
esac
else
AC_MSG_RESULT([no])
fi
AC_SUBST(SVN_GNOME_KEYRING_INCLUDES)
AC_SUBST(SVN_GNOME_KEYRING_LIBS)
dnl LibSecret -------------------
SVN_LIB_SECRET
dnl Ev2 experimental features ----------------------
dnl Note: The Ev2 implementations will be built unconditionally, but by
dnl providing this flag, users can choose to use the currently-shimmed Ev2
dnl editor implementations for various operations. This will probably
dnl negatively impact performance, but is useful for testing.
AC_ARG_ENABLE(ev2-impl,
AS_HELP_STRING([--enable-ev2-impl],
[Use Ev2 implementations, where available [EXPERIMENTAL]]),
[enable_ev2_impl=$enableval],[enable_ev2_impl=no])
if test "$enable_ev2_impl" = "yes"; then
AC_DEFINE(ENABLE_EV2_IMPL, 1,
[Define to 1 if Ev2 implementations should be used.])
fi
dnl I18n -------------------
AC_ARG_ENABLE(nls,
AS_HELP_STRING([--disable-nls],[Disable gettext functionality]),
[enable_nls=$enableval],[enable_nls=yes])
USE_NLS="no"
SVN_INTL_LIBS=""
if test "$enable_nls" = "yes"; then
dnl First, check to see if there is a working msgfmt.
AC_PATH_PROG(MSGFMT, msgfmt, none)
AC_PATH_PROG(MSGMERGE, msgmerge, none)
AC_PATH_PROG(XGETTEXT, xgettext, none)
if test "$MSGFMT" != "none"; then
AC_SEARCH_LIBS(bindtextdomain, [intl],
[
# in case libintl needs to be linked explicitly,
# $ac_cv_search_bindtextdomain contains -l linker flags
if echo "$ac_cv_search_bindtextdomain" | grep '^-l' >/dev/null
then
SVN_INTL_LIBS="$ac_cv_search_bindtextdomain"
fi
],
[
enable_nls="no"
])
if test "$enable_nls" = "no"; then
# Destroy the cached result so we can test again
unset ac_cv_search_bindtextdomain
# On some systems, libintl needs libiconv to link properly,
# so try again with -liconv.
AC_SEARCH_LIBS(bindtextdomain, [intl],
[
enable_nls="yes"
if echo "$ac_cv_search_bindtextdomain" | grep '^-l' >/dev/null
then
SVN_INTL_LIBS="$ac_cv_search_bindtextdomain"
fi
# This is here so that -liconv ends up in LIBS
# if it worked with -liconv.
AC_CHECK_LIB(iconv, libiconv_open)
],
[
AC_MSG_WARN([bindtextdomain() not found. Disabling NLS.])
enable_nls="no"
], -liconv)
fi
if test "$enable_nls" = "yes"; then
AC_DEFINE(ENABLE_NLS, 1,
[Define to 1 if translation of program messages to the user's
native language is requested.])
USE_NLS="yes"
fi
fi
fi
AC_SUBST(SVN_INTL_LIBS)
AH_BOTTOM([
/* Indicate to translators that string X should be translated. Do not look
up the translation at run time; just expand to X. This macro is suitable
for use where a constant string is required at compile time. */
#define N_(x) x
/* Indicate to translators that we have decided the string X should not be
translated. Expand to X. */
#define U_(x) x
#ifdef ENABLE_NLS
#include <locale.h>
#include <libintl.h>
/* Indicate to translators that string X should be translated. At run time,
look up and return the translation of X. */
#define _(x) dgettext(PACKAGE_NAME, x)
/* Indicate to translators that strings X1 and X2 are singular and plural
forms of the same message, and should be translated. At run time, return
an appropriate translation depending on the number N. */
#define Q_(x1, x2, n) dngettext(PACKAGE_NAME, x1, x2, n)
#else
#define _(x) (x)
#define Q_(x1, x2, n) (((n) == 1) ? x1 : x2)
#define gettext(x) (x)
#define dgettext(domain, x) (x)
#endif
/* compiler hints */
#if defined(__GNUC__) && (__GNUC__ >= 3)
# define SVN__PREDICT_FALSE(x) (__builtin_expect(x, 0))
# define SVN__PREDICT_TRUE(x) (__builtin_expect(!!(x), 1))
#else
# define SVN__PREDICT_FALSE(x) (x)
# define SVN__PREDICT_TRUE(x) (x)
#endif
#if defined(SVN_DEBUG)
# define SVN__FORCE_INLINE
# define SVN__PREVENT_INLINE
#elif defined(__GNUC__)
# define SVN__FORCE_INLINE APR_INLINE __attribute__ ((always_inline))
# define SVN__PREVENT_INLINE __attribute__ ((noinline))
#else
# define SVN__FORCE_INLINE APR_INLINE
# define SVN__PREVENT_INLINE
#endif
/* Macro used to specify that a variable is intentionally left unused.
Suppresses compiler warnings about the variable being unused. */
#define SVN_UNUSED(v) ( (void)(v) )
])
dnl Used to simulate makefile conditionals.
GETTEXT_CODESET=\#
NO_GETTEXT_CODESET=\#
if test $USE_NLS = "yes"; then
AC_CHECK_FUNCS(bind_textdomain_codeset,
[ GETTEXT_CODESET="" ],
[ NO_GETTEXT_CODESET="" ])
fi
AC_SUBST(GETTEXT_CODESET)
AC_SUBST(NO_GETTEXT_CODESET)
# Check if we are using GNU gettext.
GNU_GETTEXT=no
MSGFMTFLAGS=''
if test $USE_NLS = "yes"; then
AC_MSG_CHECKING(if we are using GNU gettext)
if $MSGFMT --version 2>&1 | $EGREP GNU > /dev/null; then
GNU_GETTEXT=yes
MSGFMTFLAGS='-c'
fi
AC_MSG_RESULT($GNU_GETTEXT)
fi
AC_SUBST(MSGFMTFLAGS)
dnl libmagic -------------------
libmagic_found=no
AC_ARG_WITH(libmagic,AS_HELP_STRING([--with-libmagic=PREFIX],
[libmagic filetype detection library]),
[
if test "$withval" = "yes" ; then
AC_CHECK_HEADER(magic.h, [
AC_CHECK_LIB(magic, magic_open, [libmagic_found="builtin"])
])
libmagic_prefix="the default locations"
elif test "$withval" != "no"; then
libmagic_prefix=$withval
save_cppflags="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I$libmagic_prefix/include"
AC_CHECK_HEADERS(magic.h,[
save_ldflags="$LDFLAGS"
LDFLAGS="-L$libmagic_prefix/lib $LDFLAGS"
AC_CHECK_LIB(magic, magic_open, [libmagic_found="yes"])
LDFLAGS="$save_ldflags"
])
CPPFLAGS="$save_cppflags"
fi
if test "$withval" != "no" && test "$libmagic_found" = "no"; then
AC_MSG_ERROR([[--with-libmagic requested, but libmagic not found at $libmagic_prefix]])
fi
],
[
AC_CHECK_HEADER(magic.h, [
AC_CHECK_LIB(magic, magic_open, [libmagic_found="builtin"])
])
])
if test "$libmagic_found" != "no"; then
AC_DEFINE([SVN_HAVE_LIBMAGIC], [1], [Defined if libmagic support is enabled])
SVN_MAGIC_LIBS="-lmagic"
fi
if test "$libmagic_found" = "yes"; then
SVN_MAGIC_INCLUDES="-I$libmagic_prefix/include"
LDFLAGS="$LDFLAGS `SVN_REMOVE_STANDARD_LIB_DIRS(-L$libmagic_prefix/lib)`"
fi
AC_SUBST(SVN_MAGIC_INCLUDES)
AC_SUBST(SVN_MAGIC_LIBS)
dnl KWallet -------------------
SVN_LIB_KWALLET
if test "$svn_lib_kwallet" = "yes"; then
AC_DEFINE([SVN_HAVE_KWALLET], 1,
[Defined if KWallet support is enabled])
fi
dnl plaintext passwords -------------------
AC_ARG_ENABLE(plaintext-password-storage,
AS_HELP_STRING([--disable-plaintext-password-storage],
[Disable on-disk caching of plaintext passwords and passphrases.
(Leaving this functionality enabled will not force Subversion
to store passwords in plaintext, but does permit users to
explicitly allow that behavior via runtime configuration.)]),
[
if test "$enableval" = "no"; then
AC_MSG_NOTICE([Disabling plaintext password/passphrase storage])
AC_DEFINE(SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE, 1,
[Defined if plaintext password/passphrase storage is disabled])
fi
])
dnl Build and install rules -------------------
INSTALL_STATIC_RULES="install-bin install-docs"
INSTALL_RULES="install-fsmod-lib install-ramod-lib install-lib install-include install-static"
INSTALL_RULES="$INSTALL_RULES $INSTALL_APACHE_RULE"
BUILD_RULES="fsmod-lib ramod-lib lib bin test sub-test $BUILD_APACHE_RULE tools"
if test "$svn_lib_berkeley_db" = "yes"; then
BUILD_RULES="$BUILD_RULES bdb-lib bdb-test"
INSTALL_RULES="`echo $INSTALL_RULES | $SED 's/install-fsmod-lib/install-fsmod-lib install-bdb-lib/'`"
INSTALL_STATIC_RULES="$INSTALL_STATIC_RULES install-bdb-lib"
BDB_TEST_DEPS="\$(BDB_TEST_DEPS)"
BDB_TEST_PROGRAMS="\$(BDB_TEST_PROGRAMS)"
fi
if test "$svn_lib_serf" = "yes"; then
BUILD_RULES="$BUILD_RULES serf-lib"
INSTALL_RULES="`echo $INSTALL_RULES | $SED 's/install-ramod-lib/install-ramod-lib install-serf-lib/'`"
INSTALL_STATIC_RULES="$INSTALL_STATIC_RULES install-serf-lib"
fi
if test "$svn_lib_kwallet" = "yes"; then
BUILD_RULES="$BUILD_RULES kwallet-lib"
INSTALL_RULES="`echo $INSTALL_RULES | $SED 's/install-lib/install-lib install-kwallet-lib/'`"
INSTALL_STATIC_RULES="$INSTALL_STATIC_RULES install-kwallet-lib"
fi
if test "$found_old_gnome_keyring" = "yes" || test "$found_gnome_keyring" = "yes"; then
BUILD_RULES="$BUILD_RULES gnome-keyring-lib"
INSTALL_RULES="`echo $INSTALL_RULES | $SED 's/install-lib/install-lib install-gnome-keyring-lib/'`"
INSTALL_STATIC_RULES="$INSTALL_STATIC_RULES install-gnome-keyring-lib"
fi
if test "$USE_NLS" = "yes"; then
BUILD_RULES="$BUILD_RULES locale"
INSTALL_RULES="$INSTALL_RULES install-locale"
fi
AC_SUBST(BUILD_RULES)
AC_SUBST(INSTALL_STATIC_RULES)
AC_SUBST(INSTALL_RULES)
AC_SUBST(BDB_TEST_DEPS)
AC_SUBST(BDB_TEST_PROGRAMS)
dnl Check for header files ----------------
dnl Check for typedefs, structures, and compiler characteristics ----------
dnl if compiler doesn't understand `const', then define it empty
AC_C_CONST
dnl if non-existent, define size_t to be `unsigned'
AC_TYPE_SIZE_T
dnl Check for library functions ----------
AC_FUNC_MEMCMP
dnl svn_error's default warning handler uses vfprintf()
AC_FUNC_VPRINTF
dnl check for functions needed in special file handling
AC_CHECK_FUNCS(symlink readlink)
dnl check for uname and ELF headers
AC_CHECK_HEADERS(sys/utsname.h, [AC_CHECK_FUNCS(uname)], [])
AC_CHECK_HEADERS(elf.h)
dnl check for termios
AC_CHECK_HEADER(termios.h,[
AC_CHECK_FUNCS(tcgetattr tcsetattr,[
AC_DEFINE(HAVE_TERMIOS_H,1,[Defined if we have a usable termios library.])
])
])
dnl Process some configuration options ----------
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug],
[Turn on debugging]),
[
if test "$enableval" = "yes" ; then
enable_debugging="yes"
else
enable_debugging="no"
fi
],
[
# Neither --enable-debug nor --disable-debug was passed.
enable_debugging="maybe"
])
AC_ARG_ENABLE(optimize,
AS_HELP_STRING([--enable-optimize],
[Turn on optimizations]),
[
if test "$enableval" = "yes" ; then
enable_optimization="yes"
else
enable_optimization="no"
fi
],
[
# Neither --enable-optimize nor --disable-optimize was passed.
enable_optimization="maybe"
])
dnl Use -Wl,--no-undefined during linking of some libraries
AC_ARG_ENABLE(disallowing-of-undefined-references,
[AS_HELP_STRING([--enable-disallowing-of-undefined-references],
[Use -Wl,--no-undefined flag during linking of some libraries to disallow undefined references])])
if test "$enable_disallowing_of_undefined_references" != "yes" && test "`uname`" != "Linux"; then