diff options
author | Bart Van Assche <bvanassche@acm.org> | 2022-04-21 15:18:10 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2022-04-22 10:44:45 -0700 |
commit | c48335416a09b881d2309b8f88c9b3d1441f4a9c (patch) | |
tree | a836145a47d2310a6449fbf3fedc0d334fd61bee | |
parent | 3e97d07348386abe02c84e3b8c9ed770487a13b4 (diff) | |
download | f2fs-tools-c48335416a09b881d2309b8f88c9b3d1441f4a9c.tar.gz |
configure.ac: Enable cross-compilation
Stop using PKG_CHECK_MODULES() since that macro is not compatible with
cross-compilation.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r-- | README | 1 | ||||
-rw-r--r-- | configure.ac | 47 | ||||
-rw-r--r-- | mkfs/f2fs_format.c | 2 | ||||
-rw-r--r-- | mkfs/f2fs_format_main.c | 4 | ||||
-rw-r--r-- | tools/f2fscrypt.c | 2 |
5 files changed, 24 insertions, 32 deletions
@@ -9,7 +9,6 @@ Before compilation You should install the following packages. - libuuid-devel or uuid-dev - - pkg-config - autoconf - libtool - libselinux1-dev diff --git a/configure.ac b/configure.ac index 0d7872a..4a3afa4 100644 --- a/configure.ac +++ b/configure.ac @@ -53,6 +53,12 @@ AC_PATH_PROG([LDCONFIG], [ldconfig], [$PATH:/sbin]) # Checks for libraries. +AC_CHECK_LIB([blkid], [blkid_probe_all], + [AC_SUBST([libblkid_LIBS], ["-lblkid"]) + AC_DEFINE([HAVE_LIBBLKID], [1], + [Define if you have libblkid]) + ], [], []) + AC_CHECK_LIB([lzo2], [main], [AC_SUBST([liblzo2_LIBS], ["-llzo2"]) AC_DEFINE([HAVE_LIBLZO2], [1], @@ -65,37 +71,22 @@ AC_CHECK_LIB([lz4], [main], [Define if you have liblz4]) ], [], []) -PKG_CHECK_MODULES([libuuid], [uuid]) - -AS_IF([test "x$with_selinux" != "xno"], - [PKG_CHECK_MODULES([libselinux], [libselinux], - [have_selinux=yes], [have_selinux=no])], - [have_selinux=no] -) - -AS_IF([test "x$have_selinux" = "xyes"], - [AC_DEFINE([HAVE_LIBSELINUX], [1], [Use libselinux])], - [AS_IF([test "x$with_selinux" = "xyes"], - [AC_MSG_ERROR([selinux support requested but libselinux not found])] - )] -) - -AS_IF([test "x$with_blkid" != "xno"], - [PKG_CHECK_MODULES([libblkid], [blkid], - [have_blkid=yes], [have_blkid=no])], - [have_blkid=no] -) - -AS_IF([test "x$have_blkid" = "xyes"], - [AC_DEFINE([HAVE_LIBBLKID], [1], [Use blkid])], - [AS_IF([test "x$with_blkid" = "xyes"], - [AC_MSG_ERROR([blkid support requested but libblkid not found])] - )] -) +AC_CHECK_LIB([selinux], [getcon], + [AC_SUBST([libselinux_LIBS], ["-lselinux"]) + AC_DEFINE([HAVE_LIBSELINUX], [1], + [Define if you have libselinux]) + ], [], []) + +AC_CHECK_LIB([uuid], [uuid_clear], + [AC_SUBST([libuuid_LIBS], ["-luuid"]) + AC_DEFINE([HAVE_LIBUUID], [1], + [Define if you have libuuid]) + ], [], []) # Checks for header files. AC_CHECK_HEADERS(m4_flatten([ attr/xattr.h + blkid/blkid.h byteswap.h fcntl.h linux/blkzoned.h @@ -110,6 +101,7 @@ AC_CHECK_HEADERS(m4_flatten([ mach/mach_time.h mntent.h scsi/sg.h + selinux/selinux.h stdlib.h string.h sys/acl.h @@ -120,6 +112,7 @@ AC_CHECK_HEADERS(m4_flatten([ sys/utsname.h sys/xattr.h unistd.h + uuid/uuid.h ])) # Checks for typedefs, structures, and compiler characteristics. diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c index dba0cec..d237d1a 100644 --- a/mkfs/f2fs_format.c +++ b/mkfs/f2fs_format.c @@ -18,7 +18,7 @@ #include <sys/mount.h> #endif #include <time.h> -#include <uuid.h> +#include <uuid/uuid.h> #include "f2fs_fs.h" #include "quota.h" diff --git a/mkfs/f2fs_format_main.c b/mkfs/f2fs_format_main.c index bf78756..797e90a 100644 --- a/mkfs/f2fs_format_main.c +++ b/mkfs/f2fs_format_main.c @@ -19,13 +19,13 @@ #include <sys/mount.h> #endif #include <time.h> -#include <uuid.h> +#include <uuid/uuid.h> #include <errno.h> #include <getopt.h> #include "config.h" #ifdef HAVE_LIBBLKID -#include <blkid.h> +#include <blkid/blkid.h> #endif #include "f2fs_fs.h" diff --git a/tools/f2fscrypt.c b/tools/f2fscrypt.c index d5bc3c5..fe3e0ff 100644 --- a/tools/f2fscrypt.c +++ b/tools/f2fscrypt.c @@ -43,7 +43,7 @@ #ifdef __KERNEL__ #include <linux/fs.h> #endif -#include <uuid.h> +#include <uuid/uuid.h> #if !defined(HAVE_ADD_KEY) || !defined(HAVE_KEYCTL) #include <sys/syscall.h> |