~ubuntu-branches/ubuntu/trusty/opendkim/trusty

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman
  • Date: 2012-06-08 14:38:25 UTC
  • mfrom: (1.2.14) (3.2.7 sid)
  • Revision ID: package-import@ubuntu.com-20120608143825-ehz9xxdvii6podhh
Tags: 2.6.0-1
* New upstream release (now DFSG free so tarball repacking no longer
  required)
  - Rename libopendkim6 to libopendkim7 to match new soname
    - Update package and dependencies in debian/control
    - Rename .install and .doc files
  - Drop --enable-xtags from configure in debian/rules since it is now on by
    default
  - Update debian/copyright
  - Remove dversionmangle from debian/watch
  - Update README.Debian to reflect documentation no longer being stripped
* Correct copyright/license information in libar/ar-strl.h based on feedback
  from upstream (correction already implemented upstream for the next
  relese)
* Set --sysconfdir=/etc in configure so that generated man pages refer to
  the correct configuration file locations

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# Package version
15
15
#
16
16
m4_define([VERSION_RELEASE], 2)
17
 
m4_define([VERSION_MAJOR_REV], 5)
18
 
m4_define([VERSION_MINOR_REV], 2)
 
17
m4_define([VERSION_MAJOR_REV], 6)
 
18
m4_define([VERSION_MINOR_REV], 0)
19
19
m4_define([VERSION_PATCH], 0)
20
20
 
21
21
#
23
23
#       - bump "current" and reset "revision" with API changes
24
24
#       - bump "revision" with internal source code changes
25
25
#
26
 
m4_define([LIBVERSION_CURRENT], 6)
 
26
m4_define([LIBVERSION_CURRENT], 7)
27
27
m4_define([LIBVERSION_REVISION], 0)
28
28
m4_define([LIBVERSION_AGE], 0)
29
29
 
164
164
AC_FUNC_MKTIME
165
165
AC_FUNC_REALLOC
166
166
 
167
 
AC_CHECK_FUNCS([dup2 endpwent getcwd gethostname gethostbyname  gettimeofday isascii memchr memmove memset regcomp select socket strcasecmp strchr strdup strerror strncasecmp strrchr strstr strtol strtoul strtoull strlcpy strlcat])
 
167
AC_CHECK_FUNCS([dup2 endpwent getcwd gethostname gethostbyname getaddrinfo gethostbyname2 gettimeofday isascii memchr memmove memset regcomp select socket strcasecmp strchr strdup strerror strncasecmp strrchr strstr strtol strtoul strtoull strlcpy strlcat])
168
168
 
169
169
#
170
170
# Checks for structure members
283
283
FFR_FEATURE([resign],
284
284
            [support for one-step re-signing])
285
285
 
286
 
FFR_FEATURE([select_canonicalization],
287
 
            [allow sender to select canonicalization])
288
 
 
289
286
FFR_FEATURE([selector_header], [special header to choose signing key])
290
287
 
291
288
FFR_FEATURE([sender_macro], [macro to determine sender])
292
289
 
 
290
FFR_FEATURE([socketdb], [arbitrary socket data sets])
 
291
 
293
292
FFR_FEATURE([stats], [stats recording and reporting])
294
293
AM_CONDITIONAL([STATS], [test x"$enable_stats" = x"yes"])
295
294
FFR_FEATURE([statsext], [extended stats recording and reporting])
300
299
FFR_FEATURE([vbr], [Vouch-By-Reference support])
301
300
AM_CONDITIONAL([VBR], [test x"$enable_vbr" = x"yes"])
302
301
 
303
 
LIB_FFR_FEATURE([xtags], [extension signature tags])
304
 
AM_CONDITIONAL([XTAGS], [test x"$enable_xtags" = x"yes"])
305
 
 
306
302
if test x"$enable_statsext" = x"yes" -a x"$enable_stats" != x"yes"
307
303
then
308
304
        AC_MSG_ERROR([--enable-statsext requires --enable-stats])
309
305
fi
310
306
 
311
 
if test x"$enable_atps" = x"yes" -a x"$enable_xtags" != x"yes"
312
 
then
313
 
        AC_MSG_ERROR([--enable-atps requires --enable-xtags])
314
 
fi
315
 
 
316
307
FFR_FEATURE([default_sender], [default sender address])
317
308
 
318
309
# sendmail command
475
466
#
476
467
LIB_FEATURE([query_cache], [local key/policy caching])
477
468
 
478
 
