Re: [Libreoffice] [PATCH] Fix configure check for BerkleyDB where db_create is macro

2011-01-21 Thread Petr Mladek
Hi,

first, I am sorry that I committed the older proposed fix and caused
Bernhard troubles. Unfortunately, the problem went somehow out of my 
radar until I saw Bernhard's bug
https://bugs.freedesktop.org/show_bug.cgi?id=33230

Gökçen Eraslan píše v Po 10. 01. 2011 v 10:16 +:
> Perşembe 06 Ocak 2011 günü (saat 20:03:28) Petr Mladek şunları yazmıştı:
> > Hi,
> > 
> > this fixed the problem described in the attached mail.
> > 
> > Gökçen, Robert, could you please test it and sign it out for
> > libreoffice-3-3 branch?
> > 
> 
> No, I only have __db185_open_4008 symbol in libdb.so, here is the result:

Could you please try the attached patch?

I would like to get it into the libreoffice-3-3 branch for LO-3.3.1
release. Thus the diff is a bit conservative. The idea is:

+ keep check for "dbopen" and "__db185_open" to keep backward
  compatibility with  3.3.0 release
+ add check for "db_create" that seems to work for most people
+ add check for "db_create_4008",  "db_create_4007", "db_create_4004" that 
  should work for db.h using macros; the version numbers 4008, 4007, 4004 come
  from the used directory suffixes 4.8, 4.7, 4.4; I have seen these problems
  with macros only with the 4.x version
+ do not use AC_CHECK_FUNC; IMHO, it just duplicate the AC_CHECK_LIB and is not
  really necessary; I did not want to duplicate the long lists of fallbacks.

It is a bit ugly but it should know in all known cases.

It works here. Also really try the fallback when needed, ...


Best Regards,
Petr
>From 38951e26266ca3d20ca8dec1abb8cc16a6932c29 Mon Sep 17 00:00:00 2001
From: Petr Mladek 
Date: Fri, 21 Jan 2011 19:04:00 +0100
Subject: [PATCH] combined check for system BerkleyDB (fdo#33230)

There are BerkleyDB installations that provides neither dbopen
nor __db185_open. Let's use more complex fallback to all
known symbols.

---
 configure.in |   12 ++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/configure.in b/configure.in
index db20f9d..80469cb 100644
--- a/configure.in
+++ b/configure.in
@@ -4312,8 +4312,16 @@ int main(int argc, char **argv) {
 ], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([no. you need at least db 4.1])])
 DB_LIB=
 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, dbopen, [ DB_LIB="db$dbver"; DB_CPPLIB="db_cxx$dbver"; break; ] ,
-AC_CHECK_LIB(db$dbver, __db185_open, [ DB_LIB="db$dbver"; DB_CPPLIB="db_cxx$dbver"; break; ]
+AC_CHECK_LIB(db$dbver, db_create, [ DB_LIB="db$dbver"; DB_CPPLIB="db_cxx$dbver"; break; ] ,
+AC_CHECK_LIB(db$dbver, dbopen, [ DB_LIB="db$dbver"; DB_CPPLIB="db_cxx$dbver"; break; ] ,
+AC_CHECK_LIB(db$dbver, db_create_4008, [ DB_LIB="db$dbver"; DB_CPPLIB="db_cxx$dbver"; break; ] ,
+AC_CHECK_LIB(db$dbver, db_create_4007, [ DB_LIB="db$dbver"; DB_CPPLIB="db_cxx$dbver"; break; ] ,
+AC_CHECK_LIB(db$dbver, db_create_4004, [ DB_LIB="db$dbver"; DB_CPPLIB="db_cxx$dbver"; break; ] ,
+AC_CHECK_LIB(db$dbver, __db185_open, [ DB_LIB="db$dbver"; DB_CPPLIB="db_cxx$dbver"; break; ]
+)
+)
+)
+)
 )
 )
 done
-- 
1.7.3.4

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] [PATCH] Fix configure check for BerkleyDB where db_create is macro

2011-01-09 Thread Robert Nagy
if we use that simol it might break other versions of db.

