db3.1.xx and dbopen()...

I'm trying to compile the latest stable GNOME libs (1.2.8), and the
configure script is broken.  It is unable to locate my Berkely DB libraries,
claiming they don't have DB185 compatibility mode built into them.  The
problem is the test program configure is using to check for dbopen() in the
database libraries:

#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char dbopen(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dbopen();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_dbopen) || defined (__stub___dbopen)
choke me

; return 0; }

The problem is that, on this system, the db1 libraries are not installed,
only db-3.1.17.  In libdb.so (which is libdb-3.1so), there is no dbopen
symbol.  It's __db_dbopen, and requires including db_185.h for the macro
'#define dbopen __db_dbopen' in order to be called from a db1-style program.
Configure does check for db_185.h, but only if it finds dbopen in the
library, at which point it's too late.  I got my configure script to work by
simply changing dbopen() to __db_dbopen(), but I'm sure this is a bad
solution (as it would, for example, not work if libdb was actually
db-1.85.so and you wanted to use db1 in preferences to db3).  Hopefully
someone more experiences with autoconf can come up with a more useful
solution, probably relying on the existance of db_185.h to rename the symbol
as needed?


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