1 ======================================
4 ======================================
13 B. Dependency Overview
14 C. Dependencies in Detail
18 A. Building from a Tarball
19 B. Building the Latest Source under Unix
20 C. Building under Unix in Different Directories
21 D. Installing from a Zip or Installer File under Windows
22 E. Building the Latest Source under Windows
24 III. BUILDING A SUBVERSION SERVER
25 A. Setting Up Apache Httpd
26 B. Making and Installing the Subversion Apache Server Module
27 C. Configuring Apache Httpd for Subversion
28 D. Running and Testing
29 E. Alternative: 'svnserve' and ra_svn
31 IV. PLATFORM-SPECIFIC ISSUES
35 V. PROGRAMMING LANGUAGE BINDINGS (PYTHON, PERL, RUBY, JAVA)
44 This document is written for people who intend to build
45 Subversion from source code. Normally, the only people who do
46 this are Subversion developers and package maintainers.
48 If neither of these labels fits you, we recommend you find an
49 appropriate binary package of Subversion and install that.
50 While the Subversion project doesn't officially release binary
51 packages, a number of volunteers have made such packages
52 available for different operating systems. Most Linux and BSD
53 distributions already have Subversion packages ready to go via
54 standard packaging channels, and other volunteers have built
55 'installers' for both Windows and OS X. Visit this page for
58 https://subversion.apache.org/packages.html
60 For those of you who still wish to build from source, Subversion
61 follows the Unix convention of "./configure && make", but it has
62 a number of dependencies.
65 B. Dependency Overview
67 You'll need the following build tools to compile Subversion:
69 * autoconf 2.59 or later (Unix only)
70 * libtool 1.4 or later (Unix only)
71 * a reasonable C compiler (gcc, Visual Studio, etc.)
74 Subversion also depends on the following third-party libraries:
76 * libapr and libapr-util (REQUIRED for client and server)
78 The Apache Portable Runtime (APR) library provides an
79 abstraction of operating-system level services such as file
80 and network I/O, memory management, and so on. It also
81 provides convenience routines for things like hashtables,
82 checksums, and argument processing. While it was originally
83 developed for the Apache HTTP server, APR is a standalone
84 library used by Subversion and other products. It is a
85 critical dependency for all of Subversion; it's the layer
86 that allows Subversion clients and servers to run on
87 different operating systems.
89 * SQLite (REQUIRED for client and server)
91 Subversion uses SQLite to manage some internal databases.
93 * libz (REQUIRED for client and server)
95 Subversion uses zlib for compressing binary differences.
96 These diff streams are used everywhere -- over the network,
97 in the repository, and in the client's working copy.
99 * Apache Serf (OPTIONAL for client)
101 The Apache Serf library allows the Subversion client to send HTTP
102 requests. This is necessary if you want your client to access
103 a repository served by the Apache HTTP server. There is an
104 alternate 'svnserve' server as well, though, and clients
105 automatically know how to speak the svnserve protocol.
106 Thus it's not strictly necessary for your client to be able
107 to speak HTTP... though we still recommend that your client
108 be built to speak both HTTP and svnserve protocols.
110 * OpenSSL (OPTIONAL for client and server)
112 OpenSSL enables your client to access SSL-encrypted https://
113 URLs (using Apache Serf) in addition to unencrypted http:// URLs.
114 To use SSL with Subversion's WebDAV server, Apache needs to be
115 compiled with OpenSSL as well.
117 * Netwide Assembler (OPTIONAL for client and server)
119 The Netwide Assembler (NASM) is used to build the (optionally)
120 assembler modules of OpenSSL. As of OpenSSL 1.1.0 NASM is the
121 only supported assembler.
123 * Berkeley DB (OPTIONAL for client and server)
125 There are two different repository 'back-end'
126 implementations. One implementation stores data in a flat
127 filesystem (known as FSFS); the other implementation stores
128 data in a Berkeley DB database (known as BDB). When you
129 create a repository, you have the option of specifying a
130 storage back-end. The Berkeley DB back-end will only be
131 available if the BDB libraries are discovered at compile
132 time. The Berkeley DB back-end has been deprecated and
135 * libsasl (OPTIONAL for client and server)
137 If the Cyrus SASL library is detected at compile time, then
138 the svn client (and svnserve server) will be able to utilize
139 SASL to do various forms of authentication when speaking the
142 * Python, Perl, Java, Ruby (OPTIONAL)
144 Subversion is mostly a collection of C libraries with
145 well-defined APIs, with a small collection of programs that
146 use the APIs. If you want to build Subversion API bindings
147 for other languages, you need to have those languages
148 available at build time.
150 * KDE Framework 5, libsecret, GNOME Keyring (OPTIONAL for client)
152 Subversion contains optional support for storing passwords in
153 KWallet via KDE Framework 5 libraries (preferred) or kdelibs4,
154 and GNOME Keyring via libsecret (preferred) or GNOME APIs.
156 * libmagic (OPTIONAL)
158 If the libmagic library is detected at compile time,
159 it will be used to determine mime-types of binary files
160 which are added to version control. Note that mime-types
161 configured via auto-props or the mime-types-file option
165 C. Dependencies in Detail
167 Subversion depends on a number of third party tools and libraries.
168 Some of them are only required to run a Subversion server; others
169 are necessary just for a Subversion client. This section explains
170 what other tools and libraries will be required so that Subversion
171 can be built with the set of features you want.
173 On Unix systems, the './configure' script will tell you if you are
174 missing the correct version of any of the required libraries or
175 tools, so if you are in a real hurry to get building, you can skip
176 straight to section II. If you want to gather the pieces you will
177 need before starting out, however, you should read the following.
179 If you're just installing a Subversion client, the Subversion
180 team has created a script that downloads the minimal prerequisite
181 libraries (Apache Portable Runtime, Sqlite, and Zlib). The script,
182 'get-deps.sh', is available in the same directory as this file.
183 When run, it will place 'apr', 'apr-util', 'serf', 'zlib', and
184 'sqlite-amalgamation' directories directly into your unpacked Subversion
185 distribution. With the exception of sqlite-amalgamation, they will
186 still need to be configured, built and installed explicitly, and
187 Subversion's own configure script may need to be told where to find
188 them, if they were not installed in standard system locations.
190 Note: there are optional dependencies (such as OpenSSL, swig, and httpd)
191 which get-deps.sh does not download.
193 Note: Because previous builds of Subversion may have installed older
194 versions of these libraries, you may want to run some of the cleanup
195 commands described in section II.B before installing the following.
198 1. Apache Portable Runtime 1.3 or newer (REQUIRED)
200 Whenever you want to build any part of Subversion, you need the
201 Apache Portable Runtime (APR) and the APR Utility (APR-util)
204 If you do not have a pre-installed APR and APR-util, you will need
205 to get these yourself:
207 https://apr.apache.org/download.cgi
209 On Unix systems, if you already have the APR libraries compiled and do
210 not wish to regenerate them from source code, then Subversion needs to
211 be able to find them.
213 There are a couple of options to "./configure" that tell it where
214 to look for the APR and APR-util libraries. By default it will try
215 to locate the libraries using apr-config and apu-config scripts.
216 These scripts provide all the relevant information for the APR and
217 APR-util installations.
219 If you want to specify the location of the APR library, you can use
220 the "--with-apr=" option of "./configure". It should be able to find
221 the apr-config script in the standard location under that directory
222 (e.g. ${prefix}/bin).
224 Similarly, you can specify the location of APR-util using the
225 "--with-apr-util=" option to "./configure". It will look for the
226 apu-config script relative to that directory.
228 For example, if you want to use the APR libraries you built
229 with the Apache httpd server, you could run:
231 $ ./configure --with-apr=/usr/local/apache2 \
232 --with-apr-util=/usr/local/apache2 ...
234 Be sure to use a native Windows SVN client (as opposed to
235 Cygwin's version) so that the .dsp files get carriage-returns at
236 the ends of their lines. Otherwise Visual Studio will complain
237 that it doesn't recognize the .dsp files.
239 If you use APR libraries checked out from svn in an Unix
240 environment, you need to run the 'buildconf' script in each
241 library's directory, to regenerate the configure scripts and
242 other files required for compiling the libraries:
244 $ cd apr; ./buildconf; ./configure ...; make; make install; cd ..
246 $ cd apr-util; ./buildconf; ./configure ...; make; make install; cd ..
248 Configure build and install both libraries before running Subversion's
254 Subversion's binary-differencing engine depends on zlib for
255 compression. Most Unix systems have libz pre-installed, but
256 if you need it, you can get it from
261 3. autoconf 2.59 or newer (Unix only)
263 This is required only if you plan to build from the latest source
264 (see section II.B). Generally only developers would be doing this.
267 4. libtool 1.4 or newer (Unix only)
269 This is required only if you plan to build from the latest source
272 Note: Some systems (Solaris, for example) require libtool 1.4.3 or
273 newer. The autogen.sh script knows about that.
276 5. Apache Serf library 1.3.4 or newer (OPTIONAL)
278 If you want your client to be able to speak to an Apache
279 server (via a http:// or https:// URL), you must link against
280 Apache Serf. Though optional, we strongly recommend this.
282 In order to use ra_serf, you must install serf, and run Subversion's
283 ./configure with the argument --with-serf. If serf is installed in a
284 non-standard place, you should use
286 --with-serf=/path/to/serf/install
290 Apache Serf can be obtained via your system's package distribution
291 system or directly from http://code.google.com/p/serf/.
293 For more information on Apache Serf and Subversion's ra_serf, see the
294 file subversion/libsvn_ra_serf/README.
296 6. OpenSSL (OPTIONAL)
298 ### needs some updates. I think Apache Serf automagically handles
299 ### finding OpenSSL, but we may need more docco here. and w.r.t
302 The Apache Serf library has support for SSL encryption by relying on the
305 a. Using OpenSSL on the client through Apache Serf
307 On Unix systems, to build Apache Serf with OpenSSL, you need OpenSSL
308 installed on your system, and you must add "--with-ssl" as a
309 "./configure" parameter. If your OpenSSL installation is hard
310 for Apache Serf to find, you may need to use
311 "--with-libs=/path/to/lib" in addition. In particular, on Red Hat
312 (but not Fedora Core) it is necessary to specify
313 "--with-libs=/usr/kerberos" for OpenSSL to be found. You can also
314 specify a path to the zlib library using "--with-libs".
316 Under Windows, you can specify the paths to these libraries by
317 passing the options --with-zlib and --with-openssl to gen-make.py.
319 b. Using OpenSSL on the Apache server
321 You can also add support for these features to an Apache httpd
322 server to be used for Subversion using the same support libraries.
323 The Subversion build system will not provide them, however. You
324 add them by specifying parameters to the "./configure" script of
325 the Apache Server instead.
327 For getting SSL on your server, you would add the "--enable-ssl"
328 or "--with-ssl=/path/to/lib" option to Apache's "./configure"
329 script. Apache enables zlib support by default, but you can
330 specify a nonstandard location for the library with the
331 "--with-z=/path/to/dir" option. Consult the Apache documentation
332 for more details, and for other modules you may wish to install
333 to enhance your Subversion server.
335 If you don't already have it, you can get a copy of OpenSSL,
336 including instructions for building and packaging on both Unix
337 systems and Windows, at:
339 https://www.openssl.org/
342 7. Berkeley DB 4.X (OPTIONAL)
344 Berkeley DB is needed to build a Subversion server that supports
345 the BDB repository filesystem, or to access a BDB repository on
346 local disk. If you will only use the FSFS repository filesystem,
347 or if you are building a Subversion client that will only speak
348 to remote (networked) repositories, you don't need it.
350 The current recommended version is 4.4.20 or newer, which brings
351 auto-recovery functionality to the Berkeley DB database
354 If you must use an older version of Berkeley DB, we *strongly*
355 recommend using 4.3 or 4.2 over the 4.1 or 4.0 versions. Not
356 only are these significantly faster and more stable, but they
357 also enable Subversion repositories to automatically clean up
358 database journal files to save disk space.
360 You'll need Berkeley DB installed on your system. You can
363 http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html
365 If you have Berkeley DB installed in a place not searched by default
366 for includes and libraries, add something like this:
368 --with-berkeley-db=db.h:/usr/local/include/db4.7:/usr/local/lib/db4.7:db-4.7
370 to your `configure' switches, and the build process will use the
371 Berkeley DB header and library in the named directories. You may
372 need to use a different path, of course. Note that in order for
373 the detection to succeed, the dynamic linker must be able to find
374 the libraries at configure time.
376 If you are on the Windows platform and want to build Subversion,
377 a precompiled version of the Berkeley DB library is available for
378 download at the Subversion web site "Documents & files" area:
380 http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=688
382 Look in the "Releases > Windows > Windows BDB" section.
385 8. Cyrus SASL library (OPTIONAL)
387 If the Simple Authentication and Security Layer (SASL) library
388 is detected on your system, then the Subversion client and
389 svnserve server can utilize its abilities for various forms of
390 authentication. To learn more about SASL or to get the source
393 http://freshmeat.net/projects/cyrussasl/
396 9. Apache Web Server 2.2.X or newer (OPTIONAL)
398 (https://httpd.apache.org/download.cgi)
400 The Apache httpd server is one of two methods to make your Subversion
401 repository available over a network - the other is a custom server
402 program called svnserve, which requires no extra software packages.
403 Building Subversion, the Apache server, and the modules that Apache
404 needs to communicate with Subversion are complicated enough that there
405 is a whole section at the end of this document that describes how it
406 is done: See section III for details.
409 10. Python 2.7 or newer (https://www.python.org/) (OPTIONAL)
411 If you want to run "make check" or build from the latest source
412 under Unix/Windows as described in section II.B, II.E and III.D,
413 install Python 2.7 or higher on your system. The majority of the
414 test suite is written in Python, as is part of Subversion's build
417 Note that Python 3.x is not supported and most likely won't work.
420 11. Perl 5.8 or newer (Windows only) (OPTIONAL)
422 To build Subversion under any of the MS Windows platforms, you
423 will also need Perl 5.8 or newer to run apr-util's w32locatedb.pl
427 12. SQLite (REQUIRED)
429 Subversion requires SQLite version 3.8.2 or above. You can meet this
430 dependency several ways:
431 * Use an SQLite amalgamation file.
432 * Specify an SQLite installation to use.
433 * Let Subversion find an installed SQLite.
435 To use an SQLite-provided amalgamation, just drop sqlite3.c into
436 Subversion's sqlite-amalgamation/ directory, or point to it with the
437 --with-sqlite configure option. This file also ships with the Subversion
438 dependencies distribution, or you can download it from SQLite:
440 https://www.sqlite.org/download.html
443 13. pkg-config (Unix only, OPTIONAL)
445 Subversion uses pkg-config to find appropriate options used
449 14. D-Bus (Unix only, OPTIONAL)
451 D-Bus is a message bus system. D-Bus is required for support for KWallet
452 and GNOME Keyring. pkg-config is needed to find D-Bus headers and library.
455 15. Qt 5 or Qt 4 (Unix only, OPTIONAL)
457 Qt is a cross-platform application framework. QtCore, QtDBus and QtGui
458 modules are required for support for KWallet. pkg-config is needed
459 to find Qt headers and libraries.
462 16. KDE 5 Framework libraries or KDELibs 4 (Unix only, OPTIONAL)
464 Subversion contains optional support for storing passwords in KWallet.
465 Subversion will look for KF5Wallet, KF5CoreAddons, KF5I18n APIs by default,
466 and needs kf5-config to find them. The KDELibs 4 api is also supported.
467 KDELibs contains core KDE libraries. Subversion uses libkdecore and libkdeui
468 libraries when support for KWallet is enabled. kde4-config is used to get
469 some necessary options. pkg-config, D-Bus and Qt 4 are also required.
471 If you want to build support for KWallet, then pass the '--with-kwallet'
472 option to `configure`. If KDE is installed in a non-standard prefix, then
475 --with-kwallet=/path/to/KDE/prefix
477 17. GLib 2 (Unix only, OPTIONAL)
479 GLib is a general-purpose utility library. GLib is required for support
480 for GNOME Keyring. pkg-config is needed to find GLib headers and library.
483 18. GNOME Keyring (Unix only, OPTIONAL)
485 Subversion contains optional support for storing passwords in GNOME Keyring.
486 pkg-config is needed to find GNOME Keyring headers and library. D-Bus and
487 GLib are also required. If you want to build support for GNOME Keyring,
488 then pass the '--with-gnome-keyring' option to `configure`.
491 19. Ctypesgen (OPTIONAL)
493 Ctypesgen is Python wrapper generator for ctypes. It is used to generate
494 a part of Subversion Ctypes Python bindings (CSVN). If you want to build
495 CSVN, then pass the '--with-ctypesgen' option to `configure`. If ctypesgen.py
496 is installed in a non-standard place, then use:
498 --with-ctypesgen=/path/to/ctypesgen.py
500 For more information on CSVN, see subversion/bindings/ctypes-python/README.
502 20. libmagic (OPTIONAL)
504 Subversion's configure script attempts to find libmagic automatically.
505 If it is installed in a non-standard location, then use:
507 --with-libmagic=/path/to/libmagic/prefix
509 The files include/magic.h and lib/libmagic.so.1.0 (or similar)
510 are expected beneath this prefix directory. If they cannot be
511 found Subversion will be compiled without support for libmagic.
513 If libmagic is installed but support for it should not be compiled
518 If configure should fail when libmagic is not present, but only
519 the default locations should be searched, then use:
525 Subversion uses LZ4 compression libary version r129 or above. Configure
526 will attempt to locate the system library by default using pkg-config
529 If it is installed in a non-standard location, then use:
531 --with-lz4=/path/to/liblz4
533 If configure should use the version bundled with the sources, use:
538 The primary documentation for Subversion is the free book
539 "Version Control with Subversion", a.k.a. "The Subversion Book",
540 obtainable from http://svnbook.red-bean.com/.
542 Various additional documentation exists in the doc/ subdirectory of
543 the Subversion source. See the file doc/README for more information.
550 A. Building from a Tarball
551 ------------------------------
553 1. Building from a Tarball
555 Download the most recent distribution tarball from:
557 https://subversion.apache.org/download/
559 Unpack it, and use the standard GNU procedure to compile:
565 You can also run the full test suite by running 'make check'. Even
566 in successful runs, some tests will report XFAIL; that is normal.
567 Failed runs are indicated by FAIL or XPASS results, or a non-zero exit
568 code from "make check".
571 B. Building the Latest Source under Unix
572 -------------------------------------
574 These instructions assume you have already installed Subversion
575 and checked out a working copy of Subversion's own code --
576 either the latest /trunk code, or some branch or tag. You also
577 need to have already installed whatever prerequisites that
578 version of Subversion requires (if you haven't, the ./configure
579 step should complain).
581 You can discard the directory created by the tarball; you're
582 about to build the latest, greatest Subversion client. This is
583 the procedure Subversion developers use.
585 First off, if you have any Subversion libraries lying around
586 from previous 'make installs', clean them up first!
588 # rm -f /usr/local/lib/libsvn*
589 # rm -f /usr/local/lib/libapr*
590 # rm -f /usr/local/lib/libserf*
592 Start the process by running "autogen.sh":
596 This script will make sure you have all the necessary components
597 available to build Subversion. If any are missing, you will be
598 told where to get them from. (See the 'Dependency Overview' in
601 Note: if the command "autoconf" on your machine does not run
602 autoconf 2.59 or later, but you do have a new enough autoconf
603 available, then you can specify the correct one with the
604 AUTOCONF variable. (The AUTOHEADER variable is similar.) This
605 may be required on Debian GNU/Linux, where "autoconf" is
606 actually a Perl script that attempts to guess which version is
607 required -- because of the interaction between Subversion's and
608 APR's configuration systems, the Perl script may get it wrong.
609 So for example, you might need to do:
611 $ AUTOCONF=autoconf2.59 sh ./autogen.sh
613 Once you've prepared the working copy by running autogen.sh,
614 just follow the usual configuration and build procedure:
620 (Optionally, you might want to pass --enable-maintainer-mode to
621 the ./configure script. This enables debugging symbols in your
622 binaries (among other things) and most Subversion developers use it.)
624 Since the resulting binary depends on shared libraries, the
625 destination library directory must be identified in your
626 operating system's library search path. That is in either
627 /etc/ld.so.conf or $LD_LIBRARY_PATH for Linux systems and in
628 /etc/rc.conf for FreeBSD, followed by a run of the 'ldconfig'
629 program. Check your system documentation for details. By
630 identifying the destination directory, Subversion will be able
631 to dynamically load repository access plugins. If you try to do
632 a checkout and see an error like:
634 subversion/libsvn_ra/ra_loader.c:209: (apr_err=170000)
635 svn: Unrecognized URL scheme 'https://svn.apache.org/repos/asf/subversion/trunk'
637 It probably means that the dynamic loader/linker can't find all
638 of the libsvn_* libraries.
641 C. Building under Unix in Different Directories
642 --------------------------------------------
644 It is possible to configure and build Subversion on Unix in a
645 directory other than the working copy. For example
647 $ svn co https://svn.apache.org/repos/asf/subversion/trunk svn
649 $ # get SQLite amalgamation if required
650 $ chmod +x autogen.sh
654 $ ../svn/configure [...with options as appropriate...]
657 puts the Subversion working copy in the directory svn and builds
658 it in a separate, parallel directory obj.
660 Why would you want to do this? Well there are a number of
663 * You may prefer to avoid "polluting" the working copy with
664 files generated during the build.
666 * You may want to put the build directory and the working
667 copy on different physical disks to improve performance.
669 * You may want to separate source and object code and only
672 * You may want to remote mount the working copy on multiple
673 machines, and build for different machines from the same
676 * You may want to build multiple configurations from the
679 The last reason above is possibly the most useful. For instance
680 you can have separate debug and optimized builds each using the
681 same working copy. Or you may want a client-only build and a
682 client-server build. Using multiple build directories you can
683 rebuild any or all configurations after an edit without the need
684 to either clean and reconfigure, or identify and copy changes
685 into another working copy.
688 D. Installing from a Zip or Installer File under Windows
689 -----------------------------------------------------
691 Of all the ways of getting a Subversion client, this is the
692 easiest. Download a Zip or self-extracting installer via:
694 https://subversion.apache.org/packages.html#windows
696 For a Zip file extract the DLLs and EXEs to a directory of your
697 choice. Included in the download are among other tools the SVN
698 client, the SVNADMIN administration tool and the SVNLOOK reporting
701 You may want to add the bin directory in the Subversion folder to your
702 PATH environment variable so as to not have to use the full path when
703 running Subversion commands.
705 To test the installation, open a DOS box (run either "cmd" or
706 "command" from the Start menu's "Run..." menu option), change to
707 the directory you installed the executables into, and run:
709 C:\test>svn co https://svn.apache.org/repos/asf/subversion/trunk svn
711 This will get the latest Subversion sources and put them into the
714 If using a self-extracting .exe file, just run it instead of
715 unzipping it, to install Subversion.
717 E. Building the Latest Source under Windows
718 ----------------------------------------
722 * Microsoft Visual Studio. Any recent (2005+) version containing the
723 Visual C++ component will work (E.g. Professional, Express, Community
724 Edition). Make sure you enable C++ support during setup.
725 * Python 2.7 or higher, downloaded from https://www.python.org/ which is
726 used to generate the project files.
727 Note that Python 3.x is not supported (yet).
728 * Perl 5.8 or higher from https://www.perl.org/get.html
729 * Awk (from https://www.cs.princeton.edu/~bwk/btl.mirror/awk95.exe) is
730 needed to compile Apache. Note that this is the actual awk program,
731 not an installer - just rename it to awk.exe and it is ready to use.
732 * Apache apr, apr-util, and optionally apr-iconv libraries, version
733 1.3 or later (1.2 for apr-iconv). If you are building from a Subversion
734 checkout and have not downloaded Apache 2, then get these 3 libraries
735 from https://www.apache.org/dist/apr/.
736 * SQLite 3.8.2 or higher from https://www.sqlite.org/download.html
737 (3.8.11.1 or higher recommended)
738 * ZLib 1.2 or higher is required and can be obtained from
740 * Either a Subversion client binary from
741 https://subversion.apache.org/packages.html to do the initial checkout
742 of the Subversion source or the zip file source distribution.
746 * [Optional] Apache Httpd 2 source, downloaded from
747 https://httpd.apache.org/download.cgi, these instructions assume
748 version 2.0.58. This is only needed for building the Subversion
749 server Apache modules. ### FIXME Apache 2.2 or greater required.
750 * [Optional] Berkeley DB for backend support of the server components
752 http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/downloads/index-082944.html
753 (Version 4.4.20 or in specific cases some higher version recommended)
754 For more information see Section I.C.7.
755 * [Optional] Openssl can be obtained from https://www.openssl.org/source/
756 * [Optional] NASM can be obtained from http://www.nasm.us/
757 * [Optional] A modified version of GNU libintl, called
758 svn-win32-libintl.zip, can be used for displaying localized
759 messages. Available at:
760 http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=2627
761 * [Optional] GNU gettext for generating message catalog (.mo)
762 files from message translations. You can get the latest
763 binaries from http://gnuwin32.sourceforge.net/. You'll need the
764 binaries (gettext-0.14.1-bin.zip) and dependencies
765 (gettext-0.14.1-dep.zip).
769 The Apache Serf library supports secure connections with OpenSSL
770 and on-the-wire compression with zlib. If you want to use the
771 secure connections feature, you should pass the option
772 "--with-openssl" to the gen-make.py script. See Section I.C.6 for
777 This section describes how to unpack the files to make a build tree.
779 * Make a directory SVN and cd into it.
780 * Either checkout Subversion:
782 svn co https://svn.apache.org/repos/asf/subversion/trunk src-trunk
784 or unpack the zip file distribution and rename the directory to
787 * Install Visual Studio Environment. You either have to tell the
788 installer to register environment variables or run VCVARS32.BAT
789 before building anything. If you are using a newer Visual Studio,
790 use the 'Visual Studio 20xx Command Prompt' on the Start menu.
791 * Install Python and add it to your path
792 * Install Perl (it should add itself to the path)
793 ### Subversion doesn't need perl. Only some dependencies need it
794 (OpenSSL and some apr scripts)
795 * Copy AWK (awk95.exe) to awk.exe (e.g. SVN\awk\awk.exe) and add
796 the directory containing it (e.g. SVN\awk) to the path.
797 ### Subversion doesn't need awk. Only some dependencies need it
799 * [Optional] Install NASM and add it to your path
800 ### Subversion doesn't need NASM. Only some dependencies need it
802 * [Optional] If you checked out Subversion from the repository and want
803 to build Subversion with http/https access support then install the
804 Apache Serf sources into SVN\src-trunk\serf.
805 * [Optional] If you want BDB backend support, extract the Berkeley DB
806 files into SVN\src-trunk\db4-win32. It's a good idea to add
807 SVN\src-trunk\db4-win32\bin to your PATH, so that Subversion can find
808 the Berkeley DB DLLs.
810 [NOTE: This binary package of Berkeley DB is provided for
811 convenience only. Please don't address questions about
812 Berkeley DB that aren't directly related to using Subversion
813 to the project mailing list.]
815 If you build Berkeley DB from the source, you will have to copy
816 the file db-x.x.x\build_win32\db.h to
817 SVN\src-trunk\db4-win32\include, and all the import libraries to
818 SVN\src-trunk\db4-win32\lib. Again, the DLLs should be somewhere in
820 ### Just use --with-serf instead of the hardcoded path
822 * [Optional] If you want to build the server modules, extract Apache
823 source into SVN\httpd-2.x.x.
824 * If you are building from a checkout of Subversion, and you are NOT
825 building Apache, then you will need the APR libraries. Depending
826 on how you got your version of APR, either:
827 - Extract the APR, APR-util and APR-iconv source distributions into
828 SVN\apr, SVN\apr-util, and SVN\apr-iconv respectively.
830 - Extract the apr, apr-util and apr-iconv directories from the
831 srclib folder in the Apache httpd source into SVN\apr,
832 SVN\apr-util, and SVN\apr-iconv respectively.
833 ### Just use --with-apr, etc. instead of the hardcoded paths
834 * Extract the ZLib sources into SVN\zlib if you are not using the zlib
835 included in the dependencies zip file.
836 ### Just use --with-zlib instead of the hardcoded path
837 * [Optional] If you want secure connection (https) client support extract
838 OpenSSL into SVN\openssl
839 ### And pass the path to both serf and gen-make.py
840 * [Optional] If you want localized message support, extract
841 svn-win32-libintl.zip into SVN\svn-win32-libintl and extract
842 gettext-x.x.x-bin.zip and gettext-x.x.x-dep.zip into
843 SVN\gettext-x.x.x-bin.
844 Add SVN\gettext-x.x.x-bin\bin to your path.
845 * Download the SQLite amalgamation from
846 https://www.sqlite.org/download.html
847 and extract it into SVN\sqlite-amalgamation.
848 See I.C.12 for alternatives to using the amalgamation package.
850 E.4 Building the Binaries
852 To build the binaries either follow these instructions.
854 Start in the SVN directory you created.
856 Set up the environment (commands should be one line even if wrapped here).
860 C:>set BUILD_ROOT=C:\SVN
861 C:>set PYTHONDIR=C:\Python27
862 C:>set AWKDIR=C:\SVN\Awk
863 C:>set ASMDIR=C:\SVN\asm
864 C:>set SDKINC="C:\Program Files\Microsoft SDK\include"
865 C:>set SDKLIB="C:\Program Files\Microsoft SDK\lib"
866 C:>set GETTEXTBIN=C:\SVN\gettext-0.14.1-bin\bin
867 C:>PATH=%PATH%;%BUILD_ROOT%\src-%DIR%\db4-win32;%ASMDIR%;
868 %PYTHONDIR%;%AWKDIR%;%GETTEXTBIN%
869 C:>set INCLUDE=%SDKINC%;%INCLUDE%
870 C:>set LIB=%SDKLIB%;%LIB%
875 C:>perl Configure VC-WIN32
876 [*] C:>call ms\do_masm
877 C:>nmake -f ms\ntdll.mak
882 *Note: Use "call ms\do_nasm" if you have nasm instead of MASM, or
883 "call ms\do_ms" if you don't have an assembler.
884 Also if you are using OpenSSL >= 1.0.0 masm is no longer
885 supported. You will have to use do_nasm or do_ms in this case.
890 C:>perl Configure VC-WIN32
897 This step is only required for building the server dso modules.
899 ### FIXME Apache 2.2 or greater required. Old build instructions for VC6.
901 C:>set APACHEDIR=C:\Program Files\Apache Group\Apache2
902 C:>msdev httpd-2.0.58\apache.dsw /MAKE "BuildBin - Win32 Release"
906 If you downloaded APR / APR-UTIL / APR_ICONV by source, you will have to
907 build these libraries first.
908 Building these libraries on Windows is straight forward and in most cases
909 as simple as issuing these two commands:
911 C:>nmake -f Makefile.win
912 C:>nmake -f Makefile.win install
914 Please refere to the build instructions provided by the library source
915 for actual build instructions.
919 If you downloaded the zlib source, you will have to build ZLib first.
920 Building ZLib using Visual Studio should be quite simple. Just open the
921 appropriate solution and build the project zlibstat using the IDE.
923 Please refere to the build instructions provided by the library source
924 for actual build instructions.
926 Note that you'd make sure to define ZLIB_WINAPI in the ZLib config
927 header and move the lib-file into the zlib root-directory.
931 ### Section about Apache Serf might be required/useful to add.
932 ### scons is required too and Apache Serf needs to be configured prior to
933 ### be able to build Subversion using:
934 ### scons APR=[PATH_TO_APR] APU=[PATH_TO_APU] OPENSSL=[PATH_TO_OPENSSL]
935 ### ZLIB=[PATH_TO_ZLIB] PREFIX=[PATH_TO_SERF_DEST]
943 * If you don't want to build mod_dav_svn, omit the --with-httpd
944 option. The zip file source distribution contains apr, apr-util and
945 apr-iconv in the default build location. If you have downloaded the
946 apr files yourself you will have to tell the generator where to find
947 the APR libraries; the options are --with-apr, --with-apr-util and
949 * If you would like a debug build substitute Debug for Release in
951 * There have been rumors that Subversion on Win32 can be built
952 using the latest cygwin, you probably don't want the zip file source
953 distribution though. ymmv.
954 * You will also have to distribute the C runtime dll with the binaries.
955 Also, since Apache/APR do not provide .vcproj files, you will need to
956 convert the Apache/APR .dsp files to .vcproj files with Visual Studio
957 before building -- just open the Apache .dsw file and answer 'Yes To
958 All' when the conversion dialog pops up, or you can open the individual
959 .dsp files and convert them one at a time.
960 The Apache/APR projects required by Subversion are:
961 apr-util\libaprutil.dsp, apr\libapr.dsp,
962 apr-iconv\libapriconv.dsp, apr-util\xml\expat\lib\xml.dsp,
963 apr-iconv\ccs\libapriconv_ccs_modules.dsp, and
964 apr-iconv\ces\libapriconv_ces_modules.dsp.
965 * If the server dso modules are being built and tested Apache must not
966 be running or the copy of the dso modules will fail.
970 If Apache 2 has been built and the server modules are required then
971 gen-make.py will already have been run. If the source is from the zip
972 file, Apache 2 has not been built so gen-make.py must be run:
974 C:>python gen-make.py --vsnet-version=20xx --with-berkeley-db=db4-win32
975 --with-openssl=..\openssl --with-zlib=..\zlib
976 --with-libintl=..\svn-win32-libintl
978 Then build subversion:
980 C:>msbuild subversion_vcnet.sln /t:__MORE__ /p:Configuration=Release
983 The binaries have now been built.
985 E.5 Packaging the binaries
987 You now need to copy the binaries ready to make the release zip
988 file. You also need to do this to run the tests as the new binaries
989 need to be in your path. You can use the build/win32/make_dist.py
990 script in the Subversion source directory to do that.
992 [TBD: Describe how to do this. Note dependencies on zip, jar, doxygen.]
994 E.6 Testing the Binaries
995 [TBD: It's been a long, long while since it was necessary to move
996 binaries around for testing. win-tests.py does that automagically.
997 Fix this section accordingly, and probably reorder, putting
998 the packaging at the end.]
1000 The build process creates the binary test programs but it does not
1001 copy the client tests into the release test area.
1004 C:>mkdir Release\subversion\tests\cmdline
1005 C:>xcopy /S /Y subversion\tests\cmdline Release\subversion\tests\cmdline
1007 If the server dso modules have been built then copy the dso files and
1008 dlls into the Apache modules directory.
1010 C:>copy Release\subversion\mod_dav_svn\mod_dav_svn.so "%APACHEDIR%"\modules
1011 C:>copy Release\subversion\mod_authz_svn\mod_authz_svn.so
1012 "%APACHEDIR%"\modules
1013 C:>copy svn-win32-%VER%\bin\intl.dll "%APACHEDIR%\bin"
1014 C:>copy svn-win32-%VER%\bin\iconv.dll "%APACHEDIR%\bin"
1015 C:>copy svn-win32-%VER%\bin\libdb42.dll "%APACHEDIR%\bin"
1018 Put the svn-win32-trunk\bin directory at the start of your path so
1019 you run the newly built binaries and not another version you might
1022 Then run the client tests:
1024 C:>PATH=%BUILD_ROOT%\svn-win32-%VER%\bin;%PATH%
1026 C:>python win-tests.py -c -r -v
1028 If the server dso modules were built configure Apache to use the
1029 mod_dav_svn and mod_authz_svn modules by making sure these lines appear
1030 uncommented in httpd.conf:
1032 LoadModule dav_module modules/mod_dav.so
1033 LoadModule dav_fs_module modules/mod_dav_fs.so
1034 LoadModule dav_svn_module modules/mod_dav_svn.so
1035 LoadModule authz_svn_module modules/mod_authz_svn.so
1037 And further down the file add location directives to point to the
1038 test repositories. Change the paths to the SVN directory you created
1039 (paths should be on one line even if wrapped here):
1041 <Location /svn-test-work/repositories>
1043 SVNParentPath C:/SVN/src-trunk/Release/subversion/tests/cmdline/
1044 svn-test-work/repositories
1047 <Location /svn-test-work/local_tmp/repos>
1049 SVNPath c:/SVN/src-trunk/Release/subversion/tests/cmdline/
1050 svn-test-work/local_tmp/repos
1053 Then restart Apache and run the tests:
1055 C:>python win-tests.py -c -r -v -u http://localhost
1058 III. BUILDING A SUBVERSION SERVER
1059 ============================
1061 Subversion has two servers you can choose from: svnserve and
1062 Apache. svnserve is a small, lightweight server program that is
1063 automatically compiled when you build Subversion's source. Apache
1064 is a more heavyweight HTTP server, but tends to have more features.
1066 This section primarily focuses on how to build Apache and the
1067 accompanying mod_dav_svn server module for it. If you plan to use
1068 svnserve instead, jump right to section E for a quick explanation.
1071 A. Setting Up Apache Httpd
1072 -----------------------
1074 1. Obtaining and Installing Apache Httpd 2
1076 Subversion tries to compile against the latest released version
1077 of Apache httpd 2.2+. The easiest thing for you to do is download
1078 a source tarball of the latest release and unpack that.
1080 If you have questions about the Apache httpd 2.2 build, please consult
1081 the httpd install documentation:
1083 https://httpd.apache.org/docs-2.2/install.html
1085 At the top of the httpd tree:
1088 $ ./configure --enable-dav --enable-so --enable-maintainer-mode
1090 The first arg says to build mod_dav.
1092 The second arg says to enable shared module support which is needed
1093 for a typical compile of mod_dav_svn (see below).
1095 The third arg says to include debugging information. If you
1096 built Subversion with --enable-maintainer-mode, then you should
1097 do the same for Apache; there can be problems if one was
1098 compiled with debugging and the other without.
1100 Note: if you have multiple db versions installed on your system,
1101 Apache might link to a different one than Subversion, causing
1102 failures when accessing the repository through Apache. To prevent
1103 this from happening, you have to tell Apache which db version to
1104 use and where to find db. Add --with-dbm=db4 and
1105 --with-berkeley-db=/usr/local/BerkeleyDB.4.2 to the configure
1106 line. Make sure this is the same db as the one Subversion uses.
1107 This note assumes you have installed Berkeley DB 4.2.52
1108 at its default locations. For more info about the db requirement,
1111 You may also want to include other modules in your build. Add
1112 --enable-ssl to turn on SSL support, and --enable-deflate to turn on
1113 compression support, for example. Consult the Apache documentation
1116 All instructions below assume you configured Apache to install
1117 in its default location, /usr/local/apache2/; substitute
1118 appropriately if you chose some other location.
1120 Compile and install apache:
1122 $ make && make install
1125 B. Making and Installing the Subversion Apache Server Module
1126 ---------------------------------------------------------
1128 Go back into your subversion working copy and run ./autogen.sh if
1129 you need to. Then, assuming Apache httpd 2.2 is installed in the
1130 standard location, run:
1134 Note: do *not* configure subversion with "--disable-shared"!
1135 mod_dav_svn *must* be built as a shared library, and it will
1136 look for other libsvn_*.so libraries on your system.
1138 If you see a warning message that the build of mod_dav_svn is
1139 being skipped, this may be because you have Apache httpd 2.x
1140 installed in a non-standard location. You can use the
1141 "--with-apxs=" option to locate the apxs script:
1143 $ ./configure --with-apxs=/usr/local/apache2/bin/apxs
1145 Note: it *is* possible to build mod_dav_svn as a static library
1146 and link it directly into Apache. Possible, but painful. Stick
1147 with the shared library for now; if you can't, then ask.
1149 $ rm /usr/local/lib/libsvn*
1151 If you have old subversion libraries sitting on your system,
1152 libtool will link them instead of the `fresh' ones in your tree.
1153 Remove them before building subversion.
1155 $ make clean && make && make install
1157 After the make install, the Subversion shared libraries are in
1158 /usr/local/lib/. mod_dav_svn.so should be installed in
1159 /usr/local/libexec/ (or elsewhere, such as /usr/local/apache2/modules/,
1160 if you passed --with-apache-libexecdir to configure).
1163 Section II.E explains how to build the server on Windows.
1166 C. Configuring Apache Httpd for Subversion
1167 ---------------------------------------
1169 The following section is an abbreviated version of the
1170 information in the Subversion Book
1171 (http://svnbook.red-bean.com). Please read chapter 6 for more
1174 The following assumes you have already created a repository.
1175 For documentation on how to do that, see README.
1177 The following also assumes that you have modified
1178 /usr/local/apache2/conf/httpd.conf to reflect your setup.
1179 At a minimum you should look at the User, Group and ServerName
1180 directives. Full details on setting up apache can be found at:
1181 https://httpd.apache.org/docs-2.2/
1183 First, your httpd.conf needs to load the mod_dav_svn module.
1184 If you pass --enable-mod-activation to Subversion's configure,
1185 'make install' target should automatically add this line for you.
1186 In any case, if Apache HTTPD gives you an error like "Unknown
1187 DAV provider: svn", then you may want to verify that this line
1188 exists in your httpd.conf:
1190 LoadModule dav_svn_module modules/mod_dav_svn.so
1192 NOTE: if you built mod_dav as a dynamic module as well, make sure
1193 the above line appears after the one that loads mod_dav.so.
1195 Next, add this to the *bottom* of your httpd.conf:
1197 <Location /svn/repos>
1199 SVNPath /absolute/path/to/repository
1202 This will give anyone unrestricted access to the repository. If
1203 you want limited access, read or write, you add these lines to
1207 AuthName "Subversion repository"
1208 AuthUserFile /my/svn/user/passwd/file
1212 a) For a read/write restricted repository:
1216 b) For a write restricted repository:
1218 <LimitExcept GET PROPFIND OPTIONS REPORT>
1222 c) For separate restricted read and write access:
1224 AuthGroupFile /my/svn/group/file
1226 <LimitExcept GET PROPFIND OPTIONS REPORT>
1227 Require group svn_committers
1230 <Limit GET PROPFIND OPTIONS REPORT>
1231 Require group svn_committers
1232 Require group svn_readers
1235 ### FIXME Tutorials section refers to old 2.0 docs
1236 These are only a few simple examples. For a complete tutorial
1237 on Apache access control, please consider taking a look at the
1238 tutorials found under "Security" on the following page:
1239 https://httpd.apache.org/docs-2.0/misc/tutorials.html
1241 In order for 'svn cp' to work (which is actually implemented as a
1242 DAV COPY command), mod_dav needs to be able to determine the
1243 hostname of the server. A standard way of doing this is to use
1244 Apache's ServerName directive to set the server's hostname. Edit
1245 your /usr/local/apache2/conf/httpd.conf to include:
1247 ServerName svn.myserver.org
1249 If you are using virtual hosting through Apache's NameVirtualHost
1250 directive, you may need to use the ServerAlias directive to specify
1251 additional names that your server is known by.
1253 If you have configured mod_deflate to be in the server, you can enable
1254 compression support for your repository by adding the following line
1255 to your Location block:
1257 SetOutputFilter DEFLATE
1260 NOTE: If you are unfamiliar with an Apache directive, or not exactly
1261 sure about what it does, don't hesitate to look it up in the
1262 documentation: https://httpd.apache.org/docs-2.2/mod/directives.html.
1264 NOTE: Make sure that the user 'nobody' (or whatever UID the
1265 httpd process runs as) has permission to read and write the
1266 Berkeley DB files! This is a very common problem.
1269 D. Running and Testing
1274 $ /usr/local/apache2/bin/apachectl stop
1275 $ /usr/local/apache2/bin/apachectl start
1277 Check /usr/local/apache2/logs/error_log to make sure it started
1280 Try doing a network checkout from the repository:
1282 $ svn co http://localhost/svn/repos wc
1284 The most common reason this might fail is permission problems
1285 reading the repository db files. If the checkout fails, make
1286 sure that the httpd process has permission to read and write to
1287 the repository. You can see all of mod_dav_svn's complaints in
1288 the Apache error logfile, /usr/local/apache2/logs/error_log.
1290 To run the regression test suite for networked Subversion, see
1291 the instructions in subversion/tests/cmdline/README.
1292 For advice about tracing problems, see "Debugging the server" in
1293 https://subversion.apache.org/docs/community-guide/.
1296 E. Alternative: 'svnserve' and ra_svn
1297 -----------------------------------
1299 An alternative network layer is libsvn_ra_svn (on the client
1300 side) and the 'svnserve' process on the server. This is a
1301 simple network layer that speaks a custom protocol over plain
1302 TCP (documented in libsvn_ra_svn/protocol):
1304 $ svnserve -d # becomes a background daemon
1305 $ svn checkout svn://localhost/usr/local/svn/repository
1307 You can use the "-r" option to svnserve to set a logical root
1308 for repositories, and the "-R" option to restrict connections to
1309 read-only access. ("Read-only" is a logical term here; svnserve
1310 still needs write access to the database in this mode, but will
1311 not allow commits or revprop changes.)
1313 'svnserve' has built-in CRAM-MD5 authentication (so you can use
1314 non-system accounts), and can also be tunneled over SSH (so you
1315 can use existing system accounts). It's also capable of using
1316 Cyrus SASL if libsasl2 is detected at ./configure time. Please
1317 read chapter 6 in the Subversion Book
1318 (http://svnbook.red-bean.com) for details on these features.
1322 IV. PLATFORM-SPECIFIC ISSUES
1323 ========================
1328 There is an error in the Windows XP TCP/IP stack which causes
1329 corruption in certain cases. This problem is exposed only
1332 The root of the matter is caused by duplicating file handles
1333 between parent and child processes. The httpd Apache group
1334 explains this a lot better:
1336 https://www.apache.org/dist/httpd/binaries/win32/#xpbug
1338 And there's an item about this in the Subversion FAQ:
1340 https://subversion.apache.org/faq.html#windows-xp-server
1342 The only known workaround for now is to update to Windows XP
1349 [TBD: Describe BDB 4.0.x problem]
1353 V. PROGRAMMING LANGUAGE BINDINGS (PYTHON, PERL, RUBY, JAVA)
1354 ========================================================
1356 For Python, Perl and Ruby bindings, see the file
1358 ./subversion/bindings/swig/INSTALL
1360 For Java bindings, see the file
1362 ./subversion/bindings/javahl/README