On (2011-01-10 10:16), Gökçen Eraslan wrote:
> Perşembe 06 Ocak 2011 günü (saat 20:03:28) Petr Mladek şunlar?? yazm??şt??:
> > Hi,
> > 
> > this fixed the problem described in the attached mail.
> > 
> > Gökçen, Robert, could you please test it and sign it out for
> > libreoffice-3-3 branch?
> > 
> 
> No, I only have __db185_open_4008 symbol in libdb.so, here is the result:
> 
> 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 dbopen in -ldb... no
> checking for __db185_open in -ldb... no
> checking for dbopen in -ldb-5.1... no
> checking for __db185_open in -ldb-5.1... no
> checking for dbopen in -ldb5.1... no
> checking for __db185_open in -ldb5.1... no
> checking for dbopen in -ldb-5.0... no
> checking for __db185_open in -ldb-5.0... no
> checking for dbopen in -ldb5.0... no
> checking for __db185_open in -ldb5.0... no
> checking for dbopen in -ldb-5... no
> checking for __db185_open in -ldb-5... no
> checking for dbopen in -ldb5... no
> checking for __db185_open in -ldb5... no
> checking for dbopen in -ldb-4.8... no
> checking for __db185_open in -ldb-4.8... no
> checking for dbopen in -ldb4.8... no
> checking for __db185_open in -ldb4.8... no
> checking for dbopen in -ldb-4.7... no
> checking for __db185_open in -ldb-4.7... no
> checking for dbopen in -ldb4.7... no
> checking for __db185_open in -ldb4.7... no
> checking for dbopen in -ldb-4... no
> checking for __db185_open in -ldb-4... no
> checking for dbopen in -ldb4... no
> checking for __db185_open in -ldb4... no
> configure: error: db not installed or functional
> 
> 
> Here is the symbols in libdb.so file containing open keyword:
> 
> $ nm -D -C /usr/lib/libdb.so |grep open
> 
> 00036a10 T __bam_open_4008
> 00025ea0 T __db185_open_4008
> 000eb1d0 T __db_get_open_flags_4008
> 000cb740 T __db_master_open_4008
> 00105000 T __db_mi_open_4008
> 000fbc40 T __db_ndbm_open_4008
> 000eb290 T __db_open_4008
> 000e52b0 T __db_open_pp_4008
> 00133150 T __db_openflags_4008
> 00105f90 T __db_tmp_open_4008
> 000ffc90 T __dbreg_do_open_4008
> 00106bb0 T __env_get_open_flags_4008
> 00107200 T __env_open_4008
> 00107450 T __env_open_pp_4008
> 00107a60 T __env_openfiles_4008
> 0006a040 T __ham_open_4008
> 000bf240 T __lock_open_4008
> 001180f0 T __log_open_4008
> 00127d90 T __memp_fopen_4008
> 00128d90 T __memp_fopen_pp_4008
> 00129fa0 T __memp_get_mp_max_openfd_4008
> 0012d780 T __memp_open_4008
> 0012a130 T __memp_set_mp_max_openfd_4008
> 000c2d30 T __mutex_open_4008
> 001350d0 T __os_open_4008
> 001342f0 T __os_openhandle_4008
> 00137cd0 T __partition_open_4008
> 000820c0 T __qam_open_4008
> 00040340 T __ram_open_4008
> 0009c650 T __rep_open_4008
> 000ab600 T __repmgr_open_4008
> 00146840 T __txn_open_4008
> 00145c50 T __txn_openfiles_4008
> 00134ec0 T db_env_set_func_open_4008
>  U fopen
>  U open
>  U opendir
> 
> 
> ...
> 
> > 
> > Best Regards,
> > Petr
> 
> -- 
> Gökçen Eraslan


___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] [PATCH] Fix configure check for BerkleyDB where db_create is macro

2011-01-09 Thread Gökçen Eraslan
Perşembe 06 Ocak 2011 günü (saat 20:03:28) Petr Mladek şunları yazmıştı:
> Hi,
> 
> this fixed the problem described in the attached mail.
> 
> Gökçen, Robert, could you please test it and sign it out for
> libreoffice-3-3 branch?
> 

