File: configure.ac

package info (click to toggle)
guessnet 0.56
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, sid, stretch
  • size: 1,064 kB
  • ctags: 863
  • sloc: cpp: 5,355; sh: 1,432; makefile: 168; perl: 118
file content (117 lines) | stat: -rw-r--r-- 3,017 bytes parent folder | download | duplicates (2)
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
dnl Process this file with autoconf to produce a configure script.
AC_INIT([guessnet],[0.54],[enrico@debian.org])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign subdir-objects])

dnl Add option to specify a nonstandard location of libnet
LIBNET_CONFIG=no
AC_ARG_WITH(libnet-config,
	[  --with-libnet-config=[PFX]           Specify location of libnet-config],
	LIBNET_CONFIG=$withval
)

dnl To use subdirs
AC_PROG_MAKE_SET

AC_ISC_POSIX
AC_PROG_CXX
AC_PROG_CXXCPP
AC_PROG_CC

AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h)

AC_C_CONST

AC_C_BIGENDIAN

dnl Needed by subdir-objects
AM_PROG_CC_C_O


AC_PROG_RANLIB

AM_PROG_LEX
AC_PROG_YACC

LIBWIBBLE_DEFS(libwibble >= 0.1.16)

dnl Check for libnet

#AC_CHECK_HEADER(libnet.h, AC_DEFINE(HAVE_LIBNET_H, 1, libnet.h has been found),
#	AC_MSG_ERROR([
#*** libnet.h not found. Check 'config.log' for more details.]))
#
#AC_CHECK_LIB(net, libnet_open_link_interface, x_libs="-lnet",
#	AC_MSG_ERROR([
#*** libnet not found. Check 'config.log' for more details.]))

dnl Find libnet
if test "$LIBNET_CONFIG" = "no"
then
	AC_PATH_PROG(LIBNET_CONFIG,libnet-config,no)
	AC_MSG_CHECKING(for libnet libraries)
	if test "$LIBNET_CONFIG" != "no"
	then
		if ! $LIBNET_CONFIG --help > /dev/null 2>&1
		then
			AC_MSG_ERROR(Could not find libnet-config anywhere (see config.log for details).)
		fi

		LIBNET_LIBS="`$LIBNET_CONFIG --libs`"
		LIBNET_CFLAGS="`$LIBNET_CONFIG --cflags` `$LIBNET_CONFIG --defines`"
		AC_MSG_RESULT(found)
		AC_SUBST(LIBNET_LIBS)
		AC_SUBST(LIBNET_CFLAGS)
	else
		AC_MSG_ERROR(No libnet-config was specified (see config.log for details).)
	fi
fi

dnl Check for libpcap
AC_CHECK_HEADER(pcap.h, AC_DEFINE(HAVE_PCAP_H, 1, pcap.h has been found),
	AC_MSG_ERROR([
	*** pcap.h not found. Check 'config.log' for more details.]))

AC_CHECK_LIB(pcap, pcap_open_live, LIBS="-lpcap $LIBS",
	AC_MSG_ERROR([
	*** libpcap not found. Check 'config.log' for more details.]))

dnl Check for libpthread
AC_CHECK_HEADER(pthread.h, AC_DEFINE(HAVE_PTHREAD_H, 1, pthread.h has been found),
	AC_MSG_ERROR([
*** pthread.h not found. Check 'config.log' for more details.]))

AC_CHECK_LIB(pthread, pthread_create, LIBS="-lpthread $LIBS",
	AC_MSG_ERROR([
*** libpthread not found. Check 'config.log' for more details.]))

AC_CHECK_LIB(iw, iw_scan, LIBS="-liw $LIBS",
	AC_MSG_ERROR([
*** libiw not found. Check 'config.log' for more details.]))

dnl Define some useful locations
scriptdir="$datadir/$PACKAGE/test"
AC_SUBST(scriptdir)

dnl Check for misc other progs
AC_PATH_PROG(SH, sh)
AC_DEFINE_UNQUOTED(SH, "$SH", [Path to a Bourne-compatible shell])
AC_PATH_PROG(IFCONFIG, ifconfig, /sbin/ifconfig, "$PATH:/sbin:/usr/sbin")
AC_DEFINE_UNQUOTED(IFCONFIG, "$IFCONFIG", [Path to ifconfig])
AC_PATH_PROG(GREP, grep)
AC_DEFINE_UNQUOTED(GREP, "$GREP", [Path to grep])

CFLAGS="-Wall $CFLAGS"

AC_CONFIG_FILES([
Makefile
src/Makefile
scripts/Makefile
tests/Makefile
])
dnl src/ipexpr/Makefile
dnl src/gnparser/Makefile
dnl src/ifparser/Makefile
AC_OUTPUT