diff options
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..847ff02 --- /dev/null +++ b/configure.in @@ -0,0 +1,69 @@ +# Process this file with autoconf to produce a configure script. +AC_INIT(bsnmp-pcap, 0.1, stef@memberwebs.com) +AM_INIT_AUTOMAKE(bsnmp-pcap, 0.1) + +AC_CONFIG_SRCDIR([module/bsnmp-pcap.c]) +AM_CONFIG_HEADER([config.h]) + +LDFLAGS="$LDFLAGS -L/usr/local/lib" +CFLAGS="$CFLAGS -I/usr/local/include" + +# Checks for programs. +AC_PROG_CC +AC_PROG_INSTALL +AC_PROG_LIBTOOL +AC_CHECK_PROG(GENSNMPTREE, gensnmptree, "gensnmptree") +if test -z "$GENSNMPTREE"; then + echo "ERROR: gensnmptree program not found." + exit 1 +fi + +# Debug mode +AC_ARG_ENABLE(debug, + AC_HELP_STRING([--enable-debug], + [Compile binaries in debug mode])) + +if test "$enable_debug" = "yes"; then + CFLAGS="$CFLAGS -g -O0 -Wall" + AC_DEFINE_UNQUOTED(_DEBUG, 1, [In debug mode]) + echo "enabling debug compile mode" +fi + +# Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS([netinet/in.h netinet/in_systm.h netinet/ip.h arpa/inet.h], , + [echo "ERROR: required netinet header not found."; exit 1], + [[ + #include <sys/types.h> + #if HAVE_NETINET_IN_H + #include <netinet/in.h> + #endif + #if HAVE_NETINET_IN_SYSTM_H + #include <netinet/in_systm.h> + #endif + #if HAVE_NETINET_IP_H + #include <netinet/ip.h> + #endif + ]]) +AC_CHECK_HEADERS([sys/queue.h sys/limits.h sys/stat.h sys/time.h], , + [echo "ERROR: required header not found."; exit 1]) +AC_CHECK_HEADERS([bsnmp/snmpmod.h], , + [echo "ERROR: required bsnmp header not found." exit 1]) +AC_CHECK_HEADERS([pcap.h], , + [echo "ERROR: required pcap header not found." exit 1]) + +# Check for libraries +AC_SEARCH_LIBS(pcap_open_live, pcap, , + [ echo "Must have a pcap library available"; exit 2 ] ) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_TYPE_SIZE_T + +# Checks for library functions. +AC_FUNC_MALLOC +AC_FUNC_MEMCMP + +AC_CONFIG_FILES([Makefile module/Makefile doc/Makefile]) +AC_OUTPUT + |