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 |
Author |
|
tangent Moderator
Joined: 16 Aug 2020 Posts: 370 Location: UK
|
Posted: Fri 06 Sep '24 20:10 Post subject: |
|
|
Build dependency updates to match Steffen's latest HTTPD 2.4.62 release changes, including other package updates:
APR (1.7.5)
CURL (8.9.1)
LIBXML2 (2.13.3)
NGHTTP2 (1.63.0)
OPENSSL (3.1.7)
Note, the trunk fix patch r1919860 mentioned in the Apache 2.4.62 Changelog has not been applied. Should you wish to, Eric Coverner's patch to mod_rewrite.c (merge r1919860 from trunk), can be downloaded (see https://github.com/apache/httpd/pull/473/files), and applied to the Apache httpd source using a Windows version of the GNU patch utility.
Note concerning CURL 8.9.1 and idn2
CURL 8.9.1 has an updated CMakeLists.txt configuration that uses pkg-config (if available) to search for idn2 library support.
It turns out one is included with Strawberry Perl, but unfortunately that finds static libary libidn2.a in the Perl distribution, which is no use here. So for now the build batch file has been updated to explicitly exclude CURL support for idn2.
Other than that, there are no changes to the batch file build logic from before.
@ranemstsage: Thanks for your post, and reference to building with git sources directly. This was something I seriously considered when first putting this guide together, but decided the need to be able to build off-line was greater. Maybe you'd care to post your GIT build variant to the HowTo section? |
|
Back to top |
|
ranemstsage
Joined: 04 Sep 2024 Posts: 3 Location: Lennon, MI, United States
|
Posted: Wed 11 Sep '24 5:24 Post subject: |
|
|
as soon as i get it fully ironed out. I have been running into some slight issues. I am trying to build it for SVN and redmine. and now it doesn't want to start with mod_dav  |
|
Back to top |
|
tangent Moderator
Joined: 16 Aug 2020 Posts: 370 Location: UK
|
Posted: Wed 13 Nov '24 18:56 Post subject: |
|
|
Build dependency updates for various support packages:
CURL (8.11.0)
EXPAT (2.6.4)
LIBXML2 (2.13.5)
NGHTTP2 (1.64.0)
Also patch HTTPD mod_rewrite.c to apply Eric Coverner's trunk fix patch r1919860 as mentioned in the Apache Lounge 2.4.62 Changelog.
Finally, report result of the mklink command when creating APR related symbolic links, in case it fails. Previously, any output of this command was redirected to null, this problem being highlighted in post https://www.apachelounge.com/viewtopic.php?t=9271 |
|
Back to top |
|
tangent Moderator
Joined: 16 Aug 2020 Posts: 370 Location: UK
|
Posted: Fri 24 Jan '25 15:37 Post subject: |
|
|
Build dependency updates to match Steffen's latest HTTPD 2.4.63 release changes:
CURL (8.11.1)
HTTPD (2.4.63)
OPENSSL (3.4.0)
Other than release version details, there are no changes to the batch file build logic from before.
Build commentary updated to note that since October 2024, Microsoft has suspended availability of their Windows 11 virtual machine images at https://developer.microsoft.com/en-us/windows/downloads/virtual-machines |
|
Back to top |
|
tanquang
Joined: 21 Mar 2020 Posts: 64 Location: Vietnam
|
Posted: Tue 25 Feb '25 20:36 Post subject: |
|
|
With cURL 8.12.1, if the LibPSL library is not found and the Code: | -DCURL_USE_LIBPSL=OFF | flag is not used when compiling with cmake, an error will be returned. |
|
Back to top |
|
tangent Moderator
Joined: 16 Aug 2020 Posts: 370 Location: UK
|
Posted: Tue 25 Feb '25 21:59 Post subject: |
|
|
Thanks for the update concerning libpsl with CURL.
I generally don't scan the build log file for warnings across all the packages, but can see there was a warning returned for this during the CURL 8.11.1 build, viz:
Code: | -- Could NOT find Libpsl (missing: LIBPSL_INCLUDE_DIR LIBPSL_LIBRARY)
CMake Warning at CMakeLists.txt:1162 (message):
libpsl is enabled, but not found.
|
So it would seem they've changed the CMakeLists.txt file logic for release 8.12.1 to make this an error.
Since CURL is not the prime target of this HOWTO, rather than try to add logic to build LIBPSL, during the next update I'll revise the build script CMake options for CURL to disable looking for LIBPSL.
I can see LIBPSL does mention building with Visual Studio (NMake), but it also requires Python, ICU libraries, etc. Hence the decision to stick with core packages, the primary requirement being to include those needed to match the binary builds released by the Apache Lounge. |
|
Back to top |
|
tanquang
Joined: 21 Mar 2020 Posts: 64 Location: Vietnam
|
Posted: Wed 26 Feb '25 13:03 Post subject: |
|
|
tangent wrote: | Thanks for the update concerning libpsl with CURL.
I generally don't scan the build log file for warnings across all the packages, but can see there was a warning returned for this during the CURL 8.11.1 build, viz:
Code: | -- Could NOT find Libpsl (missing: LIBPSL_INCLUDE_DIR LIBPSL_LIBRARY)
CMake Warning at CMakeLists.txt:1162 (message):
libpsl is enabled, but not found.
|
So it would seem they've changed the CMakeLists.txt file logic for release 8.12.1 to make this an error.
Since CURL is not the prime target of this HOWTO, rather than try to add logic to build LIBPSL, during the next update I'll revise the build script CMake options for CURL to disable looking for LIBPSL.
I can see LIBPSL does mention building with Visual Studio (NMake), but it also requires Python, ICU libraries, etc. Hence the decision to stick with core packages, the primary requirement being to include those needed to match the binary builds released by the Apache Lounge. |
I created an issue related to the libpsl library on the cURL repository: libpsl should not be marked REQUIRED in CMakeLists.txt
As explained by cURL members, libpsl is needed for secure cookie handling, but compiling it is currently quite complicated and conflicts with some other libraries when compiling Apache so temporarily use -DCURL_USE_LIBPSL=OFF to ignore it until it supports MSVC and cmake or there is another build with less conflicts.
In addition to libpsl, two libraries, Zstandard (zstd) and libssh2, are also required when building cURL. These two libraries will not return an error when not found like libpsl (since it is not marked as REQUIRED in CMakeLists.txt) and these two libraries support building with cmake.
I tried compiling these two libraries and was successful in just 4 / 6 lines of command:
Code: | *******************
** LibSSH2 Build **
*******************
CD /D C:\httpd\srclib\libssh2-1.11.1
CMAKE -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=\Apache -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=ON
NMAKE && NMAKE INSTALL
*********************
** Zstandard Build **
*********************
CD /D C:\httpd\srclib\zstd-1.5.7\build\cmake
CMAKE -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=\Apache -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON
NMAKE && NMAKE INSTALL
... cURL build |
So you might consider adding them in the next release, before compiling cURL. |
|
Back to top |
|
tanquang
Joined: 21 Mar 2020 Posts: 64 Location: Vietnam
|
Posted: Wed 26 Feb '25 13:15 Post subject: |
|
|
There is a small note with your OpenSSL build code. OpenSSL uses the (case-sensitive) argument --release (default) or --debug for release/debug builds.
tangent wrote: |
Code: | @echo off
...
set OPENSSL_CONFIGURE_OPTS=--prefix=%PREFIX% --libdir=lib --openssldir=%PREFIX%\conf --with-zlib-include=%PREFIX%\include shared zlib-dynamic enable-camellia no-idea no-mdc2
...
|
|
So if you don't specify an argument, it will always build a release build by default. |
|
Back to top |
|
admin Site Admin

Joined: 15 Oct 2005 Posts: 701
|
Posted: Thu 27 Feb '25 10:32 Post subject: |
|
|
Yes, the policy at Apache Lounge is that we ship dependencies only with for HTTP needed, so no libpsl, python. icu. |
|
Back to top |
|
tanquang
Joined: 21 Mar 2020 Posts: 64 Location: Vietnam
|
Posted: Fri 28 Feb '25 13:38 Post subject: |
|
|
admin wrote: | Yes, the policy at Apache Lounge is that we ship dependencies only with for HTTP needed, so no libpsl, python. icu. |
Yes, especially with python, I once made the mistake of installing python before compiling the dependencies and Apache and then had a headache trying to figure out how to fix dozens of errors that appeared afterwards. In the end the quickest solution was to uninstall python and everything was back to normal! |
|
Back to top |
|
tangent Moderator
Joined: 16 Aug 2020 Posts: 370 Location: UK
|
Posted: Sat 01 Mar '25 21:27 Post subject: |
|
|
Build dependency change to regress OpenSSL from 3.4 to 3.3 series, coupled to several support package updates.
CURL (8.12.1)
LIBXML2 (2.13.6)
OPENSSL (3.3.3)
PCRE2 (10.45)
Extend CURL build options to disable using libpsl and libssh2 libraries, plus add BUILD_TYPE option support to OpenSSL. Thanks to @tanquang for these details. |
|
Back to top |
|
tanquang
Joined: 21 Mar 2020 Posts: 64 Location: Vietnam
|
Posted: Sun 02 Mar '25 10:46 Post subject: |
|
|
VS 2022 only supports Windows 10 and above, according to my testing, it is not necessary to use VS 2022. With old operating systems such as Windows 8.1, Windows 7,... The last supported version is VS 2019. I am using Windows 7, installing VS 2019 Enterprise, with only 2 individual components "MSVC v142 - VS 2019 C++ x64/x86 build tools (Latest)" and "Windows Universal CRT SDK" to be able to compile Apache successfully.
P/s: There are some differences in the dependencies I use:
1. Using ActivePerl instead of Strawberry Perl: Note, I use ActivePerl 5.28.1 Build 2801 (64-bit) instead of the latest version on the homepage, it is currently quite "hard" to download and the last time I tried to build Apache using ActivePerl AFTER 5.28.1 Build 2801 I used it gave an error.
2. I use PCRE instead of PCRE 2.
3. I still use OpenSSL 1.1 instead of OpenSSL 3: At least until OpenSSL 3 performance is equal or better than OpenSSL 1.1.
I haven't tested with VS 2017 but it probably won't be a problem either. |
|
Back to top |
|
tangent Moderator
Joined: 16 Aug 2020 Posts: 370 Location: UK
|
Posted: Sun 02 Mar '25 13:16 Post subject: |
|
|
Useful details to know, for those wishing to build on Windows 7.
As mentioned above, this HOWTO attempts to track the binary packages released by Apache Lounge, as per the download page, and those builds are currently based on VS 2022 aka VS17. Similarly it tracks the dependencies detailed in the Changelog.
When I first started on this HOWTO, I was also using ActiveState Perl, but encountered a few issues not to mention their move to a commerical pricing model. On recommendation, I switched to Strawberry Perl and have never looked back. It just works. |
|
Back to top |
|
tanquang
Joined: 21 Mar 2020 Posts: 64 Location: Vietnam
|
Posted: Mon 03 Mar '25 15:08 Post subject: |
|
|
tangent wrote: | When I first started on this HOWTO, I was also using ActiveState Perl, but encountered a few issues not to mention their move to a commerical pricing model. On recommendation, I switched to Strawberry Perl and have never looked back. It just works. |
The version of ActiveState Perl (22 MB) that I use is approximately 10 times smaller than Strawberry Perl (196.4 MB), I have not tried Strawberry Perl so I don't know if it is any different from ActiveState Perl. But it is true that ActiveState Perl has moved to a commercial model, using it for development is probably fine, but using it for commercial purposes may cause problems. |
|
Back to top |
|
|
|
|
|
|