blob: 5fda9fc1ada54a19ce48d8097b155927d573ac7f [file] [log] [blame]
Roland McGrath6d2b3492002-12-30 00:51:30 +00001dnl Process this file with autoconf to create configure. Use autoreconf.
2AC_PREREQ(2.57)
3AC_INIT([strace],[4.4.90])
4AC_CONFIG_SRCDIR([strace.c])
5AM_CONFIG_HEADER([config.h])
6AM_INIT_AUTOMAKE([foreign check-news dist-bzip2])
7AM_MAINTAINER_MODE
8AC_CANONICAL_HOST
9
10AC_MSG_CHECKING([for supported operating system])
11case "$host_os" in
12linux*)
13 opsys=linux
14 AC_DEFINE([LINUX], 1, [Define for the Linux operating system.])
Roland McGrath80964aa2002-12-30 01:11:08 +000015 AM_CONDITIONAL([LINUX], [test x$opsys = xlinux])
Roland McGrath6d2b3492002-12-30 00:51:30 +000016 ;;
17sunos4*)
18 opsys=sunos4
19 AC_DEFINE([SUNOS4], 1, [Define for the SunOS 4.x operating system.])
Roland McGrath80964aa2002-12-30 01:11:08 +000020 AM_CONDITIONAL([SUNOS4], [test x$opsys = xsunos4])
Roland McGrath6d2b3492002-12-30 00:51:30 +000021 ;;
22solaris2* | sysv[[45]]* | irix[[56]]*)
23 opsys=svr4
24 AC_DEFINE([SVR4], 1, [Define for the System V release 4 operating
25system or a derivative like Solaris 2.x or Irix 5.x.])
26 case "$host_os" in
27 sysv4.2uw*)
28 AC_DEFINE(UNIXWARE, 2, [Define for UnixWare systems.])
29 ;;
30 sysv5*)
31 AC_DEFINE(UNIXWARE, 7, [Define for UnixWare systems.])
32 ;;
33 esac
Roland McGrath80964aa2002-12-30 01:11:08 +000034 AM_CONDITIONAL([SVR4], [test x$opsys = xsvr4])
Roland McGrath6d2b3492002-12-30 00:51:30 +000035 ;;
36freebsd*)
37 opsys=freebsd
38 AC_DEFINE([FREEBSD], 1, [Define for the FreeBSD operating system.])
Roland McGrath80964aa2002-12-30 01:11:08 +000039 AM_CONDITIONAL([FREEBSD], [test x$opsys = xfreebsd])
Roland McGrath6d2b3492002-12-30 00:51:30 +000040 ;;
41*)
42 AC_MSG_RESULT([NO!])
43 AC_MSG_ERROR([operating system $host_os is not supported by strace])
44 ;;
45esac
46AC_MSG_RESULT($opsys)
47
48AC_MSG_CHECKING([for supported architecture])
49case "$host_cpu" in
50i[[3456]]86|pentium)
51 arch=i386
52 AC_DEFINE([I386], 1, [Define for the i386 architecture.])
53 ;;
54ia64)
55 arch=ia64
56 AC_DEFINE([IA64], 1, [Define for the IA64 architecture.])
57 ;;
58m68k)
59 arch=m68k
60 AC_DEFINE([M68K], 1, [Define for the m68k architecture.])
61 ;;
62sparc*)
63 arch=sparc
64 AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.])
65 ;;
66mips*)
67 arch=mips
68 AC_DEFINE([MIPS], 1, [Define for the MIPS architecture.])
69 ;;
70alpha*)
71 arch=alpha
72 AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.])
73 ;;
74ppc|powerpc)
75 arch=powerpc
76 AC_DEFINE([POWERPC], 1, [Define for the PowerPC architecture.])
77 ;;
78arm*)
79 arch=arm
80 AC_DEFINE([ARM], 1, [Define for the ARM architecture.])
81 ;;
82s390)
83 arch=s390
84 AC_DEFINE([S390], 1, [Define for the S390 architecture.])
85 ;;
86s390x)
87 arch=s390x
88 AC_DEFINE([S390X], 1, [Define for the S390x architecture.])
89 ;;
90hppa*|parisc*)
91 arch=hppa
92 AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
93 ;;
94sh)
95 arch=sh
96 AC_DEFINE([SH], 1, [Define for the SH architecture.])
97 ;;
98x86?64*)
99 arch=x86_64
100 AC_DEFINE([X86_64], 1, [Define for the AMD x86-64 architecture.])
101 ;;
102*)
103 AC_MSG_RESULT([NO!])
104 AC_MSG_ERROR([architecture $host_cpu is not supported by strace])
105 ;;
106esac
107AC_MSG_RESULT($arch)
108
Roland McGrath6d2b3492002-12-30 00:51:30 +0000109AC_SUBST(opsys)
110AC_SUBST(arch)
Roland McGrath6d2b3492002-12-30 00:51:30 +0000111
112CFLAGS="-D_GNU_SOURCE $CFLAGS"
113AC_PROG_CC
114AC_INCLUDEDIR
115
116if test "x$opsys" = "xsunos4" && test "x$arch" = "xsparc"
117then
118 AC_MSG_CHECKING(for valid machine include directory)
119 if test -d "$includedir/sun4"
120 then
121 rm -f machine
122 ln -s $includedir/sun4 machine
123 AC_MSG_RESULT(yes)
124 AC_DEFINE(SUNOS4_KERNEL_ARCH_KLUDGE, 1, [
125Define if you are have a SPARC with SUNOS4 and your want a version
126of strace that will work on sun4, sun4c and sun4m kernel architectures.
127Only useful if you have a symbolic link from machine to /usr/include/sun4
128in the compilation directory.])
129 else
130 AC_MSG_RESULT(no)
131 fi
132fi
133
134AC_WARNFLAGS
135if test "x$opsys" = "xsunos4"
136then
137 if test -n "$GCC"
138 then
139 # SunOS 4.x header files don't declare int functions.
140 WARNFLAGS="$WARNFLAGS -Wno-implicit"
141 fi
142fi
143
144AC_PROG_CPP
145AC_PROG_GCC_TRADITIONAL
146AC_PROG_INSTALL
147AC_C_CONST
148AC_HEADER_STDC
149AC_HEADER_DIRENT
150AC_HEADER_STAT
151AC_CHECK_MEMBERS([struct stat.st_blksize,
152 struct stat.st_blocks,
153 struct stat.st_aclcnt,
154 struct stat.st_flags,
155 struct stat.st_fstype,
156 struct stat.st_gen,
157 struct stat.st_level,
158 struct stat.st_rdev])
159AC_STAT64
160
161AC_TYPE_SIGNAL
162AC_TYPE_UID_T
163AC_TYPE_MODE_T
164AC_TYPE_GETGROUPS
165AC_HEADER_MAJOR
166AC_CHECK_TYPES(sig_atomic_t siginfo_t,,, [#include <signal.h>])
167AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,, [#include <netinet/in.h])
168AC_CHECK_TYPES([long long])
169AC_LITTLE_ENDIAN_LONG_LONG
170AC_OFF_T_IS_LONG_LONG
171AC_RLIM_T_IS_LONG_LONG
172AC_CHECK_TYPES([struct opthdr],,, [#include <sys/socket.h>])
173AC_CHECK_TYPES([struct t_opthdr],,, [#include <sys/tiuser.h>])
174
175if test x$opsys != xlinux; then
176AC_CHECK_LIB(nsl, main)
177fi
178
179AC_CHECK_FUNCS(sigaction strerror strsignal pread sys_siglist _sys_siglist getdents mctl prctl sendmsg inet_ntop if_indextoname)
180AC_CHECK_HEADERS([sys/reg.h sys/filio.h sys/acl.h sys/asynch.h sys/door.h stropts.h sys/conf.h sys/stream.h sys/tihdr.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 sys/uio.h sys/aio.h poll.h sys/poll.h sys/vfs.h netinet/tcp.h netinet/udp.h asm/sysmips.h linux/utsname.h sys/nscsys.h], [], [])
181AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h],
182 [], [], [#include <linux/socket.h>])
183
184AC_MP_PROCFS
185AC_POLLABLE_PROCFS
186
187AC_CHECK_MEMBERS([struct msghdr.msg_control],,, [#include <sys/socket.h>])
188AC_STRUCT_PR_SYSCALL
189
190AC_CHECK_DECLS([sys_errlist])
191AC_CHECK_DECLS([sys_siglist, _sys_siglist],,, [#include <signal.h>])
192
193AC_PATH_PROG([PERL], [perl])
194
Roland McGrath80964aa2002-12-30 01:11:08 +0000195AC_CONFIG_FILES([Makefile])
Roland McGrath6d2b3492002-12-30 00:51:30 +0000196AC_OUTPUT