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 Stephen Bartnikowski <sb...@barkinglizards.com> on 2006/11/16 19:46:59 UTC

building latest on FreeBSD 6.0

Hello,

I've gotten the latest log4cxx source to build on FreeBSD 6.0 and 6.1 using
the recommended ant process.  However, I had to modify / hack a few things
to nudge it through.  It's not the best way to get around the issue, but it
could prove useful to anyone else having similar issues.

A lot of my problem comes down to the build process not recognizing that I
have iconv installed.  Also libdl is not found on FreeBSD, but the code
required from that lib is already included in another lib.

Here's a diff of the build code in SVN that I modified.  (More changes
follow after diff.)
Index: build.xml
===================================================================
--- build.xml   (revision 474575)
+++ build.xml   (working copy)
@@ -5,7 +5,7 @@
         <libset libs="${aprutil.lib.name}${lib-suffix}"
unless="aprutil.lib.dir"/>
         <libset libs="${apr.lib.name}${lib-suffix}" dir="${apr.lib.dir}"
if="apr.lib.dir"/>
         <libset libs="${apr.lib.name}${lib-suffix}" unless="apr.lib.dir"/>
-        <libset libs="iconv" if="has-iconv"/>
+        <libset libs="iconv" dir="/usr/local/lib"/>
         <libset libs="pthread" if="is-unix"/>
         <libset libs="expat" if="has-expat"/>
         <syslibset libs="advapi32 odbc32 ws2_32 mswsock" if="is-windows"/>
@@ -732,6 +732,7 @@
         <defineset define="APR_DECLARE_STATIC" if="apr-static"/>
         <defineset define="APU_DECLARE_STATIC" if="aprutil-static"/>
         <defineset define="WIN32" if="is-windows"/>
+        <defineset define="__STDC_ISO_10646__"/>
         <compilerarg value="${pic-option}" if="pic-option"/>
         &libsets;
         <project type="${project.type}" outfile="${project.dir}/log4cxx"
if="project.if"/>
@@ -899,7 +900,7 @@
         <libset libs="log4cxx${lib-suffix}" dir="${log4cxx.lib.dir}"/>
         <libset libs="${cppunit.lib.name}${lib-suffix}"
dir="${cppunit.lib.dir}" if="cppunit.lib.dir"/>
         <libset libs="${cppunit.lib.name}${lib-suffix}"
unless="cppunit.lib.dir"/>
-        <libset libs="dl" if="is-unix"/>
+<!--        <libset libs="dl" if="is-unix"/> -->
         &libsets;
 
         <project outfile="${project.dir}/log4cxx-test"
type="${project.type}" if="project.if"/>
@@ -937,7 +938,7 @@
         <libset libs="log4cxx${lib-suffix}" dir="${log4cxx.lib.dir}"/>
         <libset libs="${cppunit.lib.name}${lib-suffix}"
dir="${cppunit.lib.dir}" if="cppunit.lib.dir"/>
         <libset libs="${cppunit.lib.name}${lib-suffix}"
unless="cppunit.lib.dir"/>
-        <libset libs="dl" if="is-unix"/>
+<!--        <libset libs="dl" if="is-unix"/> -->
         &libsets;
 
         <project outfile="${project.dir}/log4cxx-defaultinit-test"
Index: aprutil-build.xml
===================================================================
--- aprutil-build.xml   (revision 474575)
+++ aprutil-build.xml   (working copy)
@@ -220,6 +220,7 @@
         <includepath path="${apr.include.dir}"/>
         <includepath path="${aprutil.dir}/xml/expat/lib"/>
         <includepath path="${aprutil.dir}/xml/expat"/>
+        <includepath path="/usr/local/include"/>
         <defineset define="APU_DECLARE_EXPORT" if="is-aprutil-shared"/>
         <defineset define="APU_DECLARE_STATIC" unless="is-aprutil-shared"/>
         <defineset define="APR_DECLARE_STATIC" unless="is-apr-shared"/>


Additionally, in /log4cxx/lib/apr-util-1.2.7/include/apu.h, I have to change
the following define so that it's turned on:
#define APU_HAVE_ICONV         1


Finally, in /log4cxx/lib/apr-util-1.2.7/include/private/apu_config.h, I have
to turn on the following defines.
#define APU_ICONV_INBUF_CONST 1
#define HAVE_ICONV_H 1


Cheers!


Re: building latest on FreeBSD 6.0

Posted by Curt Arnold <ca...@apache.org>.
__STDC_ISO_10646__ indicates that wchar_t contains UCS-4 code  
points.  It isn't true on Windows where wchar_t is UTF-16 or on some  
Asian variants of Solaris.  wchar_t on Mac OS/X is not explicitly  
defined.   I'll look at your changes and see if I can generalize them.