3 dnl Search for libesmtp, by Steven Engelhardt <sengelha@yahoo.com>
5 dnl libesmtp often requires linking against -lpthread or -lc_r (BSD).
6 dnl This macro attempts to centralize this code.
8 AC_DEFUN([MUTT_AM_LIBESMTP],
12 [ --with-libesmtp=DIR Compile in support for libesmtp for the MTA],
13 [ if test "$with_libesmtp" != "no"
15 mutt_libesmtp_check_path="$PATH"
17 if test "$with_libesmtp" != "yes"
19 mutt_libesmtp_check_path="$tmp_path:$withval/bin"
22 dnl 1. Find libesmtp-config
23 AC_PATH_PROG([mutt_libesmtp_config_path],
26 [$mutt_libesmtp_check_path])
28 if test "$mutt_libesmtp_config_path" = "no"
30 AC_MSG_ERROR([libesmtp-config binary not found.])
33 dnl 2. Get CFLAGS and LIBS from libesmtp-config
34 mutt_libesmtp_cflags=`$mutt_libesmtp_config_path --cflags`
35 mutt_libesmtp_libs=`$mutt_libesmtp_config_path --libs`
37 dnl 3. Verify libesmtp.h can be found with these settings
39 CFLAGS="$CFLAGS $mutt_libesmtp_cflags"
40 AC_CHECK_HEADER([libesmtp.h],
42 AC_MSG_ERROR([Could not find libesmtp.h]))
45 dnl 4. Export use_libesmtp variable so configure.in can