configure.ac #6

  • //
  • guest/
  • bryan_costales/
  • configure.ac
  • View
  • Commits
  • Open Download .zip Download (4 KB)
dnl Process this file with autoconf to produce a configure script
# $Id: configure.ac,v 0.4 2003/12/15 15:03:33 bcx Exp bcx $
# 
# Acceptable arguments to configure are:
# 	The usual CC= etc.
#	--with-berkeleydb41=/path define a base for Berkeley DB 4.2
#	--with-installdir=/path define where to install the slowmilter
#	--with-uniquename=dbname define if you compiled libdb this way
# 	--with-wall forces CC=gcc -Wall
#	--with-purify forces CC="purify $CC"
# 
# @start1

AC_INIT(slowmilt, [1.0.5], [slowmilt-bugs@bcx.com])

AC_COPYRIGHT([Copyright (c) 2003 Bryan Costales and Purforce, Inc.])
AC_REVISION([1.0.5])

AC_ARG_WITH([installdir],
	AC_HELP_STRING([--with-installdir=/path], [(default =/etc/mail/milter/slow)]),
	SLOWMILT_BASE=$withval, SLOWMILT_BASE=/etc/mail/milter/slow)
AC_SUBST(SLOWMILT_DIR, $SLOWMILT_BASE)
AC_SUBST(SLOWMILT_EDIT, slowedit)

AC_PREREQ(2.52)
AC_CONFIG_SRCDIR(./milter.c)
AC_CONFIG_AUX_DIR(build)
AC_CANONICAL_SYSTEM
AC_PROG_MAKE_SET
AM_INIT_AUTOMAKE(slowmilt, [1.0.5])

AC_PROG_CC(gcc cc)
AC_CONFIG_HEADERS(config.h)

AC_ARG_WITH([uniquename],
	AC_HELP_STRING([--with-uniquename=dbname], [(no default)]),
	BDB_SUFFIX=$withval,
	BDB_SUFFIX="")
AC_ARG_WITH([berkeleydb4],
	AC_HELP_STRING([--with-berkeleydb4=/path], [(default =/usr/local/BerkeleyDB.4.2)]),
	BDB_BASE=$withval,
	BDB_BASE=/usr/local/BerkeleyDB.4.2)
AC_EGREP_HEADER([struct __mutex_t], $BDB_BASE/include/db.h,
	CPPFLAGS="$CPPFLAGS -I$BDB_BASE/include",
	AC_MSG_ERROR([Require __mutex_t in db.h. (Probably not 4.2) Configure aborted.]))
AC_CHECK_HEADERS(db.h)
SAVE_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -L$BDB_BASE/lib"
AC_CHECK_LIB(        db-4.2, db_create$BDB_SUFFIX,BDB_LIB=$BDB_BASE/lib/libdb-4.2.a,
	AC_CHECK_LIB( db4.2, db_create$BDB_SUFFIX,BDB_LIB=$BDB_BASE/lib/libdb4.2.a,
	AC_CHECK_LIB(  db41, db_create$BDB_SUFFIX,BDB_LIB=$BDB_BASE/lib/libdb41.a,
	AC_CHECK_LIB(    db, db_create$BDB_SUFFIX,BDB_LIB=$BDB_BASE/lib/libdb.a,
	AC_MSG_ERROR([No libdb${BDB_SUFFIX}.a: A Berkeley DB 4.2 library required])))))
LDFLAGS="$SAVE_LDFLAGS"
LIBS="$LIBS $BDB_LIB"

AC_HEADER_STDC
AC_HEADER_TIME
AC_CHECK_HEADERS(sysexits.h)
AC_CHECK_HEADERS(stdio.h)
AC_CHECK_HEADERS(syslog.h)
AC_CHECK_HEADERS(time.h)
AC_CHECK_HEADERS(netdb.h)
AC_CHECK_HEADERS(errno.h)
AC_CHECK_HEADERS(pthread.h)
AC_CHECK_HEADERS(ctype.h)
AC_CHECK_HEADERS(fcntl.h)
AC_CHECK_HEADERS(sys/param.h)
AC_CHECK_HEADERS(sys/socket.h)
AC_CHECK_HEADERS(netinet/in.h)
AC_CHECK_HEADERS(arpa/inet.h)
AC_CHECK_HEADERS(arpa/nameser.h)

