added Vector_zeroEnd() function
[util-vserver.git] / util-vserver / m4 / ensc_fpicsyscall.m4
1 dnl $Id$
2
3 dnl Copyright (C) 2002 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
4 dnl  
5 dnl This program is free software; you can redistribute it and/or modify
6 dnl it under the terms of the GNU General Public License as published by
7 dnl the Free Software Foundation; version 2 of the License.
8 dnl  
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 dnl GNU General Public License for more details.
13 dnl  
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program; if not, write to the Free Software
16 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
18 AC_DEFUN([ENSC_FPIC_SYSCALL],
19 [
20     AC_CACHE_CHECK([whether syscall() allows -fpic], [ensc_cv_c_fpic_syscall],
21     [
22         ensc_fpic_syscall_old_CFLAGS=$CFLAGS
23         CFLAGS="-fPIC -DPIC"
24
25         AC_LANG_PUSH(C)
26         AC_COMPILE_IFELSE([
27             #include <sys/syscall.h>
28             #include <unistd.h>
29             #include <asm/unistd.h>
30             #include <errno.h>
31             
32             #define __NR_dummy  42
33             _syscall3(int, dummy, int, a, int, b, int, c)],
34         [ensc_cv_c_fpic_syscall=yes], [ensc_cv_c_fpic_syscall=no])
35         AC_LANG_POP
36
37         CFLAGS=$ensc_fpic_syscall_old_CFLAGS
38     ])
39     
40     AM_CONDITIONAL(ENSC_ALLOW_FPIC_WITH_SYSCALL, [test x"$ensc_cv_c_fpic_syscall" = xyes])
41 ])