dnl Process this file with autoconf to produce a configure script. AC_INIT(annoyance-filter.w) AC_CONFIG_HEADER(config.h) AC_PREFIX_DEFAULT(/usr/local) PRODUCT=annoyance-filter VERSION=1.0d AC_DEFINE_UNQUOTED(PRODUCT, "$PRODUCT") AC_DEFINE_UNQUOTED(VERSION, "$VERSION") AC_SUBST(PRODUCT) AC_SUBST(VERSION) dnl Checks for programs. AC_PROG_CC AC_PROG_CXX AC_PROG_INSTALL AC_LANG_CPLUSPLUS AC_CHECK_PROGS(COMPRESSOR, gzip compress) dnl Check for machine environment OSNAME=`uname` if test "${OSNAME}" = "SunOS" ; then LDSTATIC="" else LDSTATIC="" fi AC_SUBST(OSNAME) AC_SUBST(LDSTATIC) dnl Checks for site and machine environment HOSTNAME=`hostname` AC_DEFINE_UNQUOTED(HOSTNAME, "$HOSTNAME") AC_SUBST(HOSTNAME) echo checking for hostname... $HOSTNAME dnl Set options specific to GCC if test x$GCC = xyes then if test x$OSNAME = "xSunOS" ; then dnl GCC likes to hang on Solaris with -O2 CFLAGS=`echo $CFLAGS | sed 's/-O2/-O/'` fi CFLAGS="-Wall $CFLAGS" fi dnl Check for which uncompress utilities are available. AC_CHECK_PROGS(GUNZIP, gunzip) if test x$GUNZIP != x then AC_DEFINE(HAVE_GUNZIP) fi AC_CHECK_PROGS(GZCAT, gzcat) if test x$GZCAT != x then AC_DEFINE(HAVE_GZCAT) fi AC_CHECK_PROGS(GZIP, gzip) if test x$GZIP != x then AC_DEFINE(HAVE_GZIP) fi AC_CHECK_PROGS(ZCAT, zcat) if test x$ZCAT != x then AC_DEFINE(HAVE_ZCAT) fi AC_CHECK_PROGS(UNCOMPRESS, uncompress) if test x$UNCOMPRESS != x then AC_DEFINE(HAVE_UNCOMPRESS) fi AC_CHECK_PROGS(COMPRESS, compress) if test x$COMPRESS != x then AC_DEFINE(HAVE_COMPRESS) fi dnl Check for GNUPLOT and required NetPBM utilities AC_CHECK_PROGS(GNUPLOT, gnuplot) if test x$GNUPLOT != x then AC_DEFINE(HAVE_GNUPLOT) fi AC_CHECK_PROGS(NETPBM, pnmtopng) if test x$NETPBM != x then AC_DEFINE(HAVE_NETPBM) fi dnl Check for programs used to decode specific application files AC_CHECK_PROGS(PDFTOTEXT, pdftotext) if test x$PDFTOTEXT != x then AC_DEFINE(HAVE_PDFTOTEXT) fi dnl Check for a paging program. This is used only to read the man page AC_CHECK_PROGS(PAGER, "less") AC_CHECK_PROGS(PAGER, "more") AC_CHECK_PROGS(PAGER, "cat") dnl Checks for libraries. AC_CHECK_LIB(m, sqrt) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(unistd.h string.h strings.h dirent.h) dnl Checks for data types defined in system headers AC_CHECK_TYPE(u_int32_t, unsigned long int) AC_CHECK_TYPE(u_int16_t, unsigned short int) dnl Checks for networking facilities # If resolver functions are not in libc check for -lnsl or -lresolv. AC_CHECK_FUNC(gethostbyname, AC_MSG_RESULT(using libc's resolver), AC_CHECK_LIB(nsl,gethostbyname) AC_CHECK_LIB(resolv,gethostbyname)) # Find where sockets lurk AC_CHECK_FUNC(socket, AC_DEFINE(HAVE_SOCKET) AC_MSG_RESULT(using libc's socket), AC_CHECK_LIB(xnet,socket, AC_DEFINE(HAVE_SOCKET) AC_DEFINE(HAVE_LIBXNET) LIBS="$LIBS -lxnet") AC_CHECK_LIB(socket,socket, AC_DEFINE(HAVE_SOCKET) AC_DEFINE(HAVE_LIBSOCKET) LIBS="$LIBS -lsocket") AC_CHECK_LIB(inet,socket, AC_DEFINE(HAVE_SOCKET) AC_DEFINE(HAVE_LIBINET) LIBS="$LIBS -linet")) dnl Checks for signal capabilities AC_TYPE_SIGNAL AC_CHECK_FUNCS(signal) dnl Check for library compatible with fdstream.hpp AC_CACHE_CHECK([for fdstream compatibility], ac_fdstream_compatible, [ AC_TRY_COMPILE( [ #include "fdstream.hpp" ], [ fdistream fis; ], [ ac_fdstream_compatible="yes" ], [ ac_fdstream_compatible="no" ] ) ]) if test "x$ac_fdstream_compatible" = "xyes" ; then AC_DEFINE(HAVE_FDSTREAM_COMPATIBILITY) have_fdstream_compatibility=1 fi dnl Check whether we should use mystrstream_new.h AC_CACHE_CHECK([for new-style strstream], ac_new_strstream, [ AC_TRY_COMPILE( [ #include "mystrstream_new.h" ], [ char a[10]; istrstream is(a, 10); ], [ ac_new_strstream="yes" ], [ ac_new_strstream="no" ] ) ]) if test "x$ac_new_strstream" = "xyes" ; then AC_DEFINE(HAVE_NEW_STRSTREAM) have_new_strstream=1 fi dnl Checks for typedefs, structures, and compiler characteristics. dnl Checks for library functions. AC_CHECK_FUNCS(stat) AC_CHECK_FUNCS(mmap) AC_CHECK_FUNCS(system) AC_CHECK_FUNCS(readlink) AC_CHECK_FUNCS(popen) AC_CHECK_FUNCS(mkstemp) AC_CHECK_FUNCS(tmpnam) AC_OUTPUT(Makefile)