linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Bart Van Assche <bvanassche@acm.org>,
	linux-f2fs-devel@lists.sourceforge.net
Subject: [f2fs-dev] [PATCH 05/31] configure.ac: Enable cross-compilation
Date: Thu, 21 Apr 2022 15:18:10 -0700	[thread overview]
Message-ID: <20220421221836.3935616-6-bvanassche@acm.org> (raw)
In-Reply-To: <20220421221836.3935616-1-bvanassche@acm.org>

Stop using PKG_CHECK_MODULES() since that macro is not compatible with
cross-compilation.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 README                  |  1 -
 configure.ac            | 47 ++++++++++++++++++-----------------------
 mkfs/f2fs_format.c      |  2 +-
 mkfs/f2fs_format_main.c |  4 ++--
 tools/f2fscrypt.c       |  2 +-
 5 files changed, 24 insertions(+), 32 deletions(-)

diff --git a/README b/README
index afe334fc6170..c9b0c1f6f721 100644
--- a/README
+++ b/README
@@ -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 0d7872abde19..4a3afa4853eb 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 dba0cec61e60..d237d1a8c12e 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 bf78756ed374..797e90a948f5 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 d5bc3c5ff50b..fe3e0ff3c1a9 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>


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

  parent reply	other threads:[~2022-04-21 22:19 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21 22:18 [f2fs-dev] [PATCH 00/31] Make f2fs-tools easier to maintain Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 01/31] configure.ac: Stop using obsolete macros Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 02/31] configure.ac: Remove two prototype tests Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 03/31] configure.ac: Enable the automake -Wall option Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 04/31] configure.ac: Sort header file names alphabetically Bart Van Assche
2022-04-21 22:18 ` Bart Van Assche [this message]
2022-04-21 22:18 ` [f2fs-dev] [PATCH 06/31] Switch from the u_int to the uint types Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 07/31] Change the ANDROID_WINDOWS_HOST macro into _WIN32 Bart Van Assche
2022-04-22 17:53   ` Jaegeuk Kim
2022-04-21 22:18 ` [f2fs-dev] [PATCH 08/31] ci: Build f2fstools upon push and pull requests Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 09/31] Change one array member into a flexible array member Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 10/31] Verify structure sizes at compile time Bart Van Assche
2022-06-10  2:05   ` Peter Collingbourne via Linux-f2fs-devel
2022-06-10 17:12     ` Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 11/31] Suppress a compiler warning Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 12/31] f2fs_fs.h: Use standard fixed width integer types Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 13/31] Remove unnecessary __attribute__((packed)) annotations Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 14/31] Move the be32_to_cpu() definition Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 15/31] Include <stddef.h> instead of defining offsetof() Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 16/31] Use %zu to format size_t Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 17/31] Fix the MinGW build Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 18/31] configure.ac: Detect the sparse/sparse.h header Bart Van Assche
2022-04-22 19:01   ` Jaegeuk Kim
2022-04-21 22:18 ` [f2fs-dev] [PATCH 19/31] configure.ac: Detect selinux/android.h Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 20/31] mkfs/f2fs_format.c: Suppress a compiler warning Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 21/31] fsck: Remove a superfluous include directive Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 22/31] tools/f2fscrypt.c: Fix build without uuid/uuid.h header file Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 23/31] fsck/main.c: Suppress a compiler warning Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 24/31] Change #ifdef _WIN32 checks into #ifdef HAVE_.* Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 25/31] fsck/segment.c: Remove dead code Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 26/31] tools/f2fs_io: Fix the type of 'ret' Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 27/31] Annotate switch/case fallthrough Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 28/31] Suppress a compiler warning about integer truncation Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 29/31] Support cross-compiliation for PowerPC Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 30/31] Fix PowerPC format string warnings Bart Van Assche
2022-04-21 22:18 ` [f2fs-dev] [PATCH 31/31] ci: Enable -Wall, -Wextra and -Werror Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220421221836.3935616-6-bvanassche@acm.org \
    --to=bvanassche@acm.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).