forked from ffainelli/faifa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
42 lines (36 loc) · 1.3 KB
/
configure.in
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
AC_INIT(faifa, 0.2)
AC_PREREQ(2.59)
AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_INSTALL
PA_ADD_CFLAGS(-Wall)
# Basic headers
AC_CHECK_HEADERS(stdio.h)
AC_CHECK_HEADERS(stdlib.h)
AC_CHECK_HEADERS(unistd.h)
AC_CHECK_HEADERS(sys/types.h)
AC_CHECK_HEADERS(arpa/inet.h)
AC_CHECK_HEADERS(errno.h)
AC_CHECK_HEADERS(stdarg.h)
AC_CHECK_HEADERS(string.h)
AC_CHECK_HEADERS(net/if.h)
# Libraries provided headers
AC_CHECK_HEADERS([pthread.h],,[AC_MSG_ERROR([You need libpthread development files])])
AC_CHECK_HEADERS([pcap.h],,[AC_MSG_ERROR([You need libpcap development files])])
# Check libraries
AC_CHECK_LIB(pthread, pthread_create,
[AC_CHECK_LIB(pthread, pthread_join,[LIBS="${LIBS} -lpthread"],
AC_MSG_ERROR(You need pthread_join check your libpthread))],
AC_MSG_ERROR(You need pthread_create check your libpthread))
AC_CHECK_LIB(pcap, pcap_lookupdev,
[AC_CHECK_LIB(pcap, pcap_datalink,
[AC_CHECK_LIB(pcap, pcap_next_ex,
[AC_CHECK_LIB(pcap, pcap_sendpacket,
[AC_CHECK_LIB(pcap, pcap_close,
,AC_MSG_ERROR(You need pcap_close check your libpcap))],
AC_MSG_ERROR(You need pcap_sendpacket check your libpcap))],
AC_MSG_ERROR(You need pcap_next_ex check your libpcap))],
AC_MSG_ERROR(You need pcap_datalink check your libpcap))],
AC_MSG_ERROR(You need pcap_lookupdev check your libpcap))
AC_CONFIG_HEADER(config.h)
AC_OUTPUT(Makefile)