diff options
author | Reinhard Tartler <siretart@tauware.de> | 2009-04-02 13:58:11 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2009-04-02 13:58:11 +0200 |
commit | a84d45498bd861c9225080232948a99c2e317bb8 (patch) | |
tree | 8f1f5fb7bf7ffbf6f24cf4a4fd6888a235dbcc08 /infrastructure/m4/ax_func_syscall.m4 | |
parent | 25db897553a0db0f912602b375029e724f51556e (diff) |
Import upstream version 0.11~rc3~r2491
Diffstat (limited to 'infrastructure/m4/ax_func_syscall.m4')
-rw-r--r-- | infrastructure/m4/ax_func_syscall.m4 | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/infrastructure/m4/ax_func_syscall.m4 b/infrastructure/m4/ax_func_syscall.m4 index 40496bf0..2429ca93 100644 --- a/infrastructure/m4/ax_func_syscall.m4 +++ b/infrastructure/m4/ax_func_syscall.m4 @@ -12,26 +12,37 @@ dnl @category C 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 - AC_CACHE_CHECK([for __syscall needing definition], [have___syscall_need_defn], + 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; ]])], - [have___syscall_need_defn=yes], [have___syscall_need_defn=no] + [box_cv_have___syscall_need_defn=no], [box_cv_have___syscall_need_defn=yes] )]) - if test "x$have___syscall_need_defn" = "xyes"; then + if test "x$box_cv_have___syscall_need_defn" = "xyes"; then AC_DEFINE([HAVE___SYSCALL_NEED_DEFN], 1, [Define to 1 if __syscall is available but needs a definition]) fi |