diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/configure.ac b/configure.ac index 695d0b32..ebcbc9df 100644 --- a/configure.ac +++ b/configure.ac @@ -522,14 +522,23 @@ AC_DEFINE_UNQUOTED(DEFAULT_LOG_FACILITY, $DEFAULT_LOG_FACILITY, [Default log facility]) # Test for libpmilter +AC_SUBST(META1_LIBS) + AC_ARG_ENABLE([pmilter], - AC_HELP_STRING([--enable-pmilter=PATH-TO-META1], + AC_HELP_STRING([--enable-pmilter[[=PATH]]], [enable pmilter support (EXPERIMENTAL)]), [case "${enableval}" in - /*) meta1_dir=`echo ${enableval} | sed 's,/$,,'` + yes) enable_pmilter=yes;; + no) enable_pmilter=no;; + /*) dir=$enableval/lib/meta1 + if test -d $dir; then + META1_LIBS="-L$dir" + else + AC_MSG_ERROR([$dir: No such directory]) + fi enable_pmilter=yes ;; - *) AC_MSG_ERROR([Argument to --enable-pmilter is not a directory name]) + *) AC_MSG_ERROR([Bad argument to --enable-pmilter]) esac],[enable_pmilter=no]) if test "$enable_pmilter" = yes; then @@ -545,28 +554,23 @@ if test "$enable_pmilter" = yes; then AC_MSG_ERROR([POSIX threads library not found. Please install it and then reconfigure]) fi - libs="libpmilter/libpmilter.a \ - libpmilter/libpmutil.a\ - libevthr/libevthr.a\ - libthr/libthr.a\ - libmta/librcbcomm.a\ - libmta/librcb.a\ - libmta/libmtar.a\ - libmta/libcstrr.a\ - libcheck/libcheck.a\ - librepl/libreplr.a" + AC_CHECK_HEADERS([sm/error.h sm/hdrmoddef.h sm/pmfapi.h sm/pmilter.h sm/smreplycodes.h sm/generic.h sm/mfapi.h sm/pmfdef.h sm/smmts.h], + [], + [AC_MSG_ERROR([Required header file $ac_header not found])], + [ +#ifdef HAVE_SM_ERROR_H +# include <sm/error.h> +#endif]) - AC_SUBST(META1_LIBS) + libs="pmilter pmutil evthr thr rcbcomm rcb mtar cstrr replr" + LDFLAGS="$LDFLAGS $META1_LIBS" for file in $libs do - if test -f $meta1_dir/$file; then - META1_LIBS="$META1_LIBS $meta1_dir/$file" - else - AC_MSG_ERROR([Required library $file not found in $meta1_dir]) - fi + AC_CHECK_LIB($file, main, + [META1_LIBS="$META1_LIBS -l$file"], + [AC_MSG_ERROR([Required library lib$file not found])]) done AC_SUBST(ENABLE_PMULT,'${PMULT_PROG}') - AC_SUBST(META1_INCLUDES,"-I$meta1_dir/include") LIBS=$saved_LIBS fi |