You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by Jostein Tveit <jo...@pvv.ntnu.no> on 2006/05/31 16:37:16 UTC

How to build 64 bits log4cxx on Solaris with Sun Studio 11

Hi log4cxx community,

I have successfully built a 64 bits version of log4cxx on
Solaris 8 with Sun Studio 11. Here is a summary.
The steps applies to Revision 400051.

Prerequisites:
- Solaris 8, SPARC
- Sun Studio 11 (free download from www.sun.com)
- autoconf-2.59 (from www.sunfreeware.com)
- automake-1.9 (from www.sunfreeware.com)
- m4-1.4.2 (from www.sunfreeware.com)

Self-compiled versions of the following libraries was also
needed. (You can probably install this libraries as Solaris
packages, but I have not tried that):
- libtool-1.5.22
- apr-1.2.7
- apr-utils-1.2.7
- cppunit-cvs-1.10.2

To build logc4xx:

1. Replace "-xarch=v8plus" with "-xarch=v9" in configure.in, line
   207 and 208.

2. Add "#include <sys/types.h>" and "#include <unistd.h>" to
   tests/src/net/socketservertestcase.cpp to get the unit tests
   to work.

3. Be sure to have /opt/SUNWspro/bin, /usr/local/bin,
   /usr/ccs/bin and the executable cppunit-config in the PATH.

4. $ bash autogen.sh
   (libtool 1.5.22 must be installed to be able to pass on the
   -xarch=v9 parameter to the linker. Older versions of libtool
   do not pass this parameter correctly, and will result in a
   linker error message complaining about trying to use 32 bits
   libraries.)

5. $ CXX=CC CXXFLAGS="-xarch=v9 -D__STDC_ISO_10646__ \
     -I<path to cppunit includes>" \
     CPPFLAGS="-I<path to cppunit includes>" \
     LDFLAGS="-L<path to cppunit libraries>" \
     ./configure --with-apr=<path to apr dir> \
     --with-apr-util=<path to apr-util dir>

6. $ make

7. $ make check

If you have any questions regarding Solaris and Sun Studio (Sun
Forte) compilation of log4cxx, feel free to ask them to the
list. I will try to answer you.


To the log4cxx developers:
- It would be nice if you removed the hardcoding of
  "-xarch=v8plus" from configure.in.
- It would be nice if you added "#include <sys/types.h>" and
  "#include <unistd.h>" to tests/src/net/socketservertestcase.cpp
  Solaris needs those includes to find fork (and I think Linux
  does too). I don`t know how Windows will handle them, so you
  might have to use some sort of #ifdef...


Regards,
-- 
Jostein Tveit <jo...@pvv.ntnu.no>