trusteddomainproject / OpenDMARC

This is the Trusted Domain Project's impementation of the DMARC protocol libary and mail filter, called OpenDMARC. A "milter" connects to unix-based mailers (originally, sendmail, but now many) and provides a standard filtering API.
Other
101 stars 54 forks source link

patch to configure.ac (1.4.1): proper detection of libspf2 --with-spf2-include #146

Open hdatma opened 3 years ago

hdatma commented 3 years ago

The default paths of libspf2 includes are /usr/include/spf2 or /usr/local/include/spf2. When using --with-spf2-include, the configurator should expect a similar pattern, that is if you say --with-spf2-include=/path/to/my/include then the configurator should look into /path/to/my/include/spf2. This patch fixes configure.ac.

--- ./configure.ac.orig Thu Mar 25 18:01:02 2021
+++ ./configure.ac      Thu Mar 25 18:04:49 2021
@@ -338,14 +338,13 @@
 if test "x$SPF2_INCLUDE" != "x" -a "x$SPF2_LIB" != "x"
 then
        use_spf="yes"
-       if test -f ${SPF2_INCLUDE}/spf.h
+       if test -f ${SPF2_INCLUDE}/spf2/spf.h
        then
                AC_DEFINE(HAVE_SPF2_H, 1,
                        [Define to 1 if you have libspf2's `spf.h'])
-               spf2_include="-I $SPF2_INCLUDE"
                saved_CFLAGS="$CFLAGS"
                saved_LDFLAGS="$LDFLAGS"
-               CFLAGS="$spf2_include $saved_CFLAGS"
+               CFLAGS="-I $SPF2_INCLUDE/spf2 $saved_CFLAGS"
                LDFLAGS="$saved_LDFLAGS -L${SPF2_LIB}"
        fi
        AC_SEARCH_LIBS(SPF_record_new, spf2)

Tested, and it works.

thegushi commented 3 years ago

You're probably not wrong, but changing that behavior between 1.4.0 and 1.4.1 doesn't feel right, and every rework I do to the autoconf stuff requires testing on All The Platforms. I'm going to milestone this for 1.5.0.