LIB_FFR_FEATURE([parsetime], [parse From: headers for sending times])
479
 
 
480
469
#
481
470
# Conditional stuff
482
471
#
503
492
              AS_IF([test "x$enable_debug" = x"yes"],
504
493
                [
505
494
                        LIBOPENDKIM_FEATURE_STRING="$LIBOPENDKIM_FEATURE_STRING debug"
506
 
                        [[CFLAGS=`echo $CFLAGS | sed 's/ -O[0-9s]*//g'`]]
 
495
                        [[CFLAGS=`echo $CFLAGS | sed 's/ -O[1-9s]*//g'`]]
507
496
                ])
508
497
)
509
498
 
1109
1098
AC_SUBST(LIBLDNS_LIBDIRS)
1110
1099
AC_SUBST(LIBLDNS_LIBS)
1111
1100
 
 
1101
# unbound may also need libevent
 
1102
AC_ARG_WITH([libevent],
 
1103
            AS_HELP_STRING([--with-libevent],
 
1104
                           [location of libevent includes and library]),
 
1105
            [libeventpath="$withval"], [libeventpath="no"])
 
1106
 
 
1107
LIBEVENT_LIBS=""
 
1108
LIBEVENT_LIBDIRS=""
 
1109
 
 
1110
if test x"$libevent" = x"yes"
 
1111
then
 
1112
        libevent_found="no"
 
1113
 
 
1114
        libeventdirs="/usr /usr/local"
 
1115
        for d in $libeventdirs
 
1116
        do
 
1117
                unset ac_cv_search_libevent_rr_new
 
1118
                saved_LDFLAGS="$LDFLAGS"
 
1119
                LDFLAGS="-L$d/lib $LDFLAGS"
 
1120
                AC_SEARCH_LIBS([event_enable_debug_mode], [event], libevent_found="yes")
 
1121
                LDFLAGS="$saved_LDFLAGS"
 
1122
 
 
1123
                if test x"$libevent_found" = x"yes"
 
1124
                then
 
1125
                        LIBEVENT_LIBDIRS="-L$d/lib"
 
1126
                        LIBEVENT_LIBS="-levent"
 
1127
                        break
 
1128
                fi
 
1129
        done
 
1130
        if test x"$LIBEVENT_LIBS" = x""
 
1131
        then
 
1132
                AC_MSG_ERROR([libevent not found])
 
1133
        fi
 
1134
elif test x"$libeventpath" != x"no"
 
1135
then
 
1136
        libevent_found="no"
 
1137
        saved_LDFLAGS="$LDFLAGS"
 
1138
        LDFLAGS="-L$d/lib $LDFLAGS"
 
1139
        AC_SEARCH_LIBS([event_enable_debug_mode], [event], libevent_found="yes")
 
1140
        LDFLAGS="$saved_LDFLAGS"
 
1141
 
 
1142
        if test x"$libevent_found" = x"yes"
 
1143
        then
 
1144
                LIBEVENT_LIBDIRS="-L$d/lib"
 
1145
                LIBEVENT_LIBS="-levent"
 
1146
                break
 
1147
        else
 
1148
                AC_MSG_ERROR(libevent not found in $d)
 
1149
        fi
 
1150
fi
 
1151
 
 
1152
AC_SUBST(LIBEVENT_LIBDIRS)
 
1153
AC_SUBST(LIBEVENT_LIBS)
 
1154
 
1112
1155
#
1113
1156
# libtre
1114
1157
#
1118
1161
            [trepath="$withval"], [trepath="auto"])
1119
1162
 
1120
1163
tre_found="no"
1121
 
LIBTRE_CFLAGS=""
 
1164
LIBTRE_CPPFLAGS=""
1122
1165
LIBTRE_LIBS=""
1123
1166
 
1124
1167
if test x"$enable_diffheaders" != x"yes"
1153
1196
                then
1154
1197
                        tre_found="yes"
1155
1198
                        AC_MSG_RESULT($trepath)
1156
 
                        LIBTRE_CFLAGS="-I$trepath/include"
 
1199
                        LIBTRE_CPPFLAGS="-I$trepath/include"
1157
1200
                        LIBTRE_LIBS="-L$trepath/lib -ltre"
1158
1201
                elif test -f "$trepath/include/tre/regex.h"
1159
1202
                then
1161
1204
                        AC_MSG_RESULT([$trepath (old version)])
1162
1205
                        AC_DEFINE([TRE_PRE_080], 1,
1163
1206
                                  [version of libtre is older than 0.8.0])
