Hi,

there is a pending bug in log4cxx about autoconf. The problem is, that when 
installing log4cxx config_auto.h is installed, which defines some common 
symbols like PACKAGE and VERSION. The generated config_auto.h should not be 
installed.

The problem with log4cxx is, that some includes, which are included, need some 
defines from configure, so they include config_auto.h.

The solution is to create 2 config_auto.h. One is the standard-config_auto.h, 
which is generated with autoheader. The other one defines the symbols needed 
in headers with prefix LOG4CXX. This second one can be safely installed.

I have made changes. I don't know how to create a complete cvs-diff. 
'configure.in' need some changes. The changes prepends the defines with 
LOG4CXX and defines another config.h. This is in the attached diff. The 
include/log4xx/config_auto.h.in is not created by autoheader, but manually. 
The new file is also attached here.

Tommi
/* include/log4cxx/config_auto.h */

/* XML support through libxml2. */
#undef LOG4CXX_HAVE_LIBXML2

/* ODBC support through Microsoft ODBC. */
#undef LOG4CXX_HAVE_MS_ODBC

/* thread support through Microsoft threads. */
#undef LOG4CXX_HAVE_MS_THREAD

/* ODBC support through Microsoft XML. */
#undef LOG4CXX_HAVE_MS_XML

/* ODBC support */
#undef LOG4CXX_HAVE_ODBC

/* thread support through pthread library. */
#undef LOG4CXX_HAVE_PTHREAD

/* SMTP support */
#undef LOG4CXX_HAVE_SMTP

/* have swprintf */
#undef LOG4CXX_HAVE_SWPRINTF

/* XML support */
#undef LOG4CXX_HAVE_XML

/* Defined to 1 if macro _T has to be undefined */
#undef LOG4CXX_MUST_UNDEF_T

/* UTF-16 Unicode support. */
#undef LOG4CXX_UNICODE
? include/log4cxx/config_auto.in
? src/config_auto.h.in
Index: configure.in
===================================================================
RCS file: /home/cvspublic/logging-log4cxx/configure.in,v
retrieving revision 1.43
diff -r1.43 configure.in
21c21,22
< AC_CONFIG_HEADERS([include/log4cxx/config_auto.h],[cat "${ac_abs_top_builddir}/include/log4cxx/config_auto.h" | sed -e 's/\(HAVE_\|MUST_\|UNICODE\)/LOG4CXX_\1/;s/^\(.*PACKAGE.*\|.*VERSION.*\|.*STDC_HEADERS.*\)$/\/* \1 *\//' > "${ac_abs_top_builddir}/include/log4cxx/config_auto_log4cxx.h"])
---
> AC_CONFIG_HEADERS([src/config_auto.h])
> AC_CONFIG_HEADERS([include/log4cxx/config_auto.h])
144c145
< AC_CHECK_FUNCS(swprintf)
---
> AC_CHECK_FUNCS(swprintf, AC_DEFINE(LOG4CXX_HAVE_SWPRINTF, [], [have swprintf]))
164,165c165,166
< 	AC_DEFINE(HAVE_MS_THREAD, 1, thread support through Microsoft threads.)
< 	AC_DEFINE(HAVE_THREAD, 1, thread support)
---
> 	AC_DEFINE(LOG4CXX_HAVE_MS_THREAD, 1, thread support through Microsoft threads.)
> 	AC_DEFINE(LOG4CXX_HAVE_THREAD, 1, thread support)
171,172c172,173
< 	AC_DEFINE(HAVE_PTHREAD, 1, thread support through pthread library.)
< 	AC_DEFINE(HAVE_THREAD, 1, thread support)
---
> 	AC_DEFINE(LOG4CXX_HAVE_PTHREAD, 1, thread support through pthread library.)
> 	AC_DEFINE(LOG4CXX_HAVE_THREAD, 1, thread support)
229,230c230,231
< 	AC_DEFINE(HAVE_MS_XML, 1, ODBC support through Microsoft XML.)
< 	AC_DEFINE(HAVE_XML, 1, XML support)
---
> 	AC_DEFINE(LOG4CXX_HAVE_MS_XML, 1, ODBC support through Microsoft XML.)
> 	AC_DEFINE(LOG4CXX_HAVE_XML, 1, XML support)
238,239c239,240
< 		AC_DEFINE(HAVE_LIBXML2, 1, XML support through libxml2.)
< 		AC_DEFINE(HAVE_XML, 1, XML support)
---
> 		AC_DEFINE(LOG4CXX_HAVE_LIBXML2, 1, XML support through libxml2.)
> 		AC_DEFINE(LOG4CXX_HAVE_XML, 1, XML support)
261c262
< 	AC_DEFINE(UNICODE, 1, UTF-16 Unicode support.)
---
> 	AC_DEFINE(LOG4CXX_UNICODE, 1, UTF-16 Unicode support.)
274,275c275,276
< 	AC_DEFINE(HAVE_MS_ODBC, 1, ODBC support through Microsoft ODBC.)
< 	AC_DEFINE(HAVE_ODBC, 1, ODBC support)
---
> 	AC_DEFINE(LOG4CXX_HAVE_MS_ODBC, 1, ODBC support through Microsoft ODBC.)
> 	AC_DEFINE(LOG4CXX_HAVE_ODBC, 1, ODBC support)
282,283c283,284
< 	AC_DEFINE(HAVE_UNIX_ODBC, 1, ODBC support through unixODBC.)
< 	AC_DEFINE(HAVE_ODBC, 1, ODBC support)
---
> 	AC_DEFINE(LOG4CXX_HAVE_UNIX_ODBC, 1, ODBC support through unixODBC.)
> 	AC_DEFINE(LOG4CXX_HAVE_ODBC, 1, ODBC support)
291,292c292,293
< 		AC_DEFINE(HAVE_I_ODBC, 1, ODBC support through iODBC.)
< 		AC_DEFINE(HAVE_ODBC, 1, ODBC support)
---
> 		AC_DEFINE(LOG4CXX_HAVE_I_ODBC, 1, ODBC support through iODBC.)
> 		AC_DEFINE(LOG4CXX_HAVE_ODBC, 1, ODBC support)
323,324c324,325
< 	AC_DEFINE(HAVE_CDO_SMTP, 1, SMTP support through Microsoft CDO.)
< 	AC_DEFINE(HAVE_SMTP, 1, SMTP support)
---
> 	AC_DEFINE(LOG4CXX_HAVE_CDO_SMTP, 1, SMTP support through Microsoft CDO.)
> 	AC_DEFINE(LOG4CXX_HAVE_SMTP, 1, SMTP support)
331,332c332,333
< 	AC_DEFINE(HAVE_LIBSMTP, 1, SMTP support through libsmtp library.)
< 	AC_DEFINE(HAVE_SMTP, 1, SMTP support)
---
> 	AC_DEFINE(LOG4CXX_HAVE_LIBSMTP, 1, SMTP support through libsmtp library.)
> 	AC_DEFINE(LOG4CXX_HAVE_SMTP, 1, SMTP support)
349c350
< 	AC_DEFINE(MUST_UNDEF_T, 1, Defined to 1 if macro _T has to be undefined)
---
> 	AC_DEFINE(LOG4CXX_MUST_UNDEF_T, 1, Defined to 1 if macro _T has to be undefined)
Index: include/log4cxx/helpers/tchar.h
===================================================================
RCS file: /home/cvspublic/logging-log4cxx/include/log4cxx/helpers/tchar.h,v
retrieving revision 1.39
diff -r1.39 tchar.h
50c50
< #ifdef HAVE_SWPRINTF
---
> #ifdef LOG4CXX_HAVE_SWPRINTF

Reply via email to