1
answer

I'm attempting to build nxlog with some updated libraries:

  • Latest APR (1.5.2)
  • Non-Heartbleed vulnerable OpenSSL sources
  • PCRE 8.37
  • Zlib 1.2.8

After building all the dependencies I'm a little stuck on getting nxlogs to build, specifically I'm stuck on the step where I run ./configure

At first it couldn't find apr-1-config, so I added /local/apr/bin to the path.

Then it couldn't fine libapr-1 so I added /local/apr/lib to the path, this is where the problems started. When APR built there wasn't a "libapr-1" file in /local/apr/lib, only libapr-1.a, libapr-1.la, libapr-1.dll.a.

Did I build APR incorrectly?

I'm trying to build this on windows

List of steps to get where I am:

1. Install MINGW using MinGW Installation Manager

Add packages:

  • mingw-developer-toolkit
  • mingw-base
  • mingw-expat bin
  • mingw32-libexpat dev
  • msys-libopenssl dev
  • msys-automake
  • msys-autoconf

Setup msys fstab (c:/mingw     /mingw)

2. Install Python (2.5)

3. Add Python and mingw to system path (C:\Python25;C:\MinGW\bin;C:\MinGW\msys\1.0\bin)

3. Get and build APR source (I could not get APR iconv to compile)

Download:

Build:

  1. Extract all files to c:\mingw\msys\1.0\src
  2. Compile libiconv
    1. cd libiconv-1.11


    2. ./configure CFLAGS="-O2 -s -mms-bitfields -march=i686" CXXFLAGS="-O2 -s -mms-bitfields -march=i686"
    3. make && make install
  3. Compile APR
    1. cd apr
    2. ./buildconf
    3.  

      ./configure CFLAGS="-O0 -s -mms-bitfields -march=i686" CXXFLAGS="-O0 -s -mms-bitfields -march=i686"
    4. make && make install
    5. cd ..
  4. Compile APR-UTIL
    1. cd apr-util-1.5.4
    2. ./buildconf --with-apr=/usr/src/apr-1.5.2


    3. ./configure CFLAGS="-O2 -s -mms-bitfields -march=i686" CXXFLAGS="-O2 -s -mms-bitfields -march=i686" --with-apr=/usr/src/apr-1.5.2
    4. make && make install
    5. cd ..
  5. Compile PCRE
    1. cd pcre-.37
    2. ./configure
    3. make && make install
    4. (make threw an error corrected with make clean, autoconf -i --force, started back at step 1)
    5. cd ..
  6. Compile ZLIB
    1. cd zlib-1.2.8
    2. make -f win32/Makefile.gcc
  7. Compile nxlog
    1. cd nxlog-ce-2.8.1248
    2. ./configure

This is where the problems began. First it couldn't find apr-1-config.

Fixed by adding /local/apr/bin to path.

Now it can't find libapr-1, addint /local/apr/lib to the path doesn't help. There is no libapr-1 file in the MinGW directory tree. Ideas?

 

-pacmanwa

 

AskedSeptember 11, 2015 - 8:48pm

Answer (1)

  • What libapr-1 file are you referring to?
  • Make sure to build all dependencies from sources (including expat and openssl):
    • put .h in include
    • put .dll.a in lib
    • put .dll in bin
  • pre 1.0 openssl was not Heartbleed vulnerable - in case that's what this is about.

 

AnsweredSeptember 11, 2015 - 9:15pm

Comments (1)

  • pacmanwa's picture

    An error from running ./configure in the nxlogs source directory indicates its looking for a file named libapr-1.

    I think the message may have something to do with configure.in lines 66: "AC_CHECK_LIB([apr-1, [apr_socket_create], [HAVELIBAPR=1], [AC_MSG_ERROR([libapr-1 not found])])"

    Also just noticed this, the message during the configure script is:

    checking for apr_socket_create in -lapr-1... no

    configure: error: libapr-1 not found

     

    I did a "make && make install" on all the dependencies. The dll for libapr-1 has a file name of libapr-1-0.dll, not sure if this is expected. and when you say put in include, lib and bin... which paths?

    C:\MinGW, C:\MinGW\mingw32, and c:\MinGW\msys\1.0 all appear to have bin, lib and include.

     

    Also yes I built and installed expat into my mingw/msys environment, not sure why I forgot to list it.

    September 11, 2015 - 10:20pm