1164
 
                        LIBTRE_CFLAGS="-I$trepath/include"
 
1207
                        LIBTRE_CPPFLAGS="-I$trepath/include"
1165
1208
                        LIBTRE_LIBS="-L$trepath/lib -ltre"
1166
1209
                else
1167
1210
                        AC_MSG_ERROR("not found at $trepath")
1175
1218
                                trepath=$d
1176
1219
                                tre_found="yes"
1177
1220
                                AC_MSG_RESULT($d)
1178
 
                                LIBTRE_CFLAGS="-I$trepath/include"
 
1221
                                LIBTRE_CPPFLAGS="-I$trepath/include"
1179
1222
                                LIBTRE_LIBS="-L$trepath/lib -ltre"
1180
1223
                                break
1181
1224
                        elif test -f $d/include/tre/regex.h
1185
1228
                                AC_MSG_RESULT([$d (old version)])
1186
1229
                                AC_DEFINE([TRE_PRE_080], 1,
1187
1230
                                          [version of libtre is older than 0.8.0])
1188
 
                                LIBTRE_CFLAGS="-I$trepath/include"
 
1231
                                LIBTRE_CPPFLAGS="-I$trepath/include"
1189
1232
                                LIBTRE_LIBS="-L$trepath/lib -ltre"
1190
1233
                                break
1191
1234
                        fi
1205
1248
fi
1206
1249
 
1207
1250
AM_CONDITIONAL([USE_TRE], [test x"$tre_found" != x"no"])
1208
 
AC_SUBST([LIBTRE_CFLAGS])
 
1251
AC_SUBST([LIBTRE_CPPFLAGS])
1209
1252
AC_SUBST([LIBTRE_LIBS])
1210
1253
 
1211
1254
#
1418
1461
                                        LIBODBX_LIBS="-L$odbxpath/lib -lopendbx"
1419
1462
                                        break
1420
1463
                                ],[
1421
 
                                        AC_MSG_ERROR([opendbx not at least v1.3.7 at $odbxpath])
 
1464
                                        AC_MSG_ERROR([opendbx not at least v1.3.7 at $d])
1422
1465
                                ]
1423
1466
                                )
1424
1467
                        fi
1601
1644
AC_SUBST(SASL_CPPFLAGS)
1602
1645
 
1603
1646
#
 
1647
# libmdb
 
1648
#
 
1649
AC_ARG_WITH([mdb],
 
1650
            AS_HELP_STRING([--with-mdb],
 
1651
                           [location of OpenLDAP MDB includes and library]),
 
1652
            [mdbpath="$withval"], [mdbpath="no"])
 
1653
 
 
1654
mdb_found="no"
 
1655
LIBMDB_CPPFLAGS=""
 
1656
LIBMDB_LIBS=""
 
1657
 
 
1658
if test x"$mdbpath" != x"no" -a x"$mdb_found" = x"no"
 
1659
then
 
1660
        saved_ldflags="$LDFLAGS"
 
1661
        saved_cflags="$CFLAGS"
 
1662
        CFLAGS="-pthread"
 
1663
        if test x"$mdbpath" != x"auto" -a x"$mdbpath" != x"yes"
 
1664
        then
 
1665
                if test -f $mdbpath/include/mdb.h
 
1666
                then
 
1667
                        LDFLAGS="-L$mdbpath/lib"
 
1668
                        AC_CHECK_LIB(mdb, mdb_env_open,
 
1669
                        [
 
1670
                                mdb_found="yes"
 
1671
                                LIBMDB_CPPFLAGS="-I$mdbpath/include"
 
1672
                                LIBMDB_LIBS="-L$mdbpath/lib -lmdb"
 
1673
                        ],
 
1674
                        [
 
1675
                                AC_MSG_ERROR([mdb not valid at $mdbpath])
 
1676
                        ]
 
1677
                        )
 
1678
                else
 
1679
                        AC_MSG_ERROR([mdb not found at $mdbpath])
 
1680
                fi
 
1681
        else
 
1682
                mdbdirs="/usr /usr/local"
 
1683
                for d in $mdbdirs
 
1684
                do
 
1685
                        if test -f $d/include/mdb.h
 
1686
                        then
 
1687
                                LDFLAGS="-L$d/lib"
 
