check for missing statfs() prototype (happens at least under AIX 4)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35288 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
c5035065a8
commit
84ae7ca4f6
42
configure
vendored
42
configure
vendored
@ -32774,17 +32774,13 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
|||||||
ac_status=$?
|
ac_status=$?
|
||||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
(exit $ac_status); }; }; then
|
(exit $ac_status); }; }; then
|
||||||
|
|
||||||
wx_cv_func_statfs=yes
|
wx_cv_func_statfs=yes
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "$as_me: failed program was:" >&5
|
echo "$as_me: failed program was:" >&5
|
||||||
sed 's/^/| /' conftest.$ac_ext >&5
|
sed 's/^/| /' conftest.$ac_ext >&5
|
||||||
|
|
||||||
|
|
||||||
wx_cv_func_statfs=no
|
wx_cv_func_statfs=no
|
||||||
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
|
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||||
|
|
||||||
@ -32793,6 +32789,44 @@ echo "$as_me:$LINENO: result: $wx_cv_func_statfs" >&5
|
|||||||
echo "${ECHO_T}$wx_cv_func_statfs" >&6
|
echo "${ECHO_T}$wx_cv_func_statfs" >&6
|
||||||
|
|
||||||
if test "$wx_cv_func_statfs" = "yes"; then
|
if test "$wx_cv_func_statfs" = "yes"; then
|
||||||
|
|
||||||
|
|
||||||
|
ac_ext=cc
|
||||||
|
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
|
||||||
|
|
||||||
|
echo "$as_me:$LINENO: checking for statfs declaration" >&5
|
||||||
|
echo $ECHO_N "checking for statfs declaration... $ECHO_C" >&6
|
||||||
|
if test "${wx_cv_func_statfs_decl+set}" = set; then
|
||||||
|
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||||
|
else
|
||||||
|
|
||||||
|
#if defined(__BSD__)
|
||||||
|
#include <sys/param.h>
|
||||||
|
#include <sys/mount.h>
|
||||||
|
#else
|
||||||
|
#include <sys/vfs.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
fi
|
||||||
|
echo "$as_me:$LINENO: result: $wx_cv_func_statfs_decl" >&5
|
||||||
|
echo "${ECHO_T}$wx_cv_func_statfs_decl" >&6
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
if test "$wx_cv_func_statfs_decl" = "yes"; then
|
||||||
|
cat >>confdefs.h <<\_ACEOF
|
||||||
|
#define HAVE_STATFS_DECL 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
wx_cv_type_statvfs_t="struct statfs"
|
wx_cv_type_statvfs_t="struct statfs"
|
||||||
cat >>confdefs.h <<\_ACEOF
|
cat >>confdefs.h <<\_ACEOF
|
||||||
#define HAVE_STATFS 1
|
#define HAVE_STATFS 1
|
||||||
|
31
configure.in
31
configure.in
@ -4149,16 +4149,37 @@ AC_CACHE_CHECK(for statfs, wx_cv_func_statfs,
|
|||||||
l += fs.f_blocks;
|
l += fs.f_blocks;
|
||||||
l += fs.f_bavail;
|
l += fs.f_bavail;
|
||||||
],
|
],
|
||||||
[
|
wx_cv_func_statfs=yes,
|
||||||
wx_cv_func_statfs=yes
|
|
||||||
],
|
|
||||||
[
|
|
||||||
wx_cv_func_statfs=no
|
wx_cv_func_statfs=no
|
||||||
]
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if test "$wx_cv_func_statfs" = "yes"; then
|
if test "$wx_cv_func_statfs" = "yes"; then
|
||||||
|
dnl check whether we have its dcelaration too: some systems (AIX 4) lack it
|
||||||
|
AC_LANG_SAVE
|
||||||
|
AC_LANG_CPLUSPLUS
|
||||||
|
AC_CACHE_CHECK(for statfs declaration, wx_cv_func_statfs_decl,
|
||||||
|
[
|
||||||
|
#if defined(__BSD__)
|
||||||
|
#include <sys/param.h>
|
||||||
|
#include <sys/mount.h>
|
||||||
|
#else
|
||||||
|
#include <sys/vfs.h>
|
||||||
|
#endif
|
||||||
|
],
|
||||||
|
[
|
||||||
|
struct statfs fs;
|
||||||
|
statfs("", &fs);
|
||||||
|
],
|
||||||
|
wx_cv_func_statfs_decl=yes,
|
||||||
|
wx_cv_func_statfs_decl=no
|
||||||
|
)
|
||||||
|
AC_LANG_RESTORE
|
||||||
|
|
||||||
|
if test "$wx_cv_func_statfs_decl" = "yes"; then
|
||||||
|
AC_DEFINE(HAVE_STATFS_DECL)
|
||||||
|
fi
|
||||||
|
|
||||||
wx_cv_type_statvfs_t="struct statfs"
|
wx_cv_type_statvfs_t="struct statfs"
|
||||||
AC_DEFINE(HAVE_STATFS)
|
AC_DEFINE(HAVE_STATFS)
|
||||||
else
|
else
|
||||||
|
@ -769,6 +769,9 @@
|
|||||||
/* define if you have statfs function */
|
/* define if you have statfs function */
|
||||||
#undef HAVE_STATFS
|
#undef HAVE_STATFS
|
||||||
|
|
||||||
|
/* define if you have statfs prototype */
|
||||||
|
#undef HAVE_STATFS_DECL
|
||||||
|
|
||||||
/* define if you have statvfs function */
|
/* define if you have statvfs function */
|
||||||
#undef HAVE_STATVFS
|
#undef HAVE_STATVFS
|
||||||
|
|
||||||
|
@ -813,6 +813,9 @@
|
|||||||
/* define if you have statfs function */
|
/* define if you have statfs function */
|
||||||
#undef HAVE_STATFS
|
#undef HAVE_STATFS
|
||||||
|
|
||||||
|
/* define if you have statfs prototype */
|
||||||
|
#undef HAVE_STATFS_DECL
|
||||||
|
|
||||||
/* define if you have statvfs function */
|
/* define if you have statvfs function */
|
||||||
#undef HAVE_STATVFS
|
#undef HAVE_STATVFS
|
||||||
|
|
||||||
|
@ -80,6 +80,11 @@
|
|||||||
#endif // __BSD__/!__BSD__
|
#endif // __BSD__/!__BSD__
|
||||||
|
|
||||||
#define wxStatfs statfs
|
#define wxStatfs statfs
|
||||||
|
|
||||||
|
#ifndef HAVE_STATFS_DECL
|
||||||
|
// some systems lack statfs() prototype in the system headers (AIX 4)
|
||||||
|
extern "C" int statfs(const char *path, struct statfs *buf);
|
||||||
|
#endif
|
||||||
#endif // HAVE_STATFS
|
#endif // HAVE_STATFS
|
||||||
|
|
||||||
#ifdef HAVE_STATVFS
|
#ifdef HAVE_STATVFS
|
||||||
|
Loading…
Reference in New Issue
Block a user