-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfigure.ac
80 lines (58 loc) · 2.29 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
71
72
73
74
75
76
77
78
AC_INIT(lpicollector, 1.0.0, [email protected])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR(src/collector.cc)
AM_CONFIG_HEADER(src/config.h)
# Make sure we use the relatively silent automake output
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AC_PREFIX_DEFAULT(/usr/local/)
# Function that checks if the C++ compiler actually works - there's a bit of
# oversight in autoconf that will set the C++ compiler to g++ if no compiler
# is found, even if g++ is not present! So we need an extra test to make sure
# that the compiler works :(
AC_DEFUN([rw_PROG_CXX_WORKS],
[AC_REQUIRE([AC_PROG_CXX])dnl
AC_CACHE_CHECK([whether the C++ compiler works],
[rw_cv_prog_cxx_works],
[AC_LANG_PUSH([C++])
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
[rw_cv_prog_cxx_works=yes],
[rw_cv_prog_cxx_works=no])
AC_LANG_POP([C++])])
])
AC_PROG_CC
AC_PROG_CXX
rw_PROG_CXX_WORKS
AC_PROG_INSTALL
AC_LANG(C++)
AC_PROG_LIBTOOL
AC_CHECK_LIB([trace], [trace_get_source_port],,libtrace_found=0)
AC_CHECK_LIB([protoident], [lpi_guess_protocol],,lpi_found=0)
AC_CHECK_LIB([flowmanager], [lfm_release_flow],,lfm_found=0)
AC_CHECK_LIB([wandevent], [wand_add_fd],,ev_found=0)
AC_CHECK_LIB([fifo], [fifo_ptr_read_fd],,fifo_found=0)
AC_CHECK_LIB([pthread], [pthread_create],,pthread_found=0)
AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/socket.h sys/time.h syslog.h unistd.h])
AC_CONFIG_FILES([Makefile src/Makefile])
if test "$libtrace_found" = 0; then
AC_MSG_ERROR(Required library libtrace not found; use LDFLAGS to specify library location)
fi
if test "$lpi_found" = 0; then
AC_MSG_ERROR(Required library libprotoident not found; use LDFLAGS to specify library location)
fi
if test "$lfm_found" = 0; then
AC_MSG_ERROR(Required library libflowmanager not found; use LDFLAGS to specify library location)
fi
if test "$ev_found" = 0; then
AC_MSG_ERROR(Required library libwandevent not found; use LDFLAGS to specify library location)
fi
if test "$fifo_found" = 0; then
AC_MSG_ERROR(Required library libfifo not found; use LDFLAGS to specify library location)
fi
if test "$pthread_found" = 0; then
AC_MSG_ERROR(Required library libpthread not found; use LDFLAGS to specify library location)
fi
AC_SUBST([ADD_LIBS])
AC_SUBST([ADD_LDFLAGS])
AC_SUBST([ADD_INCLS])
AC_SUBST([LTLIBOBJS])
AC_OUTPUT