Fix for: libdb3 and gnome



> WWT> <snip> ... mentions having fix for libdb3 & gnome ...
>
> I really want to know how ?
>
> libgnome doesn't compile against libdb3 See #89670 and this thread from the
> gnome-devel mailing list 
>
> http://mail.gnome.org/archives/gnome-devel-list/2001-March/thread.html
>
> Christian

Sorry for the latency! I wasn't reading the debian-digest - I assumed you
would have replied to me directly. Ok, so what did I change? I did have to
patch a file or two I think (checks local copy of source)...

I remember having the __db185_open bug and tweaking something to make it go
away... Aha! Ok, here's the scoop: 

The problem is the search order for -ldb1 vs -ldb and -ldb-3.
It probably works on the upstream maintainer's machine and he should be
notified (b/c if you don't have libdb2 installed it will work fine as well).

You see, the libdb3 headers #define dbopen to __db185_open. Now, it finds
the db_185.h in configure and then looks for libdb1 and libdb before
libdb-3.

However, if you're using libdb3 headers you're screwed! You link to
the wrong lib. Even though libdb -> libdb3 the test won't work b/c it looks
for the symbol dbopen instead of __db185_open in libdb.

Now the fix I propose below is a bit hackish b/c it still makes no
guarantees that you've picked the right lib out of all those installed.

The real solution would be to test link a program that includes db_185.h and
references dbopen and try all the possible libs.

Anyways, here's the easy fix. In configure.in find:

if test "$prefer_db1" = "yes"; then
 AC_CHECK_LIB(db1, dbopen, DB_LIB="-ldb1",
  AC_CHECK_LIB(db, dbopen, DB_LIB="-ldb", 
   AC_CHECK_LIB(db-3, __db185_open, DB_LIB="-ldb-3",
    AC_MSG_ERROR([Your db library is missing db 1.85 compatibility mode])
   )
  ) 
 )  
else
 AC_CHECK_LIB(db, dbopen, DB_LIB="-ldb",
  AC_CHECK_LIB(db1, dbopen, DB_LIB="-ldb1",
   AC_CHECK_LIB(db-3, __db185_open, DB_LIB="-ldb-3",
    AC_MSG_ERROR([Your db library is missing db 1.85 compatibility mode])
   )
  ) 
 )  
fi  

Change it to:
if test "$prefer_db1" = "yes"; then
 AC_CHECK_LIB(db1, dbopen, DB_LIB="-ldb1",
  AC_CHECK_LIB(db, dbopen, DB_LIB="-ldb", 
   AC_CHECK_LIB(db, __db185_open, DB_LIB="-ldb",
    AC_CHECK_LIB(db-3, __db185_open, DB_LIB="-ldb-3",
     AC_MSG_ERROR([Your db library is missing db 1.85 compatibility mode])
    )
   )
  ) 
 )  
else
 AC_CHECK_LIB(db, dbopen, DB_LIB="-ldb",
  AC_CHECK_LIB(db, __db185_open, DB_LIB="-ldb",
   AC_CHECK_LIB(db1, dbopen, DB_LIB="-ldb1",
    AC_CHECK_LIB(db-3, __db185_open, DB_LIB="-ldb-3",
     AC_MSG_ERROR([Your db library is missing db 1.85 compatibility mode])
    )
   )
  ) 
 )  
fi  

Anyways, you have a fix that works now. Please try it yourself and let me
know whether or not it works out. Oh, I had to tweak all the Build-Depends
too.

Could you please push to get this into woody? I know you have to rebuild
half the gnome stuff b/c of relinking libgnome, but I really need
libgnome-dev and libdb3-dev together. Not to mention libdb2 sucks compared
to libdb3 in a big way. (don't mind me - I am just hooked on it)

.. And having to maintain all of the gnome .debs in parallel is getting
annoying. ;-)

PS. Be very happy you had a link error, b/c if the symbol name had by chance
not been changed in libdb3, libgnome would be link but be unstable.

Good luck.

-- 
Wesley W. Terpstra - Linux Developer




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]