Am Montag, 16. Mai 2005 10:19 schrieb Christophe de VIENNE:
> Le Samedi 14 Mai 2005 21:52, Tommi M�kitalo a �crit�:
> > Sorry - updated - I forgot LOG4CXX_HAS_WCHAR_T. And now I read once again
> > the mail from Curt about LOG4CXX_HAS_WCHAR_T and LOG4CXX_LOGCHAR_IS_UTF8.
>
> If I'm right your patch disable utf8 if wchar is present.
> Personnaly I'd use utf-8 even if my compiler can use wchar. I'll soon
> commit an up-to-date autoconf which permit to choose.
>
> Regards,
>
> Christophe
Yes. That's how I interpreted Curts comment:

> LOG4CXX_LOGCHAR_IS_UTF8 indicates that LogString (the internal string 
> type) is a std::string encoded in UTF-8.  Currently either 
> LOG4CXX_LOGCHAR_IS_UTF8 or LOG4CXX_LOGCHAR_IS_WCHAR is 1 and the other 
> 0.  It is possible, but unlikely, that at some future date that other 
> options for LogString would be provided.

But if you have a improved solution, that's great.

By the way - I replaced include/log4cxx/private/log4cxx.h with 
include/log4cxx/log4cxx.h, include/log4cxx/private/log4cxx_private.h and 
include/log4cxx/private/Makefile in AC_CONFIG_FILES. I attach my current diff 
here. After that log4cxx compiled and the examples run fine.

Tommi
Index: configure.in
===================================================================
RCS file: /home/cvspublic/logging-log4cxx/configure.in,v
retrieving revision 1.51
diff -c -r1.51 configure.in
*** configure.in	4 May 2005 16:13:40 -0000	1.51
--- configure.in	16 May 2005 08:46:03 -0000
***************
*** 22,27 ****
--- 22,29 ----
  [/* no explicit exports */
  #define LOG4CXX_EXPORT])
  
+ unset CDPATH
+ AC_CONFIG_HEADERS([src/config.h])
  AM_INIT_AUTOMAKE(log4cxx, 0.9.8)
  
  # Checks for programs
***************
*** 369,374 ****
--- 371,389 ----
  
  CPPFLAGS="-DLOG4CXX $CPPFLAGS"
  
+ AC_MSG_CHECKING([wchar_t])
+ AC_COMPILE_IFELSE(AC_LANG_SOURCE(wchar_t* w;), [have_wchar_t=yes], [have_wchar_t=no])
+ AC_MSG_RESULT($have_wchar_t)
+ 
+ if test "$have_wchar_t" = "yes"
+   then
+     AC_SUBST(LOGCHAR_IS_UTF8, 0)
+     AC_SUBST(HAS_WCHAR_T, 1)
+   else
+     AC_SUBST(LOGCHAR_IS_UTF8, 1)
+     AC_SUBST(HAS_WCHAR_T, 0)
+   fi
+ 
  # Create files
  # ----------------------------------------------------------------------------
  
***************
*** 378,384 ****
  docs/Doxyfile
  src/Makefile
  include/Makefile
! include/log4cxx/private/log4cxx.h
  include/log4cxx/Makefile
  include/log4cxx/helpers/Makefile
  include/log4cxx/net/Makefile
--- 393,401 ----
  docs/Doxyfile
  src/Makefile
  include/Makefile
! include/log4cxx/log4cxx.h
! include/log4cxx/private/log4cxx_private.h
! include/log4cxx/private/Makefile
  include/log4cxx/Makefile
  include/log4cxx/helpers/Makefile
  include/log4cxx/net/Makefile

Reply via email to