Date: prev next · Thread: first prev next last
2010 Archives by date, by thread · List index


Ç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
--- configure.in.orig   2010-12-27 15:04:05.274000696 +0000
+++ configure.in        2010-12-27 14:59:41.427000696 +0000
@@ -4418,9 +4418,9 @@
     ], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([no. you need at least db 4.1])])
     save_LIBS="$LIBS"
     for dbver in '' -5.1 5.1 -5.0 5.0 -5 5 -4.8 4.8 -4.7 4.7 -4 4; do
-        AC_CHECK_LIB(db$dbver, db_create, [ DB_LIB="db$dbver"; DB_CPPLIB="db_cxx$dbver"; 
LIBS="-ldb$dbver $LIBS"; break ])
+        AC_CHECK_LIB(db$dbver, db_create_4008, [ DB_LIB="db$dbver"; DB_CPPLIB="db_cxx$dbver"; 
LIBS="-ldb$dbver $LIBS"; break ])
     done
-    AC_CHECK_FUNC(db_create, [], [ AC_MSG_ERROR([db not installed or functional]) ])
+    AC_CHECK_FUNC(db_create_4008, [], [ AC_MSG_ERROR([db not installed or functional]) ])
     LIBS="$save_LIBS"
     SCPDEFS="$SCPDEFS -DSYSTEM_DB"
 else

Attachment: signature.asc
Description: This is a digitally signed message part.


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.