File: configure.in

package info (click to toggle)
faifa 0.2~svn82-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch, wheezy
  • size: 304 kB
  • ctags: 844
  • sloc: ansic: 3,523; sh: 169; makefile: 90
file content (49 lines) | stat: -rw-r--r-- 1,751 bytes parent folder | download | duplicates (3)
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
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])])
AC_CHECK_HEADERS([openssl/sha.h],,[AC_MSG_ERROR([You need openssl 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_CHECK_LIB([crypto], [SHA256_Init],
	[AC_CHECK_LIB([crypto], [SHA256_Update],
	[AC_CHECK_LIB([crypto], [SHA256_Final],LIBS="${LIBS} -lcrypto",
		AC_MSG_ERROR(you need SHA256_Final check your libcrypto))],
		AC_MSG_ERROR(you need SHA256_Update check your libcrypto))],
		AC_MSG_ERROR(you need SHA256_Update check your libcrypto))

AC_CONFIG_HEADER(config.h)
AC_OUTPUT(Makefile)