f2fs-tools: Fix cross-build problem caused by AC_CHECK_FILE abuse
authorHelmut Grohne <helmut@subdivi.de>
Tue, 28 Aug 2018 00:29:41 +0000 (20:29 -0400)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 28 Aug 2018 06:59:01 +0000 (23:59 -0700)
f2fs-tools fails to cross build from source, because its upstream
build system wrongly uses AC_CHECK_FILE. The purpose of the macro is
checking for files on the host system. However here it is used to
check whether a .git directory exists, which is a property of the
build place. A simple "test -d" should be used here. After doing so,
f2fs-tools cross builds successfully.

Addresses-Debian-Bug: #896909

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
configure.ac

index 672cab9..70583cd 100644 (file)
@@ -20,14 +20,14 @@ AC_DEFINE([F2FS_MINOR_VERSION], m4_bpatsubst(f2fs_tools_version,
                                [\([0-9]*\).\([0-9]*\)\(\w\|\W\)*], [\2]),
                                [Minor version for f2fs-tools])
 
-AC_CHECK_FILE(.git,
+AS_IF([test -d .git],[
        AC_DEFINE([F2FS_TOOLS_DATE],
                "m4_bpatsubst(f2fs_tools_gitdate,
                [\([0-9-]*\)\(\w\|\W\)*], [\1])",
-               [f2fs-tools date based on Git commits]),
+               [f2fs-tools date based on Git commits])],[
        AC_DEFINE([F2FS_TOOLS_DATE],
                "f2fs_tools_date",
-               [f2fs-tools date based on Source releases]))
+               [f2fs-tools date based on Source releases])])
 
 AC_CONFIG_SRCDIR([config.h.in])
 AC_CONFIG_HEADER([config.h])