dnl Process this file with autoconf to produce a configure script. AC_INIT(libtrace,2.0.2,[libtrace@wand.net.nz],libtrace) AC_CONFIG_SRCDIR(lib/trace.c) AM_INIT_AUTOMAKE(libtrace,2.0.2) AC_PREREQ(2.5) dnl GNU C library dnl AC_GNU_SOURCE AM_CONFIG_HEADER(config.h) dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_PROG_LIBTOOL dnl Checks for header files. AC_HEADER_STDC dnl AC_CHECK_HEADERS(errno.h stdlib.h stdio.h assert.h string.h netinet/in.h assert.h errno.h fcntl.h net/ethernet.h netdb.h pcap.h stdio.h stdlib.h string.h sys/stat.h sys/types.h sys/socket.h sys/un.h unistd.h time.h sys/ioctl.h net/bpf.h pcap.h zlib.h pcap-bpf.h) AC_CHECK_HEADERS(pcap.h zlib.h pcap-bpf.h net/bpf.h sys/limits.h stddef.h stdint.h limits.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_C_BIGENDIAN AC_TYPE_SIZE_T AC_HEADER_TIME AC_SYS_LARGEFILE dnl Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_CHECK_FUNCS(socket strdup) dnl configure time options for selecting which libpcap and libz to use dnl this is provided to allow for systems whose default libraries don't support dnl large files - you can build your own and link using these options AC_DEFUN([CHECK_LIBPCAP], [AC_ARG_WITH([pcap], AC_HELP_STRING([--with-pcap], [name of pcap library (default is pcap)]), [ac_cv_use_pcap=$withval], [ac_cv_use_pcap=pcap]) AC_CACHE_CHECK([which pcap library to use], [ac_cv_use_pcap], [ac_cv_use_pcap=pcap])]) AC_DEFUN([CHECK_LIBPCAP_PATH], [AC_ARG_WITH([pcap-path], AC_HELP_STRING([--with-pcap-path], [location of pcap library (default is /usr/lib)]), [ac_cv_use_pcap_path=$withval], [ac_cv_use_pcap_path=/usr/lib]) AC_CACHE_CHECK([location of pcap library], [ac_cv_use_pcap_path], [ac_cv_use_pcap_path=/usr/lib])]) AC_DEFUN([CHECK_LIBZ], [AC_ARG_WITH([zlib], AC_HELP_STRING([--with-zlib], [name of zlib library (default is z)]), [ac_cv_use_zlib=$withval], [ac_cv_use_zlib=z]) AC_CACHE_CHECK([which zlib library to use], [ac_cv_use_zlib], [ac_cv_use_zlib=z])]) AC_DEFUN([CHECK_LIBZ_PATH], [AC_ARG_WITH([zlib-path], AC_HELP_STRING([--with-zlib-path], [location of zlib library (default is /usr/lib)]), [ac_cv_use_zlib_path=$withval], [ac_cv_use_zlib_path=/usr/lib]) AC_CACHE_CHECK([location of zlib library], [ac_cv_use_zlib_path], [ac_cv_use_zlib_path=/usr/lib])]) CHECK_LIBPCAP CHECK_LIBPCAP_PATH CHECK_LIBZ CHECK_LIBZ_PATH LIBPCAP=-l$ac_cv_use_pcap LIBPCAP_PATH=-L$ac_cv_use_pcap_path AC_SUBST([LIBPCAP]) AC_SUBST([LIBPCAP_PATH]) LIBZ=-l$ac_cv_use_zlib LIBZ_PATH=-L$ac_cv_use_zlib_path AC_SUBST([LIBZ]) AC_SUBST([LIBZ_PATH]) AC_OUTPUT(Makefile lib/Makefile)