AC_C_BIGENDIAN
AC_STRUCT_TM
AC_C_CONST
AC_TYPE_SIZE_T
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(size_t)
AC_CHECK_SIZEOF(long long)
AC_CHECK_SIZEOF(unsigned long long)
AC_CHECK_SIZEOF(void *)

AC_FUNC_MALLOC
AC_FUNC_REALLOC

AC_CHECK_LIB(malloc, bsdmalloc)
AC_CHECK_LIB(nsl, gethostbyname)
AC_CHECK_LIB(socket, connect)
AC_CHECK_LIB(resolv, res_query)

AC_CHECK_FUNCS(basename)
AC_CHECK_FUNCS(syslog)
AC_CHECK_FUNCS(cuserid)
AC_CHECK_FUNCS(memset bzero, break)
AC_CHECK_FUNCS(memcpy bcopy, break)
AC_CHECK_FUNCS(strerror)
AC_CHECK_FUNCS(strchr)
AC_CHECK_FUNCS(strrchr)
AC_CHECK_FUNCS(strdup)
AC_CHECK_FUNCS(strpbrk)
AC_CHECK_FUNCS(getipnodebyaddr)
AC_CHECK_FUNCS(getipnodebyname)
AC_CHECK_FUNCS(gethostname)
AC_CHECK_FUNCS(gethostbyname)
AC_CHECK_FUNCS(gethostbyaddr)
AC_CHECK_FUNCS(inet_ntoa)
AC_CHECK_FUNCS(strcasecmp)
AC_CHECK_FUNCS(strncasecmp)
AC_CHECK_FUNCS(inet_pton inet_aton)

AC_CHECK_HEADERS(regex.h)
AC_CHECK_FUNCS(regcomp)
AC_CHECK_FUNCS(regexec)
AC_CHECK_FUNCS(regerror)


AC_PROG_LN_S
AC_PROG_RANLIB
AC_SUBST(ac_aux_dir)

AC_ARG_WITH([wall],
	AC_HELP_STRING([--with-wall], [(no default)]),
	CC="gcc -Wall",)
dnl ALWAYS_DEFINES="-D_REENTRANT"
SAVE_LIBS="$LIBS"  
SAVE_CFLAGS="$CFLAGS"
SAVE_CC="$CC"
ACX_PTHREAD()
LIBS="$PTHREAD_LIBS $SAVE_LIBS"
CFLAGS="$SAVE_CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"

AC_ARG_WITH([purify],
	AC_HELP_STRING([--with-purify], [(no default)]),
	CC="purify $CC",)

AC_OUTPUT([Makefile],
[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h.in])
# @end1
# Change User Description Committed
#6 4222 bryan_costales Massive rewrite to speed up the database writes.
Using a single database now with duplicate keys
where the keys are the IP numbers. Added a purge
command and removed the garbage command. Fixed
some leaking memory bugs and properly closed the
database in a few places were it was not
properly closed. Updated the docs to reflect
this and bumped both the database version and
release number. Running on a FreeBSD 3.x machine
and a Solaris 9 machine.
#5 4052 bryan_costales Implimented:
    whitelisting
    AddMXHost for MX servers that lie
    Converted to thread safe DNS routines
    garbage collection
    RunAsUser and RunAsGroup for root startups
    rebuild the database
    summarize by IP number
Finished all documentation.
Moved release from alpha to beta
#4 4030 bryan_costales Finished documenting the configuration file
Fixed a race condition and a core dump bug.
Added hooks for whitelisting and IP aliasing
Added support for Berkeley DB 4.2
Converted to htonl() and ntohl()

Known Bugs:
    ip.db cannot be shared over NFS
    IP tracking from MX hosts can fail
    A RunAsUser config option is needed.
#3 3998 bryan_costales Brought the whole distribution up to V0.9
Added a huge abount of documentation.
Added slowedit find
Created startup scripts to launch for testing
Fixed numerous bugs.
Fixed a few portablity issues.
Installed hooks for whitelisting and IP aliases.
#2 3957 bryan_costales Added rbl lookup support and testing for same.
Folded in support for smfi_stop().
Added lots of slowedit commands
Fixed a serious bug in MX lookups.
Added to documentation.
#1 3890 bryan_costales This is the 0.6 release. The following have been
added with the uses indicated:

    Source files: edit.c -- the slowedit functions
              compat.c -- missing system files
    Autoconf:     configure.ac, makefile.am config.h
              aclocal.m4 acinclude.m4 build/
    Documents:    doc/ -- html and man(1) documents
    Testing:      tests/ -- regressive testing
    TODO:          -- revised to show actual progress