diff options
| author | Khem Raj <khem.raj@oss.qualcomm.com> | 2026-03-22 10:54:25 -0700 |
|---|---|---|
| committer | Khem Raj <khem.raj@oss.qualcomm.com> | 2026-03-22 11:25:47 -0700 |
| commit | ad29ef3d49b45c4b4eb8cd0dc7ee85587acf6147 (patch) | |
| tree | 4fcbd027855a9d7080d5c8f8bb3bcc08584b1519 | |
| parent | 0103bd665ffec4fa63cd94e7be98307f279f42f7 (diff) | |
| download | meta-openembedded-ad29ef3d49b45c4b4eb8cd0dc7ee85587acf6147.tar.gz | |
netcf: Stick to shell implementation of gnulib-tool
Fix build with newer autotools and gnulib
Newer gnulib use python implementation by default if it
finds py3 on the system. However, netcf is old package
and its not expecting python implementation, therefore
make the shell implementation be used.
REALLOC_N is gone in latest gnulib so house a local
macro
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
3 files changed, 91 insertions, 17 deletions
diff --git a/meta-networking/recipes-support/netcf/netcf/0001-Adopt-to-new-gnulib-read_file-fread_file-signature.patch b/meta-networking/recipes-support/netcf/netcf/0001-Adopt-to-new-gnulib-read_file-fread_file-signature.patch index b188248fff..83fdfded52 100644 --- a/meta-networking/recipes-support/netcf/netcf/0001-Adopt-to-new-gnulib-read_file-fread_file-signature.patch +++ b/meta-networking/recipes-support/netcf/netcf/0001-Adopt-to-new-gnulib-read_file-fread_file-signature.patch | |||
| @@ -17,11 +17,9 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> | |||
| 17 | src/ncftransform.c | 2 +- | 17 | src/ncftransform.c | 2 +- |
| 18 | 4 files changed, 5 insertions(+), 5 deletions(-) | 18 | 4 files changed, 5 insertions(+), 5 deletions(-) |
| 19 | 19 | ||
| 20 | diff --git a/src/dutil_linux.c b/src/dutil_linux.c | ||
| 21 | index 742153a..eb72eb2 100644 | ||
| 22 | --- a/src/dutil_linux.c | 20 | --- a/src/dutil_linux.c |
| 23 | +++ b/src/dutil_linux.c | 21 | +++ b/src/dutil_linux.c |
| 24 | @@ -1113,7 +1113,7 @@ static void add_link_info(struct netcf *ncf, | 22 | @@ -1113,7 +1113,7 @@ static void add_link_info(struct netcf * |
| 25 | 23 | ||
| 26 | xasprintf(&path, "/sys/class/net/%s/operstate", ifname); | 24 | xasprintf(&path, "/sys/class/net/%s/operstate", ifname); |
| 27 | ERR_NOMEM(!path, ncf); | 25 | ERR_NOMEM(!path, ncf); |
| @@ -30,7 +28,7 @@ index 742153a..eb72eb2 100644 | |||
| 30 | if (!state) { | 28 | if (!state) { |
| 31 | /* missing operstate is *not* an error. It could be due to an | 29 | /* missing operstate is *not* an error. It could be due to an |
| 32 | * alias interface, which has no entry in /sys/class/net at | 30 | * alias interface, which has no entry in /sys/class/net at |
| 33 | @@ -1132,7 +1132,7 @@ static void add_link_info(struct netcf *ncf, | 31 | @@ -1132,7 +1132,7 @@ static void add_link_info(struct netcf * |
| 34 | FREE(path); | 32 | FREE(path); |
| 35 | xasprintf(&path, "/sys/class/net/%s/speed", ifname); | 33 | xasprintf(&path, "/sys/class/net/%s/speed", ifname); |
| 36 | ERR_NOMEM(path == NULL, ncf); | 34 | ERR_NOMEM(path == NULL, ncf); |
| @@ -39,11 +37,9 @@ index 742153a..eb72eb2 100644 | |||
| 39 | if (!speed && errno == EINVAL) { | 37 | if (!speed && errno == EINVAL) { |
| 40 | /* attempts to read $ifname/speed result in EINVAL if the | 38 | /* attempts to read $ifname/speed result in EINVAL if the |
| 41 | * interface is ifconfiged down (which isn't exactly the | 39 | * interface is ifconfiged down (which isn't exactly the |
| 42 | diff --git a/src/dutil_posix.c b/src/dutil_posix.c | ||
| 43 | index 1313514..b9884f0 100644 | ||
| 44 | --- a/src/dutil_posix.c | 40 | --- a/src/dutil_posix.c |
| 45 | +++ b/src/dutil_posix.c | 41 | +++ b/src/dutil_posix.c |
| 46 | @@ -211,7 +211,7 @@ int run_program(struct netcf *ncf, const char *const *argv, char **output) | 42 | @@ -211,7 +211,7 @@ int run_program(struct netcf *ncf, const |
| 47 | "Failed to create file stream for output while executing '%s': %s", | 43 | "Failed to create file stream for output while executing '%s': %s", |
| 48 | argv_str, errbuf); | 44 | argv_str, errbuf); |
| 49 | 45 | ||
| @@ -52,11 +48,9 @@ index 1313514..b9884f0 100644 | |||
| 52 | ERR_THROW_STRERROR(*output == NULL, ncf, EEXEC, | 48 | ERR_THROW_STRERROR(*output == NULL, ncf, EEXEC, |
| 53 | "Error while reading output from execution of '%s': %s", | 49 | "Error while reading output from execution of '%s': %s", |
| 54 | argv_str, errbuf); | 50 | argv_str, errbuf); |
| 55 | diff --git a/src/ncftool.c b/src/ncftool.c | ||
| 56 | index f1b5642..c878cb0 100644 | ||
| 57 | --- a/src/ncftool.c | 51 | --- a/src/ncftool.c |
| 58 | +++ b/src/ncftool.c | 52 | +++ b/src/ncftool.c |
| 59 | @@ -351,7 +351,7 @@ static int cmd_define(const struct command *cmd) { | 53 | @@ -351,7 +351,7 @@ static int cmd_define(const struct comma |
| 60 | struct netcf_if *nif = NULL; | 54 | struct netcf_if *nif = NULL; |
| 61 | int result = CMD_RES_ERR; | 55 | int result = CMD_RES_ERR; |
| 62 | 56 | ||
| @@ -65,8 +59,6 @@ index f1b5642..c878cb0 100644 | |||
| 65 | if (xml == NULL) { | 59 | if (xml == NULL) { |
| 66 | fprintf(stderr, "Failed to read %s\n", fname); | 60 | fprintf(stderr, "Failed to read %s\n", fname); |
| 67 | goto done; | 61 | goto done; |
| 68 | diff --git a/src/ncftransform.c b/src/ncftransform.c | ||
| 69 | index fbabfc3..4c9a56d 100644 | ||
| 70 | --- a/src/ncftransform.c | 62 | --- a/src/ncftransform.c |
| 71 | +++ b/src/ncftransform.c | 63 | +++ b/src/ncftransform.c |
| 72 | @@ -54,7 +54,7 @@ int main(int argc, char **argv) { | 64 | @@ -54,7 +54,7 @@ int main(int argc, char **argv) { |
| @@ -78,6 +70,25 @@ index fbabfc3..4c9a56d 100644 | |||
| 78 | if (in_xml == NULL) | 70 | if (in_xml == NULL) |
| 79 | die("Failed to read %s\n", argv[2]); | 71 | die("Failed to read %s\n", argv[2]); |
| 80 | 72 | ||
| 81 | -- | 73 | --- a/src/internal.h |
| 82 | 2.44.0 | 74 | +++ b/src/internal.h |
| 83 | 75 | @@ -30,6 +30,7 @@ | |
| 76 | |||
| 77 | #include <string.h> | ||
| 78 | #include <stdarg.h> | ||
| 79 | +#include <stdlib.h> | ||
| 80 | |||
| 81 | #include <libxslt/transform.h> | ||
| 82 | #include <libxml/relaxng.h> | ||
| 83 | @@ -85,6 +86,11 @@ | ||
| 84 | #define ATTRIBUTE_NOINLINE | ||
| 85 | #endif /* __GNUC__ */ | ||
| 86 | |||
| 87 | +#ifndef REALLOC_N | ||
| 88 | +# define REALLOC_N(ptr, count) \ | ||
| 89 | + (((ptr) = realloc((ptr), sizeof(*(ptr)) * (count))) == NULL ? -1 : 0) | ||
| 90 | +#endif | ||
| 91 | + | ||
| 92 | /* This needs ATTRIBUTE_RETURN_CHECK */ | ||
| 93 | #include "ref.h" | ||
| 94 | |||
diff --git a/meta-networking/recipes-support/netcf/netcf/0001-netcf-fix-bootstrap-with-newer-gnulib-automake.patch b/meta-networking/recipes-support/netcf/netcf/0001-netcf-fix-bootstrap-with-newer-gnulib-automake.patch new file mode 100644 index 0000000000..62daeff812 --- /dev/null +++ b/meta-networking/recipes-support/netcf/netcf/0001-netcf-fix-bootstrap-with-newer-gnulib-automake.patch | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | From dded6e3321e304f50922e61c553d4e4eb0f80fd0 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <khem.raj@oss.qualcomm.com> | ||
| 3 | Date: Sun, 22 Mar 2026 11:05:34 -0700 | ||
| 4 | Subject: [PATCH] netcf: fix bootstrap with newer gnulib/automake | ||
| 5 | |||
| 6 | Upstream netcf is old enough that bootstrap/autoreconf now trips over: | ||
| 7 | - gnulib-tool.py wrapper expectations in newer gnulib | ||
| 8 | - stricter automake handling of AM_CFLAGS += from generated gnulib.mk | ||
| 9 | - subdir source warnings | ||
| 10 | - deprecated INCLUDES usage | ||
| 11 | |||
| 12 | Upstream-Status: Pending | ||
| 13 | Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com> | ||
| 14 | --- | ||
| 15 | configure.ac | 2 +- | ||
| 16 | gnulib/lib/Makefile.am | 2 +- | ||
| 17 | gnulib/tests/Makefile.am | 2 ++ | ||
| 18 | tests/Makefile.am | 2 +- | ||
| 19 | 4 files changed, 5 insertions(+), 3 deletions(-) | ||
| 20 | |||
| 21 | --- a/configure.ac | ||
| 22 | +++ b/configure.ac | ||
| 23 | @@ -3,7 +3,7 @@ AC_CONFIG_SRCDIR([src/netcf.c]) | ||
| 24 | AC_CONFIG_AUX_DIR([build-aux]) | ||
| 25 | AC_CONFIG_MACRO_DIR([gnulib/m4]) | ||
| 26 | AC_CONFIG_HEADERS([config.h]) | ||
| 27 | -AM_INIT_AUTOMAKE([-Wno-portability 1.11 color-tests parallel-tests]) | ||
| 28 | +AM_INIT_AUTOMAKE([-Wno-portability 1.11 subdir-objects color-tests parallel-tests]) | ||
| 29 | AM_SILENT_RULES([yes]) # make --enable-silent-rules the default. | ||
| 30 | AC_CANONICAL_HOST | ||
| 31 | |||
| 32 | --- a/gnulib/lib/Makefile.am | ||
| 33 | +++ b/gnulib/lib/Makefile.am | ||
| 34 | @@ -13,4 +13,4 @@ CLEANFILES= | ||
| 35 | |||
| 36 | include gnulib.mk | ||
| 37 | |||
| 38 | -INCLUDES = $(GETTEXT_CPPFLAGS) | ||
| 39 | +AM_CPPFLAGS = $(GETTEXT_CPPFLAGS) | ||
| 40 | --- a/gnulib/tests/Makefile.am | ||
| 41 | +++ b/gnulib/tests/Makefile.am | ||
| 42 | @@ -3,6 +3,6 @@ | ||
| 43 | ## Copyright (C) 2011 Red Hat, Inc. | ||
| 44 | ## See COPYING.LIB for the License of this software | ||
| 45 | |||
| 46 | -include gnulib.mk | ||
| 47 | +AM_CFLAGS = | ||
| 48 | |||
| 49 | -INCLUDES = $(GETTEXT_CPPFLAGS) | ||
| 50 | +include gnulib.mk | ||
| 51 | --- a/tests/Makefile.am | ||
| 52 | +++ b/tests/Makefile.am | ||
| 53 | @@ -14,7 +14,7 @@ TESTS_ENVIRONMENT = \ | ||
| 54 | abs_top_builddir='$(abs_top_builddir)' \ | ||
| 55 | abs_top_srcdir='$(abs_top_srcdir)' | ||
| 56 | |||
| 57 | -INCLUDES = -I$(top_srcdir)/src | ||
| 58 | +AM_CPPFLAGS = -I$(top_srcdir)/src | ||
| 59 | |||
| 60 | TESTS= | ||
| 61 | check_PROGRAMS= | ||
diff --git a/meta-networking/recipes-support/netcf/netcf_0.2.8.bb b/meta-networking/recipes-support/netcf/netcf_0.2.8.bb index 4170e9fab0..d1f9e29d3a 100644 --- a/meta-networking/recipes-support/netcf/netcf_0.2.8.bb +++ b/meta-networking/recipes-support/netcf/netcf_0.2.8.bb | |||
| @@ -10,6 +10,7 @@ SRCREV = "2c5d4255857531bc09d91dcd02e86545f29004d4" | |||
| 10 | PV .= "+git" | 10 | PV .= "+git" |
| 11 | 11 | ||
| 12 | SRC_URI = "git://pagure.io/netcf.git;protocol=https;branch=master \ | 12 | SRC_URI = "git://pagure.io/netcf.git;protocol=https;branch=master \ |
| 13 | file://0001-netcf-fix-bootstrap-with-newer-gnulib-automake.patch \ | ||
| 13 | file://0001-Adopt-to-new-gnulib-read_file-fread_file-signature.patch" | 14 | file://0001-Adopt-to-new-gnulib-read_file-fread_file-signature.patch" |
| 14 | 15 | ||
| 15 | UPSTREAM_CHECK_GITTAGREGEX = "release-(?P<pver>(\d+(\.\d+)+))" | 16 | UPSTREAM_CHECK_GITTAGREGEX = "release-(?P<pver>(\d+(\.\d+)+))" |
| @@ -27,6 +28,7 @@ PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" | |||
| 27 | PACKAGECONFIG[systemd] = "--with-sysinit=systemd,--with-sysinit=initscripts," | 28 | PACKAGECONFIG[systemd] = "--with-sysinit=systemd,--with-sysinit=initscripts," |
| 28 | 29 | ||
| 29 | do_configure:prepend() { | 30 | do_configure:prepend() { |
| 31 | export GNULIB_TOOL_IMPL=sh | ||
| 30 | currdir=`pwd` | 32 | currdir=`pwd` |
| 31 | cd ${S} | 33 | cd ${S} |
| 32 | 34 | ||
| @@ -50,11 +52,11 @@ do_install:append() { | |||
| 50 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | 52 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
| 51 | install -d ${D}${systemd_unitdir}/system | 53 | install -d ${D}${systemd_unitdir}/system |
| 52 | if [ -d "${D}${libdir}/systemd/system" ]; then | 54 | if [ -d "${D}${libdir}/systemd/system" ]; then |
| 53 | if [ "${systemd_unitdir}" != "${libdir}/systemd" ] ; then | 55 | if [ "${systemd_unitdir}" != "${libdir}/systemd" ] ; then |
| 54 | mv ${D}${libdir}/systemd/system/* ${D}${systemd_unitdir}/system/ | 56 | mv ${D}${libdir}/systemd/system/* ${D}${systemd_unitdir}/system/ |
| 55 | rm -rf ${D}${libdir}/systemd/ | 57 | rm -rf ${D}${libdir}/systemd/ |
| 56 | fi | 58 | fi |
| 57 | elif [ "${systemd_unitdir}" != "${nonarch_libdir}/systemd" ] ; then | 59 | elif [ "${systemd_unitdir}" != "${nonarch_libdir}/systemd" ] ; then |
| 58 | mv ${D}${nonarch_libdir}/systemd/system/* ${D}${systemd_unitdir}/system/ | 60 | mv ${D}${nonarch_libdir}/systemd/system/* ${D}${systemd_unitdir}/system/ |
| 59 | rm -rf ${D}${nonarch_libdir}/systemd/ | 61 | rm -rf ${D}${nonarch_libdir}/systemd/ |
| 60 | fi | 62 | fi |
