| 1 | |
|---|
| 2 | AC_PREREQ(2.62) |
|---|
| 3 | define([svnversion], esyscmd([sh -c "echo -n $(( `svnversion | tr -d 'M'` + 1 ))"]))dnl |
|---|
| 4 | AC_INIT([onioncat],[[0.2.0.r]svnversion],[rahra@cypherpunk.at]) |
|---|
| 5 | AM_INIT_AUTOMAKE([-Wall -Werror]) |
|---|
| 6 | AC_CONFIG_HEADERS([config.h]) |
|---|
| 7 | |
|---|
| 8 | AC_DEFINE(SVN_REVISION, "svnversion", [SVN Revision]) |
|---|
| 9 | |
|---|
| 10 | AC_SUBST([CFLAGS], [["-Wall -O2"]]) |
|---|
| 11 | |
|---|
| 12 | AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug],[enable debugging]), AC_DEFINE([DEBUG], [], [enable debugging])) |
|---|
| 13 | AC_ARG_ENABLE([packet-log], AS_HELP_STRING([--enable-packet-log],[enable packet logging]), AC_DEFINE([PACKET_LOG], [], [enable packet logging])) |
|---|
| 14 | AC_ARG_ENABLE([handle-http], AS_HELP_STRING([--enable-handle-http],[enable handling of accidental HTTP requests]), AC_DEFINE([HANDLE_HTTP], [], [enable handling of accidental HTTP requests])) |
|---|
| 15 | AC_ARG_ENABLE([packet-queue], AS_HELP_STRING([--enable-packet-queue],[enable queueuing of packets while connecting setup]), AC_DEFINE([PACKET_QUEUE], [], [enable packet queue])) |
|---|
| 16 | AC_ARG_ENABLE([check-ipsrc], AS_HELP_STRING([--disable-check-ipsrc],[disable source ip checking before forwarding]), AC_DEFINE([CHECK_IPSRC], [], [disable source ip checking])) |
|---|
| 17 | AC_ARG_ENABLE([rtt], AS_HELP_STRING([--enable-rtt],[enable inband RTT measurement]), AC_DEFINE([MEASURE_RTT], [], [enable RTT measurement])) |
|---|
| 18 | |
|---|
| 19 | # Checks for programs. |
|---|
| 20 | AC_PROG_CC |
|---|
| 21 | #AC_PROG_INSTALL |
|---|
| 22 | AC_PROG_LN_S |
|---|
| 23 | ACX_PTHREAD |
|---|
| 24 | |
|---|
| 25 | # Checks for libraries. |
|---|
| 26 | #AC_CHECK_LIB([pthread], [pthread_create]) |
|---|
| 27 | #AC_CHECK_LIB([rt], [clock_gettime]) |
|---|
| 28 | #AC_CHECK_LIB([readline], [main]) |
|---|
| 29 | |
|---|
| 30 | LIBS="$PTHREAD_LIBS $LIBS" |
|---|
| 31 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS" |
|---|
| 32 | CC="$PTHREAD_CC" |
|---|
| 33 | |
|---|
| 34 | # Checks for header files. |
|---|
| 35 | #AC_HEADER_STDC |
|---|
| 36 | AC_CHECK_HEADERS([sys/types.h sys/socket.h netinet/in.h netinet/in_systm.h netinet/ip.h netinet/ip6.h netinet/in6.h net/if.h net/if_tun.h linux/if_tun.h linux/sockios.h endian.h sys/endian.h netinet/icmp6.h net/ethernet.h netinet/if_ether.h netinet/ether.h], [], [], |
|---|
| 37 | [[ |
|---|
| 38 | #ifdef HAVE_SYS_TYPES_H |
|---|
| 39 | #include <sys/types.h> |
|---|
| 40 | #endif |
|---|
| 41 | #ifdef HAVE_SYS_SOCKET_H |
|---|
| 42 | #include <sys/socket.h> |
|---|
| 43 | #endif |
|---|
| 44 | #ifdef HAVE_NETINET_IN_H |
|---|
| 45 | #include <netinet/in.h> |
|---|
| 46 | #endif |
|---|
| 47 | #ifdef HAVE_NETINET_IN_SYSTM_H |
|---|
| 48 | #include <netinet/in_systm.h> |
|---|
| 49 | #endif |
|---|
| 50 | #ifdef HAVE_NET_IF_H |
|---|
| 51 | #include <net/if.h> |
|---|
| 52 | #endif |
|---|
| 53 | ]] |
|---|
| 54 | ) |
|---|
| 55 | #AC_CHECK_HEADERS([readline/readline.h readline/history.h], [], [], []) |
|---|
| 56 | |
|---|
| 57 | # Checks for typedefs, structures, and compiler characteristics. |
|---|
| 58 | AC_C_CONST |
|---|
| 59 | #AC_TYPE_UID_T |
|---|
| 60 | #AC_STRUCT_TM |
|---|
| 61 | #AC_TYPE_UINT16_T |
|---|
| 62 | #AC_TYPE_UINT32_T |
|---|
| 63 | #AC_TYPE_UINT8_T |
|---|
| 64 | #AC_CHECK_MEMBER([struct sockaddr_in.sin_addr], [AC_DEFINE([HAVE_SIN_LEN], [1], [define if struct sockaddr_in.sin_len exists])]) |
|---|
| 65 | #AC_CHECK_TYPE([struct sockaddr_in], [AC_DEFINE([HAVE_STRUCT_IP6_HDR],[1],[define if struct ip6_hdr exists])]) |
|---|
| 66 | |
|---|
| 67 | AC_CHECK_TYPES([struct ip6_hdr], , , |
|---|
| 68 | [ |
|---|
| 69 | #ifdef HAVE_SYS_TYPES_H |
|---|
| 70 | #include <sys/types.h> |
|---|
| 71 | #endif |
|---|
| 72 | #ifdef HAVE_NETINET_IN_H |
|---|
| 73 | #include <netinet/in.h> |
|---|
| 74 | #endif |
|---|
| 75 | #ifdef HAVE_NETINET_IN6_H |
|---|
| 76 | #include <netinet/in6.h> |
|---|
| 77 | #endif |
|---|
| 78 | #ifdef HAVE_NETINET_IP6_H |
|---|
| 79 | #include <netinet/ip6.h> |
|---|
| 80 | #endif |
|---|
| 81 | ]) |
|---|
| 82 | |
|---|
| 83 | AC_CHECK_TYPES([struct iphdr], , , |
|---|
| 84 | [ |
|---|
| 85 | #ifdef HAVE_SYS_TYPES_H |
|---|
| 86 | #include <sys/types.h> |
|---|
| 87 | #endif |
|---|
| 88 | #ifdef HAVE_NETINET_IN_H |
|---|
| 89 | #include <netinet/in.h> |
|---|
| 90 | #endif |
|---|
| 91 | #ifdef HAVE_NETINET_IP_H |
|---|
| 92 | #include <netinet/ip.h> |
|---|
| 93 | #endif |
|---|
| 94 | ]) |
|---|
| 95 | |
|---|
| 96 | AC_CHECK_TYPES([struct ip], , , |
|---|
| 97 | [ |
|---|
| 98 | #ifdef HAVE_SYS_TYPES_H |
|---|
| 99 | #include <sys/types.h> |
|---|
| 100 | #endif |
|---|
| 101 | #ifdef HAVE_NETINET_IN_H |
|---|
| 102 | #include <netinet/in.h> |
|---|
| 103 | #endif |
|---|
| 104 | #ifdef HAVE_NETINET_IN_SYSTM_H |
|---|
| 105 | #include <netinet/in_systm.h> |
|---|
| 106 | #endif |
|---|
| 107 | #ifdef HAVE_NETINET_IP_H |
|---|
| 108 | #include <netinet/ip.h> |
|---|
| 109 | #endif |
|---|
| 110 | ]) |
|---|
| 111 | |
|---|
| 112 | AC_CHECK_MEMBER([struct sockaddr_in.sin_len], |
|---|
| 113 | [ AC_DEFINE(HAVE_SIN_LEN, 1, [Do we have sockaddr_in.sin_len?]) ], |
|---|
| 114 | [], |
|---|
| 115 | [ |
|---|
| 116 | #include <sys/types.h> |
|---|
| 117 | #include <sys/socket.h> |
|---|
| 118 | #ifdef HAVE_NETINET_IN_H |
|---|
| 119 | #include <netinet/in.h> |
|---|
| 120 | #endif |
|---|
| 121 | ]) |
|---|
| 122 | |
|---|
| 123 | # Checks for library functions. |
|---|
| 124 | #AC_PROG_GCC_TRADITIONAL |
|---|
| 125 | #AC_FUNC_MALLOC |
|---|
| 126 | #AC_FUNC_MEMCMP |
|---|
| 127 | #AC_FUNC_SELECT_ARGTYPES |
|---|
| 128 | #AC_FUNC_STRFTIME |
|---|
| 129 | #AC_FUNC_VPRINTF |
|---|
| 130 | #AC_CHECK_FUNCS([clock_gettime memset select socket strchr strerror]) |
|---|
| 131 | AC_CHECK_FUNCS([strlcat strlcpy ether_ntoa ether_ntoa_r]) |
|---|
| 132 | |
|---|
| 133 | AC_CONFIG_FILES([Makefile src/cygwin/Makefile src/Makefile man/Makefile]) |
|---|
| 134 | AC_OUTPUT |
|---|
| 135 | |
|---|