1dnl     Licensed to the Apache Software Foundation (ASF) under one
2dnl     or more contributor license agreements.  See the NOTICE file
3dnl     distributed with this work for additional information
4dnl     regarding copyright ownership.  The ASF licenses this file
5dnl     to you under the Apache License, Version 2.0 (the
6dnl     "License"); you may not use this file except in compliance
7dnl     with the License.  You may obtain a copy of the License at
8dnl    
9dnl       http://www.apache.org/licenses/LICENSE-2.0
10dnl    
11dnl     Unless required by applicable law or agreed to in writing,
12dnl     software distributed under the License is distributed on an
13dnl     "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14dnl     KIND, either express or implied.  See the License for the
15dnl     specific language governing permissions and limitations
16dnl     under the License.
17
18dnl configure.ac: Autoconfiscation for Subversion
19dnl Process this file with autoconf to produce a configure script.
20
21AC_PREREQ(2.59)
22
23dnl Get the version of Subversion, using m4's esyscmd() command to do this
24dnl at m4-time, since AC_INIT() requires it then.
25AC_INIT([subversion],
26     [esyscmd(python build/getversion.py SVN subversion/include/svn_version.h)],
27     [http://subversion.apache.org/])
28
29AC_CONFIG_SRCDIR(subversion/include/svn_types.h)
30AC_CONFIG_AUX_DIR([build])
31
32AC_MSG_NOTICE([Configuring Subversion ]AC_PACKAGE_VERSION)
33
34AC_SUBST([abs_srcdir], ["`cd $srcdir && pwd`"])
35AC_SUBST([abs_builddir], ["`pwd`"])
36if test "$abs_srcdir" = "$abs_builddir"; then
37  canonicalized_srcdir=""
38else
39  canonicalized_srcdir="$srcdir/"
40fi
41AC_SUBST([canonicalized_srcdir])
42
43SWIG_LDFLAGS="$LDFLAGS"
44AC_SUBST([SWIG_LDFLAGS])
45
46# Generate config.nice early (before the arguments are munged)
47SVN_CONFIG_NICE(config.nice)
48
49# ==== Check for programs ====================================================
50
51# Look for a C compiler (before anything can set CFLAGS)
52CUSERFLAGS="$CFLAGS"
53AC_PROG_CC
54SVN_CC_MODE_SETUP
55
56# Look for a C++ compiler (before anything can set CXXFLAGS)
57CXXUSERFLAGS="$CXXFLAGS"
58AC_PROG_CXX
59SVN_CXX_MODE_SETUP
60
61# Look for a C pre-processor
62AC_PROG_CPP
63
64# Look for a good sed
65# AC_PROG_SED was introduced in Autoconf 2.59b
66m4_ifdef([AC_PROG_SED], [AC_PROG_SED], [SED="${SED:-sed}"])
67
68# Grab target_cpu, so we can use it in the Solaris pkginfo file
69AC_CANONICAL_TARGET
70
71# Look for an extended grep
72AC_PROG_EGREP
73
74AC_PROG_LN_S
75
76AC_PROG_INSTALL
77# If $INSTALL is relative path to our fallback install-sh, then convert
78# to an absolute path, as in some cases (e.g. Solaris VPATH build), libtool
79# may try to use it from a changed working directory.
80if test "$INSTALL" = "build/install-sh -c"; then
81  INSTALL="$abs_srcdir/$INSTALL"
82fi
83
84if test -z "$MKDIR"; then
85  MKDIR="$INSTALL -d"
86fi
87AC_SUBST([MKDIR])
88
89# ==== Libraries, for which we may have source to build ======================
90
91dnl verify apr version and set apr flags
92dnl These regular expressions should not contain "\(" and "\)".
93
94APR_VER_REGEXES=["1\.[3-9]\. 2\."]
95
96SVN_LIB_APR($APR_VER_REGEXES)
97
98if test `expr $apr_version : 2` -ne 0; then
99  dnl Bump the library so-version to 2 if using APR-2
100  dnl (Debian uses so-version 1 for APR-1-with-largefile)
101  svn_lib_ver=2
102  dnl APR-2 provides APRUTIL
103  apu_config=$apr_config
104  AC_SUBST(SVN_APRUTIL_INCLUDES)
105  AC_SUBST(SVN_APRUTIL_CONFIG, ["$apu_config"])
106  AC_SUBST(SVN_APRUTIL_LIBS)
107  SVN_APR_MAJOR_VERSION=2
108else
109  svn_lib_ver=0
110  APU_VER_REGEXES=["1\.[3-9]\."]
111  SVN_LIB_APRUTIL($APU_VER_REGEXES)
112  SVN_APR_MAJOR_VERSION=1
113fi
114AC_SUBST(SVN_APR_MAJOR_VERSION)
115SVN_LT_SOVERSION="-version-info $svn_lib_ver"
116AC_SUBST(SVN_LT_SOVERSION)
117AC_DEFINE_UNQUOTED(SVN_SOVERSION, $svn_lib_ver,
118                   [Subversion library major verson])
119
120dnl Search for pkg-config
121AC_PATH_PROG(PKG_CONFIG, pkg-config)
122
123dnl Search for serf
124SVN_LIB_SERF(1,3,4)
125
126if test "$svn_lib_serf" = "yes"; then
127  AC_DEFINE([SVN_HAVE_SERF], 1,
128            [Defined if support for Serf is enabled])
129fi
130
131dnl Search for apr_memcache (only affects fs_fs)
132SVN_LIB_APR_MEMCACHE
133
134if test "$svn_lib_apr_memcache" = "yes"; then
135  AC_DEFINE(SVN_HAVE_MEMCACHE, 1,
136            [Defined if apr_memcache (standalone or in apr-util) is present])
137fi
138
139
140dnl Find Apache with a recent-enough magic module number
141SVN_FIND_APACHE(20051115)
142
143dnl Search for SQLite.  If you change SQLITE_URL from a .zip to
144dnl something else also update build/ac-macros/sqlite.m4 to reflect
145dnl the correct command to unpack the downloaded file.
146SQLITE_MINIMUM_VER="3.7.12"
147SQLITE_RECOMMENDED_VER="3.7.15.1"
148SQLITE_URL="http://www.sqlite.org/sqlite-amalgamation-$(printf %d%02d%02d%02d $(echo ${SQLITE_RECOMMENDED_VER} | sed -e 's/\./ /g')).zip"
149
150SVN_LIB_SQLITE(${SQLITE_MINIMUM_VER}, ${SQLITE_RECOMMENDED_VER},
151               ${SQLITE_URL})
152
153AC_ARG_ENABLE(sqlite-compatibility-version,
154  AS_HELP_STRING([--enable-sqlite-compatibility-version=X.Y.Z],
155                 [Allow binary to run against SQLite as old as ARG]),
156  [sqlite_compat_ver=$enableval],[sqlite_compat_ver=no])
157
158if test -n "$sqlite_compat_ver" && test "$sqlite_compat_ver" != no; then
159  SVN_SQLITE_VERNUM_PARSE([$sqlite_compat_ver],
160                          [sqlite_compat_ver_num])
161  CFLAGS="-DSVN_SQLITE_MIN_VERSION='\"$sqlite_compat_ver\"' $CFLAGS"
162  CFLAGS="-DSVN_SQLITE_MIN_VERSION_NUMBER=$sqlite_compat_ver_num $CFLAGS"
163fi
164
165SVN_CHECK_FOR_ATOMIC_BUILTINS
166if test "$svn_cv_atomic_builtins" = "yes"; then
167    AC_DEFINE(SVN_HAS_ATOMIC_BUILTINS, 1, [Define if compiler provides atomic builtins])
168fi
169
170dnl Set up a number of directories ---------------------
171
172dnl Create SVN_BINDIR for proper substitution
173if test "${bindir}" = '${exec_prefix}/bin'; then
174        if test "${exec_prefix}" = "NONE"; then
175                if test "${prefix}" = "NONE"; then
176                        SVN_BINDIR="${ac_default_prefix}/bin"
177                else
178                        SVN_BINDIR="${prefix}/bin"
179                fi
180        else
181                SVN_BINDIR="${exec_prefix}/bin"
182        fi
183else
184        SVN_BINDIR="${bindir}"
185fi
186
187dnl fully evaluate this value. when we substitute it into our tool scripts,
188dnl they will not have things such as ${bindir} available
189SVN_BINDIR="`eval echo ${SVN_BINDIR}`"
190AC_SUBST(SVN_BINDIR)
191
192dnl provide ${bindir} in svn_private_config.h for use in compiled code
193AC_DEFINE_UNQUOTED(SVN_BINDIR, "${SVN_BINDIR}",
194        [Defined to be the path to the installed binaries])
195
196dnl This purposely does *not* allow for multiple parallel installs.
197dnl However, it is compatible with most gettext usages.
198localedir='${datadir}/locale'
199AC_SUBST(localedir)
200
201dnl For SVN_LOCALE_DIR, we have to expand it to something.  See SVN_BINDIR.
202if test "${prefix}" = "NONE" \
203  && ( test "${datadir}" = '${prefix}/share' \
204       || ( test "${datadir}" = '${datarootdir}' \
205            && test "${datarootdir}" = '${prefix}/share' ) ); then
206  exp_localedir='${ac_default_prefix}/share/locale'
207else
208  exp_localedir=$localedir
209fi
210SVN_EXPAND_VAR(svn_localedir, "${exp_localedir}")
211AC_DEFINE_UNQUOTED(SVN_LOCALE_DIR, "${svn_localedir}",
212                   [Defined to be the path to the installed locale dirs])
213
214dnl Check for libtool -- we'll definitely need it for all our shared libs!
215AC_MSG_NOTICE([configuring libtool now])
216ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL])
217AC_ARG_ENABLE(experimental-libtool,
218  AS_HELP_STRING([--enable-experimental-libtool],[Use APR's libtool]),
219  [experimental_libtool=$enableval],[experimental_libtool=no])
220
221if test "$experimental_libtool" = "yes"; then
222  echo "using APR's libtool"
223  sh_libtool="`$apr_config --apr-libtool`"
224  LIBTOOL="$sh_libtool"
225  SVN_LIBTOOL="$sh_libtool"
226else
227  sh_libtool="$abs_builddir/libtool"
228  SVN_LIBTOOL="\$(SHELL) \"$sh_libtool\""
229fi
230AC_SUBST(SVN_LIBTOOL)
231
232dnl Determine the libtool version
233changequote(, )dnl
234lt_pversion=`$LIBTOOL --version 2>/dev/null|$SED -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'`
235lt_version=`echo $lt_pversion|$SED -e 's/\([a-z]*\)$/.\1/'`
236lt_major_version=`echo $lt_version | cut -d'.' -f 1`
237changequote([, ])dnl
238
239dnl set the default parameters
240svn_enable_static=yes
241svn_enable_shared=yes
242
243dnl check for --enable-static option
244AC_ARG_ENABLE(static,
245  AS_HELP_STRING([--enable-static],
246                 [Build static libraries]),
247  [svn_enable_static="$enableval"], [svn_enable_static="yes"])
248
249dnl check for --enable-shared option
250AC_ARG_ENABLE(shared,
251  AS_HELP_STRING([--enable-shared],
252                 [Build shared libraries]),
253  [svn_enable_shared="$enableval"], [svn_enable_shared="yes"])
254
255if test "$svn_enable_static" = "yes" && test "$svn_enable_shared" = "yes" ; then
256  AC_MSG_NOTICE([building both shared and static libraries])
257elif test "$svn_enable_static" = "yes" ; then
258  AC_MSG_NOTICE([building static libraries only])
259  LT_CFLAGS="-static $LT_CFLAGS"
260  LT_LDFLAGS="-static $LT_LDFLAGS"
261elif test "$svn_enable_shared" = "yes" ; then
262  AC_MSG_NOTICE([building shared libraries only])
263  if test "$lt_major_version" = "1" ; then
264    LT_CFLAGS="-prefer-pic $LT_CFLAGS"
265  elif test "$lt_major_version" = "2" ; then
266    LT_CFLAGS="-shared $LT_CFLAGS"
267  fi
268  LT_LDFLAGS="-shared $LT_LDFLAGS"
269else
270  AC_MSG_ERROR([cannot disable both shared and static libraries])
271fi
272
273dnl Check for --enable-all-static option
274AC_ARG_ENABLE(all-static,
275  AS_HELP_STRING([--enable-all-static],
276                 [Build completely static (standalone) binaries.]),
277  [
278    if test "$enableval" = "yes" ; then
279      LT_LDFLAGS="-all-static $LT_LDFLAGS"
280    elif test "$enableval" != "no" ; then
281      AC_MSG_ERROR([--enable-all-static doesn't accept argument])
282    fi
283])
284
285AC_SUBST(LT_CFLAGS)
286AC_SUBST(LT_LDFLAGS)
287
288AC_ARG_ENABLE(local-library-preloading,
289  AS_HELP_STRING([--enable-local-library-preloading], 
290                 [Enable preloading of locally built libraries in locally
291                  built executables.  This may be necessary for testing
292                  prior to installation on some platforms.  It does not
293                  work on some platforms (Darwin, OpenBSD, ...).]),
294  [
295  if test "$enableval" != "no"; then
296    if test "$svn_enable_shared" = "yes"; then
297      TRANSFORM_LIBTOOL_SCRIPTS="transform-libtool-scripts"
298    else
299      AC_MSG_ERROR([--enable-local-library-preloading conflicts with --disable-shared])
300    fi
301  else
302    TRANSFORM_LIBTOOL_SCRIPTS=""
303  fi
304  ], [
305  TRANSFORM_LIBTOOL_SCRIPTS=""
306])
307AC_SUBST(TRANSFORM_LIBTOOL_SCRIPTS)
308
309dnl Check if -no-undefined is needed for the platform.
310dnl It should always work but with libtool 1.4.3 on OS X it breaks the build.
311dnl So we only turn it on for platforms where we know we really need it.
312AC_MSG_CHECKING([whether libtool needs -no-undefined])
313case $host in
314  *-*-cygwin*)
315    AC_MSG_RESULT([yes])
316    LT_NO_UNDEFINED="-no-undefined"
317    ;;
318  *)
319    AC_MSG_RESULT([no])
320    LT_NO_UNDEFINED=""
321    ;;
322esac
323AC_SUBST(LT_NO_UNDEFINED)
324
325dnl Check for trang.
326trang=yes
327AC_ARG_WITH(trang,
328AS_HELP_STRING([--with-trang=PATH],
329               [Specify the command to run the trang schema converter]),
330[
331    trang="$withval"
332])
333if test "$trang" = "yes"; then
334    AC_PATH_PROG(TRANG, trang, none)
335else
336    TRANG="$trang"
337    AC_SUBST(TRANG)
338fi
339
340dnl Check for doxygen
341doxygen=yes
342AC_ARG_WITH(doxygen,
343AC_HELP_STRING([--with-doxygen=PATH],
344               [Specify the command to run doxygen]),
345[
346    doxygen="$withval"
347])
348if test "$doxygen" = "yes"; then
349    AC_PATH_PROG(DOXYGEN, doxygen, none)
350else
351    DOXYGEN="$doxygen"
352    AC_SUBST(DOXYGEN)
353fi
354
355
356dnl Check for libraries --------------------
357
358dnl Expat -------------------
359
360AC_ARG_WITH(expat,
361  AS_HELP_STRING([--with-expat=INCLUDES:LIB_SEARCH_DIRS:LIBS], 
362                 [Specify location of Expat]),
363                 [svn_lib_expat="$withval"],
364                 [svn_lib_expat="::expat"])
365
366# APR-util accepts "builtin" as an argument to this option so if the user
367# passed "builtin" pretend the user didn't specify the --with-expat option
368# at all. Expat will (hopefully) be found in apr-util.
369test "_$svn_lib_expat" = "_builtin" && svn_lib_expat="::expat"
370
371AC_MSG_CHECKING([for Expat])
372if test -n "`echo "$svn_lib_expat" | $EGREP ":.*:"`"; then
373  SVN_XML_INCLUDES=""
374  for i in [`echo "$svn_lib_expat" | $SED -e "s/\([^:]*\):.*/\1/"`]; do
375    SVN_XML_INCLUDES="$SVN_XML_INCLUDES -I$i"
376  done
377  SVN_XML_INCLUDES="${SVN_XML_INCLUDES## }"
378  for l in [`echo "$svn_lib_expat" | $SED -e "s/.*:\([^:]*\):.*/\1/"`]; do
379    LDFLAGS="$LDFLAGS -L$l"
380  done
381  for l in [`echo "$svn_lib_expat" | $SED -e "s/.*:\([^:]*\)/\1/"`]; do
382    SVN_XML_LIBS="$SVN_XML_LIBS -l$l"
383  done
384  SVN_XML_LIBS="${SVN_XML_LIBS## }"
385  old_CPPFLAGS="$CPPFLAGS"
386  old_LIBS="$LIBS"
387  CPPFLAGS="$CPPFLAGS $SVN_XML_INCLUDES"
388  LIBS="$LIBS $SVN_XML_LIBS"
389  AC_LINK_IFELSE([AC_LANG_SOURCE([[
390#include <expat.h>
391int main()
392{XML_ParserCreate(NULL);}]])], svn_lib_expat="yes", svn_lib_expat="no")
393  LIBS="$old_LIBS"
394  if test "$svn_lib_expat" = "yes"; then
395    AC_MSG_RESULT([yes])
396  else
397    SVN_XML_INCLUDES=""
398    SVN_XML_LIBS=""
399    CPPFLAGS="$CPPFLAGS $SVN_APRUTIL_INCLUDES"
400    if test "$enable_all_static" != "yes"; then
401      SVN_APRUTIL_LIBS="$SVN_APRUTIL_LIBS `$apu_config --libs`"
402    fi
403    AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
404#include <expat.h>
405int main()
406{XML_ParserCreate(NULL);}]])], svn_lib_expat="yes", svn_lib_expat="no")
407    if test "$svn_lib_expat" = "yes"; then
408      AC_MSG_RESULT([yes])
409      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.])
410    else
411      AC_MSG_RESULT([no])
412      AC_MSG_ERROR([Expat not found])
413    fi
414  fi
415  CPPFLAGS="$old_CPPFLAGS"
416else
417  AC_MSG_RESULT([no])
418  if test "$svn_lib_expat" = "yes"; then
419    AC_MSG_ERROR([--with-expat option requires argument])
420  elif test "$svn_lib_expat" = "no"; then
421    AC_MSG_ERROR([Expat is required])
422  else
423    AC_MSG_ERROR([Invalid syntax of argument of --with-expat option])
424  fi
425fi
426AC_SUBST(SVN_XML_INCLUDES)
427AC_SUBST(SVN_XML_LIBS)
428
429dnl Berkeley DB -------------------
430
431# Berkeley DB on SCO OpenServer needs -lsocket
432AC_CHECK_LIB(socket, socket)
433
434# Build the BDB filesystem library only if we have an appropriate
435# version of Berkeley DB.
436case "$host" in
437powerpc-apple-darwin*)
438    # Berkeley DB 4.0 does not work on OS X.
439    SVN_FS_WANT_DB_MAJOR=4
440    SVN_FS_WANT_DB_MINOR=1
441    SVN_FS_WANT_DB_PATCH=25
442    ;;
443*)
444    SVN_FS_WANT_DB_MAJOR=4
445    SVN_FS_WANT_DB_MINOR=0
446    SVN_FS_WANT_DB_PATCH=14
447    ;;
448esac
449db_alt_version="5.x"
450# Look for libdb4.so first:
451SVN_LIB_BERKELEY_DB($SVN_FS_WANT_DB_MAJOR, $SVN_FS_WANT_DB_MINOR,
452                    $SVN_FS_WANT_DB_PATCH, [db4 db])
453
454AC_DEFINE_UNQUOTED(SVN_FS_WANT_DB_MAJOR, $SVN_FS_WANT_DB_MAJOR,
455                   [The desired major version for the Berkeley DB])
456AC_DEFINE_UNQUOTED(SVN_FS_WANT_DB_MINOR, $SVN_FS_WANT_DB_MINOR,
457                   [The desired minor version for the Berkeley DB])
458AC_DEFINE_UNQUOTED(SVN_FS_WANT_DB_PATCH, $SVN_FS_WANT_DB_PATCH,
459                   [The desired patch version for the Berkeley DB])
460
461AC_SUBST(SVN_DB_INCLUDES)
462AC_SUBST(SVN_DB_LIBS)
463
464SVN_LIB_SASL
465
466if test "$svn_lib_sasl" = "yes"; then
467  AC_DEFINE(SVN_HAVE_SASL, 1,
468            [Defined if Cyrus SASL v2 is present on the system])
469fi
470
471dnl Mac OS specific features -------------------
472
473SVN_LIB_MACHO_ITERATE
474SVN_LIB_MACOS_PLIST
475SVN_LIB_MACOS_KEYCHAIN
476
477dnl APR_HAS_DSO -------------------
478
479AC_MSG_CHECKING([whether APR has support for DSOs])
480old_CPPFLAGS="$CPPFLAGS"
481CPPFLAGS="$CPPFLAGS $SVN_APR_INCLUDES"
482AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
483#include <apr.h>
484#if !APR_HAS_DSO
485#error
486#endif]])],
487  APR_HAS_DSO="yes"
488  AC_MSG_RESULT([yes]),
489  APR_HAS_DSO="no"
490  AC_MSG_RESULT([no]))
491CPPFLAGS="$old_CPPFLAGS"
492
493
494dnl D-Bus (required for support for KWallet) -------------------
495
496if test -n "$PKG_CONFIG"; then
497  AC_MSG_CHECKING([for D-Bus .pc file])
498  if $PKG_CONFIG --exists dbus-1; then
499    AC_MSG_RESULT([yes])
500    old_CPPFLAGS="$CPPFLAGS"
501    old_LIBS="$LIBS"
502    DBUS_CPPFLAGS="`$PKG_CONFIG --cflags dbus-1`"
503    AC_MSG_CHECKING([D-Bus version])
504    DBUS_VERSION="`$PKG_CONFIG --modversion dbus-1`"
505    AC_MSG_RESULT([$DBUS_VERSION])
506    # D-Bus 0.* requires DBUS_API_SUBJECT_TO_CHANGE
507    if test -n ["`echo "$DBUS_VERSION" | $EGREP '^0\.[[:digit:]]+'`"]; then
508      DBUS_CPPFLAGS="$DBUS_CPPFLAGS -DDBUS_API_SUBJECT_TO_CHANGE"
509    fi
510    DBUS_LIBS="`$PKG_CONFIG --libs dbus-1`"
511    CPPFLAGS="$CPPFLAGS $DBUS_CPPFLAGS"
512    LIBS="$LIBS $DBUS_LIBS"
513    AC_MSG_CHECKING([for D-Bus])
514    AC_LINK_IFELSE([AC_LANG_SOURCE([[
515#include <dbus/dbus.h>
516int main()
517{dbus_bus_get(DBUS_BUS_SESSION, NULL);}]])], HAVE_DBUS="yes", HAVE_DBUS="no")
518    if test "$HAVE_DBUS" = "yes"; then
519      AC_MSG_RESULT([yes])
520    else
521      AC_MSG_RESULT([no])
522    fi
523    CPPFLAGS="$old_CPPFLAGS"
524    LIBS="$old_LIBS"
525  else
526    AC_MSG_RESULT([no])
527  fi
528fi
529
530dnl GPG Agent -------------------
531
532AC_ARG_WITH(gpg_agent,
533AS_HELP_STRING([--without-gpg-agent], 
534               [Disable support for GPG-Agent]),
535               [], [with_gpg_agent=yes])
536AC_MSG_CHECKING([whether to support GPG-Agent])
537if test "$with_gpg_agent" = "yes"; then
538  AC_MSG_RESULT([yes])
539  AC_DEFINE([SVN_HAVE_GPG_AGENT], [1], 
540            [Is GPG Agent support enabled?])
541else
542  AC_MSG_RESULT([no])
543fi
544
545AC_SUBST(SVN_HAVE_GPG_AGENT)
546
547dnl GNOME Keyring -------------------
548
549AC_ARG_WITH(gnome_keyring,
550  AS_HELP_STRING([--with-gnome-keyring], 
551                 [Enable use of GNOME Keyring for auth credentials (enabled by default if found)]),
552                 [with_gnome_keyring="$withval"],
553                 [with_gnome_keyring=auto])
554
555found_gnome_keyring=no
556AC_MSG_CHECKING([whether to look for GNOME Keyring])
557if test "$with_gnome_keyring" != "no"; then
558  AC_MSG_RESULT([yes])
559  case "$host" in
560  *-*-darwin*)
561    if test "$with_gnome_keyring" = "yes"; then
562      AC_MSG_ERROR([--with-gnome-keyring is not supported on Mac OS X.])
563    else
564      with_gnome_keyring=no
565    fi
566    ;;
567  *)
568    if test "$svn_enable_shared" = "yes"; then
569      if test "$APR_HAS_DSO" = "yes"; then
570        if test -n "$PKG_CONFIG"; then
571          AC_MSG_CHECKING([for GLib and GNOME Keyring .pc files])
572          if $PKG_CONFIG --exists glib-2.0 gnome-keyring-1; then
573            AC_MSG_RESULT([yes])
574            old_CPPFLAGS="$CPPFLAGS"
575            SVN_GNOME_KEYRING_INCLUDES="`$PKG_CONFIG --cflags glib-2.0 gnome-keyring-1`"
576            CPPFLAGS="$CPPFLAGS $SVN_GNOME_KEYRING_INCLUDES"
577            AC_CHECK_HEADER(gnome-keyring.h, found_gnome_keyring=yes, found_gnome_keyring=no)
578            AC_MSG_CHECKING([for GNOME Keyring])
579            if test "$found_gnome_keyring" = "yes"; then
580              AC_MSG_RESULT([yes])
581              AC_DEFINE([SVN_HAVE_GNOME_KEYRING], [1], 
582                        [Is GNOME Keyring support enabled?])
583              CPPFLAGS="$old_CPPFLAGS"
584              SVN_GNOME_KEYRING_LIBS="`$PKG_CONFIG --libs glib-2.0 gnome-keyring-1`"
585            else
586              AC_MSG_RESULT([no])
587              if test "$with_gnome_keyring" = "yes"; then
588                AC_MSG_ERROR([cannot find GNOME Keyring])
589              fi
590            fi
591          else
592            AC_MSG_RESULT([no])
593            if test "$with_gnome_keyring" = "yes"; then
594              AC_MSG_ERROR([cannot find GLib and GNOME Keyring .pc files.])
595            else
596              with_gnome_keyring=no
597            fi
598          fi
599        else
600          if test "$with_gnome_keyring" = "yes"; then
601            AC_MSG_ERROR([cannot find pkg-config. GNOME Keyring requires this.])
602          else
603            with_gnome_keyring=no
604          fi
605        fi
606      else
607        if test "$with_gnome_keyring" = "yes"; then
608          AC_MSG_ERROR([APR does not have support for DSOs. GNOME Keyring requires this.])
609        else
610          with_gnome_keyring=no
611        fi
612      fi
613    else
614      if test "$with_gnome_keyring" = "yes"; then
615        AC_MSG_ERROR([--with-gnome-keyring conflicts with --disable-shared])
616      else
617        with_gnome_keyring=no
618      fi
619    fi
620    ;;
621  esac
622else
623  AC_MSG_RESULT([no])
624fi
625AC_SUBST(SVN_GNOME_KEYRING_INCLUDES)
626AC_SUBST(SVN_GNOME_KEYRING_LIBS)
627
628dnl Googlemock -----------------
629AC_ARG_ENABLE([gmock],
630  AS_HELP_STRING([--disable-gmock],
631                 [Do not use the Googlemock testing framework]),
632  [],
633  [enable_gmock=yes])
634
635AC_SUBST([GMOCK_SRCDIR], [$abs_srcdir/gmock-fused])
636AC_MSG_CHECKING([whether use Googlemock])
637if test "$enable_gmock" != "no"; then
638  if test -d "$GMOCK_SRCDIR"; then
639    AC_MSG_RESULT([yes])
640    SVN_USE_GMOCK=true
641  else
642    AC_MSG_RESULT([no])
643    SVN_USE_GMOCK=false
644  fi
645else
646  AC_MSG_RESULT([no])
647  SVN_USE_GMOCK_SOURCES=false
648fi
649AC_SUBST([SVN_USE_GMOCK])
650
651dnl Ev2 experimental features ----------------------
652dnl Note: The Ev2 implementations will be built unconditionally, but by
653dnl providing this flag, users can choose to use the currently-shimmed Ev2
654dnl editor implementations for various operations.  This will probably
655dnl negatively impact performance, but is useful for testing.
656AC_ARG_ENABLE(ev2-impl,
657  AS_HELP_STRING([--enable-ev2-impl],
658                 [Use Ev2 implementations, where available [EXPERIMENTAL]]),
659  [enable_ev2_impl=$enableval],[enable_ev2_impl=no])
660if test "$enable_ev2_impl" = "yes"; then
661  AC_DEFINE(ENABLE_EV2_IMPL, 1,
662            [Define to 1 if Ev2 implementations should be used.])
663fi
664
665
666dnl I18n -------------------
667
668AC_ARG_ENABLE(nls,
669  AS_HELP_STRING([--disable-nls],[Disable gettext functionality]),
670  [enable_nls=$enableval],[enable_nls=yes])
671
672USE_NLS="no"
673SVN_INTL_LIBS=""
674if test "$enable_nls" = "yes"; then
675  dnl First, check to see if there is a working msgfmt.
676  AC_PATH_PROG(MSGFMT, msgfmt, none)
677  AC_PATH_PROG(MSGMERGE, msgmerge, none)
678  AC_PATH_PROG(XGETTEXT, xgettext, none)
679  if test "$MSGFMT" != "none"; then
680    AC_SEARCH_LIBS(bindtextdomain, [intl],
681                   [
682                      # in case libintl needs to be linked explicitly,
683                      # $ac_cv_search_bindtextdomain contains -l linker flags
684                      if echo "$ac_cv_search_bindtextdomain" | grep '^-l' >/dev/null
685                      then
686                        SVN_INTL_LIBS="$ac_cv_search_bindtextdomain"
687                      fi
688                   ],
689                   [
690                    enable_nls="no"
691                   ])
692    if test "$enable_nls" = "no"; then
693      # Destroy the cached result so we can test again
694      unset ac_cv_search_bindtextdomain
695      # On some systems, libintl needs libiconv to link properly,
696      # so try again with -liconv.
697      AC_SEARCH_LIBS(bindtextdomain, [intl],
698                     [
699                      enable_nls="yes"
700                      if echo "$ac_cv_search_bindtextdomain" | grep '^-l' >/dev/null
701                      then
702                        SVN_INTL_LIBS="$ac_cv_search_bindtextdomain"
703                      fi
704                      # This is here so that -liconv ends up in LIBS
705                      # if it worked with -liconv.
706                      AC_CHECK_LIB(iconv, libiconv_open)
707                     ], 
708                     [
709                      AC_MSG_WARN([bindtextdomain() not found.  Disabling NLS.])
710                      enable_nls="no"
711                     ], -liconv)
712    fi
713    if test "$enable_nls" = "yes"; then
714      AC_DEFINE(ENABLE_NLS, 1,
715                [Define to 1 if translation of program messages to the user's
716                 native language is requested.])
717      USE_NLS="yes"
718    fi
719  fi
720fi
721
722AC_SUBST(SVN_INTL_LIBS)
723
724AH_BOTTOM([
725/* Indicate to translators that string X should be translated.  Do not look
726   up the translation at run time; just expand to X.  This macro is suitable
727   for use where a constant string is required at compile time. */
728#define N_(x) x
729/* Indicate to translators that we have decided the string X should not be
730   translated.  Expand to X. */
731#define U_(x) x
732#ifdef ENABLE_NLS
733#include <locale.h>
734#include <libintl.h>
735/* Indicate to translators that string X should be translated.  At run time,
736   look up and return the translation of X. */
737#define _(x) dgettext(PACKAGE_NAME, x)
738/* Indicate to translators that strings X1 and X2 are singular and plural
739   forms of the same message, and should be translated.  At run time, return
740   an appropriate translation depending on the number N. */
741#define Q_(x1, x2, n) dngettext(PACKAGE_NAME, x1, x2, n)
742#else
743#define _(x) (x)
744#define Q_(x1, x2, n) (((n) == 1) ? x1 : x2)
745#define gettext(x) (x)
746#define dgettext(domain, x) (x)
747#endif
748
749/* compiler hints */
750#if defined(__GNUC__) && (__GNUC__ >= 3)
751# define SVN__PREDICT_FALSE(x) (__builtin_expect(x, 0))
752# define SVN__PREDICT_TRUE(x) (__builtin_expect(!!(x), 1))
753#else
754# define SVN__PREDICT_FALSE(x) (x)
755# define SVN__PREDICT_TRUE(x) (x)
756#endif
757
758#if defined(SVN_DEBUG)
759# define SVN__FORCE_INLINE
760# define SVN__PREVENT_INLINE
761#elif defined(__GNUC__)
762# define SVN__FORCE_INLINE APR_INLINE __attribute__ ((always_inline))
763# define SVN__PREVENT_INLINE __attribute__ ((noinline))
764#else
765# define SVN__FORCE_INLINE APR_INLINE
766# define SVN__PREVENT_INLINE
767#endif
768
769/* Macro used to specify that a variable is intentionally left unused.
770   Supresses compiler warnings about the variable being unused.  */
771#define SVN_UNUSED(v) ( (void)(v) )
772])
773
774dnl Used to simulate makefile conditionals.
775GETTEXT_CODESET=\#
776NO_GETTEXT_CODESET=\#
777if test $USE_NLS = "yes"; then
778   AC_CHECK_FUNCS(bind_textdomain_codeset,
779                  [ GETTEXT_CODESET="" ],
780                  [ NO_GETTEXT_CODESET="" ])
781fi
782AC_SUBST(GETTEXT_CODESET)
783AC_SUBST(NO_GETTEXT_CODESET)
784
785# Check if we are using GNU gettext.
786GNU_GETTEXT=no
787MSGFMTFLAGS=''
788if test $USE_NLS = "yes"; then
789   AC_MSG_CHECKING(if we are using GNU gettext)
790   if $MSGFMT --version 2>&1 | $EGREP GNU > /dev/null; then
791      GNU_GETTEXT=yes
792      MSGFMTFLAGS='-c'
793   fi
794   AC_MSG_RESULT($GNU_GETTEXT)
795fi
796AC_SUBST(MSGFMTFLAGS)
797
798dnl libmagic -------------------
799
800libmagic_found=no
801
802AC_ARG_WITH(libmagic,AS_HELP_STRING([--with-libmagic=PREFIX],
803                                [libmagic filetype detection library]),
804[
805  if test "$withval" = "yes" ; then
806    AC_CHECK_HEADER(magic.h, [
807      AC_CHECK_LIB(magic, magic_open, [libmagic_found="builtin"])
808    ])
809    libmagic_prefix="the default locations"
810  elif test "$withval" != "no"; then
811    libmagic_prefix=$withval
812    save_cppflags="$CPPFLAGS"
813    CPPFLAGS="$CPPFLAGS -I$libmagic_prefix/include"
814    AC_CHECK_HEADERS(magic.h,[
815      save_ldflags="$LDFLAGS"
816      LDFLAGS="-L$libmagic_prefix/lib $LDFLAGS"
817      AC_CHECK_LIB(magic, magic_open, [libmagic_found="yes"])
818      LDFLAGS="$save_ldflags"
819    ])
820    CPPFLAGS="$save_cppflags"
821  fi
822  if test "$withval" != "no" && test "$libmagic_found" = "no"; then
823    AC_MSG_ERROR([[--with-libmagic requested, but libmagic not found at $libmagic_prefix]])
824  fi
825],
826[
827  AC_CHECK_HEADER(magic.h, [
828    AC_CHECK_LIB(magic, magic_open, [libmagic_found="builtin"])
829  ])
830])
831
832if test "$libmagic_found" != "no"; then
833  AC_DEFINE([SVN_HAVE_LIBMAGIC], [1], [Defined if libmagic support is enabled])
834  SVN_MAGIC_LIBS="-lmagic"
835fi
836
837if test "$libmagic_found" = "yes"; then
838  SVN_MAGIC_INCLUDES="-I$libmagic_prefix/include"
839  LDFLAGS="$LDFLAGS `SVN_REMOVE_STANDARD_LIB_DIRS(-L$libmagic_prefix/lib)`"
840fi
841
842AC_SUBST(SVN_MAGIC_INCLUDES)
843AC_SUBST(SVN_MAGIC_LIBS)
844
845dnl KWallet -------------------
846SVN_LIB_KWALLET
847
848if test "$svn_lib_kwallet" = "yes"; then
849  AC_DEFINE([SVN_HAVE_KWALLET], 1,
850            [Defined if KWallet support is enabled])
851fi
852
853dnl plaintext passwords -------------------
854AC_ARG_ENABLE(plaintext-password-storage,
855AS_HELP_STRING([--disable-plaintext-password-storage],
856               [Disable on-disk caching of plaintext passwords and passphrases.
857                (Leaving this functionality enabled will not force Subversion
858                to store passwords in plaintext, but does permit users to
859                explicitly allow that behavior via runtime configuration.)]),
860[
861   if test "$enableval" = "no"; then
862      AC_MSG_NOTICE([Disabling plaintext password/passphrase storage])
863      AC_DEFINE(SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE, 1,
864                [Defined if plaintext password/passphrase storage is disabled])
865   fi
866])
867
868dnl Build and install rules -------------------
869
870INSTALL_STATIC_RULES="install-bin install-docs"
871INSTALL_RULES="install-fsmod-lib install-ramod-lib install-lib install-include install-static"
872INSTALL_RULES="$INSTALL_RULES $INSTALL_APACHE_RULE"
873BUILD_RULES="fsmod-lib ramod-lib lib bin test sub-test $BUILD_APACHE_RULE tools"
874
875if test "$svn_lib_berkeley_db" = "yes"; then
876  BUILD_RULES="$BUILD_RULES bdb-lib bdb-test"
877  INSTALL_RULES="`echo $INSTALL_RULES | $SED 's/install-fsmod-lib/install-fsmod-lib install-bdb-lib/'`"
878  INSTALL_STATIC_RULES="$INSTALL_STATIC_RULES install-bdb-lib"
879  BDB_TEST_DEPS="\$(BDB_TEST_DEPS)"
880  BDB_TEST_PROGRAMS="\$(BDB_TEST_PROGRAMS)"
881fi
882
883if test "$svn_lib_serf" = "yes"; then
884  BUILD_RULES="$BUILD_RULES serf-lib"
885  INSTALL_RULES="`echo $INSTALL_RULES | $SED 's/install-ramod-lib/install-ramod-lib install-serf-lib/'`"
886  INSTALL_STATIC_RULES="$INSTALL_STATIC_RULES install-serf-lib"
887fi
888
889if test "$svn_lib_kwallet" = "yes"; then
890  BUILD_RULES="$BUILD_RULES kwallet-lib"
891  INSTALL_RULES="`echo $INSTALL_RULES | $SED 's/install-lib/install-lib install-kwallet-lib/'`"
892  INSTALL_STATIC_RULES="$INSTALL_STATIC_RULES install-kwallet-lib"
893fi
894
895if test "$found_gnome_keyring" = "yes"; then
896  BUILD_RULES="$BUILD_RULES gnome-keyring-lib"
897  INSTALL_RULES="`echo $INSTALL_RULES | $SED 's/install-lib/install-lib install-gnome-keyring-lib/'`"
898  INSTALL_STATIC_RULES="$INSTALL_STATIC_RULES install-gnome-keyring-lib"
899fi
900
901if test "$USE_NLS" = "yes"; then
902  BUILD_RULES="$BUILD_RULES locale"
903  INSTALL_RULES="$INSTALL_RULES install-locale"
904fi
905
906AC_SUBST(BUILD_RULES)
907AC_SUBST(INSTALL_STATIC_RULES)
908AC_SUBST(INSTALL_RULES)
909AC_SUBST(BDB_TEST_DEPS)
910AC_SUBST(BDB_TEST_PROGRAMS)
911
912dnl Check for header files ----------------
913
914dnl Standard C headers
915AC_HEADER_STDC
916
917dnl Check for typedefs, structures, and compiler characteristics ----------
918
919dnl if compiler doesn't understand `const', then define it empty
920AC_C_CONST
921
922dnl if non-existent, define size_t to be `unsigned'
923AC_TYPE_SIZE_T
924
925
926dnl Check for library functions ----------
927
928AC_FUNC_MEMCMP
929
930dnl svn_error's default warning handler uses vfprintf()
931AC_FUNC_VPRINTF
932
933dnl check for functions needed in special file handling
934AC_CHECK_FUNCS(symlink readlink)
935
936dnl check for uname
937AC_CHECK_HEADERS(sys/utsname.h, [AC_CHECK_FUNCS(uname)], [])
938
939dnl check for termios
940AC_CHECK_HEADER(termios.h,[
941  AC_CHECK_FUNCS(tcgetattr tcsetattr,[
942    AC_DEFINE(HAVE_TERMIOS_H,1,[Defined if we have a usable termios library.])
943  ])
944])
945
946dnl Process some configuration options ----------
947
948AC_ARG_ENABLE(debug,
949AS_HELP_STRING([--enable-debug],
950               [Turn on debugging]),
951[
952    if test "$enableval" = "yes" ; then
953      enable_debugging="yes"
954    else
955      enable_debugging="no"
956    fi
957],
958[
959    # Neither --enable-debug nor --disable-debug was passed.
960    enable_debugging="maybe"
961])
962
963AC_ARG_ENABLE(optimize,
964AS_HELP_STRING([--enable-optimize],
965               [Turn on optimizations]),
966[
967    if test "$enableval" = "yes" ; then
968      enable_optimization="yes"
969    else
970      enable_optimization="no"
971    fi
972],
973[
974    # Neither --enable-optimize nor --disable-optimize was passed.
975    enable_optimization="maybe"
976])
977
978dnl Use -Wl,--no-undefined during linking of some libraries
979AC_ARG_ENABLE(disallowing-of-undefined-references,
980  [AS_HELP_STRING([--enable-disallowing-of-undefined-references],
981                  [Use -Wl,--no-undefined flag during linking of some libraries to disallow undefined references])])
982if test "$enable_disallowing_of_undefined_references" != "yes" && test "`uname`" != "Linux"; then
983  enable_disallowing_of_undefined_references="no"
984fi
985if test "$enable_disallowing_of_undefined_references" != "no"; then
986  AC_MSG_CHECKING([for -Wl,--no-undefined])
987  old_LDFLAGS="$LDFLAGS"
988  LDFLAGS="$LDFLAGS -Wl,--no-undefined"
989  AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(){;}]])], [svn_wl_no_undefined="yes"], [svn_wl_no_undefined="no"])
990  LDFLAGS="$old_LDFLAGS"
991  if test "$svn_wl_no_undefined" = "yes"; then
992    AC_MSG_RESULT([yes])
993    for library_dir in "$abs_srcdir/subversion/libsvn_"*; do
994      eval "`basename $library_dir`_LDFLAGS=-Wl,--no-undefined"
995    done
996  else
997    AC_MSG_RESULT([no])
998    if test "$enable_disallowing_of_undefined_references" = "yes"; then
999      AC_MSG_ERROR([--enable-disallowing-of-undefined-references explicitly requested, but -Wl,--no-undefined not supported])
1000    fi
1001  fi
1002fi
1003AC_SUBST([libsvn_auth_gnome_keyring_LDFLAGS])
1004AC_SUBST([libsvn_auth_kwallet_LDFLAGS])
1005AC_SUBST([libsvn_client_LDFLAGS])
1006AC_SUBST([libsvn_delta_LDFLAGS])
1007AC_SUBST([libsvn_diff_LDFLAGS])
1008AC_SUBST([libsvn_fs_LDFLAGS])
1009AC_SUBST([libsvn_fs_base_LDFLAGS])
1010AC_SUBST([libsvn_fs_fs_LDFLAGS])
1011AC_SUBST([libsvn_fs_util_LDFLAGS])
1012AC_SUBST([libsvn_ra_LDFLAGS])
1013AC_SUBST([libsvn_ra_local_LDFLAGS])
1014AC_SUBST([libsvn_ra_serf_LDFLAGS])
1015AC_SUBST([libsvn_ra_svn_LDFLAGS])
1016AC_SUBST([libsvn_repos_LDFLAGS])
1017AC_SUBST([libsvn_subr_LDFLAGS])
1018AC_SUBST([libsvn_wc_LDFLAGS])
1019
1020
1021AC_ARG_ENABLE(maintainer-mode,
1022AS_HELP_STRING([--enable-maintainer-mode],
1023               [Turn on debugging and very strict compile-time warnings]),
1024[
1025    if test "$enableval" = "yes" ; then
1026      if test "$enable_debugging" = "no" ; then
1027        AC_MSG_ERROR([Can't have --disable-debug and --enable-maintainer-mode])
1028      fi
1029      enable_debugging=yes
1030
1031      dnl Enable some extra warnings. Put these before the user's flags
1032      dnl so the user can specify flags that override these.
1033      if test "$GCC" = "yes"; then
1034        AC_MSG_NOTICE([maintainer-mode: adding GCC warning flags])
1035
1036        dnl some additional flags that can be handy for an occasional review,
1037        dnl but throw too many warnings in svn code, of too little importance,
1038        dnl to keep these enabled. Remove the "dnl" to do a run with these
1039        dnl switches enabled.
1040        dnl ./configure CFLAGS="-Wswitch-enum -Wswitch-default"
1041
1042        dnl Add each of the following flags only if the C compiler accepts it.
1043        CFLAGS_KEEP="$CFLAGS"
1044        CFLAGS=""
1045
1046        SVN_CFLAGS_ADD_IFELSE([-Werror=implicit-function-declaration])
1047        SVN_CFLAGS_ADD_IFELSE([-Werror=declaration-after-statement])
1048        SVN_CFLAGS_ADD_IFELSE([-Wextra-tokens])
1049        SVN_CFLAGS_ADD_IFELSE([-Wnewline-eof])
1050        SVN_CFLAGS_ADD_IFELSE([-Wshorten-64-to-32])
1051        SVN_CFLAGS_ADD_IFELSE([-Wold-style-definition])
1052        SVN_CFLAGS_ADD_IFELSE([-Wno-system-headers])
1053        SVN_CFLAGS_ADD_IFELSE([-Wno-format-nonliteral])
1054        SVN_CFLAGS_ADD_IFELSE([-Wmissing-variable-declarations])
1055
1056        CMAINTAINERFLAGS="$CFLAGS"
1057        CFLAGS="$CFLAGS_KEEP"
1058
1059        dnl Add flags that all versions of GCC (should) support
1060        CMAINTAINERFLAGS="-Wall -Wpointer-arith -Wwrite-strings -Wshadow -Wformat=2 -Wunused -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wno-multichar -Wredundant-decls -Wnested-externs -Winline -Wno-long-long -Wbad-function-cast $CMAINTAINERFLAGS"
1061      fi
1062      if test "$GXX" = "yes"; then
1063        AC_MSG_NOTICE([maintainer-mode: adding G++ warning flags])
1064
1065        dnl Add each of the following flags only if the C++ compiler accepts it.
1066        CXXFLAGS_KEEP="$CXXFLAGS"
1067        CXXFLAGS=""
1068
1069        SVN_CXXFLAGS_ADD_IFELSE([-Wextra-tokens])
1070        SVN_CXXFLAGS_ADD_IFELSE([-Wnewline-eof])
1071        SVN_CXXFLAGS_ADD_IFELSE([-Wshorten-64-to-32])
1072        SVN_CXXFLAGS_ADD_IFELSE([-Wno-system-headers])
1073
1074        CXXMAINTAINERFLAGS="$CXXFLAGS"
1075        CXXFLAGS="$CXXFLAGS_KEEP"
1076
1077        dnl Add flags that all versions of G++ (should) support
1078        CXXMAINTAINERFLAGS="-Wall -Wpointer-arith -Wwrite-strings -Wshadow -Wunused -Wunreachable-code $CXXMAINTAINERFLAGS"
1079      fi
1080    fi
1081])
1082
1083if test "$enable_debugging" = "yes" ; then
1084  dnl At the moment, we don't want optimization, because we're
1085  dnl debugging. Unless optiization was explicitly enabled.
1086  if test "$enable_optimization" != "yes"; then
1087    AC_MSG_NOTICE([Disabling optimizations for debugging])
1088    CFLAGS=["`echo $CFLAGS' ' | $SED -e 's/-O[^ ]* //g'`"]
1089    CXXFLAGS=["`echo $CXXFLAGS' ' | $SED -e 's/-O[^ ]* //g'`"]
1090  fi
1091  dnl Add debugging flags, unless they were set by the user
1092  if test -z ["`echo $CUSERFLAGS' ' | $EGREP -- '-g[0-9]? '`"]; then
1093    AC_MSG_NOTICE([Enabling debugging for C])
1094    CFLAGS=["`echo $CFLAGS' ' | $SED -e 's/-g[0-9] //g' -e 's/-g //g'`"]
1095    SVN_CFLAGS_ADD_IFELSE([-fno-inline])
1096    SVN_CFLAGS_ADD_IFELSE([-fno-omit-frame-pointer])
1097    SVN_CFLAGS_ADD_IFELSE([-g3],[],[
1098      SVN_CFLAGS_ADD_IFELSE([-g2],[],[
1099        SVN_CFLAGS_ADD_IFELSE([-g])])])
1100  fi
1101  if test -z ["`echo $CXXUSERFLAGS' ' | $EGREP -- '-g[0-9]? '`"]; then
1102    AC_MSG_NOTICE([Enabling debugging for C++])
1103    CXXFLAGS=["`echo $CXXFLAGS' ' | $SED -e 's/-g[0-9] //g' -e 's/-g //g'`"]
1104    SVN_CXXFLAGS_ADD_IFELSE([-fno-inline])
1105    SVN_CXXFLAGS_ADD_IFELSE([-fno-omit-frame-pointer])
1106    SVN_CXXFLAGS_ADD_IFELSE([-g3],[],[
1107      SVN_CXXFLAGS_ADD_IFELSE([-g2],[],[
1108        SVN_CXXFLAGS_ADD_IFELSE([-g])])])
1109  fi
1110  dnl SVN_DEBUG enables specific features for developer builds
1111  dnl AP_DEBUG enables specific (Apache) features for developer builds
1112  CFLAGS="$CFLAGS -DSVN_DEBUG -DAP_DEBUG"
1113  CXXFLAGS="$CXXFLAGS -DSVN_DEBUG -DAP_DEBUG"
1114elif test "$enable_debugging" = "no" ; then
1115  AC_MSG_NOTICE([Disabling debugging])
1116  CFLAGS=["`echo $CFLAGS' ' | $SED -e 's/-g[0-9] //g' -e 's/-g //g'`"]
1117  CXXFLAGS=["`echo $CXXFLAGS' ' | $SED -e 's/-g[0-9] //g' -e 's/-g //g'`"]
1118  dnl Compile with NDEBUG to get rid of assertions
1119  CFLAGS="$CFLAGS -DNDEBUG"
1120  CXXFLAGS="$CXXFLAGS -DNDEBUG"
1121# elif test "$enable_debugging" = "maybe" ; then
1122#   # do nothing
1123fi
1124
1125if test "$enable_optimization" = "yes"; then
1126  dnl Add optimization flags, unless they were set by the user
1127  if test -z ["`echo $CUSERFLAGS' ' | $EGREP -- '-O[^ ]* '`"]; then
1128    CFLAGS=["`echo $CFLAGS' ' | $SED -e 's/-O[^ ]* //g'`"]
1129    if test "$enable_debugging" = "yes"; then
1130      AC_MSG_NOTICE([Enabling optimizations for C (with debugging enabled)])
1131      SVN_CFLAGS_ADD_IFELSE([-O1],[],[
1132        SVN_CFLAGS_ADD_IFELSE([-O])])
1133    else
1134      AC_MSG_NOTICE([Enabling optimizations for C])
1135      SVN_CFLAGS_ADD_IFELSE([-O3],[],[
1136        SVN_CFLAGS_ADD_IFELSE([-O2],[],[
1137          SVN_CFLAGS_ADD_IFELSE([-O1],[],[
1138            SVN_CFLAGS_ADD_IFELSE([-O])])])])
1139      SVN_CFLAGS_ADD_IFELSE([-Wno-clobbered])
1140      SVN_CFLAGS_ADD_IFELSE([-flto])
1141    fi
1142  fi
1143  if test -z ["`echo $CXXUSERFLAGS' ' | $EGREP -- '-O[^ ]* '`"]; then
1144    CXXFLAGS=["`echo $CXXFLAGS' ' | $SED -e 's/-O[^ ]* //g'`"]
1145    if test "$enable_debugging" = "yes"; then
1146      AC_MSG_NOTICE([Enabling optimizations for C++ (with debugging enabled)])
1147      SVN_CXXFLAGS_ADD_IFELSE([-O1],[],[
1148        SVN_CXXFLAGS_ADD_IFELSE([-O])])
1149    else
1150      AC_MSG_NOTICE([Enabling optimizations for C++])
1151      SVN_CXXFLAGS_ADD_IFELSE([-O3],[],[
1152        SVN_CXXFLAGS_ADD_IFELSE([-O2],[],[
1153          SVN_CXXFLAGS_ADD_IFELSE([-O1],[],[
1154            SVN_CXXFLAGS_ADD_IFELSE([-O])])])])
1155      SVN_CXXFLAGS_ADD_IFELSE([-Wno-clobbered])
1156      SVN_CXXFLAGS_ADD_IFELSE([-flto])
1157    fi
1158  fi
1159elif test "$enable_optimization" = "no"; then
1160  dnl Remove all optimization flags
1161  AC_MSG_NOTICE([Disabling optimizations])
1162  CFLAGS=["`echo $CFLAGS' ' | $SED -e 's/-O[^ ]* //g'`"]
1163  CXXFLAGS=["`echo $CXXFLAGS' ' | $SED -e 's/-O[^ ]* //g'`"]
1164# elif test "$enable_optimization" = "maybe" ; then
1165#   # do nothing
1166fi
1167
1168dnl Dump the current compiler options
1169AC_MSG_NOTICE([C compiler flags: $CFLAGS])
1170AC_MSG_NOTICE([    user-defined: $CUSERFLAGS])
1171AC_MSG_NOTICE([ maintainer-mode: $CMAINTAINERFLAGS])
1172AC_MSG_NOTICE([C++ compiler flags: $CXXFLAGS])
1173AC_MSG_NOTICE([      user-defined: $CXXUSERFLAGS])
1174AC_MSG_NOTICE([   maintainer-mode: $CXXMAINTAINERFLAGS])
1175
1176AC_ARG_ENABLE(full-version-match,
1177AS_HELP_STRING([--disable-full-version-match],
1178               [Disable the full version match rules when checking
1179                Subversion library compatibility.]),
1180[
1181    if test "$enableval" = "no" ; then
1182      AC_MSG_NOTICE([Disabling svn full version matching])
1183      AC_DEFINE(SVN_DISABLE_FULL_VERSION_MATCH, 1,
1184                [Defined if the full version matching rules are disabled])
1185    fi
1186])
1187
1188AC_ARG_WITH(editor,
1189AS_HELP_STRING([--with-editor=PATH],
1190               [Specify a default editor for the subversion client.]),
1191[
1192
1193    if test "$withval" = "yes" ; then
1194      AC_MSG_ERROR([--with-editor requires an argument.])
1195    else
1196      SVN_CLIENT_EDITOR=$withval
1197      AC_DEFINE_UNQUOTED(SVN_CLIENT_EDITOR, "$SVN_CLIENT_EDITOR",
1198                         [The path of a default editor for the client.])
1199
1200    fi
1201
1202])
1203
1204SVN_LIB_Z
1205
1206MOD_ACTIVATION=""
1207AC_ARG_ENABLE(mod-activation,
1208AS_HELP_STRING([--enable-mod-activation],
1209               [Enable mod_dav_svn in httpd.conf]),
1210[
1211    if test "$enableval" = "yes" ; then
1212      MOD_ACTIVATION="-a"
1213      AC_MSG_NOTICE([Enabling apache module activation])
1214    else
1215      AC_MSG_NOTICE([Disabling apache module activation])
1216    fi
1217])
1218AC_SUBST(MOD_ACTIVATION)
1219
1220
1221
1222AC_ARG_ENABLE(gcov,
1223AC_HELP_STRING([--enable-gcov],
1224               [Turn on gcov coverage testing (GCC only).]),
1225[
1226    if test "$enableval" = "yes" ; then
1227      dnl Probably other compilers support something similar;
1228      dnl feel free to extend this to include them.
1229      if test "$GCC" = "yes"; then
1230        if test "$svn_enable_shared" = "yes" ; then
1231          AC_MSG_ERROR([Can't have --enable-gcov without --disable-shared (we
1232                        recommend also using --enable-all-static).])
1233        fi
1234        if test ! "$enable_all_static" = "yes" ; then
1235          AC_MSG_WARN(We recommend --enable-all-static with --enable-gcov.)
1236        fi
1237        AC_MSG_NOTICE([Enabling gcov coverage testing.])
1238        CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
1239        CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage"
1240      else
1241        AC_MSG_ERROR([We only support --enable-gcov with GCC right now.])
1242      fi
1243    fi
1244])
1245
1246AC_ARG_ENABLE(gprof,
1247AS_HELP_STRING([--enable-gprof],
1248               [Produce gprof profiling data in 'gmon.out' (GCC only).]),
1249[
1250    if test "$enableval" = "yes" ; then
1251      dnl Probably other compilers support -pg or something similar;
1252      dnl feel free to extend this to include them.
1253      if test "$GCC" = "yes"; then
1254        if test "$svn_enable_shared" = "yes" ; then
1255          AC_MSG_ERROR([Can't have --enable-gprof without --disable-shared (we
1256                        recommend also using --enable-all-static).])
1257        fi
1258        if test ! "$enable_all_static" = "yes" ; then
1259          AC_MSG_WARN(We recommend --enable-all-static with --enable-gprof.)
1260        fi
1261        AC_MSG_NOTICE([Enabling gprof profiling data (to gmon.out).])
1262        CFLAGS="$CFLAGS -pg"
1263        CXXFLAGS="$CXXFLAGS -pg"
1264        LT_LDFLAGS="$LT_LDFLAGS -pg"
1265      else
1266        AC_MSG_ERROR([We only support --enable-gprof with GCC right now.])
1267      fi
1268    fi
1269])
1270
1271
1272# Scripting and Bindings languages
1273
1274# Python: Used for testsuite, and bindings
1275
1276
1277PYTHON="`$abs_srcdir/build/find_python.sh`"
1278if test -z "$PYTHON"; then
1279  AC_MSG_WARN([Python 2.7 or later is required to run the testsuite])
1280  AC_MSG_WARN([or to use the Subversion Python bindings])
1281  AC_MSG_WARN([])
1282  AC_MSG_WARN([If you have a suitable Python installed, but not on the])
1283  AC_MSG_WARN([PATH, set the environment variable PYTHON to the full path])
1284  AC_MSG_WARN([to the Python executable, and re-run configure])
1285fi
1286AC_PATH_PROGS(PYTHON, "$PYTHON", none)
1287
1288# The minimum version for the JVM runtime for our Java bytecode.
1289JAVA_OLDEST_WORKING_VER='1.6'
1290# SVN_CHECK_JDK sets $JAVA_CLASSPATH
1291SVN_CHECK_JDK($JAVA_OLDEST_WORKING_VER)
1292
1293AC_PATH_PROG(PERL, perl, none)
1294
1295if test -n "$RUBY"; then
1296  AC_PATH_PROG(RUBY, "$RUBY", none)
1297else
1298  AC_PATH_PROGS(RUBY, ruby ruby1.8 ruby18 ruby1.9 ruby1 ruby1.9.3 ruby193 ruby2.0 ruby2.1, none)
1299fi
1300if test "$RUBY" != "none"; then
1301  AC_MSG_CHECKING([rb_hash_foreach])
1302  if "$RUBY" -r mkmf -e 'exit(have_func("rb_hash_foreach") ? 0 : 1)' >/dev/null; then
1303    AC_MSG_RESULT([yes])
1304    if test -n "$RDOC"; then
1305      AC_PATH_PROG(RDOC, "$RDOC", none)
1306    else
1307      AC_PATH_PROGS(RDOC, rdoc rdoc1.8 rdoc18 rdoc1.9 rdoc19 rdoc1.9.3 rdoc193 rdoc2.0 rdoc2.1, none)
1308    fi
1309    AC_CACHE_CHECK([for Ruby major version], [svn_cv_ruby_major],[
1310    svn_cv_ruby_major="`$RUBY -rrbconfig -e 'print RbConfig::CONFIG.fetch(%q(MAJOR))'`"
1311    ])
1312    RUBY_MAJOR="$svn_cv_ruby_major"
1313
1314    AC_CACHE_CHECK([for Ruby minor version], [svn_cv_ruby_minor],[
1315    svn_cv_ruby_minor="`$RUBY -rrbconfig -e 'print RbConfig::CONFIG.fetch(%q(MINOR))'`"
1316    ])
1317    RUBY_MINOR="$svn_cv_ruby_minor"
1318
1319    AC_CACHE_CHECK([for Ruby teeny version], [svn_cv_ruby_teeny],[
1320    svn_cv_ruby_teeny="`$RUBY -rrbconfig -e 'major, minor, teeny = RUBY_VERSION.split("."); print teeny;'`"
1321    ])
1322    RUBY_TEENY="$svn_cv_ruby_teeny"
1323    
1324    AC_SUBST(RUBY_MAJOR)
1325    AC_SUBST(RUBY_MINOR)
1326    AC_SUBST(RUBY_TEENY)
1327    if test \( "$RUBY_MAJOR" -eq "1" -a "$RUBY_MINOR" -gt "8" -a "$RUBY_TEENY" -lt "3" \); then
1328      # Disallow Ruby between 1.8.7 and 1.9.3
1329      RUBY="none"
1330      AC_MSG_WARN([The detected Ruby is between 1.9 and 1.9.3])
1331      AC_MSG_WARN([Only 1.8.x and 1.9.3 releases are supported at this time])
1332    fi
1333  else
1334    AC_MSG_RESULT([no])
1335    RUBY="none"
1336    AC_MSG_WARN([The detected Ruby is too old for Subversion to use])
1337    AC_MSG_WARN([A Ruby which has rb_hash_foreach is required to use the])
1338    AC_MSG_WARN([Subversion Ruby bindings])
1339    AC_MSG_WARN([Upgrade to the official 1.8.2 release, or later])
1340  fi
1341fi
1342
1343SVN_CHECK_SWIG
1344
1345SVN_CHECK_CTYPESGEN
1346
1347dnl decide whether we want to link against the RA/FS libraries
1348AC_ARG_ENABLE(runtime-module-search,
1349AS_HELP_STRING([--enable-runtime-module-search],
1350               [Turn on dynamic loading of RA/FS libraries including
1351                third-party FS libraries]),
1352[
1353    if test "$enableval" = "yes"; then
1354      use_dso=yes
1355      if test "$svn_enable_shared" = "no"; then
1356        AC_MSG_ERROR([--enable-runtime-module-search conflicts with --disable-shared])
1357      fi
1358      AC_DEFINE(SVN_USE_DSO, 1,
1359                [Defined if svn should try to load DSOs])
1360    fi
1361])
1362
1363if test "$svn_enable_shared" = "no" || test "$use_dso" != "yes"; then
1364  AC_DEFINE(SVN_LIBSVN_CLIENT_LINKS_RA_LOCAL, 1,
1365      [Defined if libsvn_client should link against libsvn_ra_local])
1366  svn_ra_lib_deps="\$(RA_LOCAL_DEPS)"
1367  svn_ra_lib_install_deps="install-ramod-lib"
1368  svn_ra_lib_link="\$(RA_LOCAL_LINK)"
1369
1370  AC_DEFINE(SVN_LIBSVN_CLIENT_LINKS_RA_SVN, 1,
1371      [Defined if libsvn_client should link against libsvn_ra_svn])
1372  svn_ra_lib_deps="$svn_ra_lib_deps \$(RA_SVN_DEPS)"
1373  svn_ra_lib_link="$svn_ra_lib_link \$(RA_SVN_LINK)"
1374
1375  if test "$svn_lib_serf" = "yes"; then
1376    AC_DEFINE(SVN_LIBSVN_CLIENT_LINKS_RA_SERF, 1,
1377          [Defined if libsvn_client should link against libsvn_ra_serf])
1378    svn_ra_lib_deps="$svn_ra_lib_deps \$(RA_SERF_DEPS)"
1379    svn_ra_lib_install_deps="$svn_ra_lib_install_deps install-serf-lib"
1380    svn_ra_lib_link="$svn_ra_lib_link \$(RA_SERF_LINK)"
1381  fi
1382
1383  SVN_RA_LIB_DEPS=$svn_ra_lib_deps
1384  SVN_RA_LIB_INSTALL_DEPS=$svn_ra_lib_install_deps
1385  SVN_RA_LIB_LINK=$svn_ra_lib_link
1386
1387  AC_DEFINE(SVN_LIBSVN_FS_LINKS_FS_FS, 1,
1388      [Defined if libsvn_fs should link against libsvn_fs_fs])
1389  svn_fs_lib_deps="\$(FS_FS_DEPS)"
1390  svn_fs_lib_install_deps="install-fsmod-lib"
1391  svn_fs_lib_link="\$(FS_FS_LINK)"
1392
1393  AC_DEFINE(SVN_LIBSVN_FS_LINKS_FS_X, 1,
1394      [Defined if libsvn_fs should link against libsvn_fs_x])
1395  svn_fs_lib_deps="$svn_fs_lib_deps \$(FS_X_DEPS)"
1396  svn_fs_lib_link="$svn_fs_lib_link \$(FS_X_LINK)"
1397dnl  FSFS already installs fsmod
1398dnl  svn_fs_lib_install_deps="$svn_fs_lib_install_deps install-fsmod-lib"
1399
1400  if test "$svn_lib_berkeley_db" = "yes"; then
1401  AC_DEFINE(SVN_LIBSVN_FS_LINKS_FS_BASE, 1,
1402      [Defined if libsvn_fs should link against libsvn_fs_base])
1403    svn_fs_lib_deps="$svn_fs_lib_deps \$(FS_BASE_DEPS)"
1404    svn_fs_lib_install_deps="$svn_fs_lib_install_deps install-bdb-lib"
1405    svn_fs_lib_link="$svn_fs_lib_link \$(FS_BASE_LINK)"
1406  fi
1407
1408  SVN_FS_LIB_DEPS=$svn_fs_lib_deps
1409  SVN_FS_LIB_INSTALL_DEPS=$svn_fs_lib_install_deps
1410  SVN_FS_LIB_LINK=$svn_fs_lib_link
1411fi
1412
1413AC_SUBST(SVN_RA_LIB_DEPS)
1414AC_SUBST(SVN_RA_LIB_INSTALL_DEPS)
1415AC_SUBST(SVN_RA_LIB_LINK)
1416AC_SUBST(SVN_FS_LIB_DEPS)
1417AC_SUBST(SVN_FS_LIB_INSTALL_DEPS)
1418AC_SUBST(SVN_FS_LIB_LINK)
1419
1420# ==== JavaHL ================================================================
1421
1422dnl Possibly compile JavaHL
1423do_javahl_build=no
1424AC_ARG_ENABLE(javahl,
1425  AS_HELP_STRING([--enable-javahl],
1426             [Enable compilation of Java high-level bindings (requires C++)]),
1427  [ if test "$enableval" = "yes" ; then
1428        do_javahl_build="yes"
1429    fi
1430  ])
1431
1432JAVAHL_OBJDIR=""
1433INSTALL_EXTRA_JAVAHL_LIB=""
1434FIX_JAVAHL_LIB=""
1435JAVAHL_TESTS_TARGET=""
1436JAVAHL_COMPAT_TESTS_TARGET=""
1437LT_CXX_LIBADD=""
1438if test "$do_javahl_build" = "yes"; then
1439  dnl Check for suitable JDK
1440  if test "$JDK_SUITABLE" = "no"; then
1441    AC_MSG_ERROR([Cannot compile JavaHL without a suitable JDK. 
1442                  Please specify a suitable JDK using the --with-jdk option.])
1443  fi
1444  
1445  dnl The temporary directory where libtool compiles libsvnjavahl.
1446  JAVAHL_OBJDIR='$(libsvnjavahl_PATH)/.libs'
1447  
1448  os_arch=`uname`
1449  if test "$os_arch" = "Darwin"; then
1450    dnl On Darwin, JNI libs must be installed as .jnilib
1451    INSTALL_EXTRA_JAVAHL_LIB='ln -sf $(libdir)/libsvnjavahl-1.dylib $(libdir)/libsvnjavahl-1.jnilib'
1452    FIX_JAVAHL_LIB="ln -sf libsvnjavahl-1.dylib $JAVAHL_OBJDIR/libsvnjavahl-1.jnilib"
1453  fi
1454  # This segment (and the rest of r10800) is very likely unnecessary
1455  # with libtool 1.5, which automatically adds libstdc++ as a
1456  # dependency to the C++ libraries it builds.  So at some future time
1457  # when autogen.sh requires libtool 1.5 or higher, we can get rid of
1458  # it.
1459  AC_MSG_CHECKING([for additional flags to link C++ libraries])
1460  if test "x$ac_compiler_gnu" = "xyes"; then
1461    case "$host" in
1462      *freebsd10*)
1463        AC_MSG_RESULT([none needed])
1464      ;;
1465      *)
1466        LT_CXX_LIBADD="-lstdc++"
1467        AC_MSG_RESULT([$LT_CXX_LIBADD])
1468      ;;
1469    esac
1470  else
1471    AC_MSG_RESULT([none needed])
1472  fi
1473fi
1474AC_SUBST(INSTALL_EXTRA_JAVAHL_LIB)
1475AC_SUBST(JAVAHL_OBJDIR)
1476AC_SUBST(FIX_JAVAHL_LIB)
1477AC_SUBST(LT_CXX_LIBADD)
1478
1479AC_ARG_WITH(junit,
1480AS_HELP_STRING([--with-junit=PATH],
1481               [Specify a path to the junit JAR file.]),
1482[
1483    if test "$withval" != "no"; then
1484      if test -n "$JAVA_CLASSPATH"; then
1485        JAVA_CLASSPATH="$withval:$JAVA_CLASSPATH"
1486      else
1487        JAVA_CLASSPATH="$withval"
1488      fi
1489      JAVAHL_TESTS_TARGET="javahl-tests"
1490      JAVAHL_COMPAT_TESTS_TARGET="javahl-compat-tests"
1491    fi
1492])
1493AC_SUBST(JAVA_CLASSPATH)
1494AC_SUBST(JAVAHL_TESTS_TARGET)
1495AC_SUBST(JAVAHL_COMPAT_TESTS_TARGET)
1496
1497# ==== Miscellaneous bits ====================================================
1498
1499AC_CHECK_HEADERS([stdbool.h inttypes.h])
1500
1501# Strip '-no-cpp-precomp' from CPPFLAGS for the clang compiler
1502### I think we get this flag from APR, so the fix probably belongs there
1503if test "$CC" = "clang"; then
1504  SVN_STRIP_FLAG(CPPFLAGS, [-no-cpp-precomp ])
1505fi
1506
1507# Need to strip '-no-cpp-precomp' from CPPFLAGS for SWIG as well.
1508SWIG_CPPFLAGS="$CPPFLAGS"
1509SVN_STRIP_FLAG(SWIG_CPPFLAGS, [-no-cpp-precomp ])
1510SVN_STRIP_FLAG(SWIG_CPPFLAGS, [-Wdate-time ])
1511AC_SUBST([SWIG_CPPFLAGS])
1512
1513dnl Since this is used only on Unix-y systems, define the path separator as '/'
1514AC_DEFINE_UNQUOTED(SVN_PATH_LOCAL_SEPARATOR, '/',
1515        [Defined to be the path separator used on your local filesystem])
1516
1517AC_DEFINE_UNQUOTED(SVN_NULL_DEVICE_NAME, "/dev/null",
1518        [Defined to be the null device for the system])
1519
1520DEFAULT_FS_TYPE="fsfs"
1521AC_DEFINE_UNQUOTED(DEFAULT_FS_TYPE, "$DEFAULT_FS_TYPE",
1522                   [The fs type to use by default])
1523
1524DEFAULT_HTTP_LIBRARY="serf"
1525AC_DEFINE_UNQUOTED(DEFAULT_HTTP_LIBRARY, "$DEFAULT_HTTP_LIBRARY",
1526                   [The http library to use by default])
1527
1528# BSD/OS (BSDi) needs to use a different include syntax in Makefile
1529INCLUDE_OUTPUTS="include \$(top_srcdir)/build-outputs.mk"
1530case "$host" in
1531  *bsdi*)
1532    # Check whether they've installed GNU make
1533    if ! make --version > /dev/null 2>&1; then 
1534      # BSDi make
1535      INCLUDE_OUTPUTS=".include \"\$(top_srcdir)/build-outputs.mk\""
1536    fi
1537    ;;
1538esac
1539AC_SUBST(INCLUDE_OUTPUTS)
1540
1541# ==== Detection complete - output and run config.status =====================
1542
1543AC_CONFIG_HEADERS(subversion/svn_private_config.h.tmp:subversion/svn_private_config.h.in)
1544AC_CONFIG_COMMANDS([svn_private_config.h.tmp],
1545                   [svn_cf=subversion/svn_private_config.h;
1546                    $SED -e "s/@SVN_DB_HEADER@/$SVN_DB_HEADER/" $svn_cf.tmp > $svn_cf.tmp.new
1547                    cmp -s $svn_cf.tmp.new $svn_cf || mv -f $svn_cf.tmp.new $svn_cf
1548                    rm -f $svn_cf.tmp.new $svn_cf.tmp],
1549                   [SED="$SED"
1550                    SVN_DB_HEADER="$SVN_DB_HEADER"])
1551AC_CONFIG_FILES([Makefile])
1552
1553# Create pkg-config .pc files from .pc.in files
1554for pc_in_file in "${abs_srcdir}"/subversion/libsvn_*/*.pc.in; do
1555  pc_file=${pc_in_file#${abs_srcdir}/}
1556  pc_file=${pc_file%.in}
1557  AC_CONFIG_FILES([${pc_file}])
1558done
1559
1560SVN_CONFIG_SCRIPT(tools/backup/hot-backup.py)
1561SVN_CONFIG_SCRIPT(tools/hook-scripts/commit-access-control.pl)
1562SVN_CONFIG_SCRIPT(subversion/bindings/swig/perl/native/Makefile.PL)
1563if test -e packages/solaris/pkginfo.in; then
1564  SVN_CONFIG_SCRIPT(packages/solaris/pkginfo)
1565fi
1566AC_SUBST(SVN_CONFIG_SCRIPT_FILES)
1567
1568# Ensure that SWIG is checked after reconfiguration.
1569rm -f .swig_checked
1570
1571dnl Provide ${host} for use in compiled code (for svn --version)
1572AC_DEFINE_UNQUOTED([SVN_BUILD_HOST], "${host}",
1573                   [Defined to the config.guess name of the build system])
1574
1575dnl Provide ${target} for use in compiled code (for user-agent string)
1576AC_DEFINE_UNQUOTED([SVN_BUILD_TARGET], "${target}",
1577                   [Defined to the config.guess name of the build target])
1578
1579AC_OUTPUT
1580
1581# ==== Print final messages to user ==========================================
1582
1583dnl Configure is long - users tend to miss warnings printed during it.
1584dnl Hence, print a warnings about what we did and didn't configure at the 
1585dnl end, where people will actually see them.
1586
1587if test "$svn_have_berkeley_db" = "no6" && test "$enable_bdb6" != "no"; then
1588  AC_MSG_WARN([We have configured without BDB filesystem support
1589
1590
1591Berkeley DB 6 was found, but not used.  Please re-run configure (see
1592./config.nice) with the '--enable-bdb6' flag to use it,
1593or explicitly specify '--disable-bdb6' or '--without-berkeley-db'
1594to silence this warning.
1595
1596Please note that some versions of Berkeley DB 6+ are under the GNU Affero
1597General Public License, version 3:
1598https://oss.oracle.com/pipermail/bdb/2013-June/000056.html
1599
1600The AGPL-3.0 licence may impose special requirements for making available
1601source code of server-side software.  The text of the licence is:
1602https://www.gnu.org/licenses/agpl-3.0.html
1603http://opensource.org/licenses/AGPL-3.0
1604
1605The Berkeley DB backend to Subversion is deprecated; see
1606http://subversion.apache.org/docs/release-notes/1.8#bdb-deprecated
1607
1608The Subversion developers have not tested Subversion with Berkeley DB 6 for
1609technical problems or bugs.
1610])
1611fi
1612