From: Rene E. <re...@de...> - 2005-08-16 20:52:37
|
forwarded 323256 mdb...@li... tag 323256 + patch thanks [ For mdbtools-dev: Background is http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D323256, therefore pleas let 32...@bu... and me (re...@de...) in the loop ] The following patch fixes the build of mdbtools and libmdbtools itself to not need #include <config.h> because not every project using libmdbtools has that and #include'ing it is bad anyway: Index: configure.in =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/mdbtools/mdbtools/configure.in,v retrieving revision 1.36 diff -u -u -r1.36 configure.in --- configure.in 29 Mar 2005 03:40:48 -0000 1.36 +++ configure.in 16 Aug 2005 20:03:41 -0000 @@ -21,6 +21,12 @@ AM_ICONV +# add -DHAVE_INCONV to CFLAGS. We should not use #include <config.h> in +# public headers +if test "$am_cv_func_iconv" =3D "yes"; then + CFLAGS=3D"$CFLAGS -DHAVE_ICONV" +fi + dnl no optional stuff by default OPTDIRS=3D"" Index: include/mdbtools.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/mdbtools/mdbtools/include/mdbtools.h,v retrieving revision 1.77 diff -u -u -r1.77 mdbtools.h --- include/mdbtools.h 5 Aug 2005 15:52:16 -0000 1.77 +++ include/mdbtools.h 16 Aug 2005 20:03:41 -0000 @@ -32,7 +32,6 @@ #include <ctype.h> #include <string.h> #include <glib.h> -#include <config.h> #ifdef HAVE_ICONV #include <iconv.h> This patch simply removed the need for #including config.h by just specifyi= ng -DHAVE_ICONV on the mdbtools build since that is what seems to be why confi= g.h is included currently... While doing this I found another problem. If someone should build on a syst= em where there may be a iconv available or may not or if the application using libmdbtools does not use autoconf and therefore does not set HAVE_ICONV bad things may happen because of this from mdbtools.h: typedef struct { [...] MdbStatistics *stats; #ifdef HAVE_ICONV iconv_t iconv_in; iconv_t iconv_out; #endif } MdbHandle; Build without HAVE_ICONV miss two struct member; this is a ABI change. Well, I can work around on OpenOffice.org by just specifying -DHAVE_ICONV when building the mdbtools-using stuff but that bug remains and should be fixed in the future, but this is not a regression since this bug exists too if the projects' config.h you #include doesn't #define HAVE_ICONV anyway.. Gr=FC=DFe/Regards, Rene --=20 .''`. Rene Engelhard -- Debian GNU/Linux Developer : :' : http://www.debian.org | http://people.debian.org/~rene/ `. `' re...@de... | GnuPG-Key ID: 248AEB73 `- Fingerprint: 41FA F208 28D4 7CA5 19BB 7AD9 F859 90B0 248A EB73 |