[Box Backup-commit] COMMIT r2365 - box/trunk/infrastructure/m4

boxbackup-dev at boxbackup.org boxbackup-dev at boxbackup.org
Sun Oct 26 23:36:06 GMT 2008


Author: chris
Date: 2008-10-26 23:36:05 +0000 (Sun, 26 Oct 2008)
New Revision: 2365

Modified:
   box/trunk/infrastructure/m4/ax_func_syscall.m4
Log:
Reverse the test for __syscall(), remove the test for syscall(),
remove the definition and reverse the sense in ax_func_syscall.m4
(which checks for __syscall() needing definition).

Autoconf's AC_CHECK_FUNC defines it when testing for its presence,
so HAVE___SYSCALL will be true even if __syscall has no definition
in the system libraries, and this is precisely the case that we
want to test for, so now we test whether the test program compiles
with no explicit definition (only the system headers) and if that
fails, we set HAVE___SYSCALL_NEED_DEFN to 1.


Modified: box/trunk/infrastructure/m4/ax_func_syscall.m4
===================================================================
--- box/trunk/infrastructure/m4/ax_func_syscall.m4	2008-10-26 17:05:51 UTC (rev 2364)
+++ box/trunk/infrastructure/m4/ax_func_syscall.m4	2008-10-26 23:36:05 UTC (rev 2365)
@@ -12,24 +12,35 @@
 dnl @author Martin Ebourne
 dnl @version 2005/07/01
 dnl @license AllPermissive
+dnl
+dnl Changed by Chris on 081026:
+dnl
+dnl Reversed the test for __syscall(), remove the test for syscall(),
+dnl remove the definition and reverse the sense in ax_func_syscall.m4
+dnl (which checks for __syscall() needing definition).
+dnl
+dnl Autoconf's AC_CHECK_FUNC defines it when testing for its presence,
+dnl so HAVE___SYSCALL will be true even if __syscall has no definition
+dnl in the system libraries, and this is precisely the case that we
+dnl want to test for, so now we test whether the test program compiles
+dnl with no explicit definition (only the system headers) and if that
+dnl fails, we set HAVE___SYSCALL_NEED_DEFN to 1.
 
 AC_DEFUN([AX_FUNC_SYSCALL], [
   AC_CHECK_HEADERS([sys/syscall.h unistd.h])
   AC_CHECK_FUNCS([syscall __syscall])
-  if test "x$ac_cv_func_syscall" != "xyes" &&
-     test "x$ac_cv_func___syscall" != "xyes"; then
+  if test "x$ac_cv_func___syscall" = "xyes"; then
     AC_CACHE_CHECK([for __syscall needing definition], [box_cv_have___syscall_need_defn],
       [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
           $ac_includes_default
           #ifdef HAVE_SYS_SYSCALL_H
             #include <sys/syscall.h>
           #endif
-          extern "C" off_t __syscall(quad_t number, ...);
           ]], [[
           __syscall(SYS_exit, 0);
           return 1;
         ]])],
-        [box_cv_have___syscall_need_defn=yes], [box_cv_have___syscall_need_defn=no]
+        [box_cv_have___syscall_need_defn=no], [box_cv_have___syscall_need_defn=yes]
       )])
     if test "x$box_cv_have___syscall_need_defn" = "xyes"; then
       AC_DEFINE([HAVE___SYSCALL_NEED_DEFN], 1,




More information about the Boxbackup-commit mailing list