Skip to contentSkip to conversation

Add PKG_CHECK_VAR compatibility definition for old autoconf versions

PATCH In review Juliusz Sosinowicz 4 participants 8 messages Mar 18, 2021 – Mar 19, 2021

lore
Share & tools
lore
#0 lore raw

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

PKG_CHECK_VAR is not available on older versions of autoconf. This patch copies the definition generated by newer versions of autoconf to be used for compatibility with older versions. Tested with automake 1.14.1-2ubuntu1 and autoconf 2.69-6.

---
 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 6 lines · Juliusz Sosinowicz

PKG_CHECK_VAR is not available on older versions of autoconf. This patch copies the definition generated by newer versions of autoconf to be used for compatibility with older versions. Tested with automake 1.14.1-2ubuntu1 and autoconf 2.69-6.

I ended up doing some more investigation here, to better understand where this could fail.

So it seems this is not related to automake/autoconf versions. It is related to pkg-config version, which is the one providing /usr/share/aclocal/pkg.m4 which provides the PKG_CHECK_VAR() macro.

<https://gitlab.freedesktop.org/pkg-config/pkg-config/-/commit/5b463c927b6caeb332bb147572ea82b1650ceb7d>

What surprises me is that this was added to pkg-config 0.28, which was released in 2013-01-24. The latest release, 0.29.2 was released 2017-03-20.

<https://gitlab.freedesktop.org/pkg-config/pkg-config/-/commit/74ceac54ef6f9247c00f08eecd8cca811a3c5934>
<https://gitlab.freedesktop.org/pkg-config/pkg-config/-/tags>

It would be great to figure out if pkg-config is available on those build hosts failing without this change. If it is present, it needs to be checked which version it is.

If this is due to an outdated pkg-config, I'm reluctant to give this patch an ACK. Using properly up-to-date dependency stack should be a reasonable precondition to build OpenVPN. If it is due to unavailable pkg-config, it's a different story.

Regardless, the commit message is incorrect. But that can probably be fixed at commit time.

Signature · 4 lines
kind regards,

David Sommerseth
OpenVPN Inc
#2 lore raw

For reference, the version of pkg-config shipped on my Ubuntu 14 vm is 0.26-1ubuntu4. It looks like the default packages are very outdated.

Juliusz

Quoted 28 lines · David Sommerseth
Quoted 6 lines · Juliusz Sosinowicz

PKG_CHECK_VAR is not available on older versions of autoconf. This patch copies the definition generated by newer versions of autoconf to be used for compatibility with older versions. Tested with automake 1.14.1-2ubuntu1 and autoconf 2.69-6.

I ended up doing some more investigation here, to better understand where this could fail.

So it seems this is not related to automake/autoconf versions.  It is related to pkg-config version, which is the one providing /usr/share/aclocal/pkg.m4 which provides the PKG_CHECK_VAR() macro.

<https://gitlab.freedesktop.org/pkg-config/pkg-config/-/commit/5b463c927b6caeb332bb147572ea82b1650ceb7d>

What surprises me is that this was added to pkg-config 0.28, which was released in 2013-01-24.  The latest release, 0.29.2 was released 2017-03-20.

<https://gitlab.freedesktop.org/pkg-config/pkg-config/-/commit/74ceac54ef6f9247c00f08eecd8cca811a3c5934>

<https://gitlab.freedesktop.org/pkg-config/pkg-config/-/tags>

It would be great to figure out if pkg-config is available on those build hosts failing without this change.  If it is present, it needs to be checked which version it is.

If this is due to an outdated pkg-config, I'm reluctant to give this patch an ACK.  Using properly up-to-date dependency stack should be a reasonable precondition to build OpenVPN.  If it is due to unavailable pkg-config, it's a different story.

Regardless, the commit message is incorrect.  But that can probably be fixed at commit time.

#3 lore raw
Quoted 1 line · Juliusz Sosinowicz

For reference, the version of pkg-config shipped on my Ubuntu 14 vm is 0.26-1ubuntu4. It looks like the default packages are very outdated.

Thanks for checking. You might want to reconsider if you want to support Ubuntu 14 these days; Ubuntu 16.04 LTS is the oldest one supported by Canonical, and after end of April this year only 16.04.4 is supported.

<https://endoflife.software/operating-systems/linux/ubuntu>

Signature · 4 lines
kind regards,

David Sommerseth
OpenVPN Inc
Quoted 29 lines · David Sommerseth
Quoted 28 lines · Juliusz Sosinowicz
Quoted 6 lines

PKG_CHECK_VAR is not available on older versions of autoconf. This patch copies the definition generated by newer versions of autoconf to be used for compatibility with older versions. Tested with automake 1.14.1-2ubuntu1 and autoconf 2.69-6.

I ended up doing some more investigation here, to better understand where this could fail.

So it seems this is not related to automake/autoconf versions.  It is related to pkg-config version, which is the one providing /usr/share/aclocal/pkg.m4 which provides the PKG_CHECK_VAR() macro.

