[Mimedefang] PATCH: autoconf/configure.in cleanups

James Ralston qralston+ml.mimedefang at andrew.cmu.edu
Thu May 10 19:08:10 EDT 2007


Some configure.in patches...

Mimedefang is using old-style AC_DEFINE syntax; newer versions of
autoconf complain.  Solution: switch to the newer syntax.

(Newer version of autoconf also prefer configure.in to be named
configure.ac instead, but if you aren't using a toolchain recent
enough to support that, it doesn't hurt to keep the configure.in
name.)

The AC_PATH_PROG checks for libmilter.a, libsm.a, and libmilter.so
fail on x86_64 because these libraries live in /usr/lib64, not
/usr/lib.  Solution: include $libdir in the target path, which should
(under most build systems) automatically expand to the correct target
on a per-architecture basis.  (And if it doesn't, the user can
override it via the --libdir option.)

Actually, I'd argue that configure should check *only* $libdir by
default, and supply an option to allow the invoker to specify
additional directories to check.  (David, if you don't disagree, I'll
send in a patch to implement that behavior.)

Regards,
James
-------------- next part --------------
--- mimedefang-2.62/configure.in.autoconf-cleanups	2007-03-28 15:37:15.000000000 -0400
+++ mimedefang-2.62/configure.in	2007-05-10 18:45:54.000000000 -0400
@@ -30,7 +30,7 @@
 ], [socklen_t x;], ac_have_socklen_t=yes, ac_have_socklen_t=no)
 AC_MSG_RESULT($ac_have_socklen_t)
 if test "$ac_have_socklen_t" = "yes" ; then
-   AC_DEFINE(HAVE_SOCKLEN_T)
+   AC_DEFINE([HAVE_SOCKLEN_T], [], [Define if socklen_t is defined in <sys/socket.h>])
 fi
 
 for thing in prefix siteprefix vendorprefix installarchlib installprivlib installbin installman1dir installman3dir installscript installsitearch installsitelib; do
@@ -304,7 +304,7 @@
 AC_MSG_RESULT($ac_uint32_t_defined)
 
 if test "$ac_uint32_t_defined" = "yes" ; then
-   AC_DEFINE(HAVE_UINT32_T)
+   AC_DEFINE([HAVE_UINT32_T], [], [Define if uint32_t is defined in <stdint.h>])
 fi
 
 dnl Check if sys/types.h defines uint32_t
@@ -315,7 +315,7 @@
 AC_MSG_RESULT($ac_uint32_t_defined)
 
 if test "$ac_uint32_t_defined" = "yes" ; then
-   AC_DEFINE(HAVE_UINT32_T)
+   AC_DEFINE([HAVE_UINT32_T], [], [Define if uint32_t is defined in <sys/types.h>])
 fi
 
 if test "$HAVE_UNIX_SYSLOG" = "no" ; then
@@ -334,7 +334,7 @@
 ], [sig_atomic_t foo;], ac_have_sig_atomic_t=yes, ac_have_sig_atomic_t=no)
 AC_MSG_RESULT($ac_have_sig_atomic_t)
 if test "$ac_have_sig_atomic_t" = "yes" ; then
-   AC_DEFINE(HAVE_SIG_ATOMIC_T)
+   AC_DEFINE([HAVE_SIG_ATOMIC_T], [], [Define if sig_atomic_t is defined in <signal.h>])
 fi
 
 dnl Check if compiler allows "-pthread" option, but only if
@@ -625,12 +625,12 @@
 
 dnl find libmilter.a and libsm.a
 SMPATH=`echo ../sendmail-*/obj.*/libmilter`
-AC_PATH_PROG(LIBMILTER, libmilter.a, no, $MILTERLIB:$SMPATH:/usr/local/lib:/lib:/usr/lib:/usr/lib/libmilter)
+AC_PATH_PROG(LIBMILTER, libmilter.a, no, $MILTERLIB:$SMPATH:$libdir:/usr/local/lib:/lib:/usr/lib:/usr/lib/libmilter)
 SMPATH=`echo ../sendmail-*/obj.*/libsm`
-AC_PATH_PROG(LIBSM, libsm.a, no, $SMPATH:/usr/local/lib:/lib:/usr/lib:/usr/lib/libmilter)
+AC_PATH_PROG(LIBSM, libsm.a, no, $SMPATH:$libdir:/usr/local/lib:/lib:/usr/lib:/usr/lib/libmilter)
 
 dnl find libmilter.so in case we have shared libraries
-AC_PATH_PROG(LIBMILTERSO, libmilter.so, no, $MILTERLIB:$SMPATH:/usr/local/lib:/lib:/usr/lib:/usr/lib/libmilter)
+AC_PATH_PROG(LIBMILTERSO, libmilter.so, no, $MILTERLIB:$SMPATH:$libdir:/usr/local/lib:/lib:/usr/lib:/usr/lib/libmilter)
 
 dnl find Sendmail
 if test "$SENDMAILPROG" = "no" ; then
@@ -640,7 +640,7 @@
 dnl rm
 AC_PATH_PROG(RM, rm, no, $PATH)
 
-AC_DEFUN(MD_MILTER_SFIO,[
+AC_DEFUN([MD_MILTER_SFIO],[
     AC_MSG_CHECKING([whether libmilter requires -lsfio])
     RESULT=`$NM $LIBMILTER | grep sfsprintf`
     if test -z "$RESULT" ; then
@@ -651,7 +651,7 @@
     fi
 ])
 
-AC_DEFUN(MD_SM_LDAP,[
+AC_DEFUN([MD_SM_LDAP],[
     AC_MSG_CHECKING([whether libsm requires -lldap])
     RESULT=`$NM $LIBSM | grep ldap_`
     if test -z "$RESULT" ; then
@@ -662,7 +662,7 @@
     fi
 ])
 
-AC_DEFUN(MD_MILTER_SM,[
+AC_DEFUN([MD_MILTER_SM],[
     AC_MSG_CHECKING([whether libmilter requires -lsm])
     RESULT=`$NM $LIBMILTER | grep sm_strlcpy`
     if test -z "$RESULT" ; then


More information about the MIMEDefang mailing list