[Libreoffice] PATCH: Try to find the proper berkeley db headers and incs

Gökçen Eraslan gokcen at pardus.org.tr
Mon Dec 27 07:12:55 PST 2010


Çarşamba 01 Aralık 2010 günü (saat 20:35:22) Petr Mladek şunları yazmıştı:
> Hi Robert,
> 
> Robert Nagy píše v St 01. 12. 2010 v 11:27 +0100:
> > Hi,
> > 
> > So this is a modified versio nof patches/dev300/system-db-check.diff
> > to find the proper berkeley db headers and libs.
> > I really would like to get this into bootstrap so please test and
> > comment.
> 
> It looks reasonable and works here. Feel free to commit it.
>

With this patch (in RC2) I can no longer pass configure:

checking which db to use... external
checking for db-5.1/db.h... no
checking for db5.1/db.h... no
checking for db-5.0/db.h... no
checking for db5.0/db.h... no
checking for db-5/db.h... no
checking for db5/db.h... no
checking for db-4.8/db.h... no
checking for db4.8/db.h... no
checking for db-4.7/db.h... no
checking for db4.7/db.h... no
checking for db-4/db.h... no
checking for db4/db.h... no
checking for db/db.h... no
checking db.h usability... yes
checking db.h presence... yes
checking for db.h... yes
checking whether db is at least 4.1... yes
checking for db_create in -ldb... no
checking for db_create in -ldb-5.1... no
checking for db_create in -ldb5.1... no
checking for db_create in -ldb-5.0... no
checking for db_create in -ldb5.0... no
checking for db_create in -ldb-5... no
checking for db_create in -ldb5... no
checking for db_create in -ldb-4.8... no
checking for db_create in -ldb4.8... no
checking for db_create in -ldb-4.7... no
checking for db_create in -ldb4.7... no
checking for db_create in -ldb-4... no
checking for db_create in -ldb4... no
checking for db_create... no
configure: error: db not installed or functional

I'm using db4 version 4.8.30, and db4-devel package is installed. I can 
compile RC1 without any errors. 

When I try to compile this test file that configure generates:

/* confdefs.h */                                                                                                                                                                                                                            
#define PACKAGE_NAME ""                                                                                                                                                                                                                     
#define PACKAGE_TARNAME ""                                                                                                                                                                                                                  
#define PACKAGE_VERSION ""                                                                                                                                                                                                                  
#define PACKAGE_STRING ""                                                                                                                                                                                                                   
#define PACKAGE_BUGREPORT ""                                                                                                                                                                                                                
#define PACKAGE_URL ""                                                                                                                                                                                                                      
#define STDC_HEADERS 1                                                                                                                                                                                                                      
#define HAVE_SYS_TYPES_H 1                                                                                                                                                                                                                  
#define HAVE_SYS_STAT_H 1                                                                                                                                                                                                                   
#define HAVE_STDLIB_H 1                                                                                                                                                                                                                     
#define HAVE_STRING_H 1                                                                                                                                                                                                                     
#define HAVE_MEMORY_H 1                                                                                                                                                                                                                     
#define HAVE_STRINGS_H 1                                                                                                                                                                                                                    
#define HAVE_INTTYPES_H 1                                                                                                                                                                                                                   
#define HAVE_STDINT_H 1                                                                                                                                                                                                                     
#define HAVE_UNISTD_H 1                                                                                                                                                                                                                     
#define SIZEOF_LONG 8                                                                                                                                                                                                                       
#define HAVE_LIBCRYPT 1                                                                                                                                                                                                                     
#define HAVE_MALLOC 1                                                                                                                                                                                                                       
#define HAVE_REALLOC 1                                                                                                                                                                                                                      
#define HAVE_CALLOC 1                                                                                                                                                                                                                       
#define HAVE_FREE 1                                                                                                                                                                                                                         
#define HAVE_LIBEXPAT 1                                                                                                                                                                                                                     
/* end confdefs.h.  */                                                                                                                                                                                                                      
                                                                                                                                                                                                                                            
/* Override any GCC internal prototype to avoid an error.                                                                                                                                                                                   
   Use char because int might match the return type of a GCC                                                                                                                                                                                
   builtin and then its argument prototype would still apply.  */                                                                                                                                                                           
#ifdef __cplusplus                                                                                                                                                                                                                          
extern "C"                                                                                                                                                                                                                                  
#endif                                                                                                                                                                                                                                      
char db_create();                                                                                                                                                                                                                          
int                                                                                                                                                                                                                                         
main ()                                                                                                                                                                                                                                     
{                                                                                                                                                                                                                                           
return db_create();                                                                                                                                                                                                                        
  ;                                                                                                                                                                                                                                         
  return 0;                                                                                                                                                                                                                                 
}                                                                                                                                                                                                                                           

I got this linking error:

$ x86_64-pc-linux-gnu-gcc -o conftest -mtune=generic -march=x86-64 -ldb  -
lexpat -lcrypt db.c

/tmp/cc6Q7xex.o: In function `main':
db.c:(.text+0xa): undefined reference to `db_create'
collect2: ld returned 1 exit status

In libdb.so, there is no such symbol like db_create, but db_create_4008 exists 
and in db.h header file db_create is defined as a macro:

#define db_create db_create_4008

So, checking db_create function with AC_CHECK_FUNC is wrong for DB 4.8. I 
think db.h must be included to use db_create method but the file generated by 
autoconf just tries to use db_create function which is not available if db.h 
is not included.

When I apply the workaround attached I can pass configure now, but I know this 
is not the right solution. I think this patch must be reverted until it is 
tested with all db versions.

> Best Regards,
> Petr
> 

-- 
Gökçen Eraslan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libreoffice-db48-workaround.diff
Type: text/x-patch
Size: 812 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20101227/f2534ddd/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20101227/f2534ddd/attachment-0001.pgp>


More information about the LibreOffice mailing list