]> granicus.if.org Git - strace/blob - configure.in
Add pollhack
[strace] / configure.in
1 AC_INIT(strace.c)
2 AC_CANONICAL_HOST()
3 AC_MSG_CHECKING(for supported operating system)
4 changequote(,)dnl
5
6 case "$host_os" in
7 linux*)
8         opsys=linux
9         ;;
10 sunos4*)
11         opsys=sunos4
12         ;;
13 solaris2*)
14         opsys=svr4
15         ;;
16 sysv4*)
17         opsys=svr4
18         ;;
19 irix[56]*)
20         opsys=svr4
21         ;;
22 *)
23         AC_MSG_ERROR(this operating system is not yet supported by strace)
24         ;;
25 esac
26 AC_MSG_RESULT($opsys)
27
28 # Autoheader trick.  Heh, heh.
29 opsys_list='
30 @@@syms="$syms LINUX SUNOS4 SVR4"@@@
31 '
32
33 AC_MSG_CHECKING(for supported architecture)
34 case "$host_cpu" in
35 i[3456]86|pentium)
36         arch=i386
37         ;;
38 m68k)
39         arch=m68k
40         ;;
41 sparc)
42         arch=sparc
43         ;;
44 mips*)
45         arch=mips
46         ;;
47 alpha*)
48         arch=alpha
49         ;;
50 ppc|powerpc)
51         arch=powerpc
52         ;;
53 arm)
54         arch=arm
55         ;;
56 *)
57         AC_MSG_ERROR(this architecture is not yet supported by strace)
58         ;;
59 esac
60 AC_MSG_RESULT($arch)
61
62 # Autoheader trick.  Heh, heh.
63 arch_list='
64 @@@syms="$syms I386 M68K SPARC MIPS ALPHA ARM POWERPC"@@@
65 '
66
67 osarch="$opsys"
68 if [ -d "$srcdir/$opsys/$arch" ]; then
69         osarch="$opsys/$arch"
70 fi
71
72 OPSYS=`echo $opsys | tr '[a-z]' '[A-Z]'`
73 ARCH=`echo $arch | tr '[a-z]' '[A-Z]'`
74
75 changequote([,])dnl
76 CFLAGS="-D_GNU_SOURCE $CFLAGS"
77 AC_CONFIG_HEADER(config.h)
78 AC_SUBST(opsys)
79 AC_DEFINE_UNQUOTED($OPSYS)
80 AC_SUBST(arch)
81 AC_DEFINE_UNQUOTED($ARCH)
82 AC_SUBST(osarch)
83 AC_PROG_CC
84 AC_PROG_HOSTCC($host_alias $host)
85 AC_POLLABLE_PROCFS
86 AC_STRUCT_PR_SYSCALL
87 AC_STRUCT_MSG_CONTROL
88 AC_INCLUDEDIR
89 if test "x$OPSYS" = "xSUNOS4" && test "x$ARCH" = "xSPARC"
90 then
91         AC_MSG_CHECKING(for valid machine include directory)
92         if test -d "$includedir/sun4"
93         then
94                 rm -f machine
95                 ln -s $includedir/sun4 machine
96                 AC_MSG_RESULT(yes)
97                 AC_DEFINE(SUNOS4_KERNEL_ARCH_KLUDGE)
98         else
99                 AC_MSG_RESULT(no)
100         fi
101 fi
102 AC_WARNFLAGS
103 if test "x$OPSYS" = "xSUNOS4"
104 then
105         if test -n "$GCC"
106         then
107                 # SunOS 4.x header files don't declare int functions.
108                 WARNFLAGS="$WARNFLAGS -Wno-implicit"
109         fi
110 fi
111 AC_PROG_CPP
112 AC_PROG_GCC_TRADITIONAL
113 AC_PROG_INSTALL
114 AC_C_CONST
115 AC_HEADER_STDC
116 AC_HEADER_DIRENT
117 AC_TYPE_SIGNAL
118 AC_STRUCT_ST_BLKSIZE
119 AC_STRUCT_ST_BLOCKS
120 AC_STRUCT_ST_RDEV
121 AC_HEADER_STAT
122 AC_TYPE_UID_T
123 AC_TYPE_MODE_T
124 AC_TYPE_GETGROUPS
125 AC_HEADER_MAJOR
126 AC_SIG_ATOMIC_T
127 AC_CHECK_LIB(nsl, main)
128 AC_CHECK_FUNCS(sigaction strerror strsignal pread sys_siglist _sys_siglist getdents mctl putpmsg prctl sendmsg inet_ntop)
129 AC_CHECK_HEADERS(sys/reg.h sys/filio.h sys/acl.h sys/asynch.h sys/door.h sys/stream.h sys/tiuser.h sys/sysconfig.h asm/sigcontext.h ioctls.h sys/ioctl.h sys/ptrace.h termio.h linux/ptrace.h asm/reg.h linux/in6.h sys/uio.h linux/netlink.h linux/if_packet.h)
130 AC_DECL_SYS_ERRLIST
131 AC_DECL_SYS_SIGLIST
132 AC_DECL__SYS_SIGLIST
133 if test ! -d $osarch; then
134         mkdir -p $osarch
135 fi
136 AC_OUTPUT(Makefile $osarch/Makefile)