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 | 8829a55 | 1999-06-11 13:18:40 +0000 | [diff] [blame] | 19 | irix[56]*) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 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 | ;; |
Wichert Akkerman | f90da01 | 1999-10-31 21:15:38 +0000 | [diff] [blame^] | 44 | mips*) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 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=' |
Wichert Akkerman | 2e2553a | 1999-05-09 00:29:58 +0000 | [diff] [blame] | 64 | @@@syms="$syms I386 M68K SPARC MIPS ALPHA ARM POWERPC"@@@ |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 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 |
Ulrich Drepper | 0d2d323 | 1999-05-29 04:11:48 +0000 | [diff] [blame] | 76 | CFLAGS="-D_GNU_SOURCE $CFLAGS" |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 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) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 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) |
Wichert Akkerman | 9ce1a63 | 1999-08-29 23:15:07 +0000 | [diff] [blame] | 128 | AC_CHECK_FUNCS(sigaction strerror strsignal pread sys_siglist _sys_siglist getdents mctl putpmsg prctl sendmsg inet_ntop) |
Wichert Akkerman | 15dea97 | 1999-10-06 13:06:34 +0000 | [diff] [blame] | 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) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 130 | AC_DECL_SYS_ERRLIST |
| 131 | AC_DECL_SYS_SIGLIST |
| 132 | AC_DECL__SYS_SIGLIST |
Wichert Akkerman | 9ce1a63 | 1999-08-29 23:15:07 +0000 | [diff] [blame] | 133 | if test ! -d $osarch; then |
| 134 | mkdir -p $osarch |
| 135 | fi |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 136 | AC_OUTPUT(Makefile $osarch/Makefile) |