Strict C99 compilers do not support implicit function declarations or
implicit ints, so something like the patch below is needed.
Thanks,
Florian
diff --git a/configure.ac b/configure.ac
index 4f68e98a..b5c7a582 100644
--- a/configure.ac
+++ b/configure.ac
@@ -173,6 +173,9 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include
#include
#include
+#if HAVE_UNISTD_H
+# include
+#endif
int main(void)
{
@@ -197,7 +200,7 @@ int main(void)
}
wait();
unlink(tpl);
- exit(WEXITSTATUS(status));
+ return WEXITSTATUS(status);
}
]])],[rsync_cv_HAVE_BROKEN_LARGEFILE=yes],[rsync_cv_HAVE_BROKEN_LARGEFILE=no],[rsync_cv_HAVE_BROKEN_LARGEFILE=cross])])
if test x"$rsync_cv_HAVE_BROKEN_LARGEFILE" != x"yes"; then
@@ -366,7 +369,7 @@ int main(void)
{
dev_t dev = makedev(0, 5, 7);
if (major(dev) != 5 || minor(dev) != 7)
- exit(1);
+ return 1;
return 0;
}
]])],[rsync_cv_MAKEDEV_TAKES_3_ARGS=yes],[rsync_cv_MAKEDEV_TAKES_3_ARGS=no],[rsync_cv_MAKEDEV_TAKES_3_ARGS=no])])
@@ -647,6 +650,7 @@ AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
AC_CACHE_CHECK([for SYS_fallocate],rsync_cv_have_sys_fallocate,[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include
+#include
#include ]], [[syscall(SYS_fallocate, 0, 0, (loff_t)0,
(loff_t)0);]])],[rsync_cv_have_sys_fallocate=yes],[rsync_cv_have_sys_fallocate=no])])
if test x"$rsync_cv_have_sys_fallocate" = x"yes"; then
AC_DEFINE(HAVE_SYS_FALLOCATE, 1, [Define to 1 if you have the
SYS_fallocate syscall number])
@@ -703,7 +707,7 @@ AC_CACHE_CHECK([whether chown() modifies
symlinks],rsync_cv_chown_modifies_symli
#endif
#include
#include
-main() {
+int main() {
char const *dangling_symlink = "conftest.dangle";
unlink(dangling_symlink);
if (symlink("conftest.no-such", dangling_symlink) < 0) abort();
@@ -722,7 +726,7 @@ AC_CACHE_CHECK([whether link() can hard-link
symlinks],rsync_cv_can_hardlink_sym
#include
#include
#define FILENAME "conftest.dangle"
-main() {
+int main() {
unlink(FILENAME);
if (symlink("conftest.no-such", FILENAME) < 0) abort();
unlink(FILENAME "2");
@@ -738,10 +742,13 @@ AC_CACHE_CHECK([whether link() can hard-link special
files],rsync_cv_can_hardlin
#if HAVE_UNISTD_H
# include
#endif
+#ifdef HAVE_SYS_STAT_H
+# include
+#endif
#include
#include
#define FILENAME "conftest.fifi"
-main() {
+int main() {
unlink(FILENAME);
if (mkfifo(FILENAME, 0777) < 0) abort();
unlink(FILENAME "2");
@@ -757,9 +764,9 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include
#include
-main() {
+int main() {
int fd[2];
- exit((socketpair(AF_UNIX, SOCK_STREAM, 0, fd) != -1) ? 0 : 1);
+ return (socketpair(AF_UNIX, SOCK_STREAM, 0, fd) != -1) ? 0 : 1;
}]])],[rsync_cv_HAVE_SOCKETPAIR=yes],[rsync_cv_HAVE_SOCKETPAIR=no],[rsync_cv_HAVE_SOCKETPAIR=cross])])
if test x"$rsync_cv_HAVE_SOCKETPAIR" = x"yes"; then
AC_DEFINE(HAVE_SOCKETPAIR, 1, [Define to 1 if you have the "socketpair"
function])
@@ -824,7 +831,7 @@ fi
AC_CACHE_CHECK([for broken readdir],rsync_cv_HAVE_BROKEN_READDIR,[
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include
#include
-main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
+int main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
di->d_name[0] == 0) exit(0); exit(1);}
]])],[rsync_cv_HAVE_BROKEN_READDIR=yes],[rsync_cv_HAVE_BROKEN_READDIR=no],[rsync_cv_HAVE_BROKEN_READDIR=cross])])
if test x"$rsync_cv_HAVE_BROKEN_READDIR" = x"yes"; then
@@ -833,14 +840,14 @@ fi
AC_CACHE_CHECK([for utimbuf],rsync_cv_HAVE_STRUCT_UTIMBUF,[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include
-#include ]], [[struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime =
1;
exit(utime("foo.c",));]])],[rsync_cv_HAVE_STRUCT_UTIMBUF=yes],[rsync_cv_HAVE_STRUCT_UTIMBUF=no])])
+#include ]], [[struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime =
1;
utime("foo.c",);]])],[rsync_cv_HAVE_STRUCT_UTIMBUF=yes],[rsync_cv_HAVE_STRUCT_UTIMBUF=no])])
if test x"$rsync_cv_HAVE_STRUCT_UTIMBUF" = x"yes"; then
AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1, [Define to 1 if you have the "struct
utimbuf" type])
fi
AC_CACHE_CHECK([if gettimeofday takes tz
argument],rsync_cv_HAVE_GETTIMEOFDAY_TZ,[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include
-#include ]], [[struct timeval tv; exit(gettimeofday(,
NULL));]])],[rsync_cv_HAVE_GETTIMEOFDAY_TZ=yes],[rsync_cv_HAVE_GETTIMEOFDAY_TZ=no])])
+#include ]], [[struct timeval tv; return gettimeofday(,
NULL);]])],[rsync_cv_HAVE_GETTIMEOFDAY_TZ=yes],[rsync_cv_HAVE_GETTIMEOFDAY_TZ=no])])
if test x"$rsync_cv_HAVE_GETTIMEOFDAY_TZ" != x"no"; then
AC_DEFINE(HAVE_GETTIMEOFDAY_TZ, 1, [Define to 1 if gettimeofday() takes a
time-zone arg])
fi
@@ -849,6 +856,9 @@ AC_CACHE_CHECK([for C99
vsnprintf],rsync_cv_HAVE_C99_VSNPRINTF,[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include
#include
+#include
+#include