<https://gitlab.freedesktop.org/pkg-config/pkg-config/-/commit/5b463c927b6caeb332bb147572ea82b1650ceb7d>

What surprises me is that this was added to pkg-config 0.28, which was released in 2013-01-24.  The latest release, 0.29.2 was released 2017-03-20.

<https://gitlab.freedesktop.org/pkg-config/pkg-config/-/commit/74ceac54ef6f9247c00f08eecd8cca811a3c5934>

<https://gitlab.freedesktop.org/pkg-config/pkg-config/-/tags>

It would be great to figure out if pkg-config is available on those build hosts failing without this change.  If it is present, it needs to be checked which version it is.

If this is due to an outdated pkg-config, I'm reluctant to give this patch an ACK.  Using properly up-to-date dependency stack should be a reasonable precondition to build OpenVPN.  If it is due to unavailable pkg-config, it's a different story.

Regardless, the commit message is incorrect.  But that can probably be fixed at commit time.

#4 lore raw

Hi,

Quoted 10 lines · David Sommerseth
Quoted 2 lines · Juliusz Sosinowicz

For reference, the version of pkg-config shipped on my Ubuntu 14 vm is 0.26-1ubuntu4. It looks like the default packages are very outdated.

Thanks for checking. You might want to reconsider if you want to support Ubuntu 14 these days; Ubuntu 16.04 LTS is the oldest one supported by Canonical, and after end of April this year only 16.04.4 is supported.

<https://endoflife.software/operating-systems/linux/ubuntu>

Ubuntu 16 and Ubuntu 18 (!) also have this old stuff and fail building, so it seems "updating pkgconfig" is really not their prime priority.

I'll merge with the new commit message.

Thanks for the review.

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]...
#5 lore raw
In reply to David Sommerseth
Quoted 3 lines · David Sommerseth

It would be great to figure out if pkg-config is available on those build hosts failing without this change.  If it is present, it needs to be checked which version it is.

If this is due to an outdated pkg-config, I'm reluctant to give this patch an ACK.  Using properly up-to-date dependency stack should be a reasonable precondition to build OpenVPN.  If it is due to unavailable pkg-config, it's a different story.

So I managed to test this more properly on RHEL-7 and CentOS-7. This major release is forked off from a mixture of Fedora 19 and 20. And pkgconfig got upgraded from 0.27 in F19 to 0.28 in F20; but this was not pulled into RHEL-7 (which CentOS-7 builds on).

This is also the latest pkgconfig version available on RHEL-7, which is the oldest enterprise Linux distro we support. So my concern about not up-to-date dependency stack is no longer valid. We need this change.

If Gert is fine with updating the commit message at commit time, I'm ready to give it my ACK now.

I propose this commit message:
----------------------------------------------------------------------
build: Add support for pkg-config < 0.28

RHEL-7 ships pkgconfig-0.27-1 which is lacking the PKG_CHECK_VAR() m4 macro. This might be the situation on other OS distributions as well. Ship our own macro providing this support when not found on the build host.
----------------------------------------------------------------------

Signature · 4 lines
kind regards,

David Sommerseth
OpenVPN Inc
#6 lore raw
In reply to David Sommerseth

Am 18.03.2021 um 21:52 schrieb David Sommerseth:

Quoted 1 line

If this is due to an outdated pkg-config, I'm reluctant to give this patch an ACK.  Using properly up-to-date dependency stack should be a reasonable precondition to build OpenVPN.  If it is due to unavailable pkg-config, it's a different story.

We support RHEL7, which also has pkgconfig 0.27. So that is also a problem. And even if RHEL7 shipped a version that was recent enough, denying Ubuntu 16 support because an old dependency that can be fixed with this small change like would be quite a hyprocrasy as we supported old RHEL versions for a long time in OpenVPN often needing a lot larger compromises. In fact RHEL7/CentOS 7 is currently in my opinion only reason to still support OpenSSL 1.0.2, which has has reached end of life on 2019-12-31.

Arne

#7 lore raw

[Openvpn-devel] [PATCH applied] Re: build: Add support for pkg-config < 0.28 for old autoconf versions

In reply to Juliusz Sosinowicz

Your patch has been applied to the master branch.

I have amended the commit message to point out what David found out, that this is related to pkg-config version and not autoconf itself. The patch itself is unchanged.

I have thrown this branch towards all our buildbots first, and everything builds again (well, it builds syntactically correct "configure" scripts, that then fail at "missing lz4", but that's not your fault). THANKS!

commit 60c18b45c04f4c86241d9f6e4dc422c5c07405a1

Author: Juliusz Sosinowicz
Date:   Thu Mar 18 19:12:58 2021 +0100
     build: Add support for pkg-config < 0.28 for old autoconf versions

     Signed-off-by: Juliusz Sosinowicz <[email protected]...>
     Acked-by: David Sommerseth <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg21708.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering