configure.in 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_REVISION($Revision$)
  3. AC_INIT([libbgpdump], 1.6.2, [ris@ripe.net])
  4. AC_CONFIG_SRCDIR([bgpdump_lib.c])
  5. AC_CONFIG_HEADERS([bgpdump-config.h])
  6. CFLAGS="-g $CFLAGS -Wall"
  7. CFLAGS="$CFLAGS -Wsystem-headers -Wno-format-y2k -Wno-sign-compare -Wcast-align"
  8. CFLAGS="$CFLAGS -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wswitch -Wshadow"
  9. # Checks for programs.
  10. AC_PROG_CC
  11. AC_PROG_RANLIB
  12. # Checks for header files.
  13. AC_CHECK_HEADERS([arpa/inet.h netinet/in.h syslog.h])
  14. AC_STRUCT_TM
  15. # Check for u_*_t
  16. AC_CHECK_TYPE(u_char_t, , AC_DEFINE(u_char_t, uchar_t, [Define if system headers do not define u_char_t]))
  17. AC_CHECK_TYPE(u_int8_t, , AC_DEFINE(u_int8_t, uint8_t, [Define if system headers do not define u_int8_t]))
  18. AC_CHECK_TYPE(u_int16_t, , AC_DEFINE(u_int16_t, uint16_t, [Define if system headers do not define u_int16_t]))
  19. AC_CHECK_TYPE(u_int32_t, , AC_DEFINE(u_int32_t, uint32_t, [Define if system headers do not define u_int32_t]))
  20. AC_CHECK_LIB(z, gzopen, [], AC_MSG_ERROR([libz not found],1))
  21. AC_CHECK_LIB(bz2, BZ2_bzReadOpen, [], AC_MSG_ERROR([libbzip2 not found],1))
  22. # check for strlcat, used to not be in Linux but is now appearing in newer glibc
  23. AC_CHECK_FUNCS([strlcat])
  24. # Check for inet_ntoa in -lnsl if not found (Solaris)
  25. AC_CHECK_FUNCS(inet_ntoa, [], AC_CHECK_LIB(nsl, inet_ntoa, [], AC_MSG_ERROR([inet_ntoa not found],1)))
  26. AC_CHECK_FUNCS(inet_ntop, [], AC_CHECK_LIB(nsl, inet_ntop, [], AC_MSG_ERROR([inet_ntop not found],1)))
  27. case `uname` in
  28. Darwin*) SOFLAGS="$SOFLAGS -dynamiclib" ;;
  29. *) SOFLAGS="$SOFLAGS -shared" ;;
  30. esac
  31. AC_SUBST(CFLAGS)
  32. AC_SUBST(LIBS)
  33. AC_SUBST(SOFLAGS)
  34. AC_OUTPUT([bgpdump.spec Makefile])