summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2012-02-01 18:08:48 +0100
committerJean Delvare <jdelvare@suse.de>2012-02-01 18:08:48 +0100
commit2b47cd327f7d1f7692128ff1fa24a85b92733058 (patch)
tree92698f7e0928fe2fc8d5ad7630f57f0a3539e205 /configure.ac
parentef0e5378ed163dbea21bccec89141344498151c2 (diff)
downloadquilt-2b47cd327f7d1f7692128ff1fa24a85b92733058.tar.gz
BSD compatibility: stat
The stat command on BSD takes different parameters from the GNU one. Let configure find out which variant is available, and use the right parameters. Signed-off-by: Jean Delvare <jdelvare@suse.de>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac23
1 files changed, 23 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 16f9b88..2d1d10a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -146,6 +146,29 @@ Solaris users can use /usr/xpg4/bin/tr.
])
fi
+QUILT_COMPAT_PROG_PATH(STAT, stat)
+
+AC_MSG_CHECKING([whether $STAT -c '%h' works])
+if $STAT -c '%h' /dev/null >/dev/null 2>/dev/null; then
+ AC_MSG_RESULT(yes)
+ STAT_HARDLINK="-c '%h'"
+else
+ AC_MSG_RESULT(no)
+ AC_MSG_CHECKING([whether $STAT -f '%l' works])
+ if $STAT -f '%l' /dev/null >/dev/null 2>/dev/null; then
+ AC_MSG_RESULT(yes)
+ STAT_HARDLINK="-f '%l'"
+ else
+ AC_MSG_RESULT(no)
+ AC_MSG_ERROR([
+Sorry, you have a version of stat which understands neither -c nor -f.
+$PACKAGE_NAME needs it. If you have access to a version of stat which does
+understand -c or -f, you can supply its path with the '--with-stat=' option.
+])
+ fi
+fi
+AC_SUBST(STAT_HARDLINK)
+
QUILT_COMPAT_PROG_PATH(SED, sed)
AC_MSG_CHECKING([whether $SED understands (foo|bar)])