Skip to contentSkip to conversation

Add PKG_CHECK_VAR compatibility definition for old autoconf versions

PATCH In review Juliusz Sosinowicz 3 participants 4 messages Mar 18, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add PKG_CHECK_VAR compatibility definition for old autoconf versions

---
 compat.m4 | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
compat.m4 +16 -0
index e54a7203..47650f6d 100644
@@ -64,6 +64,22 @@ ifdef(
 		AC_DEFUN([AC_TYPE_UINT64_T], [])
 	]
 )
+ifdef(
+	[PKG_CHECK_VAR],
+	,
+	[
+		AC_DEFUN([PKG_CHECK_VAR],
+		[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+		AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])
+
+		_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+		AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+		AS_VAR_IF([$1], [""], [$5], [$4])
+		])
+	]
+)
+
 if test -z "${docdir}"; then
 	docdir="\$(datadir)/doc/\$(PACKAGE_NAME)"
 	AC_SUBST([docdir])
Signature · 1 line
2.25.1
#1 lore raw
Quoted 22 lines · Juliusz Sosinowicz
---
  compat.m4 | 16 ++++++++++++++++
  1 file changed, 16 insertions(+)
compat.m4 +9 -0
index e54a7203..47650f6d 100644
@@ -64,6 +64,22 @@ ifdef(
  		AC_DEFUN([AC_TYPE_UINT64_T], [])
  	]
  )
+ifdef(
+	[PKG_CHECK_VAR],
+	,
+	[
+		AC_DEFUN([PKG_CHECK_VAR],
+		[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+		AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])
+
+		_PKG_CONFIG([$1], [variable="][$3]["], [$2])

compat.m4 ifdef( · line 85

Quoted 10 lines
compat.m4 +7 -0
+		AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+		AS_VAR_IF([$1], [""], [$5], [$4])
+		])
+	]
+)
+
  if test -z "${docdir}"; then
  	docdir="\$(datadir)/doc/\$(PACKAGE_NAME)"
  	AC_SUBST([docdir])

I'm not seeing the rationale to why we need this; can you explain that?

The TL;DR version of Chris Beams "How to write a git commit message" [1] is:

git subject        --->>  _What_ this patch is about
git body message   --->>  _Why_  the change is needed
git diff           --->>  _How_  the change is solved

[1] <https://chris.beams.io/posts/git-commit/>

Signature · 4 lines
kind regards,

David Sommerseth
OpenVPN Inc
#2 lore raw

Hi,

Quoted 1 line · David Sommerseth

I'm not seeing the rationale to why we need this; can you explain that?

See my other mail: because the previous configure.ac patch (for WolfSSL support) breaks some platforms. Seems "some m4 bits" are not universally there.

gert

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...
#3 lore raw
Quoted 8 lines · Gert Doering

Hi,

Quoted 1 line · David Sommerseth

I'm not seeing the rationale to why we need this; can you explain that?

See my other mail: because the previous configure.ac patch (for WolfSSL support) breaks some platforms. Seems "some m4 bits" are not universally there.

Right, I missed that context when looking at it ... but that context could still have been in the commit message, for the git history to explain why we needed it ;)

Signature · 4 lines
kind regards,

David Sommerseth
OpenVPN Inc