Fix compiler warning due to missing function prototype.
[svn.git] / configure.ac
blob39e44eef4aceb6302bd41bf62099b0085705c40e
1 dnl configure.ac: Autoconfiscation for Subversion
2 dnl Process this file with autoconf to produce a configure script.
4 AC_PREREQ(2.58)
6 dnl Get the version of Subversion, using m4's esyscmd() command to do this
7 dnl at m4-time, since AC_INIT() requires it then.
8 AC_INIT([subversion],
9         [esyscmd(python build/getversion.py subversion/include/svn_version.h)],
10         [http://subversion.tigris.org/])
12 AC_CONFIG_SRCDIR(subversion/include/svn_types.h)
13 AC_CONFIG_AUX_DIR([build])
15 AC_MSG_NOTICE([Configuring Subversion ]AC_PACKAGE_VERSION)
17 AC_SUBST([abs_srcdir], ["`cd $srcdir && pwd`"])
18 AC_SUBST([abs_builddir], ["`pwd`"])
20 # Generate config.nice early (before the arguments are munged)
21 SVN_CONFIG_NICE(config.nice)
23 # ==== Check for programs ====================================================
25 # Look for a C compiler (before anything can set CFLAGS)
26 AC_PROG_CC
28 # Look for a C pre-processor
29 AC_PROG_CPP
31 # Grab target_cpu, so we can use it in the Solaris pkginfo file
32 AC_CANONICAL_TARGET
34 # Look for an extended grep
35 AC_PROG_EGREP
37 AC_PROG_LN_S
39 AC_PROG_INSTALL
40 # If $INSTALL is relative path to our fallback install-sh, then convert
41 # to an absolute path, as in some cases (e.g. Solaris VPATH build), libtool
42 # may try to use it from a changed working directory.
43 if test "$INSTALL" = "build/install-sh -c"; then
44   INSTALL="$abs_srcdir/$INSTALL"
47 AC_SUBST([MKDIR], ["$INSTALL -d"])
50 dnl find Apache with a recent-enough magic module number.
51 SVN_FIND_APACHE(20020903)
53 # ==== Libraries, for which we may have source to build ======================
55 dnl verify apr version and set apr flags
56 dnl These regular expressions should not contain "\(" and "\)".
57 dnl The specific reason we require APR 0.9.7 is:
58 dnl   It contains fixes to its file writing routines
59 dnl   now generating errors instead of silently ignoring
60 dnl   them.  Only .7 and later can guarantee repository
61 dnl   integrity with FSFS.
63 APR_VER_REGEXES=["0\.9\.[7-9] 0\.9\.1[0-9] 1\."]
64 APU_VER_REGEXES=["0\.9\.[7-9] 0\.9\.1[0-9] 1\."]
66 SVN_LIB_APR($APR_VER_REGEXES)
67 SVN_LIB_APRUTIL($APU_VER_REGEXES)
69 # Either a space-separated list of allowable Neon versions, or "any" to
70 # mean allow anything.
71 NEON_ALLOWED_LIST="0.25.0 0.25.1 0.25.2 0.25.3 0.25.4 0.25.5 0.26.0 0.26.1 0.26.2 0.26.3 0.26.4 0.27.2 0.28.0 0.28.1 0.28.2 0.29.0-dev"
72 NEON_RECOMMENDED_VER=0.28.1
73 NEON_URL="http://www.webdav.org/neon/neon-${NEON_RECOMMENDED_VER}.tar.gz"
74 dnl You can skip the neon version check only if you know what you are doing 
75 AC_ARG_ENABLE(neon-version-check,
76   AS_HELP_STRING([--disable-neon-version-check],
77                  [do not check the Neon version]),
78   [
79     if test "$enableval" = "no" ; then
80       NEON_ALLOWED_LIST="any"
81     fi
82   ],
83   [])
84 SVN_LIB_NEON($NEON_ALLOWED_LIST, $NEON_RECOMMENDED_VER, $NEON_URL)
86 dnl Search for serf as an alternative to neon
87 SVN_LIB_SERF
89 dnl Set up a number of directories ---------------------
91 dnl Create SVN_BINDIR for proper substitution
92 if test "${bindir}" = '${exec_prefix}/bin'; then
93         if test "${exec_prefix}" = "NONE"; then
94                 if test "${prefix}" = "NONE"; then
95                         SVN_BINDIR="${ac_default_prefix}/bin"
96                 else
97                         SVN_BINDIR="${prefix}/bin"
98                 fi
99         else
100                 SVN_BINDIR="${exec_prefix}/bin"
101         fi
102 else
103         SVN_BINDIR="${bindir}"
106 dnl fully evaluate this value. when we substitute it into our tool scripts,
107 dnl they will not have things such as ${bindir} available
108 SVN_BINDIR="`eval echo ${SVN_BINDIR}`"
109 AC_SUBST(SVN_BINDIR)
111 dnl provide ${bindir} in svn_private_config.h for use in compiled code
112 AC_DEFINE_UNQUOTED(SVN_BINDIR, "${SVN_BINDIR}",
113         [Defined to be the path to the installed binaries])
115 dnl This purposely does *not* allow for multiple parallel installs.
116 dnl However, it is compatible with most gettext usages.
117 localedir='${datadir}/locale'
118 AC_SUBST(localedir)
120 dnl For SVN_LOCALE_DIR, we have to expand it to something.  See SVN_BINDIR.
121 if test "${datadir}" = '${prefix}/share' && test "${prefix}" = "NONE"; then
122   exp_localedir='${ac_default_prefix}/share/locale'
123 else
124   exp_localedir=$localedir
126 SVN_EXPAND_VAR(svn_localedir, "${exp_localedir}")
127 AC_DEFINE_UNQUOTED(SVN_LOCALE_DIR, "${svn_localedir}",
128                    [Defined to be the path to the installed locale dirs])
130 dnl Check for libtool -- we'll definitely need it for all our shared libs!
131 echo "configuring libtool now"
132 AC_ARG_ENABLE(experimental-libtool,
133   AS_HELP_STRING([--enable-experimental-libtool],[Use APR's libtool]),
134   [experimental_libtool=$enableval],[experimental_libtool=no])
136 if test "$experimental_libtool" = "yes"; then
137   echo "using APR's libtool"
138   sh_libtool="`$apr_config --apr-libtool`"
139   LIBTOOL="$sh_libtool"
140   SVN_LIBTOOL="$sh_libtool"
141 else
142   sh_libtool="$abs_builddir/libtool"
143   SVN_LIBTOOL="\$(SHELL) $sh_libtool"
144   dnl libtoolize requires that the following line not be indented
145 ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL])
147 AC_SUBST(SVN_LIBTOOL)
149 dnl Before configuring libtool check for --enable-all-static option
150 AC_ARG_ENABLE(all-static,
151   AS_HELP_STRING([--enable-all-static],
152                  [Build completely static (standalone) binaries.]),
153   [
154     if test "$enableval" = "yes" ; then
155       LT_LDFLAGS="-all-static $LT_LDFLAGS"
156     fi
159 AC_SUBST(LT_LDFLAGS)
161 dnl Check if -no-undefined is needed for the platform.
162 dnl It should always work but with libtool 1.4.3 on OS X it breaks the build.
163 dnl So we only turn it on for platforms where we know we really need it.
164 AC_MSG_CHECKING([whether libtool needs -no-undefined])
165 case $host in
166   *-*-cygwin*)
167     AC_MSG_RESULT([yes])
168     LT_NO_UNDEFINED="-no-undefined"
169     ;;
170   *)
171     AC_MSG_RESULT([no])
172     LT_NO_UNDEFINED=""
173     ;;
174 esac
175 AC_SUBST(LT_NO_UNDEFINED)
177 AC_MSG_CHECKING([whether to avoid circular linkage at all costs])
178 case $host in
179   *-*-cygwin*)
180     AC_MSG_RESULT([yes])
181     AC_DEFINE([SVN_AVOID_CIRCULAR_LINKAGE_AT_ALL_COSTS_HACK], 1,
182               [Define if circular linkage is not possible on this platform.])
183     ;;
184   *)
185     AC_MSG_RESULT([no])
186     ;;
187 esac
189 dnl Check for trang.
190 trang=yes
191 AC_ARG_WITH(trang,
192 AS_HELP_STRING([--with-trang=PATH],
193                [Specify the command to run the trang schema converter]),
195     trang="$withval"
197 if test "$trang" = "yes"; then
198     AC_PATH_PROG(TRANG, trang, none)
199 else
200     TRANG="$trang"
201     AC_SUBST(TRANG)
205 dnl Check for libraries --------------------
207 # Berkeley DB on SCO OpenServer needs -lsocket
208 AC_CHECK_LIB(socket, socket)
210 # Build the BDB filesystem library only if we have an appropriate
211 # version of Berkeley DB.
212 case "$host" in
213 powerpc-apple-darwin*)
214     # Berkeley DB 4.0 does not work on OS X.
215     SVN_FS_WANT_DB_MAJOR=4
216     SVN_FS_WANT_DB_MINOR=1
217     SVN_FS_WANT_DB_PATCH=25
218     ;;
220     SVN_FS_WANT_DB_MAJOR=4
221     SVN_FS_WANT_DB_MINOR=0
222     SVN_FS_WANT_DB_PATCH=14
223     ;;
224 esac
225 # Look for libdb4.so first:
226 SVN_LIB_BERKELEY_DB($SVN_FS_WANT_DB_MAJOR, $SVN_FS_WANT_DB_MINOR,
227                     $SVN_FS_WANT_DB_PATCH, [db4 db])
229 AC_DEFINE_UNQUOTED(SVN_FS_WANT_DB_MAJOR, $SVN_FS_WANT_DB_MAJOR,
230                    [The desired major version for the Berkeley DB])
231 AC_DEFINE_UNQUOTED(SVN_FS_WANT_DB_MINOR, $SVN_FS_WANT_DB_MINOR,
232                    [The desired minor version for the Berkeley DB])
233 AC_DEFINE_UNQUOTED(SVN_FS_WANT_DB_PATCH, $SVN_FS_WANT_DB_PATCH,
234                    [The desired patch version for the Berkeley DB])
236 SVN_LIB_SASL
238 if test "$svn_lib_sasl" = "yes"; then
239   AC_DEFINE(SVN_HAVE_SASL, 1,
240             [Defined if Cyrus SASL v2 is present on the system])
243 dnl Mac OS KeyChain -------------------
245 AC_ARG_ENABLE(keychain,
246   AS_HELP_STRING([--disable-keychain], 
247   [Disable use of Mac OS KeyChain for auth credentials]),
248   [enable_keychain=$enableval],[enable_keychain=yes])
250 AC_MSG_CHECKING([for Mac OS KeyChain Services])
252 if test "$enable_keychain" = "yes"; then
253   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <AvailabilityMacros.h>
254 #if !DARWIN || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_2)
255 #error KeyChain API unavailable.
256 #endif]], [[]])],[],[enable_keychain=no])
259 if test "$enable_keychain" = "yes"; then
260   dnl ### Hack.  We should only need to pass the -framework options when
261   dnl linking libsvn_subr, since it is the only library that uses Keychain.
262   dnl
263   dnl Unfortunately, libtool 1.5.x doesn't track transitive dependencies for
264   dnl OS X frameworks like it does for normal libraries, so we need to
265   dnl explicitly pass the option to all the users of libsvn_subr to allow
266   dnl static builds to link successfully.
267   dnl
268   dnl This does mean that all executables we link will be linked directly
269   dnl to these frameworks - even when building shared libraries - but that
270   dnl shouldn't cause any problems.
271   LIBS="$LIBS -framework Security"
272   LIBS="$LIBS -framework CoreFoundation"
273   LIBS="$LIBS -framework CoreServices"
274   AC_DEFINE([SVN_HAVE_KEYCHAIN_SERVICES], [1], [Is Mac OS KeyChain support enabled?])
275   AC_MSG_RESULT([yes])
276 else
277   AC_MSG_RESULT([no])
281 dnl I18n -------------------
283 AC_ARG_ENABLE(nls,
284   AS_HELP_STRING([--disable-nls],[Disable gettext functionality]),
285   [enable_nls=$enableval],[enable_nls=yes])
287 USE_NLS="no"
288 if test "$enable_nls" = "yes"; then
289   dnl First, check to see if there is a working msgfmt.
290   AC_PATH_PROG(MSGFMT, msgfmt, none)
291   AC_PATH_PROG(MSGMERGE, msgmerge, none)
292   AC_PATH_PROG(XGETTEXT, xgettext, none)
293   if test "$MSGFMT" != "none"; then
294     AC_SEARCH_LIBS(bindtextdomain, [intl], [],
295                    [
296                     AC_MSG_WARN([bindtextdomain() not found.  Disabling NLS.])
297                     enable_nls="no"
298                    ])
299     if test "$enable_nls" = "yes"; then
300       AC_DEFINE(ENABLE_NLS, 1,
301                 [Define to 1 if translation of program messages to the user's
302                  native language is requested.])
303       USE_NLS="yes"
304     fi
305   fi
308 AH_BOTTOM(
309 #define N_(x) x
310 #ifdef ENABLE_NLS
311 #include <locale.h>
312 #include <libintl.h>
313 #define _(x) dgettext(PACKAGE_NAME, x)
314 #else
315 #define _(x) (x)
316 #define gettext(x) (x)
317 #define dgettext(domain,x) (x)
318 #endif
321 dnl Used to simulate makefile conditionals.
322 GETTEXT_CODESET=\#
323 NO_GETTEXT_CODESET=\#
324 if test $USE_NLS = "yes"; then
325    AC_CHECK_FUNCS(bind_textdomain_codeset,
326                   [ GETTEXT_CODESET="" ],
327                   [ NO_GETTEXT_CODESET="" ])
329 AC_SUBST(GETTEXT_CODESET)
330 AC_SUBST(NO_GETTEXT_CODESET)
332 # Check if we are using GNU gettext.
333 GNU_GETTEXT=no
334 MSGFMTFLAGS=''
335 if test $USE_NLS = "yes"; then
336    AC_MSG_CHECKING(if we are using GNU gettext)
337    if $MSGFMT --version 2>&1 | $EGREP GNU > /dev/null; then
338       GNU_GETTEXT=yes
339       MSGFMTFLAGS='-c'
340    fi
341    AC_MSG_RESULT($GNU_GETTEXT)
343 AC_SUBST(MSGFMTFLAGS)
345 INSTALL_STATIC_RULES="install-bin install-docs"
346 INSTALL_RULES="install-fsmod-lib install-ramod-lib install-lib install-include install-static"
347 INSTALL_RULES="$INSTALL_RULES $INSTALL_APACHE_RULE"
348 BUILD_RULES="fsmod-lib ramod-lib lib bin test $BUILD_APACHE_RULE"
350 if test "$svn_lib_berkeley_db" = "yes"; then
351   BUILD_RULES="$BUILD_RULES bdb-lib bdb-test"
352   INSTALL_RULES="`echo $INSTALL_RULES | sed 's/install-fsmod-lib/install-fsmod-lib install-bdb-lib/'`"
353   INSTALL_STATIC_RULES="$INSTALL_STATIC_RULES install-bdb-lib"
354   BDB_TEST_DEPS="\$(BDB_TEST_DEPS)"
355   BDB_TEST_PROGRAMS="\$(BDB_TEST_PROGRAMS)"
357   
358 if test "$svn_lib_neon" = "yes"; then
359   BUILD_RULES="$BUILD_RULES neon-lib"
360   INSTALL_RULES="`echo $INSTALL_RULES | sed 's/install-ramod-lib/install-ramod-lib install-neon-lib/'`"
361   INSTALL_STATIC_RULES="$INSTALL_STATIC_RULES install-neon-lib"
364 if test "$svn_lib_serf" = "yes"; then
365   BUILD_RULES="$BUILD_RULES serf-lib"
366   INSTALL_RULES="`echo $INSTALL_RULES | sed 's/install-ramod-lib/install-ramod-lib install-serf-lib/'`"
367   INSTALL_STATIC_RULES="$INSTALL_STATIC_RULES install-serf-lib"
370 if test "$USE_NLS" = "yes"; then
371   BUILD_RULES="$BUILD_RULES locale"
372   INSTALL_RULES="$INSTALL_RULES install-locale"
375 AC_SUBST(BUILD_RULES)
376 AC_SUBST(INSTALL_STATIC_RULES)
377 AC_SUBST(INSTALL_RULES)
378 AC_SUBST(BDB_TEST_DEPS)
379 AC_SUBST(BDB_TEST_PROGRAMS)
381 dnl Check for header files ----------------
383 dnl Standard C headers
384 AC_HEADER_STDC
386 dnl Check for typedefs, structures, and compiler characteristics ----------
388 dnl if compiler doesn't understand `const', then define it empty
389 AC_C_CONST
391 dnl if non-existent, define size_t to be `unsigned'
392 AC_TYPE_SIZE_T
395 dnl Check for library functions ----------
397 dnl libsvn_string uses memcmp()
398 AC_FUNC_MEMCMP
400 dnl svn_error's default warning handler uses vfprintf()
401 AC_FUNC_VPRINTF
403 dnl check for functions needed in special file handling
404 AC_CHECK_FUNCS(symlink readlink)
406         
407 dnl Process some configuration options ----------
409 AC_ARG_WITH(ssl,
410 AS_HELP_STRING([--with-ssl],
411                [This option does NOT affect the Subversion build process in any
412                 way. It enables OpenSSL support in the Neon library. If and
413                 only if you are building Neon as an integrated part of the
414                 Subversion build process, rather than linking to an already
415                 installed version of Neon, you probably want to pass this
416                 option so that Neon (and so indirectly, Subversion) will be
417                 capable of https:// access.]),
420 AC_ARG_ENABLE(debug,
421 AS_HELP_STRING([--enable-debug],
422                [Turn on debugging]),
424     if test "$enableval" = "yes" ; then
425       enable_debugging="yes"
426     else
427       enable_debugging="no"
428     fi
431 AC_ARG_ENABLE(maintainer-mode,
432 AS_HELP_STRING([--enable-maintainer-mode],
433                [Turn on debugging and very strict compile-time warnings]),
435     if test "$enableval" = "yes" ; then
436       if test "$enable_debugging" = "no" ; then
437         AC_MSG_ERROR(Can't have --disable-debug and --enable-maintainer-mode)
438       fi
439       enable_debugging=yes
440       if test "$GCC" = "yes"; then
441         CFLAGS="$CFLAGS -Wpointer-arith -Wwrite-strings -Wshadow"
442         CXXFLAGS="$CXXFLAGS -Wpointer-arith -Wwrite-strings -Wshadow"
443       fi
444     fi
447 if test "$enable_debugging" = "yes" ; then
448   dnl At the moment, we don't want optimization, because we're
449   dnl debugging.
450   CFLAGS=["`echo $CFLAGS' ' | sed -e 's/-O[^ ]* //g'`"]
451   CXXFLAGS=["`echo $CXXFLAGS' ' | sed -e 's/-O[^ ]* //g'`"]
452   dnl SVN_DEBUG enables specific features for developer builds
453   dnl AP_DEBUG enables specific (Apache) features for developer builds
454   CFLAGS="$CFLAGS -DSVN_DEBUG -DAP_DEBUG"
455   CXXFLAGS="$CXXFLAGS -DSVN_DEBUG -DAP_DEBUG"
456 else
457   if test "$enable_debugging" = "no" ; then
458     CFLAGS=["`echo $CFLAGS' ' | sed -e 's/-g[0-9] //g' | sed -e 's/-g//g'`"]
459     CXXFLAGS=["`echo $CXXFLAGS' ' | sed -e 's/-g[0-9] //g' | sed -e 's/-g//g'`"]
460   fi
464 AC_ARG_WITH(editor,
465 AS_HELP_STRING([--with-editor=PATH],
466                [Specify a default editor for the subversion client.]),
469     if test "$withval" = "yes" ; then
470       AC_MSG_ERROR([--with-editor requires an argument.])
471     else
472       SVN_CLIENT_EDITOR=$withval
473       AC_DEFINE_UNQUOTED(SVN_CLIENT_EDITOR, "$SVN_CLIENT_EDITOR",
474                          [The path of a default editor for the client.])
476     fi
480 SVN_LIB_Z
482 MOD_ACTIVATION="-a"
483 AC_ARG_ENABLE(mod-activation,
484 AS_HELP_STRING([--disable-mod-activation],
485                [Do not enable mod_dav_svn in httpd.conf]),
487     if test "$enableval" = "no" ; then
488       MOD_ACTIVATION=""
489       AC_MSG_NOTICE([Disabling apache module activation])
490     else
491       AC_MSG_NOTICE([Enabling apache module activation])
492     fi
494 AC_SUBST(MOD_ACTIVATION)
498 AC_ARG_ENABLE(gprof,
499 AS_HELP_STRING([--enable-gprof],
500                [Produce gprof profiling data in 'gmon.out' (GCC only).]),
502     if test "$enableval" = "yes" ; then
503       dnl Probably other compilers support -pg or something similar;
504       dnl feel free to extend this to include them.
505       if test "$GCC" = "yes"; then
506         if test "$enable_shared" = "yes" ; then
507           AC_MSG_ERROR(Can't have --enable-gprof without --disable-shared (we
508                   recommend also using --enable-all-static).)
509         fi
510         if test ! "$enable_all_static" = "yes" ; then
511           AC_MSG_WARN(We recommend --enable-all-static with --enable-gprof.)
512         fi
513         AC_MSG_NOTICE([Enabling gprof profiling data (to gmon.out).])
514         CFLAGS="$CFLAGS -pg"
515         CXXFLAGS="$CXXFLAGS -pg"
516         LT_LDFLAGS="$LT_LDFLAGS -pg"
517       else
518         AC_MSG_ERROR(We only support --enable-gprof with GCC right now.)
519       fi
520     fi
524 # Scripting and Bindings languages
526 # Python: Used for testsuite, and bindings
529 PYTHON="`$abs_srcdir/build/find_python.sh`"
530 if test -z "$PYTHON"; then
531   AC_MSG_WARN([Python 2.2 or later is required to run the testsuite])
532   AC_MSG_WARN([or to use the Subversion Python bindings])
533   AC_MSG_WARN([])
534   AC_MSG_WARN([If you have a suitable Python installed, but not on the])
535   AC_MSG_WARN([PATH, set the environment variable PYTHON to the full path])
536   AC_MSG_WARN([to the Python executable, and re-run configure])
538 AC_PATH_PROGS(PYTHON, "$PYTHON", none)
540 # The minimum version for the JVM runtime for our Java bytecode.
541 JAVA_OLDEST_WORKING_VER='1.2'
542 # SVN_CHECK_JDK sets $JAVA_CLASSPATH
543 SVN_CHECK_JDK($JAVA_OLDEST_WORKING_VER)
545 AC_PATH_PROG(PERL, perl, none)
547 AC_PATH_PROG(RUBY, ruby, none)
548 if test "$RUBY" != "none"; then
549   if "$RUBY" -r mkmf -e 'exit(have_func("rb_hash_foreach") ? 0 : 1)'; then
550     AC_PATH_PROG(RDOC, rdoc, none)
551     AC_CACHE_CHECK([for Ruby major version], [svn_cv_ruby_major],[
552     svn_cv_ruby_major="`$RUBY -rrbconfig -e 'print Config::CONFIG.fetch(%q(MAJOR))'`"
553     ])
554     RUBY_MAJOR="$svn_cv_ruby_major"
556     AC_CACHE_CHECK([for Ruby minor version], [svn_cv_ruby_minor],[
557     svn_cv_ruby_minor="`$RUBY -rrbconfig -e 'print Config::CONFIG.fetch(%q(MINOR))'`"
558     ])
559     RUBY_MINOR="$svn_cv_ruby_minor"
561     AC_SUBST(RUBY_MAJOR)
562     AC_SUBST(RUBY_MINOR)
563   else
564     RUBY="none"
565     AC_MSG_WARN([The detected Ruby is too old for Subversion to use])
566     AC_MSG_WARN([A Ruby which has rb_hash_foreach is required to use the])
567     AC_MSG_WARN([Subversion Ruby bindings])
568     AC_MSG_WARN([Upgrade to the official 1.8.2 release, or later])
569   fi
572 SVN_CHECK_SWIG
574 dnl decide whether we want to link against the RA/FS libraries
575 AC_ARG_ENABLE(runtime-module-search,
576 AS_HELP_STRING([--enable-runtime-module-search],
577                [Turn on dynamic loading of RA/FS libraries]),
579     if test "$enableval" = "yes"; then
580       use_dso=yes
581       if test "$enable_shared" = "no"; then
582         AC_MSG_ERROR([--enable-runtime-module-search conflicts with --disable-shared])
583       fi
584       AC_DEFINE(SVN_USE_DSO, 1,
585                 [Defined if svn should try to load DSOs])
586     fi
589 if test "$enable_shared" = "no" || test "$use_dso" != "yes"; then
590   ### We want ra_local first to handle the following scenario:
591   ### user has neon and db3 in /usr/local, and db4 in
592   ### /usr/local/BerkeleyDB.4.0.  If libsvn_ra_neon.la comes before 
593   ### libsvn_fs.la then libtool ends up linking libsvn_fs to the db3
594   ### in /usr/local/lib
595   AC_DEFINE(SVN_LIBSVN_CLIENT_LINKS_RA_LOCAL, 1,
596       [Defined if libsvn_client should link against libsvn_ra_local])
597   svn_ra_lib_deps="\$(RA_LOCAL_DEPS)"
598   svn_ra_lib_install_deps="install-ramod-lib"
599   svn_ra_lib_link="\$(RA_LOCAL_LINK)"
601   AC_DEFINE(SVN_LIBSVN_CLIENT_LINKS_RA_SVN, 1,
602       [Defined if libsvn_client should link against libsvn_ra_svn])
603   svn_ra_lib_deps="$svn_ra_lib_deps \$(RA_SVN_DEPS)"
604   svn_ra_lib_link="$svn_ra_lib_link \$(RA_SVN_LINK)"
606   if test "$svn_lib_neon" = "yes"; then
607     AC_DEFINE(SVN_LIBSVN_CLIENT_LINKS_RA_NEON, 1,
608           [Defined if libsvn_client should link against libsvn_ra_neon])
609     svn_ra_lib_deps="$svn_ra_lib_deps \$(RA_NEON_DEPS)"
610     svn_ra_lib_install_deps="$svn_ra_lib_install_deps install-neon-lib"
611     svn_ra_lib_link="$svn_ra_lib_link \$(RA_NEON_LINK)"
612   fi
614   if test "$svn_lib_serf" = "yes"; then
615     AC_DEFINE(SVN_LIBSVN_CLIENT_LINKS_RA_SERF, 1,
616           [Defined if libsvn_client should link against libsvn_ra_serf])
617     svn_ra_lib_deps="$svn_ra_lib_deps \$(RA_SERF_DEPS)"
618     svn_ra_lib_install_deps="$svn_ra_lib_install_deps install-serf-lib"
619     svn_ra_lib_link="$svn_ra_lib_link \$(RA_SERF_LINK)"
620   fi
622   SVN_RA_LIB_DEPS=$svn_ra_lib_deps
623   SVN_RA_LIB_INSTALL_DEPS=$svn_ra_lib_install_deps
624   SVN_RA_LIB_LINK=$svn_ra_lib_link
626   AC_DEFINE(SVN_LIBSVN_FS_LINKS_FS_FS, 1,
627       [Defined if libsvn_fs should link against libsvn_fs_fs])
628   svn_fs_lib_deps="\$(FS_FS_DEPS)"
629   svn_fs_lib_install_deps="install-fsmod-lib"
630   svn_fs_lib_link="\$(FS_FS_LINK)"
632   if test "$svn_lib_berkeley_db" = "yes"; then
633   AC_DEFINE(SVN_LIBSVN_FS_LINKS_FS_BASE, 1,
634       [Defined if libsvn_fs should link against libsvn_fs_base])
635     svn_fs_lib_deps="$svn_fs_lib_deps \$(FS_BASE_DEPS)"
636     svn_fs_lib_install_deps="$svn_fs_lib_install_deps install-bdb-lib"
637     svn_fs_lib_link="$svn_fs_lib_link \$(FS_BASE_LINK)"
638   fi
640   SVN_FS_LIB_DEPS=$svn_fs_lib_deps
641   SVN_FS_LIB_INSTALL_DEPS=$svn_fs_lib_install_deps
642   SVN_FS_LIB_LINK=$svn_fs_lib_link
645 AC_SUBST(SVN_RA_LIB_DEPS)
646 AC_SUBST(SVN_RA_LIB_INSTALL_DEPS)
647 AC_SUBST(SVN_RA_LIB_LINK)
648 AC_SUBST(SVN_FS_LIB_DEPS)
649 AC_SUBST(SVN_FS_LIB_INSTALL_DEPS)
650 AC_SUBST(SVN_FS_LIB_LINK)
652 # ==== JavaHL ================================================================
654 dnl Possibly compile JavaHL
655 do_javahl_build=no
656 AC_ARG_ENABLE(javahl,
657   AS_HELP_STRING([--enable-javahl],
658              [Enable compilation of Java high-level bindings (requires C++)]),
659   [ if test "$enableval" = "yes" ; then
660         do_javahl_build="yes"
661     fi
662   ])
664 JAVAHL_OBJDIR=""
665 INSTALL_EXTRA_JAVAHL_LIB=""
666 FIX_JAVAHL_LIB=""
667 JAVAHL_TESTS_TARGET=""
668 LT_CXX_LIBADD=""
669 if test "$do_javahl_build" = "yes"; then
670   dnl Check for suitable JDK
671   if test "$JDK_SUITABLE" = "no"; then
672     AC_MSG_ERROR([Cannot compile JavaHL without a suitable JDK. 
673                   Please specify a suitable JDK using the --with-jdk option.])
674   fi
675   
676   AC_PROG_CXX
677   
678   dnl The temporary directory where libtool compiles libsvnjavahl.
679   dnl N.B. objdir is "the name of the directory that contains temporary
680   dnl libtool files" and it is set by libtool.m4
681   JAVAHL_OBJDIR='$(libsvnjavahl_PATH)'/$objdir
682   
683   os_arch=`uname`
684   if test "$os_arch" = "Darwin"; then
685     dnl On Darwin, JNI libs must be installed as .jnilib
686     INSTALL_EXTRA_JAVAHL_LIB='ln -sf $(libdir)/libsvnjavahl-1.dylib $(libdir)/libsvnjavahl-1.jnilib'
687     FIX_JAVAHL_LIB="ln -sf libsvnjavahl-1.dylib $JAVAHL_OBJDIR/libsvnjavahl-1.jnilib"
688   fi
689   # This segment (and the rest of r10800) is very likely unnecessary
690   # with libtool 1.5, which automatically adds libstdc++ as a
691   # dependency to the C++ libraries it builds.  So at some future time
692   # when autogen.sh requires libtool 1.5 or higher, we can get rid of
693   # it.
694   AC_MSG_CHECKING([for additional flags to link C++ libraries])
695   if test "x$ac_compiler_gnu" = "xyes"; then
696     LT_CXX_LIBADD="-lstdc++"
697     AC_MSG_RESULT([$LT_CXX_LIBADD])
698   else
699     AC_MSG_RESULT([none needed])
700   fi
702 AC_SUBST(INSTALL_EXTRA_JAVAHL_LIB)
703 AC_SUBST(JAVAHL_OBJDIR)
704 AC_SUBST(FIX_JAVAHL_LIB)
705 AC_SUBST(LT_CXX_LIBADD)
707 AC_ARG_WITH(junit,
708 AS_HELP_STRING([--with-junit=PATH],
709                [Specify a path to the junit JAR file.]),
711     if test "$withval" != "no"; then
712       if test -n "$JAVA_CLASSPATH"; then
713         JAVA_CLASSPATH="$withval:$JAVA_CLASSPATH"
714       else
715         JAVA_CLASSPATH="$withval"
716       fi
717       JAVAHL_TESTS_TARGET="javahl-tests"
718     fi
720 AC_SUBST(JAVA_CLASSPATH)
721 AC_SUBST(JAVAHL_TESTS_TARGET)
723 # ==== Miscellaneous bits ====================================================
725 dnl Since this is used only on Unix-y systems, define the path separator as '/'
726 AC_DEFINE_UNQUOTED(SVN_PATH_LOCAL_SEPARATOR, '/',
727         [Defined to be the path separator used on your local filesystem])
729 AC_DEFINE_UNQUOTED(SVN_NULL_DEVICE_NAME, "/dev/null",
730         [Defined to be the null device for the system])
732 DEFAULT_FS_TYPE="fsfs"
733 AC_DEFINE_UNQUOTED(DEFAULT_FS_TYPE, "$DEFAULT_FS_TYPE",
734                    [The fs type to use by default])
736 # BSD/OS (BSDi) needs to use a different include syntax in Makefile
737 INCLUDE_OUTPUTS="include \$(top_srcdir)/build-outputs.mk"
738 case "$host" in
739   *bsdi*)
740     # Check whether they've installed GNU make
741     if ! make --version > /dev/null 2>&1; then 
742       # BSDi make
743       INCLUDE_OUTPUTS=".include \"\$(top_srcdir)/build-outputs.mk\""
744     fi
745     ;;
746 esac
747 AC_SUBST(INCLUDE_OUTPUTS)
749 # ==== Detection complete - output and run config.status =====================
751 AC_CONFIG_HEADER(subversion/svn_private_config.h)
752 AC_CONFIG_FILES([Makefile])
753 AC_CONFIG_COMMANDS(mkdir-init, [make mkdir-init])
755 SVN_CONFIG_SCRIPT(tools/backup/hot-backup.py)
756 SVN_CONFIG_SCRIPT(contrib/client-side/svn_load_dirs/svn_load_dirs.pl)
757 SVN_CONFIG_SCRIPT(contrib/client-side/svncopy/svncopy.pl)
758 SVN_CONFIG_SCRIPT(contrib/client-side/svncopy/testsvncopy.pl)
759 SVN_CONFIG_SCRIPT(tools/hook-scripts/commit-access-control.pl)
760 SVN_CONFIG_SCRIPT(tools/hook-scripts/commit-email.pl)
761 SVN_CONFIG_SCRIPT(subversion/bindings/swig/perl/native/Makefile.PL)
762 SVN_CONFIG_SCRIPT(packages/solaris/pkginfo)
763 AC_SUBST(SVN_CONFIG_SCRIPT_FILES)
765 AC_OUTPUT
767 # ==== Print final messages to user ==========================================
769 dnl Configure is long - users tend to miss warnings printed during it.
770 dnl Hence, print a warnings about what we did and didn't configure at the 
771 dnl end, where people will actually see them.
773 case "$svn_lib_berkeley_db" in
774   "no" )
775     db_version="$SVN_FS_WANT_DB_MAJOR.$SVN_FS_WANT_DB_MINOR.$SVN_FS_WANT_DB_PATCH"
776     AC_MSG_WARN([we have configured without BDB filesystem support
779 You don't seem to have Berkeley DB version $db_version or newer
780 installed and linked to APR-UTIL.  We have created Makefiles which
781 will build without the Berkeley DB back-end; your repositories will
782 use FSFS as the default back-end.  You can find the latest version of
783 Berkeley DB here:
784   http://www.oracle.com/technology/software/products/berkeley-db/index.html
787 esac