From: "cron2 (Code Review)" Date: Thu, 21 Sep 2023 20:45:17 +0000 In-Reply-To: References: Reply-To: heiko@...515..., openvpn-devel@lists.sourceforge.net, frank@...2641..., lstipakov@...277... Message-ID: <23d936e1b4864f16602ecd0038ef3da4555b5c86-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="FKfGd66cmfg="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: CMake: various small non-functional improvements List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld , d12fk , stipa Cc: openvpn-devel --FKfGd66cmfg= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#2) to the change originally created by= flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/342?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by stipa Change subject: CMake: various small non-functional improvements ...................................................................... CMake: various small non-functional improvements These are based on review comments for the 2.6 backport. But since they apply to the original master implementation as well, I address them in this separate patch. - Add documentation to contrib/cmake/*.py - Fix grammar in README.cmake.md - Update a TODO in CMakeLists.txt to better reflect the status quo - Fix indentation in unit_tests' Makefile.am Change-Id: I4e16767ee221e1aefdd18d13b3411c27d8dd844a Signed-off-by: Frank Lichtenheld Acked-by: Lev Stipakov Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/342 Message-Id: <20230919155635.708557-1-frank@...2641...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27= 043.html Signed-off-by: Gert Doering --- M CMakeLists.txt M README.cmake.md M contrib/cmake/git-version.py M contrib/cmake/parse-version.m4.py M tests/unit_tests/openvpn/Makefile.am 5 files changed, 17 insertions(+), 3 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/42/342/2 diff --git a/CMakeLists.txt b/CMakeLists.txt index 9de6aba..454ef62 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -292,7 +292,7 @@ configure_file(config.h.cmake.in config.h) configure_file(include/openvpn-plugin.h.in openvpn-plugin.h) -# TODO remove later when msvc-config.h is removed and we can always includ= e config.h +# TODO we should remove the need for this, and always include config.h add_definitions(-DHAVE_CONFIG_H) include_directories(${CMAKE_CURRENT_BINARY_DIR}) diff --git a/README.cmake.md b/README.cmake.md index 599d8dc..d181b64 100644 --- a/README.cmake.md +++ b/README.cmake.md @@ -24,7 +24,7 @@ ----------- The following tools are expected to be present on the system, you -can them install with a package manager of your choice (e.g. +can install them with a package manager of your choice (e.g. chocolatey, winget) or manually: * CMake diff --git a/contrib/cmake/git-version.py b/contrib/cmake/git-version.py index c2b4452..4f78ac4 100644 --- a/contrib/cmake/git-version.py +++ b/contrib/cmake/git-version.py @@ -22,6 +22,14 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # +# Usage: ./git-version.py [directory] +# Find a good textual representation of the git commit currently checked o= ut. +# Make that representation available as CONFIGURE_GIT_REVISION in +# /config-version.h. +# It will prefer a tag name if it is checked out exactly, otherwise will u= se +# the branch name. 'none' if no branch is checked out (detached HEAD). +# This is used to enhance the output of openvpn --version with Git informa= tion. + import os import sys import subprocess diff --git a/contrib/cmake/parse-version.m4.py b/contrib/cmake/parse-versio= n.m4.py index d5ff2bd..3dfb31f 100644 --- a/contrib/cmake/parse-version.m4.py +++ b/contrib/cmake/parse-version.m4.py @@ -22,6 +22,12 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # +# Usage: ./parse-version.m4.py m4file [directory] +# Read , extract all lines looking like M4 define(), and translate +# them into CMake style set(). Those are then written out to file +# /version.cmake. +# Intended to be used on top-level version.m4 file. + import os import re import sys diff --git a/tests/unit_tests/openvpn/Makefile.am b/tests/unit_tests/openvp= n/Makefile.am index 6b56f84..ef45b11 100644 --- a/tests/unit_tests/openvpn/Makefile.am +++ b/tests/unit_tests/openvpn/Makefile.am @@ -110,7 +110,7 @@ -Wl,--wrap=3Dparse_line \ -Wl,--wrap=3Drand_bytes tls_crypt_testdriver_SOURCES =3D test_tls_crypt.c mock_msg.c mock_msg.h \ - mock_win32_execve.c \ + mock_win32_execve.c \ $(top_srcdir)/src/openvpn/argv.c \ $(top_srcdir)/src/openvpn/base64.c \ $(top_srcdir)/src/openvpn/buffer.c \ -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/342?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: I4e16767ee221e1aefdd18d13b3411c27d8dd844a Gerrit-Change-Number: 342 Gerrit-PatchSet: 2 Gerrit-Owner: flichtenheld Gerrit-Reviewer: d12fk Gerrit-Reviewer: stipa Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --FKfGd66cmfg= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #2 to the change originally cr= eated by flichtenheld.

View Change

The following approvals got outda= ted and were removed: Code-Review+2 by stipa

