s3:build: fix build on AIX - only test for splice on linux
[metze/samba/wip.git] / source3 / configure.in
index 0de44f384fb8978f0ec70dddeefedfa636b39f2a..87707a2f7f7c9580f508c85d736da3a4ef285fba 100644 (file)
@@ -1395,7 +1395,7 @@ if test x"$samba_cv_stat_hires" = x"yes" ; then
            [whether struct stat has sub-second timestamps])
 fi
 
-AC_CACHE_CHECK([whether struct stat has sub-second timestamps without struct timespec], samba_cv_stat_hires_notimespec,
+AC_CACHE_CHECK([whether struct stat has sub-second timestamps without struct timespec suffixed nsec], samba_cv_stat_hires_notimespec,
     [
        AC_TRY_COMPILE(
            [
@@ -1431,7 +1431,47 @@ if test x"$samba_cv_stat_hires_notimespec" = x"yes" ; then
     AC_DEFINE(HAVE_STAT_ST_ATIMENSEC, 1, [whether struct stat contains st_atimensec])
     AC_DEFINE(HAVE_STAT_ST_CTIMENSEC, 1, [whether struct stat contains st_ctimensec])
     AC_DEFINE(HAVE_STAT_HIRES_TIMESTAMPS, 1,
-           [whether struct stat has sub-second timestamps without struct timespec])
+           [whether struct stat has sub-second timestamps without struct timespec suffixed nsec])
+fi
+
+dnl AIX stype sub-second timestamps:
+AC_CACHE_CHECK([whether struct stat has sub-second timestamps without struct timespec suffixed _n], samba_cv_stat_hires_notimespec_n,
+    [
+       AC_TRY_COMPILE(
+           [
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+           ],
+           [
+               struct timespec t;
+               struct stat s = {0};
+               t.tv_sec = s.st_mtime;
+               t.tv_nsec = s.st_mtime_n;
+               t.tv_sec = s.st_ctime;
+               t.tv_nsec = s.st_ctime_n;
+               t.tv_sec = s.st_atime;
+               t.tv_nsec = s.st_atime_n;
+           ],
+           samba_cv_stat_hires_notimespec_n=yes, samba_cv_stat_hires_notimespec_n=no)
+    ])
+
+if test x"$samba_cv_stat_hires_notimespec_n" = x"yes" ; then
+    AC_DEFINE(HAVE_STAT_ST_MTIME_N, 1, [whether struct stat contains st_mtime_n])
+    AC_DEFINE(HAVE_STAT_ST_ATIME_N, 1, [whether struct stat contains st_atime_n])
+    AC_DEFINE(HAVE_STAT_ST_CTIME_N, 1, [whether struct stat contains st_ctime_n])
+    AC_DEFINE(HAVE_STAT_HIRES_TIMESTAMPS, 1,
+           [whether struct stat has sub-second timestamps without struct timespec suffixed _n])
 fi
 
 AC_CACHE_CHECK([whether struct stat has st_birthtimespec], samba_cv_stat_st_birthtimespec,
@@ -1457,7 +1497,7 @@ AC_CACHE_CHECK([whether struct stat has st_birthtimespec], samba_cv_stat_st_birt
                struct stat s = {0};
                t = s.st_birthtimespec;
            ],
-           samba_cv_stat_st_birthtimespec=yes, samba_cv_stat_birthtimespec=no)
+           samba_cv_stat_st_birthtimespec=yes, samba_cv_stat_st_birthtimespec=no)
     ])
 
 if test x"$samba_cv_stat_st_birthtimespec" = x"yes" ; then
@@ -1487,7 +1527,7 @@ AC_CACHE_CHECK([whether struct stat has st_birthtimensec], samba_cv_stat_st_birt
                struct stat s = {0};
                t.tv_nsec = s.st_birthtimensec;
            ],
-           samba_cv_stat_st_birthtimensec=yes, samba_cv_stat_birthtimensec=no)
+           samba_cv_stat_st_birthtimensec=yes, samba_cv_stat_st_birthtimensec=no)
     ])
 
 if test x"$samba_cv_stat_st_birthtimensec" = x"yes" ; then
@@ -1517,7 +1557,7 @@ AC_CACHE_CHECK([whether struct stat has st_birthtime], samba_cv_stat_st_birthtim
                struct stat s = {0};
                t = s.st_birthtime;
            ],
-           samba_cv_stat_st_birthtime=yes, samba_cv_stat_birthtime=no)
+           samba_cv_stat_st_birthtime=yes, samba_cv_stat_st_birthtime=no)
     ])
 
 if test x"$samba_cv_stat_st_birthtime" = x"yes" ; then
@@ -5835,6 +5875,8 @@ fi
 ############################################
 # See if we have the Linux splice syscall.
 
+case "$host_os" in
+*linux*)
 AC_CACHE_CHECK([for Linux splice],
                 samba_cv_HAVE_LINUX_SPLICE,[
     AC_TRY_LINK([
@@ -5845,6 +5887,11 @@ AC_CACHE_CHECK([for Linux splice],
     [long ret = splice(0,0,1,0,400,0);],
     samba_cv_HAVE_LINUX_SPLICE=yes,
     samba_cv_HAVE_LINUX_SPLICE=no)])
+;;
+*)
+samba_cv_HAVE_LINUX_SPLICE=no
+;;
+esac
 
 if test x"$samba_cv_HAVE_LINUX_SPLICE" = x"yes"; then
   AC_DEFINE(HAVE_LINUX_SPLICE,1,