File: configure.ac

package info (click to toggle)
scamper 20161113-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 7,928 kB
  • ctags: 8,226
  • sloc: ansic: 83,690; sh: 4,102; makefile: 376; perl: 171
file content (318 lines) | stat: -rw-r--r-- 8,464 bytes parent folder | download
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
# Process this file with autoconf to produce a configure script.

AC_INIT([scamper], [20161113], [mjl@luckie.org.nz])

AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([scamper/scamper.c])
AM_INIT_AUTOMAKE
AC_CONFIG_HEADER([config.h])

AC_PROG_LIBTOOL
AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
AC_PROG_MKDIR_P
AC_LANG(C)

# Whether all the debugging output should be spewed out
AC_ARG_ENABLE([debug],
  [AS_HELP_STRING([--enable-debug], [build with debugging symbols])])

if test "x$enable_debug" != "xyes"; then
  AC_DEFINE([NDEBUG],[1],[Defined to 1 if we don't want to do any debugging])
fi

# No privilege separation
AC_ARG_ENABLE([privsep],
  [AS_HELP_STRING([--disable-privsep], [disable privilege separation])])

if test "x$enable_privsep" = xno; then
  AC_DEFINE([WITHOUT_PRIVSEP], [1], [Defined to 1 if we don't want privilege separation])
fi

# privsep parameters
AC_ARG_WITH([privsep_user],
  [AC_HELP_STRING([--with-privsep-user=USER],
    [sets user name for privsep process])],
  [privsep_user=$withval],
  [privsep_user=nobody])
AC_ARG_WITH([privsep_dir],
  [AC_HELP_STRING([--with-privsep-dir=DIR],
    [sets chroot directory for privsep process])],
  [privsep_dir=$withval],
  [privsep_dir=/var/empty])
AC_ARG_WITH([privsep_dir_owner],
  [AC_HELP_STRING([--with-privsep-dir-user=USER],
    [sets chroot directory owner])],
  [privsep_dir_user=$withval],
  [privsep_dir_user=root])
AC_ARG_WITH([privsep_dir_group],
  [AC_HELP_STRING([--with-privsep-dir-group=GROUP],
    [sets chroot directory group id])],
  [privsep_dir_group=$withval],
  [privsep_dir_group=wheel])
AC_SUBST(privsep_user)
AC_SUBST(privsep_dir)
AC_SUBST(privsep_dir_user)
AC_SUBST(privsep_dir_group)
AC_DEFINE_UNQUOTED(PRIVSEP_USER,
  ["$privsep_user"],
  [user name for privsep process])
AC_DEFINE_UNQUOTED(PRIVSEP_DIR,
  ["$privsep_dir"],
  [chroot directory for privsep process])
AC_DEFINE_UNQUOTED(PRIVSEP_DIR_USER,
  ["$privsep_dir_user"],
  [chroot directory owner])
AC_DEFINE_UNQUOTED(PRIVSEP_DIR_GROUP,
  ["$privsep_dir_group"],
  [chroot directory group id])

# Debug file support
AC_ARG_ENABLE([debug-file],
  [AS_HELP_STRING([--disable-debug-file],
    [remove support for generating a debug file])])

if test "x$enable_debug_file" = xno; then
  AC_DEFINE([WITHOUT_DEBUGFILE], [1], [Defined to 1 if we don't want to be able generate a debugfile])
fi

# dmalloc support
AC_ARG_WITH([dmalloc],
  [AS_HELP_STRING([--with-dmalloc],
     [enable support for dmalloc])])

if test "x$with_dmalloc" = xyes; then
	AC_CHECK_LIB([dmalloc],	[dmalloc_malloc],
		[
		CFLAGS="$CFLAGS -DDMALLOC"
		LDFLAGS="$LDFLAGS -ldmalloc"
		],
		[AC_MSG_FAILURE([dmalloc test failed (remove --with-dmalloc)])])

fi

# Checks for libraries.
AC_CHECK_LIB([iphlpapi], [GetIpNetTable])
AC_CHECK_LIB([ws2_32], [WSAStartup])

# Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
AC_CHECK_HEADERS(arpa/inet.h)
AC_CHECK_HEADERS(fcntl.h)
AC_CHECK_HEADERS(limits.h)
AC_CHECK_HEADERS(netdb.h)
AC_CHECK_HEADERS(net/if_dl.h)
AC_CHECK_HEADERS(net/if_types.h)
AC_CHECK_HEADERS(netinet/in.h)
AC_CHECK_HEADERS(poll.h)
AC_CHECK_HEADERS(stdint.h)
AC_CHECK_HEADERS(stdlib.h)
AC_CHECK_HEADERS(string.h)
AC_CHECK_HEADERS(sys/epoll.h)
AC_CHECK_HEADERS(sys/event.h)
AC_CHECK_HEADERS(sys/ioctl.h)
AC_CHECK_HEADERS(sys/param.h)
AC_CHECK_HEADERS(sys/socket.h)
AC_CHECK_HEADERS(sys/time.h)
AC_CHECK_HEADERS(unistd.h)
AC_CHECK_HEADERS(ifaddrs.h)

# sys/sysctl.h requires other headers on at least OpenBSD
AC_CHECK_HEADERS([sys/sysctl.h], [], [],
[[
#if HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
]])

AC_CHECK_HEADERS([netinet/ip_fw.h netinet6/ip6_fw.h], [], [],
[[
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#if HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
#if HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#if HAVE_ARPA_INET_H
# include <arpa/inet.h>
#endif
#include <net/if.h>
#include <netinet/ip_compat.h>
]])

AC_CHECK_HEADERS([netinet/tcp_var.h], [], [],
[[
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#if HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
#if HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#include <sys/queue.h>
#include <netinet/tcp.h>
]])

AC_CHECK_HEADERS(net/pfvar.h, [], [],
[[
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <net/if.h>
]])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_UID_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_STRUCT_TM
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T

# Checks for library functions.
AC_FUNC_CHOWN
AC_FUNC_FORK
AC_CHECK_FUNCS(arc4random)
AC_CHECK_FUNCS(arc4random_uniform)
AC_CHECK_FUNCS(atexit)
AC_CHECK_FUNCS(calloc)
AC_CHECK_FUNCS(daemon)
AC_CHECK_FUNCS(endpwent)
AC_CHECK_FUNCS(epoll_wait)
AC_CHECK_FUNCS(ftruncate)
AC_CHECK_FUNCS(getdtablesize)
AC_CHECK_FUNCS(gethostname)
AC_CHECK_FUNCS(getifaddrs)
AC_CHECK_FUNCS(getpagesize)
AC_CHECK_FUNCS(gettimeofday)
AC_CHECK_FUNCS(kqueue)
AC_CHECK_FUNCS(memmove)
AC_CHECK_FUNCS(memset)
AC_CHECK_FUNCS(mkdir)
AC_CHECK_FUNCS(poll)
AC_CHECK_FUNCS(rmdir)
AC_CHECK_FUNCS(select)
AC_CHECK_FUNCS(socket)
AC_CHECK_FUNCS(snprintf)
AC_CHECK_FUNCS(setproctitle)
AC_CHECK_FUNCS(strcasecmp)
AC_CHECK_FUNCS(strcasestr)
AC_CHECK_FUNCS(strdup)
AC_CHECK_FUNCS(strerror)
AC_CHECK_FUNCS(strncasecmp)
AC_CHECK_FUNCS(strtol)
AC_CHECK_FUNCS(uname)

AC_CHECK_SIZEOF(long)

AC_CHECK_MEMBER([struct sockaddr.sa_len],
	[AC_DEFINE([HAVE_STRUCT_SOCKADDR_SA_LEN],[1],
	[Define if struct sockaddr has an sa_len member])],[:],
	[#include <sys/types.h>
	 #include <sys/socket.h>])

if test "x$ac_cv_header_net_pfvar_h" == xyes; then
   AC_CHECK_MEMBER([struct pfioc_trans_e.type],
	[AC_DEFINE([HAVE_STRUCT_PFIOC_TRANS_E_TYPE],[1],
	[Define if struct pfioc_trans_e has a type member])],[:],
	[#include <sys/types.h>
	 #include <sys/socket.h>
	 #include <netinet/in.h>
	 #include <net/if.h>
	 #include <net/pfvar.h>])
   AC_CHECK_MEMBER([struct pfioc_trans_e.rs_num],
	[AC_DEFINE([HAVE_STRUCT_PFIOC_TRANS_E_RS_NUM],[1],
	[Define if struct pfioc_trans_e has a rs_num member])],[:],
	[#include <sys/types.h>
	 #include <sys/socket.h>
	 #include <netinet/in.h>
	 #include <net/if.h>
	 #include <net/pfvar.h>])
   AC_CHECK_MEMBER([struct pf_rule.nat],
	[AC_DEFINE([HAVE_STRUCT_PF_RULE_NAT],[1],
	[Define if struct pf_rule has a nat member])],[:],
	[#include <sys/types.h>
	 #include <sys/socket.h>
	 #include <netinet/in.h>
	 #include <net/if.h>
	 #include <net/pfvar.h>])
   AC_CHECK_MEMBER([struct pf_rule.rdr],
	[AC_DEFINE([HAVE_STRUCT_PF_RULE_RDR],[1],
	[Define if struct pf_rule has a rdr member])],[:],
	[#include <sys/types.h>
	 #include <sys/socket.h>
	 #include <netinet/in.h>
	 #include <net/if.h>
	 #include <net/pfvar.h>]) 
fi

# Check for structs
AC_MSG_CHECKING([for struct ip6_ext])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>]],
				   [[#include <netinet/in.h>]],
				   [[#include <netinet/ip6.h>]],
				   [[void foo(void) { struct ip6_ext ext; }]])],
                    [
                      AC_MSG_RESULT([yes])
                      AC_DEFINE_UNQUOTED([HAVE_STRUCT_IP6_EXT], 1, [Define to 1 if you have the `ip6_ext' struct.])
                    ],
                    [
                      AC_MSG_RESULT([no])
                      #AC_DEFINE_UNQUOTED([HAVE_STRUCT_IP6_EXT], 0, [Define to 1 if you have the `ip6_ext' struct.])
                    ]
                 )

# These libraries have to be explicitly linked in OpenSolaris
AC_SEARCH_LIBS(getaddrinfo, socket, [], [], -lnsl)
AC_SEARCH_LIBS(inet_ntop, nsl, [], [], -lsocket)

# Some systems need -lm to use sqrt.
AC_SEARCH_LIBS(sqrt, m, [], [], [])

AX_CHECK_OPENSSL(
	[AC_DEFINE([HAVE_OPENSSL], [1], [Define to 1 if you have OpenSSL])]
	[CFLAGS="$CFLAGS $OPENSSL_INCLUDES"])

AX_GCC_BUILTIN(__builtin_clz)

AC_CONFIG_FILES([
	Makefile
	scamper/Makefile
	utils/Makefile
	utils/sc_ally/Makefile
	utils/sc_analysis_dump/Makefile
	utils/sc_attach/Makefile
	utils/sc_bdrmap/Makefile
	utils/sc_filterpolicy/Makefile
	utils/sc_ipiddump/Makefile
	utils/sc_prefixscan/Makefile
	utils/sc_radargun/Makefile
	utils/sc_remoted/Makefile
	utils/sc_speedtrap/Makefile
	utils/sc_tbitblind/Makefile
	utils/sc_tracediff/Makefile
	utils/sc_warts2csv/Makefile
	utils/sc_warts2json/Makefile
	utils/sc_warts2pcap/Makefile
	utils/sc_warts2text/Makefile
	utils/sc_wartscat/Makefile
	utils/sc_wartsdump/Makefile
	utils/sc_wartsfix/Makefile
])
AC_OUTPUT