CMake: various small non-functional improvements
=
These are based on review comments for the 2.6 backport.
But since t= hey apply to the original master implementation
as well, I address them = in this separate patch.

- Add documentation to contrib/cmake/*.py- Fix grammar in README.cmake.md
- Update a TODO in CMakeLists.txt to b= etter reflect
the status quo
- Fix indentation in unit_tests' M= akefile.am

Change-Id: I4e16767ee221e1aefdd18d13b3411c27d8dd844a
S= igned-off-by: Frank Lichtenheld <frank@...2641...>
Acked-by: Lev S= tipakov <lstipakov@...277...>
Gerrit URL: https://gerrit.openvpn.n= et/c/openvpn/+/342
Message-Id: <20230919155635.708557-1-frank@...2746...= ...>
URL: https://www.mail-archive.com/openvpn-devel@...1483...= e.net/msg27043.html
Signed-off-by: Gert Doering <gert@...1296...><= br>---
M CMakeLists.txt
M README.cmake.md
M contrib/cmake/git-vers= ion.py
M contrib/cmake/parse-version.m4.py
M tests/unit_tests/openvpn= /Makefile.am
5 files changed, 17 insertions(+), 3 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/42/342/2
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9de6= aba..454ef62 100644
--- a/CMakeLists.txt
++= + b/CMakeLists.txt
@@ -292,7 +292,7 @@

configure_file(config.h.cmake.in config.h)
= configure_file(include/openvpn-plugin.h.in openvpn-plugin.h)
-# TODO remove later when msvc-config= .h is removed and we can always include config.h
+# TODO we should remove the need for this, and= always include config.h
add_definitions(-DHAVE_CONFIG_H)<= /span>

include_directories(${CMAKE_CURRENT_BINA= RY_DIR})
diff --git a/README.cmake.md b/README.cmake.md
index 599d8dc..d181b64 100644
--- a/README.cma= ke.md
+++ b/README.cmake.md
@@ -24,7 +24,7 = @@
-----------

The foll= owing tools are expected to be present on the system, you
-can them install with a package manager= of your choice (e.g.
+can install them with a package manager of your choice (e.g.
chocolatey, winget) or manually:


* = CMake
diff --git a/contrib/cmake/git-version.py b/contrib/c= make/git-version.py
index c2b4452..4f78ac4 100644--- a/contrib/cmake/git-version.py
+++ b/contrib/cma= ke/git-version.py
@@ -22,6 +22,14 @@
# 51= Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
= #

+= # Usage: ./git-version.py [directory]
+# Find a good textual representation of the git commit cu= rrently checked out.
= +# Make that representation available as CONFIGURE_GIT_REVISION in+# <directory>/config-v= ersion.h.
+# It will = prefer a tag name if it is checked out exactly, otherwise will use+# the branch name. 'none= ' if no branch is checked out (detached HEAD).
+# This is used to enhance the output of open= vpn --version with Git information.
+
import os
import sys
import subprocess
diff --git a/contrib/cmake/= parse-version.m4.py b/contrib/cmake/parse-version.m4.py
ind= ex d5ff2bd..3dfb31f 100644
--- a/contrib/cmake/parse-versio= n.m4.py
+++ b/contrib/cmake/parse-version.m4.py
<= span>@@ -22,6 +22,12 @@

# 51 Franklin Street, Fifth Floor= , Boston, MA 02110-1301 USA.
#
+# Usage: ./parse-version.m4.p= y m4file [directory]
= +# Read <m4file>, extract all lines looking like M4 define(), and tra= nslate
+# them into C= Make style set(). Those are then written out to file
+# <directory>/version.cmake.=
+# Intended to be used on t= op-level version.m4 file.
+
import os
import re
import sys

diff --git a/tests/unit_tests/openvpn/Makefil= e.am b/tests/unit_tests/openvpn/Makefile.am
index 6b56f84..= ef45b11 100644
--- a/tests/unit_tests/openvpn/Makefile.am
+++ b/tests/unit_tests/openvpn/Makefile.am
@= @ -110,7 +110,7 @@
-Wl,--wrap=3Dparse_line \
-Wl,--wrap=3Drand_bytes

tls_crypt_testdriver_SOURCES= =3D test_tls_crypt.c mock_msg.c mock_msg.h \
- mock_win32_execve.c \
+ mock_win32_execve.c \
$(to= p_srcdir)/src/openvpn/argv.c \
$(top_srcdir)/src/openvpn/= base64.c \
$(top_srcdir)/src/openvpn/buffer.c \

To view, visit change 342. To unsubscribe, or for hel= p writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I4e16767ee221e1aefdd18d13b34= 11c27d8dd844a
Gerrit-Change-Number: 342
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: d12fk <heiko@...515...>=
Gerrit-Reviewer: stipa <lstipakov@...277...= >
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newpatchset
--FKfGd66cmfg=--