logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Building & Member Downloads View previous topic :: View next topic
Reply to topic   Topic: Compiling httpd + libapr-2 failed on Windows
Author
nono303



Joined: 20 Dec 2016
Posts: 197
Location: Lille, FR, EU

PostPosted: Thu 16 May '24 11:07    Post subject: Compiling httpd + libapr-2 failed on Windows Reply with quote

Hi,
I currently try to compile httpd with libapr-2 (trunk) "for fun"
Itís seeming to be able to be done (see https://github.com/apache/httpd/blob/trunk/CMakeLists.txt#L35) but Iím facing some issues:

1. Compiling apr trunk with CMake (shared):
- I had to patch CMakeLists.txt to add mysql dbd support
- With APR_MODULAR_DSO=ON, APR_MODULE_DECLARE_DATA not seems to be set with __declspec(dllexport) (for apr_dbd_sqlite3 & apr_dbd_mysql) - working fine with APR_MODULAR_DSO=OFF
- LDAP support (with CMakeLists.txt to patched too) failed with many missing imports

Finally I can have a working release of libapr-2 with this config

Code:
cmake %CMAKE_OPTS% -G %CMAKE_TGT_NINJA% ^
-DCMAKE_INSTALL_PREFIX=%PATH_INSTALL% ^
-DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% ^
-DAPR_MINIMAL_BUILD=OFF ^
-DAPU_HAVE_ODBC=ON ^
-DAPU_USE_EXPAT=OFF ^
-DAPU_USE_LIBXML2=ON ^
-DAPU_USE_XMLLITE=OFF ^
-DAPR_INSTALL_PRIVATE_H=ON ^
-DAPU_HAVE_SQLITE3=ON ^
-DAPU_HAVE_MYSQL=ON ^
-DAPU_HAVE_CRYPTO=ON ^
-DAPU_HAVE_ICONV=ON ^
-DAPR_HAVE_IPV6=ON ^
-DAPU_HAVE_LDAP=OFF ^
-DAPU_HAVE_ODBC=ON ^
-DINSTALL_PDB=ON ^
-DAPR_BUILD_TESTAPR=OFF ^
-DAPR_BUILD_SHARED=ON ^
-DAPR_BUILD_STATIC=OFF ^
-DAPR_MODULAR_DSO=OFF ^
-DTEST_STATIC_LIBS=OFF ^
-DOPENSSL_ROOT_DIR=%PATH_INSTALL_OSSL% ^
-DOPENSSL_INCLUDE_DIR=%PATH_INSTALL_OSSL%\include ^
-DCMAKE_MODULE_PATH=cmake ^
-DMYSQL_LIBRARY=%PATH_MYSQL:\=/%/lib/mysqlclient.lib ^
-DMYSQL_INCLUDE_DIR=%PATH_MYSQL:\=/%/include
%PATH_SRC%\%1

2. Compiling httpd with libapr-2 (without ldap support...)
Code:
-- APR_HAS_LDAP ............. : FALSE
-- APR_HAS_XLATE ............ : TRUE
-- APU_HAVE_CRYPTO .......... : TRUE
...
--   APR include directory ........... : C:/sdk/release/vs17_x64-avx2/include/apr-2
--   APR libraries ................... : C:/sdk/release/vs17_x64-avx2/lib/libapr-2.lib

I have breaking errors 'IF_WIN_OS_IS_UNICODE': undeclared identifier
And effectively, IF_WIN_OS_IS_UNICODE had disappeared from arch/win32/apr_arch_misc.h (see https://github.com/apache/apr/blob/1.8.x/include/arch/win32/apr_arch_misc.h#L140)

Is it known that libapr-2 is not supported with https on windows?
Have someone tried to do it with success?


++NoNo
Back to top
tangent
Moderator


Joined: 16 Aug 2020
Posts: 325
Location: UK

PostPosted: Sun 09 Jun '24 20:53    Post subject: Reply with quote

I've been tied up lately, so not been able to pick up on your interesting post over building libapr-2 with CMake. At some point this will be directly relevant to the Apache build with CMake How-To script I put together some years ago.

Having built libapr-2 with CMake using the apr-trunk as you did, I forsee problems ahead.

The build evidently checks for a number of support packages, viz:

Code:
-- The C compiler identification is MSVC 19.40.33811.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found EXPAT: C:/Apache24/lib/libexpat.lib (found version "2.2.6")
-- Found LibXml2: C:/Apache24/lib/libxml2.lib (found version "2.9.9")             *** => was actually 2.12.7
-- Found OpenSSL: C:/Apache24/lib/libcrypto.lib (found version "3.1.6") 
-- Could NOT find Iconv (missing: Iconv_LIBRARY Iconv_INCLUDE_DIR)
-- Could NOT find SQLite3 (missing: SQLite3_INCLUDE_DIR SQLite3_LIBRARY)

The lack of Iconv is a problem, since the official libiconv package is GNU based and doesn't currently support building with CMake. That's why to date I've stuck with the old apr-iconv package with nmake.

There are a number of GIT forks of libiconv out there, where people have crafted a CMakeLists.txt file, but they're several revisions down from the latest libiconv package at release 1.17 (2022).

Even if we can find/craft a suitable CMakeLists.txt file, I'm equally not sure where we stand LGPL license wise.

I'd want to crack this libiconv issue before trying to refine the overall HTTPD build script further.
Back to top
nono303



Joined: 20 Dec 2016
Posts: 197
Location: Lille, FR, EU

PostPosted: Wed 12 Jun '24 15:12    Post subject: Reply with quote

Thx @tangent for your feedback!
I see that we are more or less at the same point...

Regarding libiconv, I use https://github.com/pffang/libiconv-for-Windows with MSBuild (gnu version iso src, with additional includes - probably coming from a MinGW ./configure)
Code:
config.h
include/iconv.h
include/iconv.h.inst
lib/config.h
lib/libcharset.h
lib/localcharset.h
libcharset/config.h
libcharset/include/libcharset.h
libcharset/include/libcharset.h.inst
libcharset/include/localcharset.h
libcharset/include/localcharset.h.inst

Not CMake but the release remains fully compatible with the build chain
I can release an apr-2 binary with libiconv support but, as mentioned above, other problems are blocking its integration with httpd.
Code:
-- APR configuration summary:
--
--   Build type ...................... : RelWithDebInfo
--   Install .pdb (if available)...... : ON
--   Install prefix .................. : C:/sdk/release/vs17_x64-avx2
--     Directory for binary files .... : PREFIX/bin
--     Directory for library files ... : PREFIX/lib
--     Directory for include files ... : PREFIX/include/apr-2
--   C compiler ...................... : C:/sdk/softs/vs22/Community/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe
--   IPv6 ............................ : ON
--   DBD ODBC driver ................. : ON
--   DBD SQLite3 driver .............. : ON
--   DBD MySQL driver ................ : ON
--   Use Expat ....................... : OFF
--   Use LibXml2 ..................... : ON
--   Use XmlLite ..................... : OFF
--   Have Crypto ..................... : ON
--   Have Iconv ...................... : ON
--   Library files for XML ........... : C:/sdk/release/vs17_x64-avx2/lib/libxml2.lib
--   DSO build of modular components.. : OFF
--   Turn on pools debugging ..........: OFF
--   Build shared libs ............... : ON
--   Build static libs ............... : OFF
--   Build test suite ................ : OFF
--     (testing dynamic libraries)
--   Install private .h for httpd .... : ON
-- Configuring done (3.1s)

Regarding this, I give up for the moment and will probably come back to dig when everything will be drier (or if you have some point for me to dig Wink)
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 1258
Location: Amsterdam, NL, EU

PostPosted: Wed 12 Jun '24 15:51    Post subject: Reply with quote

Regarding libiconv: clone https://github.com/winlibs/libiconv
And run this in the MSVC16 dir:
Code:
msbuild libiconv.sln /t:Rebuild /p:Configuration=Release /p:Platform=x64
Back to top
tangent
Moderator


Joined: 16 Aug 2020
Posts: 325
Location: UK

PostPosted: Wed 12 Jun '24 21:11    Post subject: Reply with quote

Thanks both for the feedback over libiconv. Much appreciated.

I've spent some time on this too, and since my challenge is to stick with CMake, had landed on the following site: https://github.com/vovythevov/libiconv-cmake

This provided a well structured CMakeLists.txt file as a starting point, albeit for libiconv 1.14, and have since managed to update this to build the latest release 1.17.

I've tried extending this to build iconv.exe, but accepted this relies on a GNU build environment rather than MSVC, so have for now given up. It's not essential, so when I recover I'll try using this libiconv variant to progress building with APR-2.

@nono303 - I notice you've chosen libxml2 over expat for XML support (APR-2 requires you to choose one or the other).

Extract from APR-2 CMakeLists.txt
Code:
IF(APU_USE_EXPAT AND APU_USE_LIBXML2)
  MESSAGE(FATAL_ERROR "Only one of Expat and LibXml2 can be selected")
ENDIF()

What was the reason you chose libxml2?
Back to top
nono303



Joined: 20 Dec 2016
Posts: 197
Location: Lille, FR, EU

PostPosted: Thu 13 Jun '24 9:52    Post subject: Reply with quote

Hi @tangent,

Was looking at CMake libiconv and found https://github.com/AiMiDi/libiconv_cmake which works fine for on 1.17 (and seems to be active).
I'll stick on it.
Just have issued to apply these 2 patches:
Quote:
What was the reason you chose libxml2?

Good question!Iím clearly not an expert on that and if there are good reasons to use expat instead of libxml2, Iíll switch eyes closed 😉
Back to top


Reply to topic   Topic: Compiling httpd + libapr-2 failed on Windows View previous topic :: View next topic
Post new topic   Forum Index -> Building & Member Downloads