Description: Redo autoconfig stuff Author: Christoph Biedl Forwarded: No Last-Update: 2016-07-20 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,14 @@ +ACLOCAL_AMFLAGS = -I m4 + +noinst_LTLIBRARIES = libbgpdump.la +libbgpdump_la_SOURCES = bgpdump-config.h bgpdump_attr.h bgpdump_formats.h bgpdump_lib.c bgpdump_lib.h bgpdump_mstream.c bgpdump_mstream.h cfile_tools.c cfile_tools.h inet_ntop.c util.c util.h + +bin_PROGRAMS = bgpdump +bgpdump_SOURCES = bgpdump.c +bgpdump_LDADD = libbgpdump.la + +check-clean: + rm -f test_out/*.bgp.gz + +test: check-clean bgpdump + @[ -d test_data ] && ./test.sh || echo "Skipping upstream tests as they are huge (see README.Debian)" --- /dev/null +++ b/configure.ac @@ -0,0 +1,43 @@ +AC_REVISION([m4_esyscmd([dpkg-parsechangelog -SVersion])]) + +AC_INIT([libbgpdump], 1.4.99.15, [ris@ripe.net]) + +AM_INIT_AUTOMAKE([foreign]) + +AC_CONFIG_SRCDIR([bgpdump_lib.c]) +AC_CONFIG_HEADERS([bgpdump-config.h]) + +# Checks for programs. +AC_PROG_CC + +AC_PROG_LIBTOOL +AC_CONFIG_MACRO_DIRS([m4]) + +# Checks for header files. +AC_CHECK_HEADERS([arpa/inet.h netinet/in.h syslog.h]) +AC_STRUCT_TM + +# Check for u_*_t +AC_CHECK_TYPE(u_char_t, , AC_DEFINE(u_char_t, uchar_t, [Define if system headers do not define u_char_t])) +AC_CHECK_TYPE(u_int8_t, , AC_DEFINE(u_int8_t, uint8_t, [Define if system headers do not define u_int8_t])) +AC_CHECK_TYPE(u_int16_t, , AC_DEFINE(u_int16_t, uint16_t, [Define if system headers do not define u_int16_t])) +AC_CHECK_TYPE(u_int32_t, , AC_DEFINE(u_int32_t, uint32_t, [Define if system headers do not define u_int32_t])) + +AC_CHECK_LIB(z, gzopen, [], AC_DEFINE(DONT_HAVE_GZ, 1, Define if libz not present)) +AC_CHECK_LIB(bz2, BZ2_bzReadOpen, [], AC_DEFINE(DONT_HAVE_BZ2, 1, Define if libbzip2 not present)) +AC_CHECK_LIB(bsd, strlcat) + +# Check for inet_ntoa in -lnsl if not found (Solaris) +AC_CHECK_FUNCS(inet_ntoa, [], AC_CHECK_LIB(nsl, inet_ntoa, [], AC_MSG_ERROR([inet_ntoa not found],1))) +AC_CHECK_FUNCS(inet_ntop, [], AC_CHECK_LIB(nsl, inet_ntop, [], AC_MSG_ERROR([inet_ntop not found],1))) + +case `uname` in + Darwin*) LDFLAGS="$LDFLAGS -dynamiclib" ;; + *) LDFLAGS="$LDFLAGS -shared" ;; +esac + +AC_SUBST(CFLAGS) +AC_SUBST(LDFLAGS) +AC_SUBST(LIBS) + +AC_OUTPUT([bgpdump.spec Makefile])