No, I only have __db185_open_4008 symbol in libdb.so, here is the result:

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 dbopen in -ldb... no
checking for __db185_open in -ldb... no
checking for dbopen in -ldb-5.1... no
checking for __db185_open in -ldb-5.1... no
checking for dbopen in -ldb5.1... no
checking for __db185_open in -ldb5.1... no
checking for dbopen in -ldb-5.0... no
checking for __db185_open in -ldb-5.0... no
checking for dbopen in -ldb5.0... no
checking for __db185_open in -ldb5.0... no
checking for dbopen in -ldb-5... no
checking for __db185_open in -ldb-5... no
checking for dbopen in -ldb5... no
checking for __db185_open in -ldb5... no
checking for dbopen in -ldb-4.8... no
checking for __db185_open in -ldb-4.8... no
checking for dbopen in -ldb4.8... no
checking for __db185_open in -ldb4.8... no
checking for dbopen in -ldb-4.7... no
checking for __db185_open in -ldb-4.7... no
checking for dbopen in -ldb4.7... no
checking for __db185_open in -ldb4.7... no
checking for dbopen in -ldb-4... no
checking for __db185_open in -ldb-4... no
checking for dbopen in -ldb4... no
checking for __db185_open in -ldb4... no
configure: error: db not installed or functional


Here is the symbols in libdb.so file containing open keyword:

$ nm -D -C /usr/lib/libdb.so |grep open

00036a10 T __bam_open_4008
00025ea0 T __db185_open_4008
000eb1d0 T __db_get_open_flags_4008
000cb740 T __db_master_open_4008
00105000 T __db_mi_open_4008
000fbc40 T __db_ndbm_open_4008
000eb290 T __db_open_4008
000e52b0 T __db_open_pp_4008
00133150 T __db_openflags_4008
00105f90 T __db_tmp_open_4008
000ffc90 T __dbreg_do_open_4008
00106bb0 T __env_get_open_flags_4008
00107200 T __env_open_4008
00107450 T __env_open_pp_4008
00107a60 T __env_openfiles_4008
0006a040 T __ham_open_4008
000bf240 T __lock_open_4008
001180f0 T __log_open_4008
00127d90 T __memp_fopen_4008
00128d90 T __memp_fopen_pp_4008
00129fa0 T __memp_get_mp_max_openfd_4008
0012d780 T __memp_open_4008
0012a130 T __memp_set_mp_max_openfd_4008
000c2d30 T __mutex_open_4008
001350d0 T __os_open_4008
001342f0 T __os_openhandle_4008
00137cd0 T __partition_open_4008
000820c0 T __qam_open_4008
00040340 T __ram_open_4008
0009c650 T __rep_open_4008
000ab600 T __repmgr_open_4008
00146840 T __txn_open_4008
00145c50 T __txn_openfiles_4008
00134ec0 T db_env_set_func_open_4008
 U fopen
 U open
 U opendir


...

> 
> Best Regards,
> Petr

-- 
Gökçen Eraslan


signature.asc
Description: This is a digitally signed message part.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] [PATCH] Fix configure check for BerkleyDB where db_create is macro

2011-01-06 Thread Hanno Meyer-Thurow
Hi,
I just checked for my db version. I, too, use

[IP-] [  ] sys-libs/db-4.8.30:4.8

which works just fine. So I wonder what differs.


Regards,
Hanno
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice] [PATCH] Fix configure check for BerkleyDB where db_create is macro

2011-01-06 Thread Petr Mladek
Hi,

this fixed the problem described in the attached mail.

Gökçen, Robert, could you please test it and sign it out for
libreoffice-3-3 branch?

It works here and it should be more safe than the current solution.


Analyze:


"db_create" function is defined by macro in some db version. I did a lot
of googling and have not found any ultimate solution.

Some people try to check all "db_create" variants, e.g. db_create_4002, 
db_create_4001, see
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/mail-filter/maildrop/files/maildrop-2.5.1-db.patch?view=diff&r1=text&tr1=1.1&r2=text&tr2=1.1&diff_format=s

The problem is that there exists too many variants. Gökçen would need
db_create_4008, ...

I have found only one other variant for "dbopen" that is __db185_open.
This symbol has been introduced in db-3.x and seems to be provided by
any newer version for compatibility reasons. See also
http://lists.debian.org/debian-devel/2001/04/msg01770.html


Solution:
-

LibO requires db >= 4.4. All these version should provide the symbol
"__db185_open" for compatibility reasons. Of course, it is better to
check for the original symbol "dbopen", so I used "__db185_open" just as
fallback.

I am not 100% sure that it would work on all archaic systems but it
should be better than the current state.


Best Regards,
Petr
--- Begin Message ---
Ç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