You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by te...@eatoni.com on 2004/02/29 04:42:15 UTC

configure fails to find Berkeley DB (subversion 1.0.0)

Hi all.

I've just downloaded the source tarball of subversion 1.0.0 and tried
to build it. Getting Berkeley DB to be located properly is beyond me -
or at least beyond my bed time. I've just spent 3 hours on it. A
summary of what I've tried is below.

Thanks for any help.

Regards,
Terry Jones.

---

This is all under Mandrake 9.2.

Following the INSTALL instructions, I ran

  $ ./configure --enable-maintainer-mode

which finished with a message telling me Berkeley DB could not be
located:

  The Subversion filesystem library, part of the server, requires
  Berkeley DB version 4.0.14 or newer, which you don't seem to have
  installed and linked to APR-UTIL.  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/.
  You can find the latest version of Berkeley DB here:
    http://www.sleepycat.com/download/index.shtml

(note the repeated & slightly differing DB URLs mentioned above).

So I grabbed the latest Berkeley DB (4.2.52) and installed it
(allowing make install to put it in /usr/local):

  /usr/local $ ls -la BerkeleyDB.4.2
  total 24
  drwxr-xr-x    6 root     root         4096 Feb 29 02:36 .
  drwxr-xr-x   14 root     root         4096 Feb 29 02:36 ..
  drwxr-xr-x    2 root     root         4096 Feb 29 02:36 bin
  drwxr-xr-x   10 root     root         4096 Feb 29 02:36 docs
  drwxr-xr-x    2 root     root         4096 Feb 29 02:36 include
  drwxr-xr-x    2 root     root         4096 Feb 29 02:36 lib

Re-running configure didn't help (I got the same message about not
finding Berkeley DB). Using --with-berkeley-db=/usr/local/BerkeleyDB.4.2
also didn't help.

