From fe762f82eac67c9af699c90e0eeeb07a1ba67dfd Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 24 Jan 2026 07:31:19 +0100 Subject: [PATCH] selinux-h: Fix compilation errors in Termux on Android. * m4/selinux-selinux-h.m4 (gl_LIBSELINUX): Prefer libandroid-selinux to libselinux. --- ChangeLog | 6 ++++++ m4/selinux-selinux-h.m4 | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e8bc6c3341..9fc1765368 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2026-01-24 Bruno Haible + + selinux-h: Fix compilation errors in Termux on Android. + * m4/selinux-selinux-h.m4 (gl_LIBSELINUX): Prefer libandroid-selinux to + libselinux. + 2026-01-23 Bruno Haible getaddrinfo: Fix test failure on Solaris 10. diff --git a/m4/selinux-selinux-h.m4 b/m4/selinux-selinux-h.m4 index b3fcd2102e..0db23ebe87 100644 --- a/m4/selinux-selinux-h.m4 +++ b/m4/selinux-selinux-h.m4 @@ -1,5 +1,5 @@ # selinux-selinux-h.m4 -# serial 10 -*- Autoconf -*- +# serial 11 -*- Autoconf -*- dnl Copyright (C) 2006-2007, 2009-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -79,7 +79,9 @@ AC_DEFUN([gl_LIBSELINUX], LIB_SELINUX= if test "$with_selinux" != no; then gl_saved_LIBS=$LIBS - AC_SEARCH_LIBS([setfilecon], [selinux], + dnl On Android, in Termux, prefer libandroid-selinux.so, because it + dnl defines many more API functions than /system/lib/libselinux.so. + AC_SEARCH_LIBS([setfilecon], [android-selinux selinux], [test "$ac_cv_search_setfilecon" = "none required" || LIB_SELINUX=$ac_cv_search_setfilecon]) LIBS=$gl_saved_LIBS -- 2.47.3