[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Patch to build db in the tree.

From: Karl Fogel <kfogel_at_galois.collab.net>
Date: 2001-03-05 21:28:33 CET

This sounds like a good idea; will it work like this?:

  - svn configuration process looks in the svn working copy for the
    berkeley db sources. If it finds them, it uses them, instead of
    whatever bdb might happen to be on the system.

  - If it does not find them, it behaves as it does now.

?,
-K

Mo DeJong <mdejong@cygnus.com> writes:
> Hi all.
>
> So it seems that most folks are
> going to need to build an updated
> version of Berkeley DB for use
> with subversion. I have a Red Hat
> 6.2 box and it appears that my
> version of Berkeley DB is too
> old for subversion :(
>
> Since we need to build it,
> I decided to add db to the
> subversion top-level configure
> by duplicating how neon is
> integrated.
>
>
> Why build our own Berkeley DB?
>
> (1) Every developer should be
> running the exact same code.
>
> There has already been one example
> where different versions of the
> db lib have caused problems.
> Statically linking in a known
> version of Berkeley DB is the
> best way to make sure nobody
> get bitten by some odd little
> bug caused by version conflicts.
>
>
> (2) Building subversion should
> be easy.
>
> It is really critical that
> folks are able to build with
> a minimum of fuss. Folks
> don't want to go download
> and build a bunch of stuff.
> One toplevel configure
> should do it all for them.
>
> We should concern ourselves
> with making it easy for joe
> developer out there to get
> subversion built with the
> minimum of fuss.
>
> Distribution builders
> and power users can always
> use an existing library via
> the --with-berkeley-db switch.
>
>
> (3) The client side fs should build
> by default.
>
> The default build should support
> a local filesystem as well as
> a networked interface. Currently,
> the local fs code will not get
> built if a good version of db
> can not be found on the system.
>
>
> Unknowns:
>
> Is db-3.2.9 the right version?
>
> Should the default db configure
> be static? We would need to
> pass the --enable-dynamic
> option to db's configure
> script to enable shared libs.
>
> Shared libs are a bit more
> dangerous since they are
> harder to build/debug and
> more can go wrong. On the
> other hand svn libs are
> currently being built shared.
>
> Should the --enable-debug or
> --enable-posixmutexes flags
> be passed to db's configure?
>
> Should the db dir be required?
> This patch will build the
> old way if the db subdir
> is not in the tree or if
> another location is passed
> via the --with-berkeley-db
> switch.
>
>
> cheers
> Mo DeJong
> Red Hat Inc
>
>
>
>
> 2001-03-04 Mo DeJong <mdejong@redhat.com>
>
> * Makefile.am: Add DB_DUBDIR to SUBDIRS.
> DB_SUBDIR is empty when db is not built
> in the subversion tree.
> * autogen.sh: Add gen time check for
> db subdir.
> * configure.in: Configure in the db
> subdir if it exists.
> * ac-helpers/berkeley-db.m4: Add
> new builtin status. It will set the
> flags to use the db dir in the
> build directory.
> * ac-helpers/get-db-ver.sh: Add
> script to determine the version
> of the db package in the srcdir.
>
>
>
> (New File)
>
> % cat ac-helpers/get-db-ver.sh
> #! /bin/sh
> #
> # USAGE: get-db-ver.sh DIRECTORY
> #
>
> conf=$1/dist/RELEASE
>
> # Tested with the 3.2.9 release from Sleepycat
>
> major=`sed -n '/DB_VERSION_MAJOR=/s/.*=//p' $conf`
> minor=`sed -n '/DB_VERSION_MINOR=/s/.*=//p' $conf`
> release=`sed -n '/DB_VERSION_PATCH=/s/.*=//p' $conf`
> echo $major.$minor.$release
>
>
> (Patch files)
>
> Index: Makefile.am
> ===================================================================
> RCS file: /cvs/subversion/Makefile.am,v
> retrieving revision 1.17
> diff -u -r1.17 Makefile.am
> --- Makefile.am 2001/02/05 19:21:25 1.17
> +++ Makefile.am 2001/03/05 08:10:56
> @@ -8,7 +8,7 @@
> ## dependencies between Makefile.am, Makefile.in, and Makefile.
> ## In other words, SUBDIRS does not completely control automake
> ## generation.
> -SUBDIRS = apr expat-lite neon subversion doc
> +SUBDIRS = apr expat-lite neon @DB_SUBDIR@ subversion doc
>
> ACLOCAL = @ACLOCAL@ -I ac-helpers
>
> Index: autogen.sh
> ===================================================================
> RCS file: /cvs/subversion/autogen.sh,v
> retrieving revision 1.36
> diff -u -r1.36 autogen.sh
> --- autogen.sh 2001/02/24 09:09:32 1.36
> +++ autogen.sh 2001/03/05 08:10:56
> @@ -33,12 +33,14 @@
>
> # Handle the neon/ subdir
> NEON_WANTED=0.11.0
> +NEON_URL="http://www.webdav.org/neon/neon-${NEON_WANTED}.tar.gz"
> +
> if [ ! -d neon ]; then
> echo ""
> echo "...Uh oh, there is a problem."
> echo "You don't have a neon/ subdirectory here."
> echo "Please get neon ${NEON_WANTED} from:"
> - echo " http://www.webdav.org/neon/neon-${NEON_WANTED}.tar.gz"
> + echo " ${NEON_URL}"
> echo ""
> echo "Unpack the archive using tar/gunzip and rename the resulting"
> echo "directory from ./neon-${NEON_WANTED}/ to ./neon/"
> @@ -52,13 +54,50 @@
> echo "You have a neon/ subdir containing version $NEON_VERSION,"
> echo "but Subversion needs neon ${NEON_WANTED}."
> echo "Please get neon ${NEON_WANTED} from:"
> - echo " http://www.webdav.org/neon/neon-${NEON_WANTED}.tar.gz"
> + echo " ${NEON_URL}"
> echo ""
> echo "Unpack the archive using tar/gunzip and rename the resulting"
> echo "directory from ./neon-${NEON_WANTED}/ to ./neon/"
> echo ""
> exit 1
> fi
> +
> +
> +# Handle the db/ subdir
> +DB_WANTED=3.2.9
> +DB_URL="http://www.sleepycat.com/update/3.2.9/db-3.2.9.tar.gz"
> +
> +if [ ! -d db ]; then
> + echo ""
> + echo "...Uh oh, there is a problem."
> + echo "You don't have a db/ subdirectory here."
> + echo "Please get berkely DB ${DB_WANTED} from:"
> + echo " ${DB_URL}"
> + echo ""
> + echo "Unpack the archive using tar/gunzip and rename the resulting"
> + echo "directory from ./db-${NEON_WANTED}/ to ./db/"
> + echo ""
> + exit 1
> +fi
> +
> +DB_VERSION=`ac-helpers/get-db-ver.sh db`
> +if test "$DB_WANTED" != "$DB_VERSION"; then
> + echo ""
> + echo "...Uh oh, there is a problem."
> + echo "You have a db/ subdir containing version $DB_VERSION,"
> + echo "but Subversion needs ${DB_WANTED}."
> + echo "Please get berkely DB ${DB_WANTED} from:"
> + echo " ${DB_URL}"
> + echo ""
> + echo "Unpack the archive using tar/gunzip and rename the resulting"
> + echo "directory from ./db-${DB_WANTED}/ to ./db/"
> + echo ""
> + exit 1
> +fi
> +
> +
> +
> +
>
> # Produce aclocal.m4, so autoconf gets the automake macros it needs
> echo "Creating aclocal.m4..."
> Index: configure.in
> ===================================================================
> RCS file: /cvs/subversion/configure.in,v
> retrieving revision 1.67
> diff -u -r1.67 configure.in
> --- configure.in 2001/03/02 23:38:20 1.67
> +++ configure.in 2001/03/05 08:10:56
> @@ -44,6 +44,13 @@
> if test "$enable_subdir_config" = "yes"; then
> APR_SUBDIR_CONFIG(apr)
> APR_SUBDIR_CONFIG(neon, --with-expat="$abs_srcdir/expat-lite/libexpat.la")
> +
> + if test -d $abs_srcdir/db ; then
> + APR_SUBDIR_CONFIG(db/dist)
> + # Note: DB_SUBDIR is used in subversion/Makefile.am only
> + DB_SUBDIR=db/dist
> + fi
> + AC_SUBST(DB_SUBDIR)
> fi
>
>
> @@ -260,7 +267,7 @@
>
>
> the Subversion filesystem library, part of
> -the server, requires Berkeley DB version 3.1.14 or newer, which you
> +the server, requires Berkeley DB version 3.2.9 or newer, which you
> don't seem to have installed. We have created makefiles which will
> build the Subversion client code only, and skip the server.
> You can find latest version of Berkeley DB at http://www.sleepycat.com.])
> Index: ac-helpers/berkeley-db.m4
> ===================================================================
> RCS file: /cvs/subversion/ac-helpers/berkeley-db.m4,v
> retrieving revision 1.6
> diff -u -r1.6 berkeley-db.m4
> --- ac-helpers/berkeley-db.m4 2001/03/02 23:38:22 1.6
> +++ ac-helpers/berkeley-db.m4 2001/03/05 08:10:57
> @@ -71,11 +71,32 @@
> fi
> ],
> [
> - status=if-found
> - places=search
> + # No --with-berkeley-db option:
> + #
> + # Check to see if a db directory exists in the build directory.
> + # If it does then we will be using the berkeley DB version
> + # from the source tree. We can't test it since it is not built
> + # yet, so we have to assume it is the correct version.
> +
> + AC_MSG_CHECKING([for built-in Berkeley DB])
> +
> + if test -d db ; then
> + status=builtin
> + AC_MSG_RESULT([yes])
> + else
> + status=if-found
> + places=search
> + AC_MSG_RESULT([no])
> + fi
> ])
>
> - if test "$status" = "skip"; then
> + if test "$status" = "builtin"; then
> + # Use the include a nd lib files in the build dir.
> + dbdir=`cd db/dist ; pwd`
> + CPPFLAGS="$CPPFLAGS -I$dbdir"
> + LIBS="$LIBS -L$dbdir -ldb"
> + svn_lib_berkeley_db=yes
> + elif test "$status" = "skip"; then
> svn_lib_berkeley_db=no
> else
>
Received on Sat Oct 21 14:36:25 2006

This is an archived mail posted to the Subversion Dev mailing list.