Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
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.
| |
|
Topic: HOWTO: Building Apache and dependencies using CMake |
Page Previous 1, 2, 3, 4, 5 |
Author |
|
tangent Moderator
Joined: 16 Aug 2020 Posts: 394 Location: UK
|
Posted: Mon 11 Aug '25 17:04 Post subject: |
|
|
You're keeping me busy...
If you check the LIBXML2 section, you'll see I already specify -DLIBXML2_WITH_ZLIB=ON; indeed this option has been present since I switched to building LIBXML2 using CMake (available since release 2.14.1).
Your other LIBXML2 recommendations are worthy, and I've added them.
Regarding the APR-UTIL version check, there's clearly more than one way to do this. I've always lamented the poor string handling in the Windows shell (having come from a UNIX background). Indeed, I have a DOS version of UNIX find in my Windows path (which therefore takes precedence over the Windows builtin find command), and equally findstr is a pain, partly because its regex handling is poor, but also because it's primarily a file filter. Moreover, in a batch file, for a simple string check do I really have to write something like:
Code: | echo %APR-UTIL% | findstr /r "1.6.3$" > nul
if %errorlevel% EQU 0 (
...
) |
which is arguably as cryptic as the one liner I've used (clarified with a comment), but then Windows batch file commands are full of idiosyncratic syntax.
But thank you for pointing out the error, which turns out to be a typo in my "if string" test (an extraneous :). It should read:
Code: | if not x%APR-UTIL:1.6.3=% == x%APR-UTIL% (
...
) |
Regarding the HTTPD 2.4.62 check, I seriously considered removing this section when moving to the 2.4.65 release, but felt it might still be pertinant. I'll revisit this when the next HTTPD release comes out.
In the CURL edit, your request for a single line 'C' comment is somewhat academic, but nonetheless accepted.
A footnote...
This CMake build HowTo is primarily meant to shadow the packages referenced in the official Apache Lounge HTTPD release, and there are comments to this effect across the thread. Thereto, I've chosen to not delete the additional package binaries that get installed into the Apache24 bin directory along the way, e.g. brotli.exe, curl.exe, lua.exe, xmllint.exe, etc., since users may find these of interest. However, building further packages to provide additional functionality (LIBLZMA, LIBPSL, LIBSSH2, NGHTTP3, NGTCP2, ZSTANDARD, PYTHON, etc), is entirely down to individual choice.
I've just seen your further post concerning mod_charset_lite.
Code: | ...
-- Modules not built:
-- mod_socache_dc
-- mod_charset_lite
... |
When I build HTTPD, this module is compiled and I see following in my output log:
Code: | -- Looking for APR_HAS_XLATE
-- Looking for APR_HAS_XLATE - found
-- Performing Test APR_HAS_XLATE
-- Performing Test APR_HAS_XLATE - Success <=====
...
-- Modules not built:
-- mod_socache_dc
... |
The HTTPD CMakeLists.txt file includes a macro CHECK_APR_FEATURE, which checks the APR-UTIL header file apu.h for APR_HAS_XLATE, which needs to include:
Code: | #define APR_HAS_XLATE (APU_HAVE_APR_ICONV || APU_HAVE_ICONV |
Can I advise you check your APR-UTIL build code, which should be aware that APR-ICONV has been built and is to be included. The CMake HowTo uses the following code to cover off this requirement:
Code: | rem Patch CMakelists.txt to support APR-ICONV if we've built it.
rem
if exist "%PREFIX%\lib\libapriconv-1.lib" (
perl -pi.bak -e ^" ^
s~^(SET.+APR_LIBRARIES[\s]+^)(\x22^)(.+libapr^)(-1.lib^)(.+ CACHE^)~${1}${2}${3}${4}${2} ${2}${3}iconv${4}${5}~; ^
s~^(apu_have_apr_iconv_10^) 0~${1} 1~; ^
^" CMakeLists.txt
) |
|
|
Back to top |
|
tanquang
Joined: 21 Mar 2020 Posts: 73 Location: Vietnam
|
Posted: Tue 12 Aug '25 5:14 Post subject: |
|
|
tangent wrote: | You're keeping me busy... |
I am truly sorry for that.
Quote: | Can I advise you check your APR-UTIL build code, which should be aware that APR-ICONV has been built and is to be included. The CMake HowTo uses the following code to cover off this requirement:
Code: | rem Patch CMakelists.txt to support APR-ICONV if we've built it.
rem
if exist "%PREFIX%\lib\libapriconv-1.lib" (
perl -pi.bak -e ^" ^
s~^(SET.+APR_LIBRARIES[\s]+^)(\x22^)(.+libapr^)(-1.lib^)(.+ CACHE^)~${1}${2}${3}${4}${2} ${2}${3}iconv${4}${5}~; ^
s~^(apu_have_apr_iconv_10^) 0~${1} 1~; ^
^" CMakeLists.txt
) |
|
It was my mistake exactly, I used the variable %PREFIX_DIR% instead of %PREFIX%, so the above patched code failed.
I have tried compiling with the latest source code of httpd, apr, and other libraries (except openssl-3.5.1 -> changed to openssl-1.1.1w and pcre2-10.45 changed to pcre-8.45) using VS BuildTools 2019 and confirmed that it has no issues or errors. So you can safely update to the latest version of these packages/libraries.
Quote: | P/s: I did not update OpenSSL to 3.x because of performance issues. If there is no real need/dependency, I recommend openssl-1.1.1w.
Similarly, with pcre2, there are already big syntax and performance differences between pcre and pcre2, so if you have no real need/dependency (like new/complex regex syntax), I still recommend pcre. Also, pcre is still very well supported with the current version of httpd (2.4.65), it is possible to compile pcre directly without patching. |
|
|
Back to top |
|
|
|
|
|
|