Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1 | AC_INIT(strace.c) |
Wichert Akkerman | 4f1bbbe | 2001-07-23 14:43:07 +0000 | [diff] [blame] | 2 | AC_CANONICAL_SYSTEM() |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 3 | AC_MSG_CHECKING(for supported operating system) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 4 | |
| 5 | case "$host_os" in |
| 6 | linux*) |
| 7 | opsys=linux |
| 8 | ;; |
| 9 | sunos4*) |
| 10 | opsys=sunos4 |
| 11 | ;; |
| 12 | solaris2*) |
| 13 | opsys=svr4 |
| 14 | ;; |
| 15 | sysv4*) |
| 16 | opsys=svr4 |
| 17 | ;; |
Wichert Akkerman | ea78f0f | 1999-11-29 15:34:02 +0000 | [diff] [blame] | 18 | sysv5*) |
| 19 | opsys=svr4 |
| 20 | ;; |
Michal Ludvig | 53b320f | 2002-09-23 13:30:09 +0000 | [diff] [blame] | 21 | irix[[56]]*) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 22 | opsys=svr4 |
| 23 | ;; |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 24 | freebsd*) |
| 25 | opsys=freebsd |
| 26 | ;; |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 27 | *) |
| 28 | AC_MSG_ERROR(this operating system is not yet supported by strace) |
| 29 | ;; |
| 30 | esac |
| 31 | AC_MSG_RESULT($opsys) |
| 32 | |
| 33 | # Autoheader trick. Heh, heh. |
| 34 | opsys_list=' |
Wichert Akkerman | bf79f2e | 2000-09-01 21:03:06 +0000 | [diff] [blame] | 35 | @@@syms="$syms LINUX SUNOS4 SVR4 FREEBSD"@@@ |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 36 | ' |
| 37 | |
| 38 | AC_MSG_CHECKING(for supported architecture) |
Wichert Akkerman | 4f1bbbe | 2001-07-23 14:43:07 +0000 | [diff] [blame] | 39 | case "$target_cpu" in |
Michal Ludvig | 53b320f | 2002-09-23 13:30:09 +0000 | [diff] [blame] | 40 | i[[3456]]86|pentium) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 41 | arch=i386 |
| 42 | ;; |
Wichert Akkerman | 8b1b40c | 2000-02-03 21:58:30 +0000 | [diff] [blame] | 43 | ia64) |
| 44 | arch=ia64 |
| 45 | ;; |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 46 | m68k) |
| 47 | arch=m68k |
| 48 | ;; |
Wichert Akkerman | 00a82ee | 2001-03-28 20:29:17 +0000 | [diff] [blame] | 49 | sparc*) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 50 | arch=sparc |
| 51 | ;; |
Wichert Akkerman | f90da01 | 1999-10-31 21:15:38 +0000 | [diff] [blame] | 52 | mips*) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 53 | arch=mips |
| 54 | ;; |
| 55 | alpha*) |
| 56 | arch=alpha |
| 57 | ;; |
| 58 | ppc|powerpc) |
| 59 | arch=powerpc |
| 60 | ;; |
| 61 | arm) |
| 62 | arch=arm |
| 63 | ;; |
Wichert Akkerman | 4dc8a2a | 1999-12-23 14:20:14 +0000 | [diff] [blame] | 64 | s390) |
| 65 | arch=s390 |
| 66 | ;; |
Michal Ludvig | 10a88d0 | 2002-10-07 14:31:00 +0000 | [diff] [blame] | 67 | s390x) |
| 68 | arch=s390x |
| 69 | ;; |
Wichert Akkerman | c1652e2 | 2001-03-27 12:17:16 +0000 | [diff] [blame] | 70 | hppa*|parisc*) |
| 71 | arch=hppa |
| 72 | ;; |
Wichert Akkerman | ccef637 | 2002-05-01 16:39:22 +0000 | [diff] [blame] | 73 | sh) |
| 74 | arch=sh |
| 75 | ;; |
Michal Ludvig | 0e03550 | 2002-09-23 15:41:01 +0000 | [diff] [blame] | 76 | x86?64*) |
| 77 | arch=x86_64 |
| 78 | ;; |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 79 | *) |
| 80 | AC_MSG_ERROR(this architecture is not yet supported by strace) |
| 81 | ;; |
| 82 | esac |
| 83 | AC_MSG_RESULT($arch) |
| 84 | |
| 85 | # Autoheader trick. Heh, heh. |
| 86 | arch_list=' |
Michal Ludvig | 10a88d0 | 2002-10-07 14:31:00 +0000 | [diff] [blame] | 87 | @@@syms="$syms I386 IA64 M68K SPARC MIPS ALPHA ARM POWERPC S390 S390X HPPA SH X86_64"@@@ |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 88 | ' |
| 89 | |
| 90 | osarch="$opsys" |
Michal Ludvig | 53b320f | 2002-09-23 13:30:09 +0000 | [diff] [blame] | 91 | if test -d "$srcdir/$opsys/$arch"; then |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 92 | osarch="$opsys/$arch" |
| 93 | fi |
| 94 | |
Michal Ludvig | 53b320f | 2002-09-23 13:30:09 +0000 | [diff] [blame] | 95 | OPSYS=`echo $opsys | tr '[[a-z]]' '[[A-Z]]'` |
| 96 | ARCH=`echo $arch | tr '[[a-z]]' '[[A-Z]]'` |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 97 | |
Ulrich Drepper | 0d2d323 | 1999-05-29 04:11:48 +0000 | [diff] [blame] | 98 | CFLAGS="-D_GNU_SOURCE $CFLAGS" |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 99 | AC_CONFIG_HEADER(config.h) |
| 100 | AC_SUBST(opsys) |
| 101 | AC_DEFINE_UNQUOTED($OPSYS) |
Wichert Akkerman | ea78f0f | 1999-11-29 15:34:02 +0000 | [diff] [blame] | 102 | case "$host_os" in |
| 103 | sysv4.2uw*) |
| 104 | AC_DEFINE(UNIXWARE, 2) |
| 105 | ;; |
| 106 | sysv5*) |
| 107 | AC_DEFINE(UNIXWARE, 7) |
| 108 | ;; |
| 109 | esac |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 110 | AC_SUBST(arch) |
| 111 | AC_DEFINE_UNQUOTED($ARCH) |
| 112 | AC_SUBST(osarch) |
| 113 | AC_PROG_CC |
| 114 | AC_PROG_HOSTCC($host_alias $host) |
Wichert Akkerman | ea78f0f | 1999-11-29 15:34:02 +0000 | [diff] [blame] | 115 | AC_MP_PROCFS |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 116 | AC_POLLABLE_PROCFS |
| 117 | AC_STRUCT_PR_SYSCALL |
| 118 | AC_STRUCT_MSG_CONTROL |
| 119 | AC_INCLUDEDIR |
| 120 | if test "x$OPSYS" = "xSUNOS4" && test "x$ARCH" = "xSPARC" |
| 121 | then |
| 122 | AC_MSG_CHECKING(for valid machine include directory) |
| 123 | if test -d "$includedir/sun4" |
| 124 | then |
| 125 | rm -f machine |
| 126 | ln -s $includedir/sun4 machine |
| 127 | AC_MSG_RESULT(yes) |
| 128 | AC_DEFINE(SUNOS4_KERNEL_ARCH_KLUDGE) |
| 129 | else |
| 130 | AC_MSG_RESULT(no) |
| 131 | fi |
| 132 | fi |
| 133 | AC_WARNFLAGS |
| 134 | if test "x$OPSYS" = "xSUNOS4" |
| 135 | then |
| 136 | if test -n "$GCC" |
| 137 | then |
| 138 | # SunOS 4.x header files don't declare int functions. |
| 139 | WARNFLAGS="$WARNFLAGS -Wno-implicit" |
| 140 | fi |
| 141 | fi |
| 142 | AC_PROG_CPP |
| 143 | AC_PROG_GCC_TRADITIONAL |
| 144 | AC_PROG_INSTALL |
| 145 | AC_C_CONST |
| 146 | AC_HEADER_STDC |
| 147 | AC_HEADER_DIRENT |
| 148 | AC_TYPE_SIGNAL |
| 149 | AC_STRUCT_ST_BLKSIZE |
| 150 | AC_STRUCT_ST_BLOCKS |
| 151 | AC_STRUCT_ST_RDEV |
| 152 | AC_HEADER_STAT |
| 153 | AC_TYPE_UID_T |
| 154 | AC_TYPE_MODE_T |
| 155 | AC_TYPE_GETGROUPS |
| 156 | AC_HEADER_MAJOR |
| 157 | AC_SIG_ATOMIC_T |
John Hughes | 5826589 | 2001-10-18 15:13:53 +0000 | [diff] [blame] | 158 | AC_SIGINFO_T |
Ulrich Drepper | dfff33c | 1999-12-24 08:03:15 +0000 | [diff] [blame] | 159 | AC_STAT64 |
Wichert Akkerman | f185065 | 2001-02-16 20:29:03 +0000 | [diff] [blame] | 160 | AC_SIN6_SCOPE_ID |
Wichert Akkerman | 16a03d2 | 2000-08-10 02:14:04 +0000 | [diff] [blame] | 161 | AC_LONG_LONG |
John Hughes | b8a85a4 | 2001-03-28 08:05:27 +0000 | [diff] [blame] | 162 | AC_LITTLE_ENDIAN_LONG_LONG |
John Hughes | 70623be | 2001-03-08 13:59:00 +0000 | [diff] [blame] | 163 | AC_OFF_T_IS_LONG_LONG |
| 164 | AC_RLIM_T_IS_LONG_LONG |
John Hughes | c0fc3fd | 2001-03-08 16:10:40 +0000 | [diff] [blame] | 165 | AC_ST_FLAGS |
| 166 | AC_ST_ACLCNT |
| 167 | AC_ST_LEVEL |
| 168 | AC_ST_FSTYPE |
| 169 | AC_ST_GEN |
John Hughes | 38ae88d | 2002-05-23 11:48:58 +0000 | [diff] [blame] | 170 | AC_STRUCT_OPTHDR |
| 171 | AC_STRUCT_T_OPTHDR |
Wichert Akkerman | 43a7482 | 2000-06-27 17:33:32 +0000 | [diff] [blame] | 172 | if test x$OPSYS != xLINUX; then |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 173 | AC_CHECK_LIB(nsl, main) |
Wichert Akkerman | 43a7482 | 2000-06-27 17:33:32 +0000 | [diff] [blame] | 174 | fi |
Wichert Akkerman | f185065 | 2001-02-16 20:29:03 +0000 | [diff] [blame] | 175 | AC_CHECK_FUNCS(sigaction strerror strsignal pread sys_siglist _sys_siglist getdents mctl putpmsg prctl sendmsg inet_ntop if_indextoname) |
John Hughes | 4e36a81 | 2001-04-18 15:11:51 +0000 | [diff] [blame] | 176 | AC_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 linux/icmp.h linux/in6.h sys/uio.h sys/aio.h linux/netlink.h linux/if_packet.h poll.h sys/poll.h sys/vfs.h netinet/tcp.h netinet/udp.h asm/sysmips.h linux/utsname.h sys/nscsys.h) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 177 | AC_DECL_SYS_ERRLIST |
| 178 | AC_DECL_SYS_SIGLIST |
| 179 | AC_DECL__SYS_SIGLIST |
Wichert Akkerman | 9ce1a63 | 1999-08-29 23:15:07 +0000 | [diff] [blame] | 180 | if test ! -d $osarch; then |
| 181 | mkdir -p $osarch |
| 182 | fi |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 183 | AC_OUTPUT(Makefile $osarch/Makefile) |