Explicitely check for statfs/statvfs flags member

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@39896 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Riccardo Mottola 2016-06-21 15:43:27 +00:00
parent cfd8e541ce
commit baa5ac40aa
5 changed files with 87 additions and 4 deletions

View file

@ -1,3 +1,10 @@
2016-06-21 Riccardo Mottola <rm@gnu.org>
* Source/NSWorkspace.m
* configure.ac
* configure
Explicitely check for statfs/statvfs flags member.
2016-06-16 Ivan Vucica <ivan@vucica.net>
* ANNOUNCE:

View file

@ -27,7 +27,7 @@
/* Define to 1 if you have the `GifQuantizeBuffer' function. */
#undef HAVE_GIFQUANTIZEBUFFER
/* Have ImageMagick */
/* Don't have ImageMagick */
#undef HAVE_IMAGEMAGICK
/* Define to 1 if you have the <inttypes.h> header file. */
@ -84,6 +84,9 @@
/* Define to 1 if you have the <sndfile.h> header file. */
#undef HAVE_SNDFILE_H
/* Define to 1 if you have the `statvfs' function. */
#undef HAVE_STATVFS
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
@ -96,6 +99,12 @@
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if `f_flags' is a member of `struct statfs'. */
#undef HAVE_STRUCT_STATFS_F_FLAGS
/* Define to 1 if `f_flag' is a member of `struct statvfs'. */
#undef HAVE_STRUCT_STATVFS_F_FLAG
/* Define to 1 if you have the <sys/mntent.h> header file. */
#undef HAVE_SYS_MNTENT_H

View file

@ -1210,7 +1210,7 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
non-standard f_basetype field, which provides the name of the
underlying file system type.
*/
#if (defined (__NetBSD__) && __NetBSD_Version__ >= 300000000) || (defined(__sun__) && defined(__svr4__))
#if (defined (__NetBSD__) && defined (HAVE_STATVFS)) || (defined(__sun__) && defined(__svr4__))
#define statfs statvfs
#define f_flags f_flag
#endif
@ -1228,8 +1228,7 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
*removableFlag = YES;
*writableFlag = 1;
// FIXME TODO maybe we need an explicit configure check for f_flags
#if !defined(__GNU__)
#if defined(HAVE_STRUCT_STATFS_F_FLAGS) || defined(HAVE_STRUCT_STATVFS_F_FLAG)
*writableFlag = (m.f_flags & ST_RDONLY) == 0;
#endif
*unmountableFlag = NO;

49
configure vendored
View file

@ -4036,6 +4036,17 @@ _ACEOF
fi
done
for ac_func in statvfs
do :
ac_fn_c_check_func "$LINENO" "statvfs" "ac_cv_func_statvfs"
if test "x$ac_cv_func_statvfs" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_STATVFS 1
_ACEOF
fi
done
for ac_header in sys/statvfs.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "sys/statvfs.h" "ac_cv_header_sys_statvfs_h" "$ac_includes_default"
@ -4061,6 +4072,44 @@ fi
done
ac_fn_c_check_member "$LINENO" "struct statfs" "f_flags" "ac_cv_member_struct_statfs_f_flags" "
#if defined(HAVE_GETMNTINFO)
#include <sys/param.h>
#include <sys/mount.h>
#endif
#if defined (HAVE_SYS_STATVFS_H)
#include <sys/statvfs.h>
#endif
#if defined (HAVE_SYS_VFS_H)
#include <sys/vfs.h>
#endif
"
if test "x$ac_cv_member_struct_statfs_f_flags" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_STRUCT_STATFS_F_FLAGS 1
_ACEOF
fi
ac_fn_c_check_member "$LINENO" "struct statvfs" "f_flag" "ac_cv_member_struct_statvfs_f_flag" "
#if defined (HAVE_SYS_STATVFS_H)
#include <sys/statvfs.h>
#endif
"
if test "x$ac_cv_member_struct_statvfs_f_flag" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_STRUCT_STATVFS_F_FLAG 1
_ACEOF
fi
#--------------------------------------------------------------------
# Simple way to add a bunch of paths to the flags
#--------------------------------------------------------------------

View file

@ -155,9 +155,28 @@ AC_CHECK_MEMBER(struct mntent.mnt_dir,[AC_DEFINE(MNT_MEMB,mnt_dir,mntent structu
AC_CHECK_MEMBER(struct mntent.mnt_mountp,[AC_DEFINE(MNT_MEMB,mnt_mountp,mntent structure member name)],,[#include <sys/mntent.h>])
AC_FUNC_GETMNTENT
AC_CHECK_FUNCS(getmntinfo)
AC_CHECK_FUNCS(statvfs)
AC_CHECK_HEADERS(sys/statvfs.h)
AC_CHECK_HEADERS(sys/vfs.h)
AC_CHECK_MEMBERS([struct statfs.f_flags],[],[],[
#if defined(HAVE_GETMNTINFO)
#include <sys/param.h>
#include <sys/mount.h>
#endif
#if defined (HAVE_SYS_STATVFS_H)
#include <sys/statvfs.h>
#endif
#if defined (HAVE_SYS_VFS_H)
#include <sys/vfs.h>
#endif
])
AC_CHECK_MEMBERS([struct statvfs.f_flag],[],[],[
#if defined (HAVE_SYS_STATVFS_H)
#include <sys/statvfs.h>
#endif
])
#--------------------------------------------------------------------
# Simple way to add a bunch of paths to the flags
#--------------------------------------------------------------------