Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 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 | ;; |
Wichert Akkerman | ea78f0f | 1999-11-29 15:34:02 +0000 | [diff] [blame] | 19 | sysv5*) |
| 20 | opsys=svr4 |
| 21 | ;; |
Wichert Akkerman | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 22 | irix[56]*) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 23 | opsys=svr4 |
| 24 | ;; |
| 25 | *) |
| 26 | AC_MSG_ERROR(this operating system is not yet supported by strace) |
| 27 | ;; |
| 28 | esac |
| 29 | AC_MSG_RESULT($opsys) |
| 30 | |
| 31 | # Autoheader trick. Heh, heh. |
| 32 | opsys_list=' |
| 33 | @@@syms="$syms LINUX SUNOS4 SVR4"@@@ |
| 34 | ' |
| 35 | |
| 36 | AC_MSG_CHECKING(for supported architecture) |
| 37 | case "$host_cpu" in |
| 38 | i[3456]86|pentium) |
| 39 | arch=i386 |
| 40 | ;; |
| 41 | m68k) |
| 42 | arch=m68k |
| 43 | ;; |
| 44 | sparc) |
| 45 | arch=sparc |
| 46 | ;; |
Wichert Akkerman | f90da01 | 1999-10-31 21:15:38 +0000 | [diff] [blame] | 47 | mips*) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 48 | arch=mips |
| 49 | ;; |
| 50 | alpha*) |
| 51 | arch=alpha |
| 52 | ;; |
| 53 | ppc|powerpc) |
| 54 | arch=powerpc |
| 55 | ;; |
| 56 | arm) |
| 57 | arch=arm |
| 58 | ;; |
Wichert Akkerman | 4dc8a2a | 1999-12-23 14:20:14 +0000 | [diff] [blame] | 59 | s390) |
| 60 | arch=s390 |
| 61 | ;; |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 62 | *) |
| 63 | AC_MSG_ERROR(this architecture is not yet supported by strace) |
| 64 | ;; |
| 65 | esac |
| 66 | AC_MSG_RESULT($arch) |
| 67 | |
| 68 | # Autoheader trick. Heh, heh. |
| 69 | arch_list=' |
Wichert Akkerman | 2e2553a | 1999-05-09 00:29:58 +0000 | [diff] [blame] | 70 | @@@syms="$syms I386 M68K SPARC MIPS ALPHA ARM POWERPC"@@@ |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 71 | ' |
| 72 | |
| 73 | osarch="$opsys" |
| 74 | if [ -d "$srcdir/$opsys/$arch" ]; then |
| 75 | osarch="$opsys/$arch" |
| 76 | fi |
| 77 | |
| 78 | OPSYS=`echo $opsys | tr '[a-z]' '[A-Z]'` |
| 79 | ARCH=`echo $arch | tr '[a-z]' '[A-Z]'` |
| 80 | |
| 81 | changequote([,])dnl |
Ulrich Drepper | 0d2d323 | 1999-05-29 04:11:48 +0000 | [diff] [blame] | 82 | CFLAGS="-D_GNU_SOURCE $CFLAGS" |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 83 | AC_CONFIG_HEADER(config.h) |
| 84 | AC_SUBST(opsys) |
| 85 | AC_DEFINE_UNQUOTED($OPSYS) |
Wichert Akkerman | ea78f0f | 1999-11-29 15:34:02 +0000 | [diff] [blame] | 86 | case "$host_os" in |
| 87 | sysv4.2uw*) |
| 88 | AC_DEFINE(UNIXWARE, 2) |
| 89 | ;; |
| 90 | sysv5*) |
| 91 | AC_DEFINE(UNIXWARE, 7) |
| 92 | ;; |
| 93 | esac |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 94 | AC_SUBST(arch) |
| 95 | AC_DEFINE_UNQUOTED($ARCH) |
| 96 | AC_SUBST(osarch) |
| 97 | AC_PROG_CC |
| 98 | AC_PROG_HOSTCC($host_alias $host) |
Wichert Akkerman | ea78f0f | 1999-11-29 15:34:02 +0000 | [diff] [blame] | 99 | AC_MP_PROCFS |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 100 | AC_POLLABLE_PROCFS |
| 101 | AC_STRUCT_PR_SYSCALL |
| 102 | AC_STRUCT_MSG_CONTROL |
| 103 | AC_INCLUDEDIR |
| 104 | if test "x$OPSYS" = "xSUNOS4" && test "x$ARCH" = "xSPARC" |
| 105 | then |
| 106 | AC_MSG_CHECKING(for valid machine include directory) |
| 107 | if test -d "$includedir/sun4" |
| 108 | then |
| 109 | rm -f machine |
| 110 | ln -s $includedir/sun4 machine |
| 111 | AC_MSG_RESULT(yes) |
| 112 | AC_DEFINE(SUNOS4_KERNEL_ARCH_KLUDGE) |
| 113 | else |
| 114 | AC_MSG_RESULT(no) |
| 115 | fi |
| 116 | fi |
| 117 | AC_WARNFLAGS |
| 118 | if test "x$OPSYS" = "xSUNOS4" |
| 119 | then |
| 120 | if test -n "$GCC" |
| 121 | then |
| 122 | # SunOS 4.x header files don't declare int functions. |
| 123 | WARNFLAGS="$WARNFLAGS -Wno-implicit" |
| 124 | fi |
| 125 | fi |
| 126 | AC_PROG_CPP |
| 127 | AC_PROG_GCC_TRADITIONAL |
| 128 | AC_PROG_INSTALL |
| 129 | AC_C_CONST |
| 130 | AC_HEADER_STDC |
| 131 | AC_HEADER_DIRENT |
| 132 | AC_TYPE_SIGNAL |
| 133 | AC_STRUCT_ST_BLKSIZE |
| 134 | AC_STRUCT_ST_BLOCKS |
| 135 | AC_STRUCT_ST_RDEV |
| 136 | AC_HEADER_STAT |
| 137 | AC_TYPE_UID_T |
| 138 | AC_TYPE_MODE_T |
| 139 | AC_TYPE_GETGROUPS |
| 140 | AC_HEADER_MAJOR |
| 141 | AC_SIG_ATOMIC_T |
Ulrich Drepper | dfff33c | 1999-12-24 08:03:15 +0000 | [diff] [blame^] | 142 | AC_STAT64 |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 143 | AC_CHECK_LIB(nsl, main) |
Wichert Akkerman | 9ce1a63 | 1999-08-29 23:15:07 +0000 | [diff] [blame] | 144 | AC_CHECK_FUNCS(sigaction strerror strsignal pread sys_siglist _sys_siglist getdents mctl putpmsg prctl sendmsg inet_ntop) |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 145 | 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) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 146 | AC_DECL_SYS_ERRLIST |
| 147 | AC_DECL_SYS_SIGLIST |
| 148 | AC_DECL__SYS_SIGLIST |
Wichert Akkerman | 9ce1a63 | 1999-08-29 23:15:07 +0000 | [diff] [blame] | 149 | if test ! -d $osarch; then |
| 150 | mkdir -p $osarch |
| 151 | fi |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 152 | AC_OUTPUT(Makefile $osarch/Makefile) |