]> git.ipfire.org Git - thirdparty/openvpn.git/commit
fix building of openvpnsrvmsg.dll from eventmsg.mc in mingw builds
authorGert Doering <gert@greenie.muc.de>
Fri, 19 Sep 2025 11:24:19 +0000 (13:24 +0200)
committerGert Doering <gert@greenie.muc.de>
Fri, 19 Sep 2025 11:57:41 +0000 (13:57 +0200)
commit9d89e750d3e07b401e042b5456dec5d1187e346f
tree9a15267e550789670ff172e01f92f08a8fe2b9ff
parent7f6d228f8d9426358e359f8c3278250414fd6618
fix building of openvpnsrvmsg.dll from eventmsg.mc in mingw builds

commit 06919a60ae61 introduces .mc files that need to be compiled to
.h and .bin by the windows "mc.exe" tool, and from there into a new
.dll.  This worked for MSVC builds, did nothing for cmake/mingw builds,
and broke compilation on autoconf/mingw builds.

This patch consists of two parts:

1. add building of openvpnsrvmsg.dll to autoconf/mingw builds

   Add logic to configure.ac to find the "windmc" binary in the linux or
   mingw variants, add rules to src/openvpnserv/Makefile.am so make knows
   what to do.

   Libtool is getting in the way when "openvpnsrvmsg.dll" is created as
   anything listed in ...BIN or ...LIB, so decare it as "DATA" and make
   the necessary rules explicit.

2. fix building of openvpnsrvmsg.dll on cmake/mingw builds

   Fix "find_program()" invocation to avoid using "midnight commander"
   binary (mc) on Linux (called "windmc" there).

   Change from "-Wl,--noentry" to linker invocation that works.

See also:
https://learn.microsoft.com/en-us/cpp/build/creating-a-resource-only-dll?view=msvc-170

Change-Id: I071e8190dac28f429257b8af1c6f9e68f8896bc0
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1197
Message-Id: <20250919112424.24728-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg33083.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit 744a2bd556833cf5e65d737e1bcffd2cb89a6d2f)
configure.ac
src/openvpnserv/CMakeLists.txt
src/openvpnserv/Makefile.am