In ./configure check if umount support --fake and --no-canonicalize
authorMiklos Szeredi <mszeredi@suse.cz>
Thu, 2 Jun 2011 14:16:39 +0000 (16:16 +0200)
committerMiklos Szeredi <mszeredi@suse.cz>
Thu, 2 Jun 2011 14:16:39 +0000 (16:16 +0200)
options and warn othewise

configure.in

index 0e41cca64e9ccb597c08dc7b9d2820aeff979e8b..aab304bda066378e6578a9ccce2960e7eac8b4f8 100644 (file)
@@ -97,5 +97,27 @@ AM_CONDITIONAL(LINUX, test "$arch" = linux)
 AM_CONDITIONAL(NETBSD, test "$arch" = netbsd)
 AM_CONDITIONAL(BSD, test "$arch" = bsd)
 
+util_linux_ok=yes
+if test "$arch" = linux -a "$cross_compiling" != "yes"; then
+       AC_MSG_CHECKING([if umount supports --fake --no-canonicalize])
+       # exit code of umount is 1 if option is unrecognised, 2 otherwise
+       umount --fake --no-canonicalize > /dev/null 2>&1
+       if test $? != 1; then
+               AC_MSG_RESULT([yes])
+       else
+               firstline=`umount --fake --no-canonicalize 2>&1 | head -1`
+               AC_MSG_RESULT([$firstline])
+               util_linux_ok=no
+       fi
+fi
+
 AC_CONFIG_FILES([fuse.pc Makefile lib/Makefile util/Makefile example/Makefile include/Makefile])
 AC_OUTPUT
+
+if test "$util_linux_ok" = no; then
+       AC_MSG_WARN([
+******************************************************************
+* Please install util-linux version 2.18 or later which supports *
+* --fake and --no-canonicalize options in mount and umount       *
+******************************************************************])
+fi