File: configure.in

package info (click to toggle)
sniffit 0.3.7.beta-15
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 1,096 kB
  • ctags: 1,421
  • sloc: ansic: 11,592; sh: 2,296; yacc: 234; lex: 203; makefile: 162
file content (111 lines) | stat: -rw-r--r-- 2,270 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
dnl Sniffit configure.in File
dnl   - by: Brecht Claerhout 
dnl
dnl GNU Autoconf file

AC_INIT(sniffit.h)

dnl Config of libpcap
AC_CONFIG_SUBDIRS(libpcap)

dnl Check the C compiler
AC_PROG_CC

dnl Check NCURSES availability
NCURSES_PATH=/usr/include:/usr/include/ncurses:/usr/include/curses:/usr/local/include:/usr/local/include/ncurses:/usr/local/include/curses:./:./ncurses.h
ncurses_warn=0
AC_CHECK_LIB(ncurses,main,,ncurses_warn=1)

AC_PATH_PROGS(NCURSES_LOCATION,ncurses.h,no,$NCURSES_PATH)
if test "$NCURSES_LOCATION" != no; then
	echo "#include \"$NCURSES_LOCATION\"" >sn_curses.h
	AC_DEFINE(HAVE_NCURSES_H,1)
else
	ncurses_warn=1
fi

dnl Print warning for interactive mode
if test $ncurses_warn -ne 0; then
        AC_MSG_WARN(Interactive mode (-i/-I) will NOT be supported.!)
	AC_MSG_WARN(Install ncurses!)       
fi

dnl Check Shared Memory support
AC_CHECK_FUNCS(shmget)

dnl exit function check
AC_CHECK_FUNCS(atexit)

dnl Check the datalength
AC_CHECK_SIZEOF(unsigned short int)
if test $ac_cv_sizeof_unsigned_short_int -ne 2; then
	echo "unsigned short is NOT 2 bytes... quiting"
	exit
fi

AC_CHECK_SIZEOF(unsigned long int)
if test $ac_cv_sizeof_unsigned_long_int -eq 4; then
AC_DEFINE(USE_32_LONG_INT)
else
	echo "unsigned long is NOT 4 bytes... hmmm..."
	AC_CHECK_SIZEOF(unsigned int)
	if test $ac_cv_sizeof_unsigned_int -ne 4; then
		echo "unsigned int is NOT 4 bytes either... quiting"
        	exit
	else
		AC_DEFINE(USE_32_INT)
	fi
fi


dnl Check the OS
AC_CANONICAL_SYSTEM
case "$target_os" in
linux*)
	AC_DEFINE(LINUX)
	OS_OPT=	
	AC_SUBST(OS_OPT)
        ;;
sunos*)
	AC_DEFINE(SUNOS)
	AC_CHECK_LIB(socket,main)
	AC_CHECK_LIB(nsl,main)
	OS_OPT=
	AC_SUBST(OS_OPT)
	;;
solaris*)
	AC_DEFINE(SUNOS)
	AC_CHECK_LIB(socket,main)
	AC_CHECK_LIB(nsl,main)
	OS_OPT=
	AC_SUBST(OS_OPT)
        ;;
hpux*)
	AC_DEFINE(HPUX)
	OS_OPT=
	AC_SUBST(OS_OPT)
        ;;
irix*)
	AC_DEFINE(IRIX)
	OS_OPT=
	AC_SUBST(OS_OPT)
        ;;
freebsd*)
	AC_DEFINE(FREEBSD)
	OS_OPT=
	AC_SUBST(OS_OPT)
        ;;
netbsd*)
	AC_DEFINE(NETBSD)
	OS_OPT=
	AC_SUBST(OS_OPT)
        ;;
*)
	echo "NOT A SUPPORTED SYSTEM / OR SYSTEM NOT RECOGNISED"
	echo "Contact <Coder@reptile.rug.ac.be> if you feel it might be a bug."
	exit	
	;;
esac                    

dnl FINISHED!
AC_OUTPUT(Makefile)