logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curt Arnold <carn...@apache.org>
Subject Re: another attempt to get cygwin working
Date Wed, 14 Nov 2007 03:39:25 GMT

On Nov 13, 2007, at 4:11 PM, Bernd Prager wrote:

> Hi,
>
> I tried again to make a cygwin compilation of the latest svn branch.
>
> I am using the latest cygwin version:
> CYGWIN_NT-5.1 NY026WRRGC1 1.5.24(0.156/4/2) 2007-01-31 10:57 i686  
> Cygwin
>
> Since I got linker errors related to apr components the last time I  
> decided
> to compile apr and apr-util from scratch.
> Here is exactly what I did:
>

> wget http://www.axint.net/apache/apr/apr-1.2.11.tar.gz
> tar -xzf apr-1.2.11.tar.gz
> cd apr-1.2.11
> ./configure --enable-threads
> make
> make install
> cd ..
> wget http://www.axint.net/apache/apr/apr-util-1.2.10.tar.bz2
> tar -xjf apr-util-1.2.10.tar.bz2
> cd apr-util-1.2.10
> ./configure --with-apr=/usr/local/apr
> make
> make install
> cd ..
> svn co https://svn.apache.org/repos/asf/logging/log4cxx/trunk
> mv trunk/ log4cxx
> cd log4cxx/
> ./configure --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr
> make
>
> All apr and apr-util components compile without error and threads are
> clearly enabled.
>
> Compiling log4cxx still breaks with the same errors:
>
> Making all in src
> make[1]: Entering directory `/home/me/log4cxx/src'
> Making all in main
> make[2]: Entering directory `/home/me/log4cxx/src/main'
> Making all in cpp
> make[3]: Entering directory `/home/me/log4cxx/src/main/cpp'
> /bin/sh ../../../libtool --tag=CXX   --mode=compile g++ - 
> DPACKAGE_NAME=\"\"
> -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\"
> -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"log4cxx\" -DVERSION=\"0.10.0\"
> -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 - 
> DHAVE_STDLIB_H=1
> -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 - 
> DHAVE_INTTYPES_H=1
> -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DHAVE_UNISTD_H=1
> -DHAVE_IO_H=1 -DHAVE_ALLOCA_H=1 -DHAVE_SYSLOG=1 -DHAVE_GETHOSTBYNAME=1
> -DHAVE_SETSOCKOPT=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_FTIME=1 - 
> DHAVE_SETENV=1
> -I. -I../../../src/main/include -I../../../src/main/include  -DLOG4CXX
> -mfpmath=sse -msse2 -mmmx   -DCYGWIN  -I/usr/local/apr/include/apr-1
> -I/usr/local/apr/include/apr-1   -g -O2 -MT thread.lo -MD -MP -MF
> .deps/thread.Tpo -c -o thread.lo thread.cpp
>  g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\"
> -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"log4cxx\"
> -DVERSION=\"0.10.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1
> -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 - 
> DHAVE_MEMORY_H=1
> -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 - 
> DHAVE_UNISTD_H=1
> -DHAVE_DLFCN_H=1 -DHAVE_UNISTD_H=1 -DHAVE_IO_H=1 -DHAVE_ALLOCA_H=1
> -DHAVE_SYSLOG=1 -DHAVE_GETHOSTBYNAME=1 -DHAVE_SETSOCKOPT=1
> -DHAVE_GETTIMEOFDAY=1 -DHAVE_FTIME=1 -DHAVE_SETENV=1 -I.
> -I../../../src/main/include -I../../../src/main/include -DLOG4CXX
> -mfpmath=sse -msse2 -mmmx -DCYGWIN -I/usr/local/apr/include/apr-1
> -I/usr/local/apr/include/apr-1 -g -O2 -MT thread.lo -MD -MP -MF
> .deps/thread.Tpo -c thread.cpp  -DDLL_EXPORT -DPIC -o .libs/thread.o
> thread.cpp: In member function `void
> log4cxx::helpers::Thread::run(void*(*) 
> (log4cxx::helpers::log4cxx_thread_t*,
> void*), void*)':
> thread.cpp:69: error: `apr_threadattr_create' undeclared (first use  
> this
> function)
> thread.cpp:69: error: (Each undeclared identifier is reported only  
> once for
> each function it appears in.)
> thread.cpp:78: error: `apr_thread_create' undeclared (first use this
> function)
> thread.cpp: In static member function `static void*
> log4cxx::helpers::Thread::launcher 
> (log4cxx::helpers::log4cxx_thread_t*,
> void*)':
> thread.cpp:100: error: `apr_thread_exit' undeclared (first use this
> function)
> thread.cpp: In member function `void log4cxx::helpers::Thread::join 
> ()':
> thread.cpp:117: error: `apr_thread_join' undeclared (first use this
> function)
> make[3]: *** [thread.lo] Error 1
> make[3]: Leaving directory `/home/me/log4cxx/src/main/cpp'
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory `/home/me/log4cxx/src/main'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/home/me/log4cxx/src'
> make: *** [all-recursive] Error 1
>
> Has anybody recently been successful in compiling log4cxx under  
> cygwin?
>
> The README still states:
> Supported OS
> ============
> * Windows (MSVC 6.0, MSVC 7.1 or Cygwin)
>
> -- Bernd Prager
>

The compile messages are consistent with APR_HAS_THREADS not being  
true.  From a quick Google search it looks like pthreads are  
available for Cygwin, but something is apparently missing in APR from  
detecting that they are there.  However, I didn't dig into it.

I've committed two sets of changes that allowed me to compile and  
link log4cxx against the apr and apr-util currently distributed with  
cygwin (which defines APR_HAS_PTHREADS = 0) using the autotools  
chain.  Without APR_HAS_THREADS several useful appenders disappear  
(AsyncAppender, TelnetAppender, SocketAppender, etc), but seems to  
pass the unit tests and the examples seem to work.




Mime
View raw message