summaryrefslogtreecommitdiffstats
path: root/configure.ac
blob: 2155474f1d7310c82b37d87d6ca15bf58a2bebd6 (plain)
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
#Autoconfigure for lander
#$Id$
AC_INIT([dag_scrubber], [0.5], [yuri@isi.edu])
AC_SUBST(RELEASE, [${RELEASE:-2}])

AC_CONFIG_AUX_DIR(.build-aux)
AM_INIT_AUTOMAKE([-Wall -Wno-portability -Werror foreign])

AC_CONFIG_HEADERS([config.h])

#checks for programs
AC_PROG_CC
AC_PROG_INSTALL
#AC_PROG_MKDIR_P
AC_PROG_LN_S
#AC_PROG_SED
AC_PROG_AWK


#check for libraries
found_pcap=
AC_CHECK_LIB([pcap], [pcap_open_offline],
	     [#restore libs
	      LIBS=$ac_check_lib_save_LIBS
	      found_pcap=yes
	     ])
found_ssl=

AC_CHECK_LIB([crypto], [BF_ecb_encrypt],
	     [#restore libs
	      LIBS=$ac_check_lib_save_LIBS
	      found_ssl=yes
	     ])
#check for headers
if test -n "$found_ssl"; then
	AC_CHECK_HEADER([openssl/md5.h],,[found_ssl=])
fi
if test -n "$found_ssl"; then
	AC_CHECK_HEADER([openssl/blowfish.h],,[found_ssl=])
fi
if test -n "$found_ssl"; then
    	AC_CHECK_HEADER([openssl/sha.h],,[found_ssl=])
fi
if test -n "$found_pcap"; then
    	AC_CHECK_HEADER([pcap.h],, [found_pcap=])
fi
AC_CACHE_SAVE



AC_CONFIG_FILES([
		 Makefile
                 dag_scrubber.spec
		 ])

AC_OUTPUT

if test -z "$found_ssl" -o -z "$found_pcap"; then
	AC_MSG_WARN([--------------------------------------------------])
	AC_MSG_WARN([Some scrubber components were not found:          ])
	AC_MSG_WARN([])
 	test -z "$found_ssl"  && {
		AC_MSG_ERROR([	Could not find libssl                      ])
	}
	test -z "$found_pcap" && {
		AC_MSG_WARN([	Could not find libpcap                     ])
	}
	AC_MSG_WARN([])
 	AC_MSG_WARN([--------------------------------------------------])
else
	AC_MSG_NOTICE([------------------------------------------------])
	AC_MSG_NOTICE([No errors, everything seems to be in place      ])
	AC_MSG_NOTICE([------------------------------------------------])
fi