Merge branch 'statvfs'
Fix statvfs() detection in CMake under NetBSD and prefer statvfs() to non-portable statfs() more generally. See #22643.
This commit is contained in:
commit
556868390f
4 changed files with 245 additions and 233 deletions
260
configure
vendored
260
configure
vendored
|
|
@ -35199,109 +35199,7 @@ fi
|
|||
done
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for statfs" >&5
|
||||
$as_echo_n "checking for statfs... " >&6; }
|
||||
if ${wx_cv_func_statfs+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#if defined(__BSD__)
|
||||
#include <sys/param.h>
|
||||
#include <sys/mount.h>
|
||||
#else
|
||||
#include <sys/vfs.h>
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
long l;
|
||||
struct statfs fs;
|
||||
statfs("/", &fs);
|
||||
l = fs.f_bsize;
|
||||
l += fs.f_blocks;
|
||||
l += fs.f_bavail;
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
wx_cv_func_statfs=yes
|
||||
else
|
||||
wx_cv_func_statfs=no
|
||||
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wx_cv_func_statfs" >&5
|
||||
$as_echo "$wx_cv_func_statfs" >&6; }
|
||||
|
||||
if test "$wx_cv_func_statfs" = "yes"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for statfs declaration" >&5
|
||||
$as_echo_n "checking for statfs declaration... " >&6; }
|
||||
if ${wx_cv_func_statfs_decl+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_ext=cpp
|
||||
ac_cpp='$CXXCPP $CPPFLAGS'
|
||||
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
||||
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#if defined(__BSD__)
|
||||
#include <sys/param.h>
|
||||
#include <sys/mount.h>
|
||||
#else
|
||||
#include <sys/vfs.h>
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
struct statfs fs;
|
||||
statfs("", &fs);
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_cxx_try_compile "$LINENO"; then :
|
||||
wx_cv_func_statfs_decl=yes
|
||||
else
|
||||
wx_cv_func_statfs_decl=no
|
||||
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
ac_ext=c
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
|
||||
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wx_cv_func_statfs_decl" >&5
|
||||
$as_echo "$wx_cv_func_statfs_decl" >&6; }
|
||||
|
||||
if test "$wx_cv_func_statfs_decl" = "yes"; then
|
||||
$as_echo "#define HAVE_STATFS_DECL 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
wx_cv_type_statvfs_t="struct statfs"
|
||||
$as_echo "#define HAVE_STATFS 1" >>confdefs.h
|
||||
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for statvfs" >&5
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for statvfs" >&5
|
||||
$as_echo_n "checking for statvfs... " >&6; }
|
||||
if ${wx_cv_func_statvfs+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
|
|
@ -35309,14 +35207,14 @@ else
|
|||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#include <stddef.h>
|
||||
#include <sys/statvfs.h>
|
||||
#include <stddef.h>
|
||||
#include <sys/statvfs.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
statvfs("/", NULL);
|
||||
statvfs("/", NULL);
|
||||
|
||||
;
|
||||
return 0;
|
||||
|
|
@ -35334,8 +35232,8 @@ fi
|
|||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wx_cv_func_statvfs" >&5
|
||||
$as_echo "$wx_cv_func_statvfs" >&6; }
|
||||
|
||||
if test "$wx_cv_func_statvfs" = "yes"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for statvfs argument type" >&5
|
||||
if test "$wx_cv_func_statvfs" = "yes"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for statvfs argument type" >&5
|
||||
$as_echo_n "checking for statvfs argument type... " >&6; }
|
||||
if ${wx_cv_type_statvfs_t+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
|
|
@ -35346,21 +35244,21 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
|||
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
||||
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#include <sys/statvfs.h>
|
||||
#include <sys/statvfs.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
long l;
|
||||
statvfs_t fs;
|
||||
statvfs("/", &fs);
|
||||
l = fs.f_bsize;
|
||||
l += fs.f_blocks;
|
||||
l += fs.f_bavail;
|
||||
long l;
|
||||
statvfs_t fs;
|
||||
statvfs("/", &fs);
|
||||
l = fs.f_bsize;
|
||||
l += fs.f_blocks;
|
||||
l += fs.f_bavail;
|
||||
|
||||
;
|
||||
return 0;
|
||||
|
|
@ -35370,21 +35268,21 @@ if ac_fn_cxx_try_compile "$LINENO"; then :
|
|||
wx_cv_type_statvfs_t=statvfs_t
|
||||
else
|
||||
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#include <sys/statvfs.h>
|
||||
#include <sys/statvfs.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
long l;
|
||||
struct statvfs fs;
|
||||
statvfs("/", &fs);
|
||||
l = fs.f_bsize;
|
||||
l += fs.f_blocks;
|
||||
l += fs.f_bavail;
|
||||
long l;
|
||||
struct statvfs fs;
|
||||
statvfs("/", &fs);
|
||||
l = fs.f_bsize;
|
||||
l += fs.f_blocks;
|
||||
l += fs.f_bavail;
|
||||
|
||||
;
|
||||
return 0;
|
||||
|
|
@ -35401,7 +35299,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
|||
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
ac_ext=c
|
||||
ac_ext=c
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
|
|
@ -35412,12 +35310,116 @@ fi
|
|||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wx_cv_type_statvfs_t" >&5
|
||||
$as_echo "$wx_cv_type_statvfs_t" >&6; }
|
||||
|
||||
if test "$wx_cv_type_statvfs_t" != "unknown"; then
|
||||
$as_echo "#define HAVE_STATVFS 1" >>confdefs.h
|
||||
if test "$wx_cv_type_statvfs_t" != "unknown"; then
|
||||
$as_echo "#define HAVE_STATVFS 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
else
|
||||
wx_cv_type_statvfs_t="unknown"
|
||||
fi
|
||||
|
||||
if test "$wx_cv_type_statvfs_t" = "unknown"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for statfs" >&5
|
||||
$as_echo_n "checking for statfs... " >&6; }
|
||||
if ${wx_cv_func_statfs+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#if defined(__BSD__)
|
||||
#include <sys/param.h>
|
||||
#include <sys/mount.h>
|
||||
#else
|
||||
#include <sys/vfs.h>
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
long l;
|
||||
struct statfs fs;
|
||||
statfs("/", &fs);
|
||||
l = fs.f_bsize;
|
||||
l += fs.f_blocks;
|
||||
l += fs.f_bavail;
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
wx_cv_func_statfs=yes
|
||||
else
|
||||
wx_cv_func_statfs=no
|
||||
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wx_cv_func_statfs" >&5
|
||||
$as_echo "$wx_cv_func_statfs" >&6; }
|
||||
|
||||
if test "$wx_cv_func_statfs" = "yes"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for statfs declaration" >&5
|
||||
$as_echo_n "checking for statfs declaration... " >&6; }
|
||||
if ${wx_cv_func_statfs_decl+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_ext=cpp
|
||||
ac_cpp='$CXXCPP $CPPFLAGS'
|
||||
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
||||
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#if defined(__BSD__)
|
||||
#include <sys/param.h>
|
||||
#include <sys/mount.h>
|
||||
#else
|
||||
#include <sys/vfs.h>
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
struct statfs fs;
|
||||
statfs("", &fs);
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_cxx_try_compile "$LINENO"; then :
|
||||
wx_cv_func_statfs_decl=yes
|
||||
else
|
||||
wx_cv_func_statfs_decl=no
|
||||
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
ac_ext=c
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
|
||||
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $wx_cv_func_statfs_decl" >&5
|
||||
$as_echo "$wx_cv_func_statfs_decl" >&6; }
|
||||
|
||||
if test "$wx_cv_func_statfs_decl" = "yes"; then
|
||||
$as_echo "#define HAVE_STATFS_DECL 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
else
|
||||
wx_cv_type_statvfs_t="unknown"
|
||||
|
||||
wx_cv_type_statvfs_t="struct statfs"
|
||||
$as_echo "#define HAVE_STATFS 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue