From 39e795031ce54cf3b0b2ec8eb7bbf6429e267c30 Mon Sep 17 00:00:00 2001 From: Sanel Zukan Date: Mon, 26 Jan 2009 13:41:28 +0000 Subject: [PATCH] Added checks for statfs() and stat64() functions. Added removal of 'config.h.in~' in autogen.sh --- autogen.sh | 1 + configure.in | 3 +++ m4/stat64.m4 | 33 +++++++++++++++++++++++++++++++++ m4/statfs.m4 | 30 ++++++++++++++++++++++++++++++ 4 files changed, 67 insertions(+) create mode 100644 m4/stat64.m4 create mode 100644 m4/statfs.m4 diff --git a/autogen.sh b/autogen.sh index 7261ac1..e7488cc 100755 --- a/autogen.sh +++ b/autogen.sh @@ -19,6 +19,7 @@ EOF if aclocal -I m4 && autoheader && autoconf; then #dump_config "Jamconfig.in" + rm -f "config.h.in~" echo "" echo "Now run ./configure [OPTIONS]" diff --git a/configure.in b/configure.in index 3ab31f5..f0c0546 100644 --- a/configure.in +++ b/configure.in @@ -152,6 +152,9 @@ if test "$have_libxpm" = "yes"; then FLTK_LIBS_NOIMAGES="$FLTK_LIBS_NOIMAGES $LIBXPM_LIBS" fi +EDE_CHECK_STATFS +EDE_CHECK_STAT64 + EDE_INIT_JAM AC_SUBST(EDE_VERSION) diff --git a/m4/stat64.m4 b/m4/stat64.m4 new file mode 100644 index 0000000..96775c3 --- /dev/null +++ b/m4/stat64.m4 @@ -0,0 +1,33 @@ +dnl +dnl $Id$ +dnl +dnl Part of edelib. +dnl Copyright (c) 2009 EDE Authors. +dnl +dnl This program is licenced under terms of the +dnl GNU General Public Licence version 2 or newer. +dnl See COPYING for details. + +AC_DEFUN([EDE_CHECK_STAT64], [ + AC_MSG_CHECKING([for stat64]) + + AC_LANG_SAVE + AC_LANG_C + AC_TRY_COMPILE([ + /* C++ already defines this, but C does not and 'struct stat64' will not be seen */ + #define _LARGEFILE64_SOURCE 1 + #include + ],[ + + struct stat64 s; + stat64("/", &s); + ],[have_stat64=yes],[have_stat64=no]) + AC_LANG_RESTORE + + if eval "test $have_stat64 = yes"; then + AC_DEFINE(HAVE_STAT64, 1, [Define to 1 if you have stat64]) + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi +]) diff --git a/m4/statfs.m4 b/m4/statfs.m4 new file mode 100644 index 0000000..f033849 --- /dev/null +++ b/m4/statfs.m4 @@ -0,0 +1,30 @@ +dnl +dnl $Id$ +dnl +dnl Part of edelib. +dnl Copyright (c) 2009 EDE Authors. +dnl +dnl This program is licenced under terms of the +dnl GNU General Public Licence version 2 or newer. +dnl See COPYING for details. + +AC_DEFUN([EDE_CHECK_STATFS], [ + AC_MSG_CHECKING([for statfs]) + + AC_LANG_SAVE + AC_LANG_C + AC_TRY_COMPILE([ + #include + ],[ + struct statfs s; + statfs("/", &s); + ],[have_statfs=yes],[have_statfs=no]) + AC_LANG_RESTORE + + if eval "test $have_statfs = yes"; then + AC_DEFINE(HAVE_STATFS, 1, [Define to 1 if you have statfs]) + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi +])