Ignore:
Timestamp:
26/10/2008 23:36:05 (4 years ago)
Author:
chris
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/infrastructure/m4/ax_func_syscall.m4

    r2327 r2365  
    1313dnl @version 2005/07/01 
    1414dnl @license AllPermissive 
     15dnl 
     16dnl Changed by Chris on 081026: 
     17dnl 
     18dnl Reversed the test for __syscall(), remove the test for syscall(), 
     19dnl remove the definition and reverse the sense in ax_func_syscall.m4 
     20dnl (which checks for __syscall() needing definition). 
     21dnl 
     22dnl Autoconf's AC_CHECK_FUNC defines it when testing for its presence, 
     23dnl so HAVE___SYSCALL will be true even if __syscall has no definition 
     24dnl in the system libraries, and this is precisely the case that we 
     25dnl want to test for, so now we test whether the test program compiles 
     26dnl with no explicit definition (only the system headers) and if that 
     27dnl fails, we set HAVE___SYSCALL_NEED_DEFN to 1. 
    1528 
    1629AC_DEFUN([AX_FUNC_SYSCALL], [ 
    1730  AC_CHECK_HEADERS([sys/syscall.h unistd.h]) 
    1831  AC_CHECK_FUNCS([syscall __syscall]) 
    19   if test "x$ac_cv_func_syscall" != "xyes" && 
    20      test "x$ac_cv_func___syscall" != "xyes"; then 
     32  if test "x$ac_cv_func___syscall" = "xyes"; then 
    2133    AC_CACHE_CHECK([for __syscall needing definition], [box_cv_have___syscall_need_defn], 
    2234      [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ 
     
    2537            #include <sys/syscall.h> 
    2638          #endif 
    27           extern "C" off_t __syscall(quad_t number, ...); 
    2839          ]], [[ 
    2940          __syscall(SYS_exit, 0); 
    3041          return 1; 
    3142        ]])], 
    32         [box_cv_have___syscall_need_defn=yes], [box_cv_have___syscall_need_defn=no] 
     43        [box_cv_have___syscall_need_defn=no], [box_cv_have___syscall_need_defn=yes] 
    3344      )]) 
    3445    if test "x$box_cv_have___syscall_need_defn" = "xyes"; then 
Note: See TracChangeset for help on using the changeset viewer.