]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
selinux-h: Fix compilation errors in Termux on Android.
authorBruno Haible <bruno@clisp.org>
Sat, 24 Jan 2026 06:31:19 +0000 (07:31 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 24 Jan 2026 06:31:35 +0000 (07:31 +0100)
* m4/selinux-selinux-h.m4 (gl_LIBSELINUX): Prefer libandroid-selinux to
libselinux.

ChangeLog
m4/selinux-selinux-h.m4

index e8bc6c3341252ad07785295c80b21b4134ef12f8..9fc176536828d87797476afb33f06786bae9b685 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2026-01-24  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        getaddrinfo: Fix test failure on Solaris 10.
index b3fcd2102e286c83d9d137bfd739ee6e4bcf5bc2..0db23ebe87a12ad11c8f13430decb5a6d7b90efb 100644 (file)
@@ -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