All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/nut: replace NUT_FIX_CONFIGURE
@ 2023-11-04 15:19 Fabrice Fontaine
  2023-11-04 15:19 ` [Buildroot] [PATCH 2/2] package/nut: fix python build Fabrice Fontaine
  2023-11-04 17:40 ` [Buildroot] [PATCH 1/2] package/nut: replace NUT_FIX_CONFIGURE Thomas Petazzoni via buildroot
  0 siblings, 2 replies; 4+ messages in thread
From: Fabrice Fontaine @ 2023-11-04 15:19 UTC (permalink / raw)
  To: buildroot; +Cc: Bernd Kuhls, Yann E . MORIN, Fabrice Fontaine

Replace NUT_FIX_CONFIGURE by an upstreamable patch

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...iler_family.m4-fix-cross-compilation.patch | 55 +++++++++++++++++++
 package/nut/nut.mk                            |  9 +--
 2 files changed, 57 insertions(+), 7 deletions(-)
 create mode 100644 package/nut/0001-m4-nut_compiler_family.m4-fix-cross-compilation.patch

diff --git a/package/nut/0001-m4-nut_compiler_family.m4-fix-cross-compilation.patch b/package/nut/0001-m4-nut_compiler_family.m4-fix-cross-compilation.patch
new file mode 100644
index 0000000000..6356990749
--- /dev/null
+++ b/package/nut/0001-m4-nut_compiler_family.m4-fix-cross-compilation.patch
@@ -0,0 +1,55 @@
+From a743617099ea50fcce333a8a074751434d25b7ac Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Fri, 3 Nov 2023 18:29:29 +0100
+Subject: [PATCH] m4/nut_compiler_family.m4: fix cross-compilation
+
+Do not use isystem with host paths when cross-compiling
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Upstream: https://github.com/networkupstools/nut/pull/2146
+---
+ m4/nut_compiler_family.m4 | 28 +++++++++++++++-------------
+ 1 file changed, 15 insertions(+), 13 deletions(-)
+
+diff --git a/m4/nut_compiler_family.m4 b/m4/nut_compiler_family.m4
+index f47b1ae9..99608bab 100644
+--- a/m4/nut_compiler_family.m4
++++ b/m4/nut_compiler_family.m4
+@@ -178,19 +178,21 @@ dnl # confuse the compiler assumptions - along with its provided headers)...
+ dnl # ideally; in practice however cppunit, net-snmp and some system include
+ dnl # files do cause grief to picky compiler settings (more so from third
+ dnl # party packages shipped via /usr/local/... namespace):
+-    AS_IF([test "x$CLANGCC" = xyes -o "x$GCC" = xyes], [
+-dnl #        CFLAGS="-isystem /usr/include $CFLAGS"
+-        AS_IF([test -d /usr/local/include],
+-            [CFLAGS="-isystem /usr/local/include $CFLAGS"])
+-        AS_IF([test -d /usr/pkg/include],
+-            [CFLAGS="-isystem /usr/pkg/include $CFLAGS"])
+-    ])
+-    AS_IF([test "x$CLANGXX" = xyes -o "x$GXX" = xyes], [
+-dnl #        CXXFLAGS="-isystem /usr/include $CXXFLAGS"
+-        AS_IF([test -d /usr/local/include],
+-            [CXXFLAGS="-isystem /usr/local/include $CXXFLAGS"])
+-        AS_IF([test -d /usr/pkg/include],
+-            [CXXFLAGS="-isystem /usr/pkg/include $CXXFLAGS"])
++    AS_IF([test "x$cross_compiling" != xyes], [
++        AS_IF([test "x$CLANGCC" = xyes -o "x$GCC" = xyes], [
++dnl #            CFLAGS="-isystem /usr/include $CFLAGS"
++            AS_IF([test -d /usr/local/include],
++                [CFLAGS="-isystem /usr/local/include $CFLAGS"])
++            AS_IF([test -d /usr/pkg/include],
++                [CFLAGS="-isystem /usr/pkg/include $CFLAGS"])
++        ])
++        AS_IF([test "x$CLANGXX" = xyes -o "x$GXX" = xyes], [
++dnl #           CXXFLAGS="-isystem /usr/include $CXXFLAGS"
++            AS_IF([test -d /usr/local/include],
++                [CXXFLAGS="-isystem /usr/local/include $CXXFLAGS"])
++            AS_IF([test -d /usr/pkg/include],
++                [CXXFLAGS="-isystem /usr/pkg/include $CXXFLAGS"])
++        ])
+     ])
+ 
+ dnl # Default to avoid noisy warnings on older compilers
+-- 
+2.42.0
+
diff --git a/package/nut/nut.mk b/package/nut/nut.mk
index c376ffb2e2..ba71319f90 100644
--- a/package/nut/nut.mk
+++ b/package/nut/nut.mk
@@ -11,13 +11,8 @@ NUT_LICENSE_FILES = COPYING LICENSE-GPL2 LICENSE-GPL3
 NUT_SELINUX_MODULES = apache nut
 NUT_INSTALL_STAGING = YES
 NUT_DEPENDENCIES = host-pkgconf
-
-# prevent usage of unsafe paths
-define NUT_FIX_CONFIGURE
-	$(SED) 's%CFLAGS="-isystem /usr/local/include%_UNUSED_CFLAGS="-isystem /usr/local/include%' $(@D)/configure
-	$(SED) 's%CXXFLAGS="-isystem /usr/local/include%_UNUSED_CXXFLAGS="-isystem /usr/local/include%' $(@D)/configure
-endef
-NUT_POST_PATCH_HOOKS += NUT_FIX_CONFIGURE
+# We're patching m4/nut_compiler_family.m4
+NUT_AUTORECONF = YES
 
 # Put the PID files in a read-write place (/var/run is a tmpfs)
 # since the default location (/var/state/ups) maybe readonly.
-- 
2.42.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-11-04 17:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-04 15:19 [Buildroot] [PATCH 1/2] package/nut: replace NUT_FIX_CONFIGURE Fabrice Fontaine
2023-11-04 15:19 ` [Buildroot] [PATCH 2/2] package/nut: fix python build Fabrice Fontaine
2023-11-04 17:39   ` Thomas Petazzoni via buildroot
2023-11-04 17:40 ` [Buildroot] [PATCH 1/2] package/nut: replace NUT_FIX_CONFIGURE Thomas Petazzoni via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.