From: "cron2 (Code Review)" Date: Thu, 18 Sep 2025 07:01:16 +0000 References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <0406f854772d1debaefb38069b5e611326a60f71-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="vJjndZlRh4A="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: add building of openvpnsrvmsg.dll from eventmsg.mc to autoconf/mingw ... List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --vJjndZlRh4A= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1197?usp=3Demail to review the following change. Change subject: add building of openvpnsrvmsg.dll from eventmsg.mc to autoc= onf/mingw builds ...................................................................... add building of openvpnsrvmsg.dll from eventmsg.mc to autoconf/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 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. See also: https://learn.microsoft.com/en-us/cpp/build/creating-a-resource-only-dll?vi= ew=3Dmsvc-170 Change-Id: I071e8190dac28f429257b8af1c6f9e68f8896bc0 Signed-off-by: Gert Doering --- M configure.ac M src/openvpnserv/Makefile.am 2 files changed, 14 insertions(+), 0 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/97/1197/1 diff --git a/configure.ac b/configure.ac index 7059871..38b14a1 100644 --- a/configure.ac +++ b/configure.ac @@ -441,6 +441,7 @@ AC_DEFINE_UNQUOTED([IPROUTE_PATH], ["$IPROUTE"], [Path to iproute tool]) AC_DEFINE_UNQUOTED([ROUTE_PATH], ["$ROUTE"], [Path to route tool]) AC_DEFINE_UNQUOTED([SYSTEMD_ASK_PASSWORD_PATH], ["$SYSTEMD_ASK_PASSWORD"],= [Path to systemd-ask-password tool]) +AC_CHECK_TOOLS([WINDMC], [windmc mc.exe],[no]) # # man page generation - based on python-docutils diff --git a/src/openvpnserv/Makefile.am b/src/openvpnserv/Makefile.am index ef5f3f3..e66ece9 100644 --- a/src/openvpnserv/Makefile.am +++ b/src/openvpnserv/Makefile.am @@ -28,6 +28,8 @@ openvpnserv_LDADD =3D \ -ladvapi32 -luserenv -liphlpapi -lfwpuclnt -lrpcrt4 \ -lshlwapi -lnetapi32 -lws2_32 -lntdll -lole32 +noinst_DATA =3D \ + MSG00409.bin eventmsg.h eventmsg.rc openvpnservmsg.dll endif openvpnserv_SOURCES =3D \ @@ -37,3 +39,14 @@ validate.c validate.h \ $(top_srcdir)/src/openvpn/wfp_block.c $(top_srcdir)/src/openvpn/wfp_block= .h \ openvpnserv_resources.rc + +openvpnservmsg.dll: eventmsg.o + $(CC) -shared -Wl,--entry=3D0 -nostdlib -nostartfiles -o openvpnservmsg.d= ll eventmsg.o + +eventmsg.o: eventmsg.rc + +BUILT_SOURCES =3D \ + eventmsg.h + +eventmsg.h: eventmsg.mc + $(WINDMC) -U eventmsg.mc -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1197?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I071e8190dac28f429257b8af1c6f9e68f8896bc0 Gerrit-Change-Number: 1197 Gerrit-PatchSet: 1 Gerrit-Owner: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-MessageType: newchange --vJjndZlRh4A= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, plaisthos.

cron2 would like plaisthos and flichtenheld to review t= his change.

V= iew Change

add building of openvpnsrvmsg.dll from eventmsg.mc to autoco=
nf/mingw builds

commit 06919a60ae61 introduces .mc files that need t= o be compiled to
.h and .bin by the windows "mc.exe" tool, and= from there into a new
.dll

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
anyt= hing listed in ...BIN or ...LIB, so decare it as "DATA" and make<= br>the necessary rules explicit.

See also:
https://learn.microsof= t.com/en-us/cpp/build/creating-a-resource-only-dll?view=3Dmsvc-170

C= hange-Id: I071e8190dac28f429257b8af1c6f9e68f8896bc0
Signed-off-by: Gert = Doering <gert@...1296...>
---
M configure.ac
M src/openvpnse= rv/Makefile.am
2 files changed, 14 insertions(+), 0 deletions(-)

=
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/97/1197/1
diff --git a/configure.ac b/configure.ac
index 70598= 71..38b14a1 100644
--- a/configure.ac
+++ b= /configure.ac
@@ -441,6 +441,7 @@
AC_DEFIN= E_UNQUOTED([IPROUTE_PATH], ["$IPROUTE"], [Path to iproute tool])<= /span>
AC_DEFINE_UNQUOTED([ROUTE_PATH], ["$ROUTE"], [Pa= th to route tool])
AC_DEFINE_UNQUOTED([SYSTEMD_ASK_PASSWOR= D_PATH], ["$SYSTEMD_ASK_PASSWORD"], [Path to systemd-ask-password= tool])
+AC_CHECK_TOO= LS([WINDMC], [windmc mc.exe],[no])

#
# man page generation - based on python-docutils
<= span>diff --git a/src/openvpnserv/Makefile.am b/src/openvpnserv/Makefile.am=

index ef5f3f3..e66ece9 100644
--- a/src/op= envpnserv/Makefile.am
+++ b/src/openvpnserv/Makefile.am
@@ -28,6 +28,8 @@
openvpnserv_LDADD =3D \
-ladvapi32 -luserenv -liphlpapi -lfwpuclnt -lrpcrt4 \=
-lshlwapi -lnetapi32 -lws2_32 -lntdll -lole32
+noinst_DATA =3D \
+ MSG00409.bin eventmsg.h eventmsg.rc op= envpnservmsg.dll
endif

= openvpnserv_SOURCES =3D \
@@ -37,3 +39,14 @@
validate.c validate.h \

$(top_srcdir)/src/openvpn/wfp= _block.c $(top_srcdir)/src/openvpn/wfp_block.h \
openvpns= erv_resources.rc
+
+openvpnservmsg.dll: ev= entmsg.o
+ $(CC) -sha= red -Wl,--entry=3D0 -nostdlib -nostartfiles -o openvpnservmsg.dll eventmsg.= o
+
+eventmsg.o: eventmsg.rc
+

+BUILT_SOURCES =3D \
+ eventmsg.h
+
+even= tmsg.h: eventmsg.mc
+= $(WINDMC) -U eventmsg.mc

To view, visi= t change= 1197. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I071e8190dac28f429257b8af1c6= f9e68f8896bc0
Gerrit-Change-Number: 1197
Gerrit-PatchSet: 1
Gerrit-Owner: cron2 <gert@...1296...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-MessageType: newchange
--vJjndZlRh4A=--