Am I doing something silly here? The output of configure shows it
going to look for Berkeley DB. config.log shows that the test program
isn't even compiling though:


  configure:8818: checking for availability of Berkeley DB
  configure:8882: gcc -o conftest -g -O2  -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -p
  thread  -DNEON_ZLIB  -I/home/terry/s/net/subversion-1.0.0/apr-util/include -I/usr/local/BerkeleyDB.4.2/include   -DLINU
  X=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE     -L/usr/local/BerkeleyDB.4.2/lib con
  ftest.c  -L/usr/local/BerkeleyDB.4.2/lib -ldb1  >&5
  configure:8849: warning: return type defaults to `int'
  configure:8849: warning: function declaration isn't a prototype
  configure: In function `main':
  configure:8852: warning: implicit declaration of function `db_version'
  configure:8856: error: `DB_VERSION_MAJOR' undeclared (first use in this function)
  configure:8856: error: (Each undeclared identifier is reported only once
  configure:8856: error: for each function it appears in.)
  configure:8857: error: `DB_VERSION_MINOR' undeclared (first use in this function)
  configure:8857: error: `DB_VERSION_PATCH' undeclared (first use in this function)
  configure:8858: warning: implicit declaration of function `exit'
  configure:8885: $? = 1
  configure: program exited with status 1
  configure: failed program was:


And it looks like the culprit is in apr-util/include/apu_want.h, which contains
#include <db1/db.h>

and this is pulling in the wrong db.h (from my
/usr/include/db1/db.h). The configure output shows it (I guess)
winding up believing it should use db1:

  checking checking for Berkeley DB 4.1 in /usr/local/BerkeleyDB.4.2... 
  checking db4/db.h usability... no
  checking db4/db.h presence... no
  checking for db4/db.h... no
  checking db.h usability... yes
  checking db.h presence... yes
  checking for db.h... yes
  checking for db-4.1... no
  checking db4/db.h usability... no
  checking db4/db.h presence... no
  checking for db4/db.h... no
  checking db.h usability... yes
  checking db.h presence... yes
  checking for db.h... yes
  checking for db4... no
  checking db4/db.h usability... no
  checking db4/db.h presence... no
  checking for db4/db.h... no
  checking db.h usability... yes
  checking db.h presence... yes
  checking for db.h... yes
  checking for db... no
  checking checking for Berkeley DB 4.0 in /usr/local/BerkeleyDB.4.2... 
  checking db4/db.h usability... no
  checking db4/db.h presence... no
  checking for db4/db.h... no
  checking db.h usability... yes
  checking db.h presence... yes
  checking for db.h... yes
  checking for db-4.0... no
  checking db4/db.h usability... no
  checking db4/db.h presence... no
  checking for db4/db.h... no
  checking db.h usability... yes
  checking db.h presence... yes
  checking for db.h... yes
  checking for db4... no
  checking db4/db.h usability... no
  checking db4/db.h presence... no
  checking for db4/db.h... no
  checking db.h usability... yes
  checking db.h presence... yes
  checking for db.h... yes
  checking for db... no
  checking checking for Berkeley DB 3 in /usr/local/BerkeleyDB.4.2... 
  checking db3/db.h usability... no
  checking db3/db.h presence... no
  checking for db3/db.h... no
  checking db.h usability... yes
  checking db.h presence... yes
  checking for db.h... yes
  checking for db3... no
  checking db3/db.h usability... no
  checking db3/db.h presence... no
  checking for db3/db.h... no
  checking db.h usability... yes
  checking db.h presence... yes
  checking for db.h... yes
  checking for db... no
  checking checking for Berkeley DB 2 in /usr/local/BerkeleyDB.4.2... 
  checking db2/db.h usability... no
  checking db2/db.h presence... no
  checking for db2/db.h... no
  checking db.h usability... yes
  checking db.h presence... yes
  checking for db.h... yes
  checking for db_open in -ldb2... no
  checking db2/db.h usability... no
  checking db2/db.h presence... no
  checking for db2/db.h... no
  checking db.h usability... yes
  checking db.h presence... yes
  checking for db.h... yes
  checking for db_open in -ldb... no
  checking checking for Berkeley DB 1.0.0 in /usr/local/BerkeleyDB.4.2... 
  checking db1/db.h usability... yes
  checking db1/db.h presence... yes
  checking for db1/db.h... yes
  checking for dbopen in -ldb1... yes
    setting APRUTIL_INCLUDES to "-I/usr/local/BerkeleyDB.4.2/include"
    setting APRUTIL_LDFLAGS to "-L/usr/local/BerkeleyDB.4.2/lib"
  checking for Berkeley DB... found db1

Why, oh why, does configure not just go straight for /usr/local/BerkeleyDB.4.2
like it was so nicely told? Argh.

---

I've since gone into the apr and apr-util dirs and run configure and
make in these, including using --with-berkeley-db to try to help
things along. I added ./apr and ./apr-util to my PATH and re-did
configure in the main subversion directory. Same output.

I'll dig into it more on Monday if no-one can tell me what's going on.
I've attached a .bz2 of my config.log


Re: configure fails to find Berkeley DB (subversion 1.0.0)

Posted by Robert Guthrie <rg...@pobox.com>.
I should double-check things before opening my big mouth (out typing 
with my metaphorically big hands).

We had downloaded apr & apr-util from the apache project's CVS tree, 
which is what requires autoconf to produce the configure script. 
Subversion's copy of apr-util DOES indeed come with it's own configure.

Sorry to bother.

Robert Guthrie wrote:
> Erik Huelsmann wrote:
> 
>> There was a FAQ added very recently about exactly this problem.
>>
>> The FAQ includes a reference to a patch which should relieve your pain.
>>
>> check:
>> http://subversion.tigris.org/project_faq.html#linux-bdb42-build
>>
>> HTH,
> 
> I think it would help except for the instructions for people not 
> compiling Apache at all.  The entry says "If you're not building Apache, 
> apply the patch to the apr-util ./configure script in your Subversion 
> tree".  The problem is, there _IS_ no apr-util/configure script included 
> in the subversion tar ball, which the FAQ entry (as a whole) implies.
> 
> To get it, I believe I'll have to install autoconf and run it on apr & 
> apr-utils individually, but being that this is the wonderful world of 
> not being root on AIX, I have to custom-install autoconf, and all of 
> this dependencies.  This is a headache I'd like to avoid.
> 
> So is there supposed to be a configure script for apr-util included in 
> the tar-ball, or am I going to have to keep plodding along the 
> "try-and-compile autoconf" path?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: configure fails to find Berkeley DB (subversion 1.0.0)

Posted by Robert Guthrie <rg...@pobox.com>.
Erik Huelsmann wrote:
> There was a FAQ added very recently about exactly this problem.
> 
> The FAQ includes a reference to a patch which should relieve your pain.
> 
> check:
> http://subversion.tigris.org/project_faq.html#linux-bdb42-build
> 
> HTH,
I think it would help except for the instructions for people not 
compiling Apache at all.  The entry says "If you're not building Apache, 
apply the patch to the apr-util ./configure script in your Subversion 
tree".  The problem is, there _IS_ no apr-util/configure script included 
in the subversion tar ball, which the FAQ entry (as a whole) implies.

To get it, I believe I'll have to install autoconf and run it on apr & 
apr-utils individually, but being that this is the wonderful world of 
not being root on AIX, I have to custom-install autoconf, and all of 
this dependencies.  This is a headache I'd like to avoid.

So is there supposed to be a configure script for apr-util included in 
the tar-ball, or am I going to have to keep plodding along the 
"try-and-compile autoconf" path?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: configure fails to find Berkeley DB (subversion 1.0.0)

Posted by Andreas Jellinghaus <aj...@dungeon.inka.de>.
Hi,

you alway either need any lib directory in /etc/ld.so.conf (and run
ldconfig), or you can set LD_LIBRARY_PATH to include the libs
directory.

your patch command is bogus, to patch apache you need
	patch -p0 < db42-support-patch.txt
to patch subversion you need
	patch -p1 < db42-support-patch.txt
to make patch look in the right directory.


I finaly have success with these commands:

export PATH=/opt/subversion/bin:$PATH
export LD_LIBRARY_PATH=/opt/subversion/lib:$LD_LIBRARY_PATH

tar xvfz db-4.2.52.tar.gz

pushd db-4.2.52
	pushd build_unix
		../dist/configure --prefix=/opt/subversion
		make
		make install
	popd
popd

tar xvfz httpd-2.0.48.tar.gz
pushd httpd-2.0.48
	patch -p0 < /home/aj/db42-support-patch.txt
	./configure --prefix=/opt/subversion --enable-ssl --enable-dav \
		--enable-so --enable-deflate --with-dbm=db42 \
		 --without-gdbm --with-berkeley-db=/opt/subversion
	make
	make install
popd

tar xvfz subversion-1.0.0.tar.gz
pushd subversion-1.0.0
	patch -p1 < /home/aj/db42-support-patch.txt # not needed I guess
	./configure --prefix=/opt/subversion --with-zlib \
		--with-apxs=/opt/subversion/bin/apxs \
		--with-ssl --with-apr=/opt/subversion \
		--with-apr-util=/opt/subversion
	make
	make install
popd

change the directories, if you have db, httpd and subversion in
different diretories. make sure LD_LIBRARY_PATH and PATH include all
those lib/ and bin/ directories.

the key was to specify all three, --with-apxs --with-apr and
--with-apr-util for subversion. with only --with-apxs it simply
didn't work.

Good luck to you!

Regards, Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: configure fails to find Berkeley DB (subversion 1.0.0)

Posted by te...@eatoni.com.
Thanks for the replies trying to help me get subversion to see
Berkeley DB 4.2. A couple of the things I tried failed, but the last
succeeded. Below is what I did to make it work.

[I don't know if this is related, but after several failures today, I
wound up:

  # echo /usr/local/BerkeleyDB.4.2/lib >> /etc/ld.so.conf
  # ldconfig

I'm not sure if this was important at any later point. Certainly my
earlier problems were unrelated, as configure just plain wasn't yet
equipped to detect db42.]


As far as concrete changes to the FAQ go, someone should probably
confirm that the db42 patch does not work against the 2.0.48 httpd and
I guess update the FAQ.

Thanks again.
Terry


--- Attempt 1 ---

The FAQ Eric pointed me to seems to be just what I need. It has a
couple of suggested approaches. Let's take it from the top:

| In the short term, the best thing to do is apply this patch to your
| apr-util's ./configure script -- either to the apr-util in your apache
| tree (if you're building Apache before Subversion), or to the apr-util
| in your Subversion tarball (if you're not building Apache at all.)
| This patch is the new DB 4.2 detection code already in the latest
| apr-util CVS.
| 
| If you've building Apache first, apply the patch to httpd-2.0.48's
| apr-util's configure script, and then build with these options:
| 
|   $ configure \
|   --enable-dav \
|   --enable-so \
|   --with-berkeley-db=/usr/local/BerkeleyDB.4.2
|   --with-dbm=db42
| 
| You can confirm that Apache is built with the proper BDB libraries
| with the following command:
| 
|   $ ldd /usr/local/apache2/bin/httpd | fgrep libdb
|       libdb-4.2.so => /usr/local/BerkeleyDB.4.2/lib/libdb-4.2.so

So let's build apache first. I download httpd-2.0.48.tar.gz and unpack
it.  Then I try to apply the patch:

  $ cd httpd-2.0.48
  $ patch < db42-support-patch.txt
  patching file configure
  Hunk #1 FAILED at 13386.
  Hunk #2 FAILED at 27186.
  2 out of 2 hunks FAILED -- saving rejects to file configure.rej

Oops. The patch doesn't work on httpd-2.0.48. I've not dug into this
but I note that the patch file is trying to insert a db42 case into
srclib/apr-util/configure and that grep db42 srclib/apr-util/configure
returns nothing, so the patch is clearly not already in there (as
patch probably would have told me).


--- Attempt 2 ---

David says 1) install Berkeley DB (done), and 2) to install 2.0.48 and
use the following configure line:

  ./configure --prefix=/usr/local/lib/httpd \
  --enable-shared \
  --enable-mods-shared=all \
  --with-berkeley-db=/usr/local/share/BerkeleyDB.4.2

and make && make install.

Note that this is similar to the above, without using the patch. I
follow the above (though with my own --prefix).  The configure run
prints out stuff showing me it hasn't found db42, but I let it go and
do the make && make install. Afterwards, ldd httpd shows me

  libdb.so.2 => /usr/lib/libdb.so.2 (0x2aae7000)

So that hasn't worked either. Nevertheless I do David's step 3 and the
configure of subversion tells me:

  configure: error: APR-UTIL was installed independently, it won't be
  possible to use the specified Berkeley DB: /usr/local/share/BerkeleyDB.4.2

No [Mm]akefile has been produced, so I can't do a make.


--- Attempt 3 ---

The FAQ has another approach.

| If you're not building Apache, apply the patch to the apr-util
| ./configure script in your Subversion tree, and use similar build
| options:
| 
|   $ configure \
|   --with-berkeley-db=/usr/local/BerkeleyDB.4.2
|   --with-dbm=db42
| 
| Again, you can confirm that Subversion was built against the proper
| BDB library with the following:
| 
|   $ ldd /usr/local/bin/svn | fgrep libdb
|       libdb-4.2.so => /usr/local/BerkeleyDB.4.2/lib/libdb-4.2.so

I unpack the subversion tarball again (btw, I do a fresh unpack of
subversion, httpd etc whenever starting out again). Applying the patch
works fine:

  $ patch -p1 < ../db42-support-patch.txt 
  patching file apr-util/configure
  Hunk #1 succeeded at 13688 (offset 302 lines).
  Hunk #2 succeeded at 27788 (offset 602 lines).

I do the configure and it finds db42. The make works, ldd shows me
that db42 is found for both svn and svnserve.

So I think I'm done.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: configure fails to find Berkeley DB (subversion 1.0.0)

Posted by Erik Huelsmann <e....@gmx.net>.
There was a FAQ added very recently about exactly this problem.

The FAQ includes a reference to a patch which should relieve your pain.

check:
http://subversion.tigris.org/project_faq.html#linux-bdb42-build

HTH,


Erik.

> 
> Hi all.
> 
> I've just downloaded the source tarball of subversion 1.0.0 and tried
> to build it. Getting Berkeley DB to be located properly is beyond me -
> or at least beyond my bed time. I've just spent 3 hours on it. A
> summary of what I've tried is below.
> 
> Thanks for any help.
> 
> Regards,
> Terry Jones.
> 

-- 
GMX ProMail (250 MB Mailbox, 50 FreeSMS, Virenschutz, 2,99 EUR/Monat...)
jetzt 3 Monate GRATIS + 3x DER SPIEGEL +++ http://www.gmx.net/derspiegel +++


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org