1688
                                AC_CHECK_LIB(mdb, mdb_env_open,
 
1689
                                [
 
1690
                                        mdbpath=$d
 
1691
                                        mdb_found="yes"
 
1692
                                        LIBMDB_CPPFLAGS="-I$mdbpath/include"
 
1693
                                        LIBMDB_LIBS="-L$mdbpath/lib -lmdb"
 
1694
                                        break
 
1695
                                ]
 
1696
                                )
 
1697
                        fi
 
1698
                done
 
1699
                if test x"$mdb_found" != x"yes"
 
1700
                then
 
1701
                        AC_MSG_ERROR([mdb not found])
 
1702
                fi
 
1703
        fi
 
1704
        LDFLAGS="$saved_ldflags"
 
1705
        CFLAGS="$saved_cflags"
 
1706
fi
 
1707
if test x"$mdb_found" = x"yes"
 
1708
then
 
1709
        AC_DEFINE([USE_MDB], 1, [OpenLDAP MDB support for datasets enabled])
 
1710
fi
 
1711
AM_CONDITIONAL(USE_MDB, test x"$mdb_found" = x"yes")
 
1712
AC_SUBST(LIBMDB_CPPFLAGS)
 
1713
AC_SUBST(LIBMDB_LIBS)
 
1714
 
 
1715
#
 
