src/osflags: fully fix cross-compilation

Cross-compilation was only partially fixed by
024481c94b
as selinux was still enabled depending on host file existence

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
This commit is contained in:
Fabrice Fontaine 2023-11-02 23:03:15 +01:00
parent b82bc776b3
commit a5d71d0761

View File

@ -20,7 +20,7 @@ link)
;;
Linux)
FLAGS="";
[ -e /usr/include/selinux/selinux.h ] && FLAGS="$FLAGS -lselinux";
"$PKG_CONFIG" --exists libselinux && FLAGS="$FLAGS $($PKG_CONFIG --libs libselinux)";
"$PKG_CONFIG" --exists libsystemd-daemon && FLAGS="$FLAGS $($PKG_CONFIG --libs libsystemd-daemon)";
"$PKG_CONFIG" --exists libsystemd && FLAGS="$FLAGS $($PKG_CONFIG --libs libsystemd)";
echo $FLAGS;
@ -40,7 +40,7 @@ cflags)
;;
Linux)
FLAGS="-D_GNU_SOURCE"
[ -e /usr/include/selinux/selinux.h ] && FLAGS="$FLAGS -DHAVE_SETCON";
"$PKG_CONFIG" --exists libselinux && FLAGS="$FLAGS -DHAVE_SETCON";
"$PKG_CONFIG" --exists libsystemd-daemon && FLAGS="$FLAGS -DHAVE_SYSTEMD";
"$PKG_CONFIG" --exists libsystemd && FLAGS="$FLAGS -DHAVE_SYSTEMD";
echo $FLAGS;