aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac60
1 files changed, 32 insertions, 28 deletions
diff --git a/configure.ac b/configure.ac
index 695d0b32..ebcbc9df 100644
--- a/configure.ac
+++ b/configure.ac
@@ -522,51 +522,55 @@ 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,/$,,'`
- enable_pmilter=yes
- ;;
- *) AC_MSG_ERROR([Argument to --enable-pmilter is not a directory name])
+ 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([Bad argument to --enable-pmilter])
esac],[enable_pmilter=no])
if test "$enable_pmilter" = yes; then
saved_LIBS=$LIBS
AC_SUBST(PTHREAD_LIBRARIES)
AC_CHECK_LIB(pthread, pthread_self,
- [ have_pthread=yes
- PTHREAD_LIBRARIES="-lpthread -lc" ],
- [ PTHREAD_LIBRARIES="-lpthread"
- AC_CHECK_FUNC(pthread_self,
- [HAVE_PTHREAD=yes]) ])
+ [ have_pthread=yes
+ PTHREAD_LIBRARIES="-lpthread -lc" ],
+ [ PTHREAD_LIBRARIES="-lpthread"
+ AC_CHECK_FUNC(pthread_self,
+ [HAVE_PTHREAD=yes]) ])
if test $have_pthread != 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_SUBST(META1_LIBS)
+ 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])
+
+ 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

Return to:

Send suggestions and report system problems to the System administrator.