source: valtobtest/subversion-1.6.2/configure.ac @ 3

Last change on this file since 3 was 3, checked in by valtob, 15 years ago

subversion source 1.6.2 as test

File size: 32.7 KB
Line 
1dnl configure.ac: Autoconfiscation for Subversion
2dnl Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.58)
5
6dnl Get the version of Subversion, using m4's esyscmd() command to do this
7dnl at m4-time, since AC_INIT() requires it then.
8AC_INIT([subversion],
9     [esyscmd(python build/getversion.py SVN subversion/include/svn_version.h)],
10     [http://subversion.tigris.org/])
11
12AC_CONFIG_SRCDIR(subversion/include/svn_types.h)
13AC_CONFIG_AUX_DIR([build])
14
15AC_MSG_NOTICE([Configuring Subversion ]AC_PACKAGE_VERSION)
16
17AC_SUBST([abs_srcdir], ["`cd $srcdir && pwd`"])
18AC_SUBST([abs_builddir], ["`pwd`"])
19if test "$abs_srcdir" = "$abs_builddir"; then
20  canonicalized_srcdir=""
21else
22  canonicalized_srcdir="$srcdir/"
23fi
24AC_SUBST([canonicalized_srcdir])
25
26SWIG_LDFLAGS="$LDFLAGS"
27AC_SUBST([SWIG_LDFLAGS])
28
29# Generate config.nice early (before the arguments are munged)
30SVN_CONFIG_NICE(config.nice)
31
32# ==== Check for programs ====================================================
33
34# Look for a C compiler (before anything can set CFLAGS)
35AC_PROG_CC
36
37# Look for a C++ compiler
38AC_PROG_CXX
39
40# Look for a C pre-processor
41AC_PROG_CPP
42
43# Grab target_cpu, so we can use it in the Solaris pkginfo file
44AC_CANONICAL_TARGET
45
46# Look for an extended grep
47AC_PROG_EGREP
48
49AC_PROG_LN_S
50
51AC_PROG_INSTALL
52# If $INSTALL is relative path to our fallback install-sh, then convert
53# to an absolute path, as in some cases (e.g. Solaris VPATH build), libtool
54# may try to use it from a changed working directory.
55if test "$INSTALL" = "build/install-sh -c"; then
56  INSTALL="$abs_srcdir/$INSTALL"
57fi
58
59AC_SUBST([MKDIR], ["$INSTALL -d"])
60
61# ==== Libraries, for which we may have source to build ======================
62
63dnl verify apr version and set apr flags
64dnl These regular expressions should not contain "\(" and "\)".
65dnl The specific reason we require APR 0.9.7 is:
66dnl   It contains fixes to its file writing routines
67dnl   now generating errors instead of silently ignoring
68dnl   them.  Only .7 and later can guarantee repository
69dnl   integrity with FSFS.
70
71APR_VER_REGEXES=["0\.9\.[7-9] 0\.9\.1[0-9] 1\."]
72APU_VER_REGEXES=["0\.9\.[7-9] 0\.9\.1[0-9] 1\."]
73
74SVN_LIB_APR($APR_VER_REGEXES)
75SVN_LIB_APRUTIL($APU_VER_REGEXES)
76
77dnl Search for pkg-config
78AC_PATH_PROG(PKG_CONFIG, pkg-config)
79
80# Either a space-separated list of allowable Neon versions, or "any" to
81# mean allow anything.
82NEON_ALLOWED_LIST="0\.25 0\.26 0\.27\.2 0\.28"
83NEON_RECOMMENDED_VER=0.28.4
84NEON_URL="http://www.webdav.org/neon/neon-${NEON_RECOMMENDED_VER}.tar.gz"
85dnl You can skip the neon version check only if you know what you are doing
86AC_ARG_ENABLE(neon-version-check,
87  AS_HELP_STRING([--disable-neon-version-check],
88                 [do not check the Neon version]),
89  [
90    if test "$enableval" = "no" ; then
91      NEON_ALLOWED_LIST="any"
92    fi
93  ],
94  [])
95SVN_LIB_NEON($NEON_ALLOWED_LIST, $NEON_RECOMMENDED_VER, $NEON_URL)
96
97if test "$svn_lib_neon" = "yes"; then
98  AC_DEFINE([SVN_HAVE_NEON], 1,
99            [Defined if support for Neon is enabled])
100fi
101
102dnl Search for serf as an alternative to neon
103SVN_LIB_SERF
104
105if test "$svn_lib_serf" = "yes"; then
106  AC_DEFINE([SVN_HAVE_SERF], 1,
107            [Defined if support for Serf is enabled])
108fi
109
110dnl Search for apr_memcache (only affects fs_fs)
111SVN_LIB_APR_MEMCACHE
112
113if test "$svn_lib_apr_memcache" = "yes"; then
114  AC_DEFINE(SVN_HAVE_MEMCACHE, 1,
115            [Defined if apr_memcache (standalone or in apr-util) is present])
116fi
117
118
119dnl Find Apache with a recent-enough magic module number
120SVN_FIND_APACHE(20020903)
121
122dnl Search for SQLite
123SQLITE_MINIMUM_VER="3.4.0"
124SQLITE_RECOMMENDED_VER="3.6.13"
125SQLITE_URL="http://www.sqlite.org/sqlite-amalgamation-${SQLITE_RECOMMENDED_VER}.tar.gz"
126SVN_LIB_SQLITE(${SQLITE_MINIMUM_VER}, ${SQLITE_RECOMMENDED_VER},
127               ${SQLITE_URL})
128
129dnl Set up a number of directories ---------------------
130
131dnl Create SVN_BINDIR for proper substitution
132if test "${bindir}" = '${exec_prefix}/bin'; then
133        if test "${exec_prefix}" = "NONE"; then
134                if test "${prefix}" = "NONE"; then
135                        SVN_BINDIR="${ac_default_prefix}/bin"
136                else
137                        SVN_BINDIR="${prefix}/bin"
138                fi
139        else
140                SVN_BINDIR="${exec_prefix}/bin"
141        fi
142else
143        SVN_BINDIR="${bindir}"
144fi
145
146dnl fully evaluate this value. when we substitute it into our tool scripts,
147dnl they will not have things such as ${bindir} available
148SVN_BINDIR="`eval echo ${SVN_BINDIR}`"
149AC_SUBST(SVN_BINDIR)
150
151dnl provide ${bindir} in svn_private_config.h for use in compiled code
152AC_DEFINE_UNQUOTED(SVN_BINDIR, "${SVN_BINDIR}",
153        [Defined to be the path to the installed binaries])
154
155dnl This purposely does *not* allow for multiple parallel installs.
156dnl However, it is compatible with most gettext usages.
157localedir='${datadir}/locale'
158AC_SUBST(localedir)
159
160dnl For SVN_LOCALE_DIR, we have to expand it to something.  See SVN_BINDIR.
161if test "${datadir}" = '${prefix}/share' && test "${prefix}" = "NONE"; then
162  exp_localedir='${ac_default_prefix}/share/locale'
163else
164  exp_localedir=$localedir
165fi
166SVN_EXPAND_VAR(svn_localedir, "${exp_localedir}")
167AC_DEFINE_UNQUOTED(SVN_LOCALE_DIR, "${svn_localedir}",
168                   [Defined to be the path to the installed locale dirs])
169
170dnl Check for libtool -- we'll definitely need it for all our shared libs!
171echo "configuring libtool now"
172AC_ARG_ENABLE(experimental-libtool,
173  AS_HELP_STRING([--enable-experimental-libtool],[Use APR's libtool]),
174  [experimental_libtool=$enableval],[experimental_libtool=no])
175
176if test "$experimental_libtool" = "yes"; then
177  echo "using APR's libtool"
178  sh_libtool="`$apr_config --apr-libtool`"
179  LIBTOOL="$sh_libtool"
180  SVN_LIBTOOL="$sh_libtool"
181else
182  sh_libtool="$abs_builddir/libtool"
183  SVN_LIBTOOL="\$(SHELL) $sh_libtool"
184  dnl libtoolize requires that the following line not be indented
185ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL])
186fi
187AC_SUBST(SVN_LIBTOOL)
188
189dnl Before configuring libtool check for --enable-all-static option
190AC_ARG_ENABLE(all-static,
191  AS_HELP_STRING([--enable-all-static],
192                 [Build completely static (standalone) binaries.]),
193  [
194    if test "$enableval" = "yes" ; then
195      LT_LDFLAGS="-all-static $LT_LDFLAGS"
196    fi
197])
198
199AC_SUBST(LT_LDFLAGS)
200
201dnl Check if -no-undefined is needed for the platform.
202dnl It should always work but with libtool 1.4.3 on OS X it breaks the build.
203dnl So we only turn it on for platforms where we know we really need it.
204AC_MSG_CHECKING([whether libtool needs -no-undefined])
205case $host in
206  *-*-cygwin*)
207    AC_MSG_RESULT([yes])
208    LT_NO_UNDEFINED="-no-undefined"
209    ;;
210  *)
211    AC_MSG_RESULT([no])
212    LT_NO_UNDEFINED=""
213    ;;
214esac
215AC_SUBST(LT_NO_UNDEFINED)
216
217AC_MSG_CHECKING([whether to avoid circular linkage at all costs])
218case $host in
219  *-*-cygwin*)
220    AC_MSG_RESULT([yes])
221    AC_DEFINE([SVN_AVOID_CIRCULAR_LINKAGE_AT_ALL_COSTS_HACK], 1,
222              [Define if circular linkage is not possible on this platform.])
223    ;;
224  *)
225    AC_MSG_RESULT([no])
226    ;;
227esac
228
229dnl Check for trang.
230trang=yes
231AC_ARG_WITH(trang,
232AS_HELP_STRING([--with-trang=PATH],
233               [Specify the command to run the trang schema converter]),
234[
235    trang="$withval"
236])
237if test "$trang" = "yes"; then
238    AC_PATH_PROG(TRANG, trang, none)
239else
240    TRANG="$trang"
241    AC_SUBST(TRANG)
242fi
243
244
245dnl Check for libraries --------------------
246
247# Berkeley DB on SCO OpenServer needs -lsocket
248AC_CHECK_LIB(socket, socket)
249
250# Build the BDB filesystem library only if we have an appropriate
251# version of Berkeley DB.
252case "$host" in
253powerpc-apple-darwin*)
254    # Berkeley DB 4.0 does not work on OS X.
255    SVN_FS_WANT_DB_MAJOR=4
256    SVN_FS_WANT_DB_MINOR=1
257    SVN_FS_WANT_DB_PATCH=25
258    ;;
259*)
260    SVN_FS_WANT_DB_MAJOR=4
261    SVN_FS_WANT_DB_MINOR=0
262    SVN_FS_WANT_DB_PATCH=14
263    ;;
264esac
265# Look for libdb4.so first:
266SVN_LIB_BERKELEY_DB($SVN_FS_WANT_DB_MAJOR, $SVN_FS_WANT_DB_MINOR,
267                    $SVN_FS_WANT_DB_PATCH, [db4 db])
268
269AC_DEFINE_UNQUOTED(SVN_FS_WANT_DB_MAJOR, $SVN_FS_WANT_DB_MAJOR,
270                   [The desired major version for the Berkeley DB])
271AC_DEFINE_UNQUOTED(SVN_FS_WANT_DB_MINOR, $SVN_FS_WANT_DB_MINOR,
272                   [The desired minor version for the Berkeley DB])
273AC_DEFINE_UNQUOTED(SVN_FS_WANT_DB_PATCH, $SVN_FS_WANT_DB_PATCH,
274                   [The desired patch version for the Berkeley DB])
275
276AC_SUBST(SVN_DB_INCLUDES)
277AC_SUBST(SVN_DB_LIBS)
278
279SVN_LIB_SASL
280
281if test "$svn_lib_sasl" = "yes"; then
282  AC_DEFINE(SVN_HAVE_SASL, 1,
283            [Defined if Cyrus SASL v2 is present on the system])
284fi
285
286dnl Mac OS KeyChain -------------------
287
288AC_ARG_ENABLE(keychain,
289  AS_HELP_STRING([--disable-keychain],
290  [Disable use of Mac OS KeyChain for auth credentials]),
291  [enable_keychain=$enableval],[enable_keychain=yes])
292
293AC_MSG_CHECKING([for Mac OS KeyChain Services])
294
295if test "$enable_keychain" = "yes"; then
296  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <AvailabilityMacros.h>
297#if !DARWIN || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_2)
298#error KeyChain API unavailable.
299#endif]], [[]])],[],[enable_keychain=no])
300fi
301
302if test "$enable_keychain" = "yes"; then
303  dnl ### Hack.  We should only need to pass the -framework options when
304  dnl linking libsvn_subr, since it is the only library that uses Keychain.
305  dnl
306  dnl Unfortunately, libtool 1.5.x doesn't track transitive dependencies for
307  dnl OS X frameworks like it does for normal libraries, so we need to
308  dnl explicitly pass the option to all the users of libsvn_subr to allow
309  dnl static builds to link successfully.
310  dnl
311  dnl This does mean that all executables we link will be linked directly
312  dnl to these frameworks - even when building shared libraries - but that
313  dnl shouldn't cause any problems.
314  LIBS="$LIBS -framework Security"
315  LIBS="$LIBS -framework CoreFoundation"
316  LIBS="$LIBS -framework CoreServices"
317  AC_DEFINE([SVN_HAVE_KEYCHAIN_SERVICES], [1], [Is Mac OS KeyChain support enabled?])
318  AC_MSG_RESULT([yes])
319else
320  AC_MSG_RESULT([no])
321fi
322
323
324dnl APR_HAS_DSO -------------------
325
326AC_MSG_CHECKING([whether APR has support for DSOs])
327old_CPPFLAGS="$CPPFLAGS"
328CPPFLAGS="$CPPFLAGS $SVN_APR_INCLUDES"
329AC_PREPROC_IFELSE([
330#include <apr.h>
331#if !APR_HAS_DSO
332#error
333#endif],
334  APR_HAS_DSO="yes"
335  AC_MSG_RESULT([yes]),
336  APR_HAS_DSO="no"
337  AC_MSG_RESULT([no]))
338CPPFLAGS="$old_CPPFLAGS"
339
340
341dnl D-Bus (required for support for KWallet and GNOME Keyring) -------------------
342
343if test -n "$PKG_CONFIG"; then
344  AC_MSG_CHECKING([for D-Bus .pc file])
345  if $PKG_CONFIG --exists dbus-1; then
346    AC_MSG_RESULT([yes])
347    old_CPPFLAGS="$CPPFLAGS"
348    old_LIBS="$LIBS"
349    DBUS_CPPFLAGS="`$PKG_CONFIG --cflags dbus-1`"
350    AC_MSG_CHECKING([D-Bus version])
351    DBUS_VERSION="`$PKG_CONFIG --modversion dbus-1`"
352    AC_MSG_RESULT([$DBUS_VERSION])
353    # D-Bus 0.* requires DBUS_API_SUBJECT_TO_CHANGE
354    if test -n ["`echo "$DBUS_VERSION" | $GREP '^0\.[[:digit:]]\+'`"]; then
355      DBUS_CPPFLAGS="$DBUS_CPPFLAGS -DDBUS_API_SUBJECT_TO_CHANGE"
356    fi
357    DBUS_LIBS="`$PKG_CONFIG --libs dbus-1`"
358    CPPFLAGS="$CPPFLAGS $DBUS_CPPFLAGS"
359    LIBS="$LIBS $DBUS_LIBS"
360    AC_MSG_CHECKING([for D-Bus])
361    AC_LINK_IFELSE([
362#include <dbus/dbus.h>
363int main()
364{dbus_bus_get(DBUS_BUS_SESSION, NULL);}], HAVE_DBUS="yes", HAVE_DBUS="no")
365    if test "$HAVE_DBUS" = "yes"; then
366      AC_MSG_RESULT([yes])
367    else
368      AC_MSG_RESULT([no])
369    fi
370    CPPFLAGS="$old_CPPFLAGS"
371    LIBS="$old_LIBS"
372  else
373    AC_MSG_RESULT([no])
374  fi
375fi
376
377dnl GNOME Keyring -------------------
378
379AC_ARG_WITH(gnome_keyring,
380  AS_HELP_STRING([--with-gnome-keyring],
381                 [Enable use of GNOME Keyring for auth credentials]),
382                 [with_gnome_keyring="$withval"],
383                 [with_gnome_keyring=no])
384
385AC_MSG_CHECKING([whether to look for GNOME Keyring])
386if test "$with_gnome_keyring" != "no"; then
387  AC_MSG_RESULT([yes])
388  if test "$enable_shared" = "yes"; then
389    if test "$APR_HAS_DSO" = "yes"; then
390      if test -n "$PKG_CONFIG"; then
391        if test "$HAVE_DBUS" = "yes"; then
392          AC_MSG_CHECKING([for GLib and GNOME Keyring .pc files])
393          if $PKG_CONFIG --exists glib-2.0 gnome-keyring-1; then
394            AC_MSG_RESULT([yes])
395            old_CPPFLAGS="$CPPFLAGS"
396            SVN_GNOME_KEYRING_INCLUDES="$DBUS_CPPFLAGS `$PKG_CONFIG --cflags glib-2.0 gnome-keyring-1`"
397            CPPFLAGS="$CPPFLAGS $SVN_GNOME_KEYRING_INCLUDES"
398            AC_CHECK_HEADER(gnome-keyring.h, with_gnome_keyring=yes, with_gnome_keyring=no)
399            AC_MSG_CHECKING([for GNOME Keyring])
400            if test "$with_gnome_keyring" = "yes"; then
401              AC_MSG_RESULT([yes])
402              AC_DEFINE([SVN_HAVE_GNOME_KEYRING], [1],
403                        [Is GNOME Keyring support enabled?])
404              CPPFLAGS="$old_CPPFLAGS"
405              SVN_GNOME_KEYRING_LIBS="$DBUS_LIBS `$PKG_CONFIG --libs glib-2.0 gnome-keyring-1`"
406            else
407              AC_MSG_RESULT([no])
408              AC_MSG_ERROR([cannot find GNOME Keyring])
409            fi
410          else
411            AC_MSG_RESULT([no])
412            AC_MSG_ERROR([cannot find GLib and GNOME Keyring .pc files])
413          fi
414        else
415          AC_MSG_ERROR([cannot find D-Bus])
416        fi
417      else
418        AC_MSG_ERROR([cannot find pkg-config])
419      fi
420    else
421      AC_MSG_ERROR([APR does not have support for DSOs])
422    fi
423  else
424    AC_MSG_ERROR([--with-gnome-keyring conflicts with --disable-shared])
425  fi
426else
427  AC_MSG_RESULT([no])
428fi
429AC_SUBST(SVN_GNOME_KEYRING_INCLUDES)
430AC_SUBST(SVN_GNOME_KEYRING_LIBS)
431
432
433dnl I18n -------------------
434
435AC_ARG_ENABLE(nls,
436  AS_HELP_STRING([--disable-nls],[Disable gettext functionality]),
437  [enable_nls=$enableval],[enable_nls=yes])
438
439USE_NLS="no"
440if test "$enable_nls" = "yes"; then
441  dnl First, check to see if there is a working msgfmt.
442  AC_PATH_PROG(MSGFMT, msgfmt, none)
443  AC_PATH_PROG(MSGMERGE, msgmerge, none)
444  AC_PATH_PROG(XGETTEXT, xgettext, none)
445  if test "$MSGFMT" != "none"; then
446    AC_SEARCH_LIBS(bindtextdomain, [intl], [],
447                   [
448                    AC_MSG_WARN([bindtextdomain() not found.  Disabling NLS.])
449                    enable_nls="no"
450                   ])
451    if test "$enable_nls" = "yes"; then
452      AC_DEFINE(ENABLE_NLS, 1,
453                [Define to 1 if translation of program messages to the user's
454                 native language is requested.])
455      USE_NLS="yes"
456    fi
457  fi
458fi
459
460AH_BOTTOM(
461#define N_(x) x
462#define U_(x) x
463#ifdef ENABLE_NLS
464#include <locale.h>
465#include <libintl.h>
466#define _(x) dgettext(PACKAGE_NAME, x)
467#define Q_(x1, x2, n) dngettext(PACKAGE_NAME, x1, x2, n)
468#else
469#define _(x) (x)
470#define Q_(x1, x2, n) (((n) == 1) ? x1 : x2)
471#define gettext(x) (x)
472#define dgettext(domain, x) (x)
473#endif
474)
475
476dnl Used to simulate makefile conditionals.
477GETTEXT_CODESET=\#
478NO_GETTEXT_CODESET=\#
479if test $USE_NLS = "yes"; then
480   AC_CHECK_FUNCS(bind_textdomain_codeset,
481                  [ GETTEXT_CODESET="" ],
482                  [ NO_GETTEXT_CODESET="" ])
483fi
484AC_SUBST(GETTEXT_CODESET)
485AC_SUBST(NO_GETTEXT_CODESET)
486
487# Check if we are using GNU gettext.
488GNU_GETTEXT=no
489MSGFMTFLAGS=''
490if test $USE_NLS = "yes"; then
491   AC_MSG_CHECKING(if we are using GNU gettext)
492   if $MSGFMT --version 2>&1 | $EGREP GNU > /dev/null; then
493      GNU_GETTEXT=yes
494      MSGFMTFLAGS='-c'
495   fi
496   AC_MSG_RESULT($GNU_GETTEXT)
497fi
498AC_SUBST(MSGFMTFLAGS)
499
500
501dnl KWallet -------------------
502SVN_LIB_KWALLET
503
504if test "$svn_lib_kwallet" = "yes"; then
505  AC_DEFINE([SVN_HAVE_KWALLET], 1,
506            [Defined if KWallet support is enabled])
507fi
508
509
510dnl Build and install rules -------------------
511
512INSTALL_STATIC_RULES="install-bin install-docs"
513INSTALL_RULES="install-fsmod-lib install-ramod-lib install-lib install-include install-static"
514INSTALL_RULES="$INSTALL_RULES $INSTALL_APACHE_RULE"
515BUILD_RULES="fsmod-lib ramod-lib lib bin test $BUILD_APACHE_RULE"
516
517if test "$svn_lib_berkeley_db" = "yes"; then
518  BUILD_RULES="$BUILD_RULES bdb-lib bdb-test"
519  INSTALL_RULES="`echo $INSTALL_RULES | sed 's/install-fsmod-lib/install-fsmod-lib install-bdb-lib/'`"
520  INSTALL_STATIC_RULES="$INSTALL_STATIC_RULES install-bdb-lib"
521  BDB_TEST_DEPS="\$(BDB_TEST_DEPS)"
522  BDB_TEST_PROGRAMS="\$(BDB_TEST_PROGRAMS)"
523fi
524 
525if test "$svn_lib_neon" = "yes"; then
526  BUILD_RULES="$BUILD_RULES neon-lib"
527  INSTALL_RULES="`echo $INSTALL_RULES | sed 's/install-ramod-lib/install-ramod-lib install-neon-lib/'`"
528  INSTALL_STATIC_RULES="$INSTALL_STATIC_RULES install-neon-lib"
529fi
530
531if test "$svn_lib_serf" = "yes"; then
532  BUILD_RULES="$BUILD_RULES serf-lib"
533  INSTALL_RULES="`echo $INSTALL_RULES | sed 's/install-ramod-lib/install-ramod-lib install-serf-lib/'`"
534  INSTALL_STATIC_RULES="$INSTALL_STATIC_RULES install-serf-lib"
535fi
536
537if test "$svn_lib_kwallet" = "yes"; then
538  BUILD_RULES="$BUILD_RULES kwallet-lib"
539  INSTALL_RULES="`echo $INSTALL_RULES | sed 's/install-lib/install-lib install-kwallet-lib/'`"
540  INSTALL_STATIC_RULES="$INSTALL_STATIC_RULES install-kwallet-lib"
541fi
542
543if test "$with_gnome_keyring" = "yes"; then
544  BUILD_RULES="$BUILD_RULES gnome-keyring-lib"
545  INSTALL_RULES="`echo $INSTALL_RULES | sed 's/install-lib/install-lib install-gnome-keyring-lib/'`"
546  INSTALL_STATIC_RULES="$INSTALL_STATIC_RULES install-gnome-keyring-lib"
547fi
548
549if test "$USE_NLS" = "yes"; then
550  BUILD_RULES="$BUILD_RULES locale"
551  INSTALL_RULES="$INSTALL_RULES install-locale"
552fi
553
554AC_SUBST(BUILD_RULES)
555AC_SUBST(INSTALL_STATIC_RULES)
556AC_SUBST(INSTALL_RULES)
557AC_SUBST(BDB_TEST_DEPS)
558AC_SUBST(BDB_TEST_PROGRAMS)
559
560dnl Check for header files ----------------
561
562dnl Standard C headers
563AC_HEADER_STDC
564
565dnl Check for typedefs, structures, and compiler characteristics ----------
566
567dnl if compiler doesn't understand `const', then define it empty
568AC_C_CONST
569
570dnl if non-existent, define size_t to be `unsigned'
571AC_TYPE_SIZE_T
572
573
574dnl Check for library functions ----------
575
576dnl libsvn_string uses memcmp()
577AC_FUNC_MEMCMP
578
579dnl svn_error's default warning handler uses vfprintf()
580AC_FUNC_VPRINTF
581
582dnl check for functions needed in special file handling
583AC_CHECK_FUNCS(symlink readlink)
584
585
586dnl Process some configuration options ----------
587
588AC_ARG_WITH(ssl,
589AS_HELP_STRING([--with-ssl],
590               [This option does NOT affect the Subversion build process in any
591                way. It enables OpenSSL support in the Neon library. If and
592                only if you are building Neon as an integrated part of the
593                Subversion build process, rather than linking to an already
594                installed version of Neon, you probably want to pass this
595                option so that Neon (and so indirectly, Subversion) will be
596                capable of https:// access.]),
597[])
598
599AC_ARG_ENABLE(debug,
600AS_HELP_STRING([--enable-debug],
601               [Turn on debugging]),
602[
603    if test "$enableval" = "yes" ; then
604      enable_debugging="yes"
605    else
606      enable_debugging="no"
607    fi
608],
609[
610    # Neither --enable-debug nor --disable-debug was passed.
611    enable_debugging="maybe"
612
613        # We leave this as 'maybe' because setting it to 'no' would modify the
614        # CFLAGS/CXXFLAGS later (just after the --enable-maintainer-mode block),
615        # and we don't want to force that.
616    #
617    # TODO: set enable_debugging='no' here, and provide another way to disable
618    #       the CFLAGS/CXXFLAGS munging.
619])
620
621
622AC_ARG_ENABLE(maintainer-mode,
623AS_HELP_STRING([--enable-maintainer-mode],
624               [Turn on debugging and very strict compile-time warnings]),
625[
626    if test "$enableval" = "yes" ; then
627      if test "$enable_debugging" = "no" ; then
628        AC_MSG_ERROR(Can't have --disable-debug and --enable-maintainer-mode)
629      fi
630      enable_debugging=yes
631      if test "$GCC" = "yes"; then
632        AC_MSG_NOTICE([maintainer-mode: adding GCC warning flags])
633        dnl Enable some extra warnings. Put these before the user's flags
634        dnl so the user can specify flags that override these.
635        CFLAGS="-Wpointer-arith -Wwrite-strings -Wshadow -ansi -Wall -Wformat=2 -Wunused -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wno-multichar -Wredundant-decls -Wnested-externs -Wunreachable-code -Winline -Wno-long-long $CFLAGS"
636        CXXFLAGS="-Wpointer-arith -Wwrite-strings -Wshadow $CXXFLAGS"
637
638        dnl some additional flags that can be handy for an occasional review,
639        dnl but throw too many warnings in svn code, of too little importance,
640        dnl to keep these enabled. Remove the "dnl" to do a run with these
641        dnl switches enabled.
642        dnl CFLAGS="-Wswitch-enum -Wswitch-default $CFLAGS"
643
644        dnl Add each of the following flags only if the compiler accepts it.
645
646        CFLAGS_KEEP="$CFLAGS"
647        AC_LANG_PUSH([C])
648
649        CFLAGS="-Wextra-tokens $CFLAGS_KEEP"
650        AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])], [CFLAGS_KEEP="$CFLAGS"])
651
652        CFLAGS="-Wnewline-eof $CFLAGS_KEEP"
653        AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])], [CFLAGS_KEEP="$CFLAGS"])
654
655        CFLAGS="-Wshorten-64-to-32 $CFLAGS_KEEP"
656        AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])], [CFLAGS_KEEP="$CFLAGS"])
657
658        CFLAGS="-Wold-style-definition $CFLAGS_KEEP"
659        AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])], [CFLAGS_KEEP="$CFLAGS"])
660
661        AC_LANG_POP([C])
662        CFLAGS="$CFLAGS_KEEP"
663      fi
664    fi
665])
666
667if test "$enable_debugging" = "yes" ; then
668  dnl At the moment, we don't want optimization, because we're
669  dnl debugging.
670  CFLAGS=["`echo $CFLAGS' ' | sed -e 's/-O[^ ]* //g'`"]
671  CXXFLAGS=["`echo $CXXFLAGS' ' | sed -e 's/-O[^ ]* //g'`"]
672  dnl SVN_DEBUG enables specific features for developer builds
673  dnl AP_DEBUG enables specific (Apache) features for developer builds
674  CFLAGS="$CFLAGS -DSVN_DEBUG -DAP_DEBUG"
675  CXXFLAGS="$CXXFLAGS -DSVN_DEBUG -DAP_DEBUG"
676elif test "$enable_debugging" = "no" ; then
677    CFLAGS=["`echo $CFLAGS' ' | sed -e 's/-g[0-9] //g' | sed -e 's/-g//g'`"]
678    CXXFLAGS=["`echo $CXXFLAGS' ' | sed -e 's/-g[0-9] //g' | sed -e 's/-g//g'`"]
679    dnl Compile with NDEBUG to get rid of assertions
680    CFLAGS="$CFLAGS -DNDEBUG"
681    CXXFLAGS="$CXXFLAGS -DNDEBUG"
682# elif test "$enable_debugging" = "maybe" ; then
683#   # do nothing
684fi
685
686
687AC_ARG_WITH(editor,
688AS_HELP_STRING([--with-editor=PATH],
689               [Specify a default editor for the subversion client.]),
690[
691
692    if test "$withval" = "yes" ; then
693      AC_MSG_ERROR([--with-editor requires an argument.])
694    else
695      SVN_CLIENT_EDITOR=$withval
696      AC_DEFINE_UNQUOTED(SVN_CLIENT_EDITOR, "$SVN_CLIENT_EDITOR",
697                         [The path of a default editor for the client.])
698
699    fi
700
701])
702
703SVN_LIB_Z
704
705MOD_ACTIVATION="-a"
706AC_ARG_ENABLE(mod-activation,
707AS_HELP_STRING([--disable-mod-activation],
708               [Do not enable mod_dav_svn in httpd.conf]),
709[
710    if test "$enableval" = "no" ; then
711      MOD_ACTIVATION=""
712      AC_MSG_NOTICE([Disabling apache module activation])
713    else
714      AC_MSG_NOTICE([Enabling apache module activation])
715    fi
716])
717AC_SUBST(MOD_ACTIVATION)
718
719
720
721AC_ARG_ENABLE(gprof,
722AS_HELP_STRING([--enable-gprof],
723               [Produce gprof profiling data in 'gmon.out' (GCC only).]),
724[
725    if test "$enableval" = "yes" ; then
726      dnl Probably other compilers support -pg or something similar;
727      dnl feel free to extend this to include them.
728      if test "$GCC" = "yes"; then
729        if test "$enable_shared" = "yes" ; then
730          AC_MSG_ERROR(Can't have --enable-gprof without --disable-shared (we
731                  recommend also using --enable-all-static).)
732        fi
733        if test ! "$enable_all_static" = "yes" ; then
734          AC_MSG_WARN(We recommend --enable-all-static with --enable-gprof.)
735        fi
736        AC_MSG_NOTICE([Enabling gprof profiling data (to gmon.out).])
737        CFLAGS="$CFLAGS -pg"
738        CXXFLAGS="$CXXFLAGS -pg"
739        LT_LDFLAGS="$LT_LDFLAGS -pg"
740      else
741        AC_MSG_ERROR(We only support --enable-gprof with GCC right now.)
742      fi
743    fi
744])
745
746
747# Scripting and Bindings languages
748
749# Python: Used for testsuite, and bindings
750
751
752PYTHON="`$abs_srcdir/build/find_python.sh`"
753if test -z "$PYTHON"; then
754  AC_MSG_WARN([Python 2.4 or later is required to run the testsuite])
755  AC_MSG_WARN([or to use the Subversion Python bindings])
756  AC_MSG_WARN([])
757  AC_MSG_WARN([If you have a suitable Python installed, but not on the])
758  AC_MSG_WARN([PATH, set the environment variable PYTHON to the full path])
759  AC_MSG_WARN([to the Python executable, and re-run configure])
760fi
761AC_PATH_PROGS(PYTHON, "$PYTHON", none)
762
763# The minimum version for the JVM runtime for our Java bytecode.
764JAVA_OLDEST_WORKING_VER='1.2'
765# SVN_CHECK_JDK sets $JAVA_CLASSPATH
766SVN_CHECK_JDK($JAVA_OLDEST_WORKING_VER)
767
768AC_PATH_PROG(PERL, perl, none)
769
770AC_PATH_PROG(RUBY, ruby, none)
771if test "$RUBY" != "none"; then
772  if "$RUBY" -r mkmf -e 'exit(have_func("rb_hash_foreach") ? 0 : 1)'; then
773    AC_PATH_PROG(RDOC, rdoc, none)
774    AC_CACHE_CHECK([for Ruby major version], [svn_cv_ruby_major],[
775    svn_cv_ruby_major="`$RUBY -rrbconfig -e 'print Config::CONFIG.fetch(%q(MAJOR))'`"
776    ])
777    RUBY_MAJOR="$svn_cv_ruby_major"
778
779    AC_CACHE_CHECK([for Ruby minor version], [svn_cv_ruby_minor],[
780    svn_cv_ruby_minor="`$RUBY -rrbconfig -e 'print Config::CONFIG.fetch(%q(MINOR))'`"
781    ])
782    RUBY_MINOR="$svn_cv_ruby_minor"
783
784    AC_SUBST(RUBY_MAJOR)
785    AC_SUBST(RUBY_MINOR)
786  else
787    RUBY="none"
788    AC_MSG_WARN([The detected Ruby is too old for Subversion to use])
789    AC_MSG_WARN([A Ruby which has rb_hash_foreach is required to use the])
790    AC_MSG_WARN([Subversion Ruby bindings])
791    AC_MSG_WARN([Upgrade to the official 1.8.2 release, or later])
792  fi
793fi
794
795SVN_CHECK_SWIG
796
797SVN_CHECK_CTYPESGEN
798
799dnl decide whether we want to link against the RA/FS libraries
800AC_ARG_ENABLE(runtime-module-search,
801AS_HELP_STRING([--enable-runtime-module-search],
802               [Turn on dynamic loading of RA/FS libraries]),
803[
804    if test "$enableval" = "yes"; then
805      use_dso=yes
806      if test "$enable_shared" = "no"; then
807        AC_MSG_ERROR([--enable-runtime-module-search conflicts with --disable-shared])
808      fi
809      AC_DEFINE(SVN_USE_DSO, 1,
810                [Defined if svn should try to load DSOs])
811    fi
812])
813
814if test "$enable_shared" = "no" || test "$use_dso" != "yes"; then
815  ### We want ra_local first to handle the following scenario:
816  ### user has neon and db3 in /usr/local, and db4 in
817  ### /usr/local/BerkeleyDB.4.0.  If libsvn_ra_neon.la comes before
818  ### libsvn_fs.la then libtool ends up linking libsvn_fs to the db3
819  ### in /usr/local/lib
820  AC_DEFINE(SVN_LIBSVN_CLIENT_LINKS_RA_LOCAL, 1,
821      [Defined if libsvn_client should link against libsvn_ra_local])
822  svn_ra_lib_deps="\$(RA_LOCAL_DEPS)"
823  svn_ra_lib_install_deps="install-ramod-lib"
824  svn_ra_lib_link="\$(RA_LOCAL_LINK)"
825
826  AC_DEFINE(SVN_LIBSVN_CLIENT_LINKS_RA_SVN, 1,
827      [Defined if libsvn_client should link against libsvn_ra_svn])
828  svn_ra_lib_deps="$svn_ra_lib_deps \$(RA_SVN_DEPS)"
829  svn_ra_lib_link="$svn_ra_lib_link \$(RA_SVN_LINK)"
830
831  if test "$svn_lib_neon" = "yes"; then
832    AC_DEFINE(SVN_LIBSVN_CLIENT_LINKS_RA_NEON, 1,
833          [Defined if libsvn_client should link against libsvn_ra_neon])
834    svn_ra_lib_deps="$svn_ra_lib_deps \$(RA_NEON_DEPS)"
835    svn_ra_lib_install_deps="$svn_ra_lib_install_deps install-neon-lib"
836    svn_ra_lib_link="$svn_ra_lib_link \$(RA_NEON_LINK)"
837  fi
838
839  if test "$svn_lib_serf" = "yes"; then
840    AC_DEFINE(SVN_LIBSVN_CLIENT_LINKS_RA_SERF, 1,
841          [Defined if libsvn_client should link against libsvn_ra_serf])
842    svn_ra_lib_deps="$svn_ra_lib_deps \$(RA_SERF_DEPS)"
843    svn_ra_lib_install_deps="$svn_ra_lib_install_deps install-serf-lib"
844    svn_ra_lib_link="$svn_ra_lib_link \$(RA_SERF_LINK)"
845  fi
846
847  SVN_RA_LIB_DEPS=$svn_ra_lib_deps
848  SVN_RA_LIB_INSTALL_DEPS=$svn_ra_lib_install_deps
849  SVN_RA_LIB_LINK=$svn_ra_lib_link
850
851  AC_DEFINE(SVN_LIBSVN_FS_LINKS_FS_FS, 1,
852      [Defined if libsvn_fs should link against libsvn_fs_fs])
853  svn_fs_lib_deps="\$(FS_FS_DEPS)"
854  svn_fs_lib_install_deps="install-fsmod-lib"
855  svn_fs_lib_link="\$(FS_FS_LINK)"
856
857  if test "$svn_lib_berkeley_db" = "yes"; then
858  AC_DEFINE(SVN_LIBSVN_FS_LINKS_FS_BASE, 1,
859      [Defined if libsvn_fs should link against libsvn_fs_base])
860    svn_fs_lib_deps="$svn_fs_lib_deps \$(FS_BASE_DEPS)"
861    svn_fs_lib_install_deps="$svn_fs_lib_install_deps install-bdb-lib"
862    svn_fs_lib_link="$svn_fs_lib_link \$(FS_BASE_LINK)"
863  fi
864
865  SVN_FS_LIB_DEPS=$svn_fs_lib_deps
866  SVN_FS_LIB_INSTALL_DEPS=$svn_fs_lib_install_deps
867  SVN_FS_LIB_LINK=$svn_fs_lib_link
868fi
869
870AC_SUBST(SVN_RA_LIB_DEPS)
871AC_SUBST(SVN_RA_LIB_INSTALL_DEPS)
872AC_SUBST(SVN_RA_LIB_LINK)
873AC_SUBST(SVN_FS_LIB_DEPS)
874AC_SUBST(SVN_FS_LIB_INSTALL_DEPS)
875AC_SUBST(SVN_FS_LIB_LINK)
876
877# ==== JavaHL ================================================================
878
879dnl Possibly compile JavaHL
880do_javahl_build=no
881AC_ARG_ENABLE(javahl,
882  AS_HELP_STRING([--enable-javahl],
883             [Enable compilation of Java high-level bindings (requires C++)]),
884  [ if test "$enableval" = "yes" ; then
885        do_javahl_build="yes"
886    fi
887  ])
888
889JAVAHL_OBJDIR=""
890INSTALL_EXTRA_JAVAHL_LIB=""
891FIX_JAVAHL_LIB=""
892JAVAHL_TESTS_TARGET=""
893LT_CXX_LIBADD=""
894if test "$do_javahl_build" = "yes"; then
895  dnl Check for suitable JDK
896  if test "$JDK_SUITABLE" = "no"; then
897    AC_MSG_ERROR([Cannot compile JavaHL without a suitable JDK.
898                  Please specify a suitable JDK using the --with-jdk option.])
899  fi
900 
901  dnl The temporary directory where libtool compiles libsvnjavahl.
902  dnl N.B. objdir is "the name of the directory that contains temporary
903  dnl libtool files" and it is set by libtool.m4
904  JAVAHL_OBJDIR='$(libsvnjavahl_PATH)'/$objdir
905 
906  os_arch=`uname`
907  if test "$os_arch" = "Darwin"; then
908    dnl On Darwin, JNI libs must be installed as .jnilib
909    INSTALL_EXTRA_JAVAHL_LIB='ln -sf $(libdir)/libsvnjavahl-1.dylib $(libdir)/libsvnjavahl-1.jnilib'
910    FIX_JAVAHL_LIB="ln -sf libsvnjavahl-1.dylib $JAVAHL_OBJDIR/libsvnjavahl-1.jnilib"
911  fi
912  # This segment (and the rest of r10800) is very likely unnecessary
913  # with libtool 1.5, which automatically adds libstdc++ as a
914  # dependency to the C++ libraries it builds.  So at some future time
915  # when autogen.sh requires libtool 1.5 or higher, we can get rid of
916  # it.
917  AC_MSG_CHECKING([for additional flags to link C++ libraries])
918  if test "x$ac_compiler_gnu" = "xyes"; then
919    LT_CXX_LIBADD="-lstdc++"
920    AC_MSG_RESULT([$LT_CXX_LIBADD])
921  else
922    AC_MSG_RESULT([none needed])
923  fi
924fi
925AC_SUBST(INSTALL_EXTRA_JAVAHL_LIB)
926AC_SUBST(JAVAHL_OBJDIR)
927AC_SUBST(FIX_JAVAHL_LIB)
928AC_SUBST(LT_CXX_LIBADD)
929
930AC_ARG_WITH(junit,
931AS_HELP_STRING([--with-junit=PATH],
932               [Specify a path to the junit JAR file.]),
933[
934    if test "$withval" != "no"; then
935      if test -n "$JAVA_CLASSPATH"; then
936        JAVA_CLASSPATH="$withval:$JAVA_CLASSPATH"
937      else
938        JAVA_CLASSPATH="$withval"
939      fi
940      JAVAHL_TESTS_TARGET="javahl-tests"
941    fi
942])
943AC_SUBST(JAVA_CLASSPATH)
944AC_SUBST(JAVAHL_TESTS_TARGET)
945
946# ==== Miscellaneous bits ====================================================
947
948dnl Since this is used only on Unix-y systems, define the path separator as '/'
949AC_DEFINE_UNQUOTED(SVN_PATH_LOCAL_SEPARATOR, '/',
950        [Defined to be the path separator used on your local filesystem])
951
952AC_DEFINE_UNQUOTED(SVN_NULL_DEVICE_NAME, "/dev/null",
953        [Defined to be the null device for the system])
954
955DEFAULT_FS_TYPE="fsfs"
956AC_DEFINE_UNQUOTED(DEFAULT_FS_TYPE, "$DEFAULT_FS_TYPE",
957                   [The fs type to use by default])
958
959# BSD/OS (BSDi) needs to use a different include syntax in Makefile
960INCLUDE_OUTPUTS="include \$(top_srcdir)/build-outputs.mk"
961case "$host" in
962  *bsdi*)
963    # Check whether they've installed GNU make
964    if ! make --version > /dev/null 2>&1; then
965      # BSDi make
966      INCLUDE_OUTPUTS=".include \"\$(top_srcdir)/build-outputs.mk\""
967    fi
968    ;;
969esac
970AC_SUBST(INCLUDE_OUTPUTS)
971
972# ==== Detection complete - output and run config.status =====================
973
974AC_CONFIG_HEADERS(subversion/svn_private_config.h)
975AC_CONFIG_COMMANDS([svn_private_config.h],
976                   [sed -e "s/@SVN_DB_HEADER@/$SVN_DB_HEADER/" subversion/svn_private_config.h > subversion/svn_private_config.h.new
977                    mv -f subversion/svn_private_config.h.new subversion/svn_private_config.h],
978                   [SVN_DB_HEADER="$SVN_DB_HEADER"])
979AC_CONFIG_FILES([Makefile])
980
981SVN_CONFIG_SCRIPT(tools/backup/hot-backup.py)
982SVN_CONFIG_SCRIPT(contrib/client-side/svn_load_dirs/svn_load_dirs.pl)
983SVN_CONFIG_SCRIPT(contrib/client-side/svncopy/svncopy.pl)
984SVN_CONFIG_SCRIPT(contrib/client-side/svncopy/testsvncopy.pl)
985SVN_CONFIG_SCRIPT(contrib/hook-scripts/commit-email.pl)
986SVN_CONFIG_SCRIPT(tools/hook-scripts/commit-access-control.pl)
987SVN_CONFIG_SCRIPT(subversion/bindings/swig/perl/native/Makefile.PL)
988SVN_CONFIG_SCRIPT(packages/solaris/pkginfo)
989AC_SUBST(SVN_CONFIG_SCRIPT_FILES)
990
991AC_OUTPUT
992
993# ==== Print final messages to user ==========================================
994
995dnl Configure is long - users tend to miss warnings printed during it.
996dnl Hence, print a warnings about what we did and didn't configure at the
997dnl end, where people will actually see them.
998
999case "$svn_lib_berkeley_db" in
1000  "no" )
1001    db_version="$SVN_FS_WANT_DB_MAJOR.$SVN_FS_WANT_DB_MINOR.$SVN_FS_WANT_DB_PATCH"
1002    AC_MSG_WARN([we have configured without BDB filesystem support
1003
1004
1005You don't seem to have Berkeley DB version $db_version or newer
1006installed and linked to APR-UTIL.  We have created Makefiles which
1007will build without the Berkeley DB back-end; your repositories will
1008use FSFS as the default back-end.  You can find the latest version of
1009Berkeley DB here:
1010  http://www.oracle.com/technology/software/products/berkeley-db/index.html
1011])
1012;;
1013esac
1014
Note: See TracBrowser for help on using the repository browser.