-
Notifications
You must be signed in to change notification settings - Fork 3
/
configure.ac
70 lines (55 loc) · 1.5 KB
/
configure.ac
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
AC_PREREQ(2.59)
AC_INIT(pppoesk, 1.1)
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADER([config.h])
CFLAGS="${CFLAGS} -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes"
AC_SUBST(CFLAGS)
# Check for endianness
AC_C_BIGENDIAN(
[AC_MSG_ERROR([big endian, sorry but pppoesk will not work])],
[AC_MSG_RESULT([little endian, fine])],
[AC_MSG_ERROR([unknown endianess ?])]
)
# Checks extra paths for headers and libraries
AC_MSG_NOTICE([checking extra paths for libpcap and libnet libraries])
for p in /usr/local /opt; do
AC_MSG_CHECKING([for $p/include directory])
if test -d $p/include; then
AC_MSG_RESULT([yes])
CPPFLAGS="${CPPFLAGS} -I$p/include/"
else
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([for $p/lib directory])
if test -d $p/lib; then
AC_MSG_RESULT([yes])
LDFLAGS="${LDFLAGS} -L$p/lib/"
else
AC_MSG_RESULT([no])
fi
done
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
AC_SEARCH_LIBS([pcap_compile],
[pcap],
[],
[AC_MSG_ERROR([Cannot find libpcap library !])],
)
AC_SEARCH_LIBS([libnet_init],
[net],
[],
[AC_MSG_ERROR([Cannot find libnet library !])],
)
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([string.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([memset])
AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT