]> granicus.if.org Git - strace/blob - configure.ac
Ensure that SWAP_FLAG_* constants are defined
[strace] / configure.ac
1 dnl Process this file with autoconf to create configure.  Use autoreconf.
2 AC_PREREQ(2.57)
3 AC_INIT([strace],[4.6])
4 AC_CONFIG_SRCDIR([strace.c])
5 AC_CONFIG_AUX_DIR([.])
6 AM_CONFIG_HEADER([config.h])
7 AM_INIT_AUTOMAKE([foreign check-news dist-xz no-dist-gzip silent-rules])
8 AM_MAINTAINER_MODE
9 AC_CANONICAL_HOST
10
11 AC_MSG_CHECKING([for supported architecture])
12 case "$host_cpu" in
13 bfin)
14         arch=bfin
15         AC_DEFINE([BFIN], 1, [Define for the Blackfin architecture.])
16         ;;
17 i[[3456]]86|pentium)
18         arch=i386
19         AC_DEFINE([I386], 1, [Define for the i386 architecture.])
20         ;;
21 ia64)
22         arch=ia64
23         AC_DEFINE([IA64], 1, [Define for the IA64 architecture.])
24         ;;
25 m68k)
26         arch=m68k
27         AC_DEFINE([M68K], 1, [Define for the m68k architecture.])
28         ;;
29 sparc64*)
30         arch=sparc64
31         AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.])
32         ;;
33 sparc*)
34         arch=sparc
35         AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.])
36         ;;
37 mips*)
38         arch=mips
39         AC_DEFINE([MIPS], 1, [Define for the MIPS architecture.])
40         ;;
41 alpha*)
42         arch=alpha
43         AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.])
44         ;;
45 powerpc*)
46         arch=powerpc
47         AC_DEFINE([POWERPC], 1, [Define for the PowerPC architecture.])
48         if test $host_cpu = powerpc64; then
49                 AC_DEFINE([POWERPC64], 1, [Define for the PowerPC64 architecture.])
50         fi
51         ;;
52 arm*)
53         arch=arm
54         AC_DEFINE([ARM], 1, [Define for the ARM architecture.])
55         ;;
56 avr32*)
57         arch=avr32
58         AC_DEFINE([AVR32], 1, [Define for the AVR32 architecture.])
59         ;;
60 s390)
61         arch=s390
62         AC_DEFINE([S390], 1, [Define for the S390 architecture.])
63         ;;
64 s390x)
65         arch=s390x
66         AC_DEFINE([S390X], 1, [Define for the S390x architecture.])
67         ;;
68 hppa*|parisc*)
69         arch=hppa
70         AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
71         ;;
72 sh64*)
73         arch=sh64
74         AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
75         ;;
76 sh*)
77         arch=sh
78         AC_DEFINE([SH], 1, [Define for the SH architecture.])
79         ;;
80 x86?64*)
81         arch=x86_64
82         AC_DEFINE([X86_64], 1, [Define for the AMD x86-64 architecture.])
83         ;;
84 cris|crisv10)
85         arch=crisv10
86         AC_DEFINE([CRISV10], 1, [Define for the CRISv10 architecture.])
87         ;;
88 crisv32)
89         arch=crisv32
90         AC_DEFINE([CRISV32], 1, [Define for the CRISv32 architecture.])
91         ;;
92 tile*)
93         arch=tile
94         AC_DEFINE([TILE], 1, [Define for the Tile architecture])
95         ;;
96 microblaze*)
97         arch=microblaze
98         AC_DEFINE([MICROBLAZE], 1, [Define for the MicroBlaze architecture.])
99         ;;
100 *)
101         AC_MSG_RESULT([NO!])
102         AC_MSG_ERROR([architecture $host_cpu is not supported by strace])
103         ;;
104 esac
105 AC_MSG_RESULT($arch)
106
107 AC_SUBST(arch)
108
109 AM_CONDITIONAL([I386], [test x$arch = xi386])
110 AM_CONDITIONAL([X86_64], [test x$arch = xx86_64])
111
112 AC_PROG_CC
113 AC_GNU_SOURCE
114
115 AC_INCLUDEDIR
116
117 gl_WARN_ADD([-Wall])
118 gl_WARN_ADD([-Wwrite-strings])
119 AC_SUBST([WARN_CFLAGS])
120
121 AC_PROG_CPP
122 AC_PROG_INSTALL
123 AC_C_CONST
124 AC_C_BIGENDIAN
125 AC_HEADER_STDC
126 AC_HEADER_STDBOOL
127 AC_HEADER_DIRENT
128 AC_HEADER_STAT
129 AC_CHECK_MEMBERS([struct stat.st_blksize,
130                   struct stat.st_blocks,
131                   struct stat.st_aclcnt,
132                   struct stat.st_flags,
133                   struct stat.st_fstype,
134                   struct stat.st_gen,
135                   struct stat.st_level,
136                   struct stat.st_rdev])
137 AC_STAT64
138 AC_STATFS64
139
140 AC_TYPE_SIGNAL
141 AC_TYPE_UID_T
142 AC_TYPE_MODE_T
143 AC_TYPE_GETGROUPS
144 AC_HEADER_MAJOR
145 AC_CHECK_TYPES([sig_atomic_t, siginfo_t],,, [#include <signal.h>])
146 AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,,
147 [#include <sys/types.h>
148 #include <sys/socket.h>
149 #include <netinet/in.h>])
150 AC_CHECK_TYPES([long long])
151 AC_LITTLE_ENDIAN_LONG_LONG
152 AC_OFF_T_IS_LONG_LONG
153 AC_RLIM_T_IS_LONG_LONG
154 AC_CHECK_TYPES([struct opthdr],,, [#include <sys/socket.h>])
155 AC_CHECK_TYPES([struct t_opthdr],,, [#include <sys/tiuser.h>])
156
157 AC_CHECK_FUNCS([ \
158         fork \
159         if_indextoname \
160         inet_ntop \
161         prctl \
162         sendmsg \
163         sigaction \
164         strerror \
165         strsignal \
166         sys_siglist \
167         _sys_siglist \
168         stpcpy \
169         process_vm_readv \
170 ])
171 AC_CHECK_HEADERS([ \
172         inttypes.h \
173         ioctls.h \
174         libaio.h \
175         mqueue.h \
176         poll.h \
177         stropts.h \
178         sys/acl.h \
179         sys/asynch.h \
180         sys/conf.h \
181         sys/epoll.h \
182         sys/filio.h \
183         sys/ioctl.h \
184         sys/poll.h \
185         sys/ptrace.h \
186         sys/reg.h \
187         sys/uio.h \
188         sys/vfs.h \
189         asm/cachectl.h \
190         asm/sysmips.h \
191         linux/capability.h \
192         linux/ptrace.h \
193         linux/utsname.h \
194         netinet/sctp.h \
195 ], [], [])
196 AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h],
197                  [], [], [#include <stddef.h>
198 #include <sys/socket.h>
199 #include <asm/types.h>])
200 AC_CHECK_HEADERS([asm/sigcontext.h], [], [], [#include <signal.h>])
201 AC_CHECK_TYPES([struct sigcontext_struct,
202                 struct sigcontext],,, [#include <signal.h>])
203 AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>])
204
205 AC_CHECK_MEMBERS([struct msghdr.msg_control],,, [#include <sys/socket.h>])
206
207 AC_CHECK_MEMBERS([struct T_conn_res.QUEUE_ptr,
208                   struct T_conn_res.ACCEPTOR_id],,,
209 [#include <sys/stream.h>
210 #include <sys/tihdr.h>])
211
212 AC_CHECK_TYPES([struct __old_kernel_stat],,, [#include <asm/stat.h>])
213
214 AC_CHECK_TYPES([struct pt_all_user_regs, struct ia64_fpreg],,,
215                [#include <sys/ptrace.h>])
216
217 AC_CHECK_TYPES([struct user_desc],,, [#include <asm/ldt.h>])
218
219 AC_CHECK_MEMBERS([struct dqblk.dqb_curblocks],,, [#include <sys/quota.h>])
220
221 AC_CHECK_MEMBERS([struct sigcontext.sc_hi2],,, [#include <signal.h>
222 #ifdef HAVE_ASM_SIGCONTEXT_H
223 # include <asm/sigcontext.h>
224 #endif])
225
226 AC_CHECK_DECLS([sys_errlist])
227 AC_CHECK_DECLS([sys_siglist, _sys_siglist],,, [#include <signal.h>])
228 AC_CHECK_DECLS([
229                 PTRACE_SETOPTIONS,
230                 PTRACE_GETEVENTMSG,
231                 PTRACE_GETSIGINFO,
232                 PTRACE_O_TRACESYSGOOD,
233                 PTRACE_O_TRACEFORK,
234                 PTRACE_O_TRACEVFORK,
235                 PTRACE_O_TRACECLONE,
236                 PTRACE_O_TRACEEXEC,
237                 PTRACE_O_TRACEEXIT,
238                 PTRACE_EVENT_FORK,
239                 PTRACE_EVENT_VFORK,
240                 PTRACE_EVENT_CLONE,
241                 PTRACE_EVENT_EXEC,
242                 PTRACE_EVENT_VFORK_DONE,
243                 PTRACE_EVENT_EXIT],,, [#include <sys/ptrace.h>])
244
245 AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64],
246         [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
247 #include <stdlib.h>
248 #include <linux/fs.h>], [return !BLKGETSIZE64;])],
249                            [ac_cv_have_blkgetsize64=yes], [ac_cv_have_blkgetsize64=no])]
250         if test $ac_cv_have_blkgetsize64 = yes; then
251                 AC_DEFINE([HAVE_BLKGETSIZE64], [1], [Define to 1 if you have BLKGETSIZE64.])
252         fi)
253
254 AC_PATH_PROG([PERL], [perl])
255
256 AC_CONFIG_FILES([Makefile tests/Makefile])
257 AC_OUTPUT