[go: up one dir, main page]

File: configure.in

package info (click to toggle)
sing 1.1-17
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,496 kB
  • ctags: 2,092
  • sloc: ansic: 20,745; sh: 4,924; makefile: 718; yacc: 234; lex: 203
file content (183 lines) | stat: -rw-r--r-- 4,318 bytes parent folder | download | duplicates (5)
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
dnl $Id: configure.in,v 1.5 2001/02/13 10:52:01 slay Exp $
dnl
dnl Process this file with autoconf to produce a configure script.
dnl

AC_INIT(sing.c)

AM_CONFIG_HEADER(config.h)

AC_CANONICAL_SYSTEM

AM_INIT_AUTOMAKE(SING, 1.1)

AC_PROG_CC
if test -n "$GCC"; then
      CFLAGS="-O3 -Wall"
fi

AC_STDC_HEADERS

AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(getopt_SOURCES)
AC_SUBST(getopt_OBJECTS)

AC_PROG_INSTALL
AC_PATH_PROG(MAKEDEPEND, makedepend)


dnl
dnl Check for libs
dnl
AC_CHECK_LIB(socket,main)
AC_CHECK_LIB(resolv,main)
AC_CHECK_LIB(nsl,main)
AC_CHECK_LIB(pcap, pcap_datalink, have_libpcap=yes, have_libpcap=no)
AC_CHECK_LIB(net, libnet_open_raw_sock, have_libnet=yes, have_libnet=no)

dnl
dnl Check headers
dnl
AC_CHECK_HEADERS(sys/sockio.h string.h strings.h bstring.h sys/ioctl.h)
AC_CHECK_HEADERS(sys/time.h sys/param.h netinet/in_systm.h netinet/in_system.h)
AC_CHECK_HEADERS(net/if.h unistd.h)
AC_HEADER_TIME

AC_C_BIGENDIAN

dnl
dnl Check structs
dnl
AC_MSG_CHECKING([for struct ip])
AC_TRY_COMPILE([#include <sys/types.h>
		#include <netinet/in.h>
		#include <netinet/in_systm.h>
		#include <netinet/ip.h>],
	               [struct ip ip;],
        	       [AC_MSG_RESULT(yes);
	AC_DEFINE(HAVE_STRUCT_IP)
	AC_MSG_CHECKING([if struct ip has ip_sum field])
	AC_TRY_COMPILE([#include <sys/types.h>
	#include <netinet/in.h>
	#include <netinet/in_systm.h>
	#include <netinet/ip.h>],
                   [struct ip ip; ip.ip_sum;],
                   [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_IP_IP_SUM)],
                   [AC_MSG_RESULT(no);

		AC_MSG_CHECKING([if struct ip has ip_csum field])
		AC_TRY_COMPILE([#include <sys/types.h>
		#include <netinet/in.h>
		#include <netinet/in_systm.h>
		#include <netinet/ip.h>],
                	   [struct ip ip; ip.ip_csum;],
                   	[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_IP_IP_CSUM)],
	                   [AC_MSG_RESULT(no);])
])

], [AC_MSG_RESULT(no);]);

dnl
dnl sockaddr sa_len?
dnl
AC_MSG_CHECKING([if struct sockaddr has sa_len field])
AC_TRY_COMPILE([#include <sys/types.h>
		#include <sys/socket.h>],
	        [struct sockaddr sa; sa.sa_len;],
        	[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SOCKADDR_SA_LEN)],
                [AC_MSG_RESULT(no);]
)


case "$target_os" in

   *linux*)
           AC_DEFINE(LINUX)
           AC_DEFINE(CAN_FRAGMENT)
           case "`uname -r`" in
                2.4*)
                   AC_DEFINE(LINUX_24)
                ;;
                2.2*)
                   AC_DEFINE(LINUX_22)
                ;;
                2.1*)
                   AC_DEFINE(LINUX_21)
                ;;
                2.0*)
                   AC_DEFINE(LINUX_20)
                ;;
           esac
           ;;

   *solaris*)
           AC_DEFINE(SOLARIS)
           case "`uname -r`" in
                5.5.1)
                   AC_DEFINE(SOLARIS_251)
                ;;
                5.6*)
                   AC_DEFINE(SOLARIS_26)
                ;;
                5.7*)
                   AC_DEFINE(SOLARIS_27)
                ;;
                5.8*)
                   AC_DEFINE(SOLARIS_27)
                ;;                
           esac
           ;;

   *freebsd*)
           AC_DEFINE(FREEBSD)
           AC_DEFINE(STRANGE_BSD_BYTE)
           AC_DEFINE(CAN_FRAGMENT)
           ;;

   *netbsd*)
           AC_DEFINE(NETBSD)
           AC_DEFINE(STRANGE_BSD_BYTE)
           AC_DEFINE(CAN_FRAGMENT)
           ;;

   *openbsd*)
           AC_DEFINE(OPENBSD)
           AC_DEFINE(CAN_FRAGMENT)
           case "`uname -r`" in
                1.*)
                   AC_DEFINE(STRANGE_BSD_BYTE)
                ;;
                2.0*)
                   AC_DEFINE(STRANGE_BSD_BYTE)
                ;;
                2.*)

                ;;
                *)
                  AC_DEFINE(STRANGE_BSD_BYTE)
                ;;
           esac
           ;;

   *)
       AC_MSG_WARN(it seems that your OS is not supported)
       AC_MSG_WARN(and this may cause troubles)
       AC_MSG_WARN(please send bugs and diffs to aandres@s21sec.com)
    ;;

esac

dnl
dnl Check for library functions
dnl
AC_CHECK_FUNCS(memcpy memset)
AC_CHECK_FUNCS(getopt_long_only, , [ getopt_SOURCES="getopt.c getopt1.c getopt.h"
 getopt_OBJECTS="getopt.o getopt1.o" ])


dnl
dnl Build Makefile.
dnl
AC_OUTPUT(Makefile)