aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2022-04-21 15:18:24 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2022-04-22 12:42:50 -0700
commitef011a49f3c640c59c7e21c3816d01c039711c58 (patch)
tree8398430162ca53dbe93a763232326b7a2ea0ac5c
parent2e59ab8fa6519e1169631189bd50810cb6b49426 (diff)
downloadf2fs-tools-ef011a49f3c640c59c7e21c3816d01c039711c58.tar.gz
configure.ac: Detect selinux/android.h
The selinux/android.h header file is available in Android but not in the Android NDK. Hence this patch that detects presence of that header file at configure time. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--configure.ac1
-rw-r--r--fsck/sload.c4
-rw-r--r--include/android_config.h1
3 files changed, 4 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 317030d..fc094b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -108,6 +108,7 @@ AC_CHECK_HEADERS(m4_flatten([
mntent.h
pthread_time.h
scsi/sg.h
+ selinux/android.h
selinux/selinux.h
sparse/sparse.h
stdlib.h
diff --git a/fsck/sload.c b/fsck/sload.c
index 475ea6d..00c3403 100644
--- a/fsck/sload.c
+++ b/fsck/sload.c
@@ -31,7 +31,7 @@ typedef void (*fs_config_f)(const char *path, int dir,
#ifndef _WIN32
static fs_config_f fs_config_func = NULL;
-#ifdef WITH_ANDROID
+#ifdef HAVE_SELINUX_ANDROID_H
#include <selinux/android.h>
#include <private/android_filesystem_config.h>
#include <private/canned_fs_config.h>
@@ -324,7 +324,7 @@ static int configure_files(void)
#endif
skip:
#endif
-#ifdef WITH_ANDROID
+#ifdef HAVE_SELINUX_ANDROID_H
/* Load the FS config */
if (c.fs_config_file) {
int ret = load_canned_fs_config(c.fs_config_file);
diff --git a/include/android_config.h b/include/android_config.h
index 3e62fe4..865e408 100644
--- a/include/android_config.h
+++ b/include/android_config.h
@@ -28,6 +28,7 @@
#define HAVE_LLSEEK 1
#define HAVE_LSEEK64 1
#define HAVE_MEMSET 1
+#define HAVE_SELINUX_ANDROID_H 1
#define HAVE_SETMNTENT 1
#define HAVE_SPARSE_SPARSE_H 1