1716
#
1604
1717
# libcurl, required by reputation
1605
1718
#
1606
1719
AC_ARG_WITH([libcurl],
1681
1794
fi
1682
1795
 
1683
1796
#
1684
 
# libxml2, required by reputation
1685
 
#
 
1797
# libjansson, required by reputation
 
1798
#
 
1799
 
 
1800
AC_ARG_WITH([libjansson],
 
1801
            AS_HELP_STRING([--with-libjansson],
 
1802
                           [location of jansson includes and library]),
 
1803
            [janssonpath="$withval"], [janssonpath="auto"])
 
1804
 
 
1805
LIBJANSSON_CPPFLAGS=""
 
1806
LIBJANSSON_LDFLAGS=""
 
1807
LIBJANSSON_LIBS=""
 
1808
 
 
1809
if test x"$enable_reputation" != x"yes" -a \
 
1810
        x"$janssonpath" = x"auto"
 
1811
then
 
1812
        janssonpath="no"
 
1813
fi
 
1814
 
 
1815
jansson_found="no"
 
1816
if test \( x"$janssonpath" = x"auto" -o x"$janssonpath" = x"yes" \) -a \
 
1817
        x"$PKG_CONFIG" != x""
 
1818
then
 
1819
        PKG_CHECK_MODULES([LIBJANSSON], [libjansson >= 2.2.1],
 
1820
        [
 
1821
                jansson_found="yes"
 
1822
                LIBJANSSON_CPPFLAGS="$LIBJANSSON_CFLAGS"
 
1823
                LIBJANSSON_LIBS="$LIBJANSSON_LIBS"
 
1824
        ],
 
1825
        [
 
1826
                jansson_found="no"
 
1827
                AC_MSG_WARN([pkg-config for libjansson not found, trying manual
 
1828
                            search...])
 
1829
        ])
 
1830
fi
 
1831
 
 
1832
if test x"$janssonpath" != x"no" -a x"$jansson_found" = x"no"
 
1833
then
 
1834
        AC_MSG_CHECKING([for libjansson])
 
1835
        if test x"$janssonpath" != x"auto" -a x"$janssonpath" != x"yes"
 
1836
        then
 
1837
                if test -f $janssonpath/include/jansson.h
 
1838
                then
 
1839
                        AC_MSG_RESULT($janssonpath)
 
1840
                        jansson_found="yes"
 
1841
                        LIBJANSSON_CPPFLAGS="-I$janssonpath/include"
 
1842
                        LIBJANSSON_LDFLAGS="-L$janssonpath/lib"
 
1843
                        LIBJANSSON_LIBS="-ljansson"
 
1844
                else
 
1845
                        AC_MSG_ERROR(not found at $janssonpath)
 
1846
                fi
 
1847
        else
 
1848
                janssondirs="/usr /usr/local"
 
1849
                for d in $janssondirs
 
1850
                do
 
1851
                        if test -f $d/include/jansson.h
 
1852
                        then
 
1853
                                janssonpath=$d
 
1854
                                AC_MSG_RESULT($d)
 
1855
                                jansson_found="yes"
 
1856
                                LIBJANSSON_CPPFLAGS="-I$janssonpath/include"
 
1857
                                LIBJANSSON_LDFLAGS="-L$janssonpath/lib"
 
1858
                                LIBJANSSON_LIBS="-ljansson"
 
1859
                                break
 
1860
                        fi
 
1861
                done
 
1862
        fi
 
1863
        if test x"$jansson_found" != x"yes"
 
1864
        then
 
1865
                AC_MSG_RESULT([no])
 
1866
        fi
 
1867
fi
 
1868
AC_SUBST(LIBJANSSON_CPPFLAGS)
 
1869
AC_SUBST(LIBJANSSON_LDFLAGS)
 
1870
AC_SUBST(LIBJANSSON_LIBS)
 
1871
 
 
1872
#
 
1873
# libxml2
 
1874
#
 
1875
 
1686
1876
AC_ARG_WITH([libxml2],
1687
1877
            AS_HELP_STRING([--with-libxml2],
1688
1878
                           [location of XML2 includes and library]),
1693
1883
LIBXML2_LIBS=""
1694
1884
 
1695
1885
if test x"$enable_reputation" != x"yes" -a \
 
1886
        x"$jansson_found" != x"yes" -a \
1696
1887
        x"$xml2path" = x"auto"
1697
1888
then
1698
1889
        xml2path="no"
1699
1890
fi
1700
1891
 
 
1892
if test x"$enable_reputation" = x"yes" -a x"$jansson_found" = x"yes"
 
1893
then
 
1894
        xml2path="no"
 
1895
fi
 
1896
 
1701
1897
xml2_found="no"
1702
1898
if test \( x"$xml2path" = x"auto" -o x"$xml2path" = x"yes" \) -a \
1703
1899
        x"$PKG_CONFIG" != x""
1720
1916
        AC_MSG_CHECKING([for libxml2])
1721
1917
        if test x"$xml2path" != x"auto" -a x"$xml2path" != x"yes"
1722
1918
        then
1723
 
                if test -f $xml2path/include/libxml/parser.h
 
1919
                if test -f $xml2path/include/libxml2/libxml/parser.h
1724
1920
                then
1725
1921
                        AC_MSG_RESULT($xml2path)
1726
1922
                        xml2_found="yes"
1727
 
                        LIBXML2_CPPFLAGS="-I$xml2path/include"
 
1923
                        LIBXML2_CPPFLAGS="-I$xml2path/include/libxml2"
1728
1924
                        LIBXML2_LDFLAGS="-I$xml2path/lib"
1729
1925
                        LIBXML2_LIBS="-lxml2"
1730
1926
                else
1734
1930
                xml2dirs="/usr /usr/local"
1735
1931
                for d in $xml2dirs
1736
1932
                do
1737
 
                        if test -f $d/include/libxml/parser.h
 
1933
                        if test -f $d/include/libxml2/libxml/parser.h
1738
1934
                        then
1739
1935
                                xml2path=$d
1740
1936
                                AC_MSG_RESULT($d)
1741
1937
                                xml2_found="yes"
1742
 
                                LIBXML2_CPPFLAGS="-I$xml2path/include"
 
1938
                                LIBXML2_CPPFLAGS="-I$xml2path/include/libxml2"
1743
1939
                                LIBXML2_LDFLAGS="-I$xml2path/lib"
1744
1940
                                LIBXML2_LIBS="-lxml2"
1745
1941
                                break
1756
1952
AC_SUBST(LIBXML2_LIBS)
1757
1953
 
1758
1954
if test x"$enable_reputation" = x"yes" -a \
1759
 
        x"$xml2_found" != x"yes"
1760
 
then
1761
 
        AC_MSG_ERROR([reputation requires libxml2])
 
1955
        \( x"$xml2_found" != x"yes" -a \
 
1956
           x"$jansson_found" != x"yes" \)
 
1957
then
 
1958
        AC_MSG_ERROR([reputation requires libxml2 or libjansson])
 
1959
fi
 
1960
 
 
1961
if test  x"$xml2_found" == x"yes" -a x"$jansson_found" == x"yes"
 
1962
then
 
1963
        AC_MSG_ERROR([cannot use both libxml2 and libjansson])
 
1964
fi
 
1965
 
 
1966
if test x"$xml2_found" == x"yes"
 
1967
then
 
1968
        AC_DEFINE(USE_XML2, 1, [use libxml2 to parse REPUTE replies])
 
1969
fi
 
1970
if test x"$jansson_found" == x"yes"
 
1971
then
 
1972
        AC_DEFINE(USE_JANSSON, 1, [use libjansson to parse REPUTE replies])
1762
1973
fi
1763
1974
 
1764
1975
 
1801
2012
        bdbrequested="yes"
1802
2013
fi
1803
2014
 
 
2015
rep_needs_bdb="no"
 
2016
if test x"$enable_reputation" = x"yes" -a x"$mdb_found" = x"no"
 
2017
then
 
2018
        rep_needs_bdb="yes"
 
2019
fi
 
2020
 
1804
2021
AM_CONDITIONAL(USE_DB_OPENDKIM,
1805
2022
               test x"$enable_popauth" = x"yes" -o \
1806
 
                    x"$enable_reputation" = x"yes" -o \
1807
 
                    x"$enable_reputation_cache" = x"yes" -o \
 
2023
                    x"$rep_needs_bdb" = x"yes" -o \
 
2024
                    x"$enable_ldap_caching" = x"yes" -o \
1808
2025
                    x"$bdbrequested" = x"yes")
1809
2026
AM_CONDITIONAL(USE_DB_LIBOPENDKIM, test x"$enable_query_cache" = x"yes")
1810
2027
 
1865
2082
                AC_MSG_RESULT([$bdb_incdir])
1866
2083
        fi
1867
2084
 
1868
 
        # look for libdb.a
1869
 
        AC_MSG_CHECKING([for BerkeleyDB library lib$bdb_lib.a])
1870
 
        if test x"$bdb_libdir" = x""
1871
 
        then
1872
 
                for d in $bdbdirs
1873
 
                do
1874
 
                        if test -f $d/lib/lib$bdb_lib.a
1875
 
                        then
1876
 
                                bdb_libdir=$d/lib
1877
 
                                AC_MSG_RESULT($bdb_libdir)
1878
 
                                libdbfound="yes"
1879
 
                                break
1880
 
                        fi
1881
 
                done
1882
 
 
1883
 
                if test x"$bdb_libdir" = x""
1884
 
                then
1885
 
                        AC_MSG_RESULT([not found])
1886
 
                fi
1887
 
        elif ! test -f $bdb_libdir/lib$bdb_lib.a
1888
 
        then
1889
 
                AC_MSG_ERROR([not found in $bdb_libdir])
1890
 
        else
1891
 
                AC_MSG_RESULT([$bdb_libdir/lib$bdb_lib.a])
1892
 
                libdbfound="yes"
1893
 
        fi
1894
 
 
1895
 
        # If no matching library, see if we can find one.  Note that
1896
 
        # this can cause compilation problems if for example a db.h
 
2085
        # See if we can find a library by looking for db_create(), then
 
2086
        # db_open(), then dbopen().
 
2087
        #
 
2088
        # This can cause compilation problems if for example a db.h
1897
2089
        # and a libdb are found that aren't the same version, but it's
1898
2090
        # worth a shot in general.
1899
 
        if test x"$libdbfound" = x"no"
1900
 
        then
1901
 
                AC_SEARCH_LIBS([db_create], [db], [libdbfound="yes"])
1902
 
        fi
1903
 
        if test x"$libdbfound" = x"no"
1904
 
        then
1905
 
                AC_SEARCH_LIBS([dbopen], [db], [libdbfound="yes"])
1906
 
        fi
1907
 
        if test x"$libdbfound" = x"no"
1908
 
        then
1909
 
                AC_MSG_CHECKING([for libdb])
 
2091
        if test x"$bdb_libdir" = x""
 
2092
        then
1910
2093
                for d in $bdbdirs
1911
2094
                do
1912
 
                        if test -f $d/lib/lib$bdb_lib.a
1913
 
                        then
1914
 
                                bdb_libdir=$d/lib
1915
 
                                AC_MSG_RESULT($bdb_libdir)
1916
 
                                libdbfound="yes"
1917
 
                                break
1918
 
                        fi
 
2095
                        saved_LDFLAGS="$LDFLAGS"
 
2096
                        saved_CPPFLAGS="$CPPFLAGS"
 
2097
                        saved_LIBS="$LIBS"
 
2098
                        LDFLAGS="$LDFLAGS -L$d/lib"
 
2099
                        CPPFLAGS="$CPPFLAGS -I$bdb_incdir"
 
2100
                        LIBS=""
 
2101
                        if test x"$libdbfound" = x"no"
 
2102
                        then
 
2103
                                AC_SEARCH_LIBS([db_create], $bdb_lib,
 
2104
                                               [libdbfound="yes"])
 
2105
                                bdb_libdir=$d/lib
 
2106
                        fi
 
2107
                        if test x"$libdbfound" = x"no"
 
2108
                        then
 
2109
                                AC_SEARCH_LIBS([db_open], $bdb_lib,
 
2110
                                               [libdbfound="yes"])
 
2111
                                bdb_libdir=$d/lib
 
2112
                        fi
 
2113
                        if test x"$libdbfound" = x"no"
 
2114
                        then
 
2115
                                AC_SEARCH_LIBS([dbopen], $bdb_lib,
 
2116
                                               [libdbfound="yes"])
 
2117
                                bdb_libdir=$d/lib
 
2118
                        fi
 
2119
 
 
2120
                        LDFLAGS="$saved_LDFLAGS"
 
2121
                        CPPFLAGS="$saved_CPPFLAGS"
 
2122
                        LIBS="$saved_LIBS"
1919
2123
                done
 
2124
        else
 
2125
                saved_LDFLAGS="$LDFLAGS"
 
2126
                saved_CPPFLAGS="$CPPFLAGS"
 
2127
                saved_LIBS="$LIBS"
 
2128
                LDFLAGS="$LDFLAGS -L$bdb_libdir"
 
2129
                CPPFLAGS="$CPPFLAGS -I$bdb_incdir"
 
2130
                LIBS=""
 
2131
                if test x"$libdbfound" = x"no"
 
2132
                then
 
2133
                        AC_SEARCH_LIBS([db_create], $bdb_lib,
 
2134
                                       [libdbfound="yes"])
 
2135
                fi
 
2136
                if test x"$libdbfound" = x"no"
 
2137
                then
 
2138
                        AC_SEARCH_LIBS([db_open], $bdb_lib,
 
2139
                                       [libdbfound="yes"])
 
2140
                fi
 
2141
                if test x"$libdbfound" = x"no"
 
2142
                then
 
2143
                        AC_SEARCH_LIBS([dbopen], $bdb_lib,
 
2144
                                       [libdbfound="yes"])
 
2145
                fi
 
2146
 
 
2147
                LDFLAGS="$saved_LDFLAGS"
 
2148
                CPPFLAGS="$saved_CPPFLAGS"
 
2149
                LIBS="$saved_LIBS"
1920
2150
        fi
1921
2151
 
1922
2152
        if test x"$libdbfound" = x"no"
1923
2153
        then
1924
 
                AC_MSG_ERROR([cannot find db_create or dbopen])
 
2154
                AC_MSG_ERROR([cannot find db_create, db_open or dbopen])
1925
2155
        fi
1926
2156
 
1927
2157
        if test x"$bdb_incdir" != x""
1952
2182
if test x"$unboundpath" != x"no" -a x"$bdbrequired" = x"yes"
1953
2183
then
1954
2184
        saved_LDFLAGS="$LDFLAGS"
1955
 
        saved_CFLAGS="$CFLAGS"
 
2185
        saved_CPPFLAGS="$CPPFLAGS"
1956
2186
        LDFLAGS="$LDFLAGS $LIBDB_LIBDIRS $LIBUNBOUND_LIBDIRS"
1957
 
        CFLAGS="$CFLAGS $LIBDB_INCDIRS $LIBUNBOUND_INCDIRS"
1958
 
        AC_CHECK_LIB([db],[log_file],
1959
 
                AC_CHECK_LIB([unbound],[log_file],
 
2187
        CPPFLAGS="$CPPFLAGS $LIBDB_INCDIRS $LIBUNBOUND_INCDIRS"
 
2188
        AC_CHECK_LIB([db], [log_file],
 
2189
                AC_CHECK_LIB([unbound], [log_file],
1960
2190
                        AC_MSG_ERROR([Cannot enable feature requiring BerkeleyDB with libunbound - both have log_file defined.  Please use newer BerkeleyDB version])
1961
2191
                )
1962
2192
        )
1963
2193
        LDFLAGS="$saved_LDFLAGS"
1964
 
        CFLAGS="$saved_CFLAGS"
 
2194
        CPPFLAGS="$saved_CPPFLAGS"
1965
2195
fi
1966
2196
AC_SUBST(LIBDB_INCDIRS)
1967
2197
AC_SUBST(LIBDB_LIBDIRS)
1970
2200
LIBOPENDKIM_LIBS="$LIBCRYPTO_LIBS $LIBTRE_LIBS $LIBRESOLV"
1971
2201
# This (below) is just for the pkg-config file opendkim.pc.in
1972
2202
LIBOPENDKIM_LIBS_PKG="$LIBOPENDKIM_LIBS"
1973
 
LIBOPENDKIM_INC="$LIBCRYPTO_CPPFLAGS $LIBCRYPTO_CFLAGS $LIBTRE_CFLAGS"
 
2203
LIBOPENDKIM_INC="$LIBCRYPTO_CPPFLAGS $LIBCRYPTO_CFLAGS $LIBTRE_CPPFLAGS"
1974
2204
 
1975
2205
if test x"$enable_arlib" = x"yes"
1976
2206
then
2035
2265
 
2036
2266
AC_SUBST([DOMAIN])
2037
2267
 
 
2268
AC_ARG_WITH(erlang,
 
2269
            AS_HELP_STRING([--with-erlang],
 
2270
                           [location of Erlang includes and library]),
 
2271
            [erlpath="$withval"], [erlpath="no"])
 
2272
 
 
2273
LIBERL_INCDIRS=""
 
2274
LIBERL_LIBDIRS=""
 
2275
LIBERL_LIBS=""
 
2276
erl_found="no"
 
2277
 
 
2278
if test \( x"$erlpath" = x"yes" -o x"$erlpath" = x"auto" \)
 
2279
then
 
2280
        AC_MSG_CHECKING([for Erlang])
 
2281
        b=`erl -noshell -eval 'io:format("~s~n", [[code:lib_dir()]]).' -s erlang halt`
 
2282
        erlbase=`ls -d $b/erl_interface-* | tail -n1`
 
2283
        AC_MSG_RESULT($erlbase)
 
2284
        LIBERL_INCDIRS="-I$erlbase/include"
 
2285
        LIBERL_LIBDIRS="-L$erlbase/lib"
 
2286
        LIBERL_LIBS="-pthread -lerl_interface -lei"
 
2287
        AC_DEFINE([USE_ERLANG], 1, [support for erlang access])
 
2288
        erl_found="yes"
 
2289
fi
 
2290
 
 
2291
if test x"$erlpath" != x"yes" -a x"$erlpath" != x"auto" -a x"$erlpath" != x"no"
 
2292
then
 
2293
        AC_MSG_CHECKING([for Erlang])
 
2294
        if test -f $erlpath/include/ei.h
 
2295
        then
 
2296
                AC_MSG_RESULT($erlpath)
 
2297
                LIBERL_INCDIRS="-I$erlpath/include"
 
2298
                LIBERL_LIBDIRS="-L$erlpath/lib"
 
2299
                LIBERL_LIBS="-pthread -lerl_interface -lei"
 
2300
                erl_found="yes"
 
2301
        else
 
2302
                AC_MSG_ERROR(not found at $erlpath)
 
2303
        fi
 
2304
fi
 
2305
 
 
2306
if test x"$erl_found" = x"yes"
 
2307
then
 
2308
        saved_CPPFLAGS="$CPPFLAGS"
 
2309
        CPPFLAGS="$LIBERL_INCDIRS"
 
2310
        AC_DEFINE([USE_ERLANG], 1, [support for Erlang access])
 
2311
        AC_SUBST([LIBERL_MANNOTICE], "")
 
2312
else
 
2313
        AC_SUBST([LIBERL_MANNOTICE], "(Not enabled for this installation.)")
 
2314
fi
 
2315
 
 
2316
AM_CONDITIONAL(ERLANG, test x"$erl_found" = x"yes")
 
2317
AC_SUBST(LIBERL_INCDIRS)
 
2318
AC_SUBST(LIBERL_LIBDIRS)
 
2319
AC_SUBST(LIBERL_LIBS)
 
2320
 
2038
2321
#
2039
2322
# final command line tweaks
2040
2323
#
2085
2368
                        opendkim/opendkim-atpszone.8 opendkim/opendkim-spam.1
2086
2369
                opendkim/tests/Makefile
2087
2370
                stats/Makefile stats/opendkim-importstats.8
 
2371
                        stats/opendkim-expire
 
2372
                        stats/opendkim-expire.8
2088
2373
                        stats/opendkim-gengraphs
 
2374
                        stats/opendkim-gengraphs.8
2089
2375
                        stats/opendkim-genstats
 
2376
                        stats/opendkim-genstats.8
 
2377
                        stats/opendkim-reportstats
2090
2378
                reputation/Makefile
2091
2379
                        reputation/opendkim-genrates
2092
2380
                        reputation/opendkim-genrates.8