0001-src-osflags-fully-fix-cross-compilation.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From a5d71d076168f8ad1e7dd30b35f1569f180f429c Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Thu, 2 Nov 2023 23:03:15 +0100
  4. Subject: [PATCH] src/osflags: fully fix cross-compilation
  5. Cross-compilation was only partially fixed by
  6. https://github.com/yarrick/iodine/commit/024481c94b97ef37981621cdc38f8b20f8919418
  7. as selinux was still enabled depending on host file existence
  8. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  9. Upstream: https://github.com/yarrick/iodine/pull/93
  10. ---
  11. src/osflags | 4 ++--
  12. 1 file changed, 2 insertions(+), 2 deletions(-)
  13. diff --git a/src/osflags b/src/osflags
  14. index 9a437bd..39ca5fa 100755
  15. --- a/src/osflags
  16. +++ b/src/osflags
  17. @@ -20,7 +20,7 @@ link)
  18. ;;
  19. Linux)
  20. FLAGS="";
  21. - [ -e /usr/include/selinux/selinux.h ] && FLAGS="$FLAGS -lselinux";
  22. + "$PKG_CONFIG" --exists libselinux && FLAGS="$FLAGS $($PKG_CONFIG --libs libselinux)";
  23. "$PKG_CONFIG" --exists libsystemd-daemon && FLAGS="$FLAGS $($PKG_CONFIG --libs libsystemd-daemon)";
  24. "$PKG_CONFIG" --exists libsystemd && FLAGS="$FLAGS $($PKG_CONFIG --libs libsystemd)";
  25. echo $FLAGS;
  26. @@ -40,7 +40,7 @@ cflags)
  27. ;;
  28. Linux)
  29. FLAGS="-D_GNU_SOURCE"
  30. - [ -e /usr/include/selinux/selinux.h ] && FLAGS="$FLAGS -DHAVE_SETCON";
  31. + "$PKG_CONFIG" --exists libselinux && FLAGS="$FLAGS -DHAVE_SETCON";
  32. "$PKG_CONFIG" --exists libsystemd-daemon && FLAGS="$FLAGS -DHAVE_SYSTEMD";
  33. "$PKG_CONFIG" --exists libsystemd && FLAGS="$FLAGS -DHAVE_SYSTEMD";
  34. echo $FLAGS;
  35. --
  36. 2.42.0