Annotation of embedaddon/trafshow/configure.in, revision 1.1.1.1
1.1 misho 1: dnl
2: dnl Copyright (c) 2003 Rinet Corp., Novosibirsk, Russia
3: dnl
4: dnl Redistribution and use in source forms, with and without modification,
5: dnl are permitted provided that this entire comment appears intact.
6: dnl Redistribution in binary form may occur without any restrictions.
7: dnl
8: dnl THIS SOFTWARE IS PROVIDED ``AS IS'' WITHOUT ANY WARRANTIES OF ANY KIND.
9: dnl
10:
11: dnl
12: dnl configure.in -- template for ./configure
13: dnl Process this file with `autoconf' to produce a configure script
14: dnl remember to edit configure.in, not ./configure
15: dnl
16:
17: AC_INIT(trafshow.c)
18: AC_CONFIG_HEADER(config.h)
19:
20: AC_CANONICAL_SYSTEM
21:
22: dnl Checks for misc required programs.
23: AC_PROG_CC
24: AC_PROG_YACC
25: AC_PROG_LEX
26: AC_REQUIRE_CPP
27: AC_AIX
28: ACX_PTHREAD(, AC_MSG_ERROR(cannot find pthread; see the INSTALL notes))
29:
30: dnl Checks for header files.
31: AC_HEADER_STDC
32: AC_HEADER_TIME
33: AC_CHECK_HEADERS(sys/termios.h net/if_dl.h paths.h resolv.h)
34:
35: dnl Checks for typedefs, structures, and compiler characteristics.
36: AC_C_CONST
37: AC_CHECK_TYPE(u_int8_t, unsigned char)
38: AC_CHECK_TYPE(u_int16_t, unsigned short)
39: AC_CHECK_TYPE(u_int32_t, unsigned int)
40: AC_CHECK_TYPE(u_int64_t, unsigned long long)
41:
42: dnl AC_CHECK_TYPE(in_addr_t, unsigned int)
43: dnl Some OS keeps in_addr_t in netinet/in.h not in sys/types.h
44: AC_CACHE_CHECK(for in_addr_t, ac_cv_type_in_addr_t,
45: AC_TRY_COMPILE([
46: #include <sys/types.h>
47: #include <netinet/in.h>
48: ],[in_addr_t ipaddr],
49: ac_cv_type_in_addr_t="yes",
50: ac_cv_type_in_addr_t="unsigned int"
51: )
52: )
53: if test "$ac_cv_type_in_addr_t" != yes; then
54: AC_DEFINE_UNQUOTED(in_addr_t, $ac_cv_type_in_addr_t)
55: fi
56:
57: AC_CACHE_CHECK(for socklen_t, ac_cv_type_socklen_t,
58: AC_TRY_COMPILE([
59: #include <sys/types.h>
60: #include <sys/socket.h>
61: #include <netdb.h>
62: ],[socklen_t slen],
63: ac_cv_type_socklen_t="yes",
64: ac_cv_type_socklen_t="int"
65: )
66: )
67: if test "$ac_cv_type_socklen_t" != yes; then
68: AC_DEFINE_UNQUOTED(socklen_t, $ac_cv_type_socklen_t)
69: fi
70:
71: AC_CACHE_CHECK(for struct sockaddr_storage, ac_cv_sockaddr_storage,
72: AC_TRY_COMPILE([
73: #include <sys/types.h>
74: #include <sys/socket.h>
75: #include <netinet/in.h>
76: ],[struct sockaddr_storage ss],
77: ac_cv_sockaddr_storage="yes",
78: ac_cv_sockaddr_storage="no"
79: )
80: )
81: if test "$ac_cv_sockaddr_storage" != no; then
82: AC_DEFINE(HAVE_SOCKADDR_STORAGE)
83: fi
84:
85: AC_CACHE_CHECK(for struct ether_addr, ac_cv_ether_addr,
86: AC_TRY_COMPILE([
87: #include <sys/types.h>
88: #include <sys/socket.h>
89: #include <net/if.h>
90: #include <netinet/if_ether.h>
91: ],[struct ether_addr ea],
92: ac_cv_ether_addr="yes",
93: ac_cv_ether_addr="no"
94: )
95: )
96: if test "$ac_cv_ether_addr" != no; then
97: AC_DEFINE(HAVE_ETHER_ADDR)
98: fi
99:
100: dnl Check for network system libraries.
101: AC_CHECK_LIB(resolv, main)
102: AC_CHECK_LIB(inet, main)
103: AC_CHECK_LIB(nsl, gethostbyname)
104: AC_CHECK_LIB(socket, connect)
105:
106: dnl Checks for library functions.
107: AC_CHECK_FUNCS(siginterrupt)
108: AC_REPLACE_FUNCS(snprintf strftime strcasecmp)
109:
110: dnl Check for pcap libraries.
111: AC_CHECK_LIB(pcap, pcap_findalldevs,,
112: AC_MSG_ERROR(at least libpcap 0.7 is required; see the INSTALL notes))
113: AC_CHECK_FUNCS(pcap_dump_flush)
114: AC_CHECK_FUNCS(pcap_get_selectable_fd)
115:
116: dnl termcap library may be required.
117: AC_CHECK_LIB(termcap, tgetent)
118:
119: AC_MSG_CHECKING(for curses library)
120: AC_CACHE_VAL(ac_cv_have_curses,
121: ac_cv_save_CFLAGS="$CFLAGS"
122: ac_cv_save_LIBS="$LIBS"
123: LIBS="-lslang $ac_cv_save_LIBS"
124: AC_TRY_LINK([#include <slcurses.h>],[initscr();],
125: ac_cv_have_curses="slang",
126: LIBS="-lncurses $ac_cv_save_LIBS"
127: AC_TRY_LINK([#include <ncurses.h>], [initscr();],
128: ac_cv_have_curses="ncurses",
129: CFLAGS="-I/usr/include/ncurses $ac_cv_save_CFLAGS"
130: AC_TRY_LINK([#include <ncurses.h>], [initscr();],
131: ac_cv_have_curses="n_curses",
132: LIBS="-lcurses $ac_cv_save_LIBS"
133: AC_TRY_LINK([#include <curses.h>], [initscr();],
134: ac_cv_have_curses="curses",
135: ac_cv_have_curses="none"
136: )
137: )
138: )
139: )
140: CFLAGS="$ac_cv_save_CFLAGS"
141: )
142: AC_MSG_RESULT($ac_cv_have_curses)
143:
144: case "$ac_cv_have_curses" in
145:
146: slang)
147: AC_DEFINE(HAVE_SLCURSES)
148: AC_DEFINE(HAVE_HAS_COLORS)
149: ;;
150: ncurses)
151: AC_DEFINE(HAVE_NCURSES)
152: AC_CHECK_FUNCS(has_colors)
153: ;;
154: n_curses)
155: CFLAGS="-I/usr/include/ncurses $CFLAGS"
156: AC_DEFINE(HAVE_NCURSES)
157: AC_CHECK_FUNCS(has_colors)
158: ;;
159: curses)
160: AC_DEFINE(HAVE_CURSES)
161: AC_CHECK_FUNCS(has_colors)
162: ;;
163: *)
164: AC_MSG_ERROR(cannot find curses; see the INSTALL notes)
165: ;;
166: esac
167:
168: AC_CHECK_FUNCS(bkgd wbkgd wredrawln resizeterm use_default_colors)
169:
170: AC_OUTPUT(Makefile)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>