Hi,

I don't know if its appropriate to answer myself but I investigated a little more and like to contribute some stuff.
ant -Dlib.type=shared -Dapr.lib.type=shared -Daprutil.lib.type=shared -Dhas.wchar_t=0 -Dlogchar=utf8 -Ddebug=false -Dcompiler=msvc build
Is giving me an error:

      [cc] Starting link
[cc] Bibliothek "apr-1.lib" und Objekt "apr-1.exp" werden erstellt. [cc] apr_app.obj : error LNK2019: Verweis auf nicht aufgel÷stes externes
Symbol "_main" in Funktion "_wmain".
[cc] apr-1.dll : fatal error LNK1120: 1 nicht aufgel÷ste externe Verweise
.

BUILD FAILED
C:\Temp\log4cxx-0.9.8\build.xml:490: The following error occurred while executing this line: C:\Temp\log4cxx-0.9.8\apr-build.xml:164: link failed with return code 1120
As far as I understand, the apr-build.xml is excluding the apr_app.c in line 166, which is correct. But then in line 169 it's included once again, so excluding it there too does the trick. I attached the apr-build.xml.patch which corrects this.
So I decided to build my own Visual Studio 2005 Solution and using the apr-1.dll, apr-util.1.dll (both version 1.2.7) and apr-iconv-1.dll (Version 1.1.1). When doing this, everything works fine except that I get an unresolved external for apr_wait_for_io_or_timeout, which is correct in the sense that this function is not exported and not even implemented in the windows version of apr.
Building with apr-1 and aprutil-1 both version 1.2.2 and using ant
ant -Dlib.type=shared -Dapr.lib.type=shared -Daprutil.lib.type=shared -Dhas.wchar_t=0 -Dlogchar=utf8 -Ddebug=false -Dcompiler=msvc build also gives this unresolved externals. This can be solved by patching two files in apr-1.2.2. When declaring apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s,int for_read)
as
APR_DECLARE(apr_status_t) apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s,int for_read) this function is exported. This has be done in apr_support.h and support/unix/waitio.c

So I decided to patch the patch ;-) See attached apr-1.2.2.patch.patch

Can someone please double cross check and if correct and appropriate incorporate this.

Many thanks
Thomas Graefenhain
Index: apr-build.xml
===================================================================
--- apr-build.xml       (revision 412247)
+++ apr-build.xml       (working copy)
@@ -166,7 +166,7 @@
         <fileset dir="${src.dir}/file_io/unix"
             includes="copy.c fileacc.c filepath_util.c fullrw.c mktemp.c 
tempdir.c"/>
         <fileset dir="${src.dir}/memory/unix" includes="*.c"/>
-        <fileset dir="${src.dir}/misc/${arch}" includes="*.c"/>
+        <fileset dir="${src.dir}/misc/${arch}" includes="*.c" 
excludes="apr_app.c"/>
         <fileset dir="${src.dir}/misc/unix"
             includes="errorcodes.c getopt.c otherchild.c version.c"/>
         <fileset dir="${src.dir}/mmap/unix" includes="common.c"/>
Index: apr-1.2.2.patch
===================================================================
--- apr-1.2.2.patch     (revision 412247)
+++ apr-1.2.2.patch     (working copy)
@@ -334,3 +334,140 @@
              memcpy((void*)*env, _environ, (dupenv + 1) * sizeof (char *));
          }
          else {
+Index: support/unix/waitio.c
+===================================================================
+--- support/unix/waitio.c      (revision 153549)
++++ support/unix/waitio.c      (working copy)
+@@ -37,8 +37,8 @@
+ #include <sys/poll.h>
+ #endif
+ 
+-apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s,
+-                                        int for_read)
++APR_DECLARE(apr_status_t) apr_wait_for_io_or_timeout(apr_file_t *f, 
apr_socket_t *s,
++                                                     int for_read)
+ {
+     struct pollfd pfd;
+     int rc, timeout;
+@@ -63,8 +63,8 @@
+ 
+ #else /* !WAITIO_USES_POLL */
+ 
+-apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s,
+-                                        int for_read)
++APR_DECLARE(apr_status_t) apr_wait_for_io_or_timeout(apr_file_t *f, 
apr_socket_t *s,
++                                                     int for_read)
+ {
+     apr_interval_time_t timeout;
+     apr_pollfd_t pfd;
+Index: include/apr_support.h
+===================================================================
+--- include/apr_support.h      (revision 153549)
++++ include/apr_support.h      (working copy)
+@@ -1,53 +1,53 @@
+-/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
+- * applicable.
+- *
+- * Licensed under the Apache License, Version 2.0 (the "License");
+- * you may not use this file except in compliance with the License.
+- * You may obtain a copy of the License at
+- *
+- *     http://www.apache.org/licenses/LICENSE-2.0
+- *
+- * Unless required by applicable law or agreed to in writing, software
+- * distributed under the License is distributed on an "AS IS" BASIS,
+- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+- * See the License for the specific language governing permissions and
+- * limitations under the License.
+- */
+-
+-#ifndef APR_SUPPORT_H
+-#define APR_SUPPORT_H
+-
+-/**
+- * @file apr_support.h
+- * @brief APR Support functions
+- */
+-
+-#include "apr.h"
+-#include "apr_network_io.h"
+-#include "apr_file_io.h"
+-
+-#ifdef __cplusplus
+-extern "C" {
+-#endif /* __cplusplus */
+-
+-/**
+- * @defgroup apr_support Internal APR support functions
+- * @ingroup APR 
+- * @{
+- */
+-
+-/**
+- * Wait for IO to occur or timeout.
+- *
+- * Uses POOL for temporary allocations.
+- */
+-apr_status_t apr_wait_for_io_or_timeout(apr_file_t *f, apr_socket_t *s,
+-                                        int for_read);
+-
+-/** @} */
+-
+-#ifdef __cplusplus
+-}
+-#endif
+-
+-#endif  /* ! APR_SUPPORT_H */
++/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
++ * applicable.
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ *     http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
++
++#ifndef APR_SUPPORT_H
++#define APR_SUPPORT_H
++
++/**
++ * @file apr_support.h
++ * @brief APR Support functions
++ */
++
++#include "apr.h"
++#include "apr_network_io.h"
++#include "apr_file_io.h"
++
++#ifdef __cplusplus
++extern "C" {
++#endif /* __cplusplus */
++
++/**
++ * @defgroup apr_support Internal APR support functions
++ * @ingroup APR 
++ * @{
++ */
++
++/**
++ * Wait for IO to occur or timeout.
++ *
++ * Uses POOL for temporary allocations.
++ */
++APR_DECLARE(apr_status_t) apr_wait_for_io_or_timeout(apr_file_t *f, 
apr_socket_t *s,
++                                                     int for_read);
++
++/** @} */
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif  /* ! APR_SUPPORT_H */

Reply via email to