swebb2066 commented on issue #362:
URL: 
https://github.com/apache/logging-log4cxx/issues/362#issuecomment-2038443183

   The distro provied apr and apr-util static libraries are built without -fPIC 
(probably assuming everthing will be statically linked if anything is 
statically linked). 
   
   To build a log4cxx DSO with -DAPR_STATIC=yes you will need to also provide 
-DCMAKE_PREFIX_PATH=~/libraries after populating ~/libraries with apr that you 
built yourself.
   
   For example:
   ```
   curl -L -O https://archive.apache.org/dist/apr/apr-1.7.4.tar.bz2
   tar xf apr-1.7.4.tar.bz2
   cd apr-1.7.4
   export CFLAGS=-fPIC
   ./configure --prefix=~/libraries
   make install
   ```
   
   I recommend your also -DAPU_STATIC=yes when using -DAPR_STATIC=yes. This 
requires you build apr-util yourself as well.
   
   ```
   curl -L -O https://archive.apache.org/dist/apr/apr-util-1.6.3.bz2
   tar xf apr-util-1.6.3.bz2
   cd apr-util-1.6.3
   export CFLAGS=-fPIC
   ./configure --prefix=~/libraries
   make install
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@logging.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to