(--with-berkeley-db): New option
(--with-db2): Deprecated. Remove from the help list.
Showing
1 changed file
with
103 additions
and
26 deletions
... | @@ -16,7 +16,7 @@ dnl You should have received a copy of the GNU General Public License along | ... | @@ -16,7 +16,7 @@ dnl You should have received a copy of the GNU General Public License along |
16 | dnl with GNU Mailutils; if not, write to the Free Software Foundation, | 16 | dnl with GNU Mailutils; if not, write to the Free Software Foundation, |
17 | dnl Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 17 | dnl Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
18 | 18 | ||
19 | AC_INIT([GNU Mailutils], [0.6.93], [bug-mailutils@gnu.org], [mailutils]) | 19 | AC_INIT([GNU Mailutils], [0.6.94], [bug-mailutils@gnu.org], [mailutils]) |
20 | AC_CONFIG_SRCDIR([mailbox/mailbox.c]) | 20 | AC_CONFIG_SRCDIR([mailbox/mailbox.c]) |
21 | AC_CONFIG_AUX_DIR([scripts]) | 21 | AC_CONFIG_AUX_DIR([scripts]) |
22 | AC_CANONICAL_TARGET([]) | 22 | AC_CANONICAL_TARGET([]) |
... | @@ -45,6 +45,13 @@ AC_SUBST(MU_LIB_SIEVE,'${top_builddir}/libsieve/libsieve.la') | ... | @@ -45,6 +45,13 @@ AC_SUBST(MU_LIB_SIEVE,'${top_builddir}/libsieve/libsieve.la') |
45 | AC_SUBST(MU_LIB_SCM,'${top_builddir}/libmu_scm/libmu_scm.la') | 45 | AC_SUBST(MU_LIB_SCM,'${top_builddir}/libmu_scm/libmu_scm.la') |
46 | AC_SUBST(MU_LIB_CPP,'${top_builddir}/libmu_cpp/libmu_cpp.la') | 46 | AC_SUBST(MU_LIB_CPP,'${top_builddir}/libmu_cpp/libmu_cpp.la') |
47 | 47 | ||
48 | dnl Other variables | ||
49 | AC_SUBST(SIEVE_MODDIR,'$(libdir)/$(PACKAGE)') | ||
50 | |||
51 | AC_SUBST(MU_COMMON_LIBRARIES,'$(LTLIBINTL) $(LTLIBICONV)') | ||
52 | |||
53 | AC_SUBST(MU_COMMON_INCLUDES,'-I${srcdir} -I${top_srcdir}/include -I${top_srcdir}/lib -I${top_builddir} -I${top_builddir}/include -I${top_builddir}/include/mailutils/gnu -I${top_srcdir}/mailbox') | ||
54 | |||
48 | dnl Check for programs | 55 | dnl Check for programs |
49 | AC_PROG_CC | 56 | AC_PROG_CC |
50 | AC_PROG_INSTALL | 57 | AC_PROG_INSTALL |
... | @@ -57,7 +64,7 @@ AM_PROG_LEX | ... | @@ -57,7 +64,7 @@ AM_PROG_LEX |
57 | ## Predefine several variables used to display configuration status | 64 | ## Predefine several variables used to display configuration status |
58 | status_pam=no | 65 | status_pam=no |
59 | status_ltdl=no | 66 | status_ltdl=no |
60 | status_bdb2=no | 67 | status_bdb=no |
61 | status_ndbm=no | 68 | status_ndbm=no |
62 | status_dbm=no | 69 | status_dbm=no |
63 | status_gdbm=no | 70 | status_gdbm=no |
... | @@ -261,14 +268,23 @@ case "${withval}" in | ... | @@ -261,14 +268,23 @@ case "${withval}" in |
261 | *) AC_MSG_ERROR(bad value ${withval} for --with-gdbm) ;; | 268 | *) AC_MSG_ERROR(bad value ${withval} for --with-gdbm) ;; |
262 | esac]) | 269 | esac]) |
263 | 270 | ||
264 | AC_ARG_WITH([db2], | 271 | ## Support --with-db2 for backward compatibility |
265 | AC_HELP_STRING([--with-db2], | 272 | if test ${with_db2+set} = set; then |
273 | case "${with_db2}" in | ||
274 | yes) use_dbm=BDB2 ;; | ||
275 | no) use_dbm=no ;; | ||
276 | *) AC_MSG_ERROR(bad value ${withval} for --with-db2) ;; | ||
277 | esac | ||
278 | fi | ||
279 | |||
280 | AC_ARG_WITH([berkeley-db], | ||
281 | AC_HELP_STRING([--with-berkeley-db], | ||
266 | [use Berkeley DB]), | 282 | [use Berkeley DB]), |
267 | [ | 283 | [ |
268 | case "${withval}" in | 284 | case "${withval}" in |
269 | yes) use_dbm=BDB2 ;; | 285 | yes) use_dbm=BDB ;; |
270 | no) use_dbm=no ;; | 286 | no) use_dbm=no ;; |
271 | *) AC_MSG_ERROR(bad value ${withval} for --with-db) ;; | 287 | *) use_dbm=BDB="${withval}";; |
272 | esac]) | 288 | esac]) |
273 | 289 | ||
274 | AC_ARG_WITH([ndbm], | 290 | AC_ARG_WITH([ndbm], |
... | @@ -847,6 +863,7 @@ if test x"$usereadline" = x"yes"; then | ... | @@ -847,6 +863,7 @@ if test x"$usereadline" = x"yes"; then |
847 | fi | 863 | fi |
848 | 864 | ||
849 | fi | 865 | fi |
866 | |||
850 | AH_BOTTOM([ | 867 | AH_BOTTOM([ |
851 | /* Newer versions of readline have rl_completion_matches */ | 868 | /* Newer versions of readline have rl_completion_matches */ |
852 | #ifndef HAVE_RL_COMPLETION_MATCHES | 869 | #ifndef HAVE_RL_COMPLETION_MATCHES |
... | @@ -856,6 +873,61 @@ AH_BOTTOM([ | ... | @@ -856,6 +873,61 @@ AH_BOTTOM([ |
856 | dnl Check for DBM | 873 | dnl Check for DBM |
857 | 874 | ||
858 | AC_SUBST(POPAUTH) | 875 | AC_SUBST(POPAUTH) |
876 | AH_TEMPLATE([WITH_BDB], | ||
877 | [Define to the major version of Berkeley DB library to use]) | ||
878 | |||
879 | ## Set the variable status_bdb to $1 if: | ||
880 | ## | ||
881 | ## 1. Function $3 is defined in the library $2 | ||
882 | ## 2. Header file db.h is available | ||
883 | ## | ||
884 | ## Then check if the major version, minor version and patchlevel of the | ||
885 | ## library matches those from the header. If so, define WITH_BDB | ||
886 | ## to the version (i.e. $1 with all dots removed). Otherwise, report | ||
887 | ## an error and stop. | ||
888 | ## | ||
889 | check_bdb() { | ||
890 | AC_CHECK_LIB($2, $3, | ||
891 | [ver=`echo $1|tr -d '.'` | ||
892 | AC_CHECK_HEADERS(db.h, | ||
893 | AC_DEFINE_UNQUOTED(WITH_BDB,$ver)) | ||
894 | LIBS="$LIBS -l$2" | ||
895 | MU_DB2_CURSOR | ||
896 | POPAUTH='popauth$(EXEEXT)' | ||
897 | status_bdb=$1]) | ||
898 | if test $status_bdb = no; then | ||
899 | : | ||
900 | else | ||
901 | AC_RUN_IFELSE( | ||
902 | [AC_LANG_PROGRAM([#include "db.h"], | ||
903 | [int v_major, v_minor, v_patch; | ||
904 | db_version(&v_major, &v_minor, &v_patch); | ||
905 | return !(v_major == DB_VERSION_MAJOR | ||
906 | && v_minor == DB_VERSION_MINOR | ||
907 | && v_patch == DB_VERSION_PATCH); | ||
908 | ])], | ||
909 | [], | ||
910 | [AC_MSG_ERROR([DB Library and header versions don't match]) | ||
911 | status_bdb=no]) | ||
912 | fi | ||
913 | } | ||
914 | |||
915 | ## Check for the Berkeley DB library version $1, assuming Slackware-like | ||
916 | ## installation layout (header files in /usr/incude/db$vn and library named | ||
917 | ## libdb-$version.so, where $version is the library version and $vn is | ||
918 | ## $version with all dots removed. | ||
919 | ## | ||
920 | check_slackware_bdb() { | ||
921 | dir=db`echo $1|tr -d '.'` | ||
922 | save_CPPFLAGS=$CPPFLAGS | ||
923 | CPPFLAGS="$CPPFLAGS -I/usr/include/$dir" | ||
924 | check_bdb $1 db-$1 db_create | ||
925 | CPPFLAGS=$save_CPPFLAGS | ||
926 | if test $status_bdb = "$1"; then | ||
927 | MU_COMMON_INCLUDES="$MU_COMMON_INCLUDES -I/usr/include/$dir" | ||
928 | fi | ||
929 | } | ||
930 | |||
859 | case "$use_dbm" in | 931 | case "$use_dbm" in |
860 | GDBM) | 932 | GDBM) |
861 | AC_CHECK_LIB(gdbm, gdbm_open, | 933 | AC_CHECK_LIB(gdbm, gdbm_open, |
... | @@ -865,15 +937,25 @@ GDBM) | ... | @@ -865,15 +937,25 @@ GDBM) |
865 | LIBS="$LIBS -lgdbm" | 937 | LIBS="$LIBS -lgdbm" |
866 | POPAUTH='popauth$(EXEEXT)' | 938 | POPAUTH='popauth$(EXEEXT)' |
867 | status_gdbm=yes]);; | 939 | status_gdbm=yes]);; |
868 | BDB2) | 940 | |
869 | AC_CHECK_LIB(db, db_open, | 941 | BDB2) check_bdb 2 db db_open;; |
870 | [AC_CHECK_HEADERS(db.h, | 942 | |
871 | AC_DEFINE(WITH_BDB2,1, | 943 | BDB) |
872 | [Enable use of Berkeley DB])) | 944 | check_bdb 2 db db_open |
873 | LIBS="$LIBS -ldb" | 945 | if test $status_bdb = no; then |
874 | MU_DB2_CURSOR | 946 | check_bdb 3 db db_create |
875 | POPAUTH='popauth$(EXEEXT)' | 947 | fi;; |
876 | status_bdb2=yes]);; | 948 | |
949 | BDB=*) | ||
950 | name=`expr $use_dbm : 'BDB=\(.*\)'` | ||
951 | case $name in | ||
952 | [[0-9]]*) check_slackware_bdb $name;; | ||
953 | *) check_bdb 2 $name db_open | ||
954 | test $status_bdb = no && check_bdb 3 $name db_create | ||
955 | ;; | ||
956 | esac | ||
957 | ;; | ||
958 | |||
877 | NDBM) | 959 | NDBM) |
878 | AC_CHECK_LIB(ndbm, dbm_open, | 960 | AC_CHECK_LIB(ndbm, dbm_open, |
879 | [AC_CHECK_HEADERS(ndbm.h, | 961 | [AC_CHECK_HEADERS(ndbm.h, |
... | @@ -976,15 +1058,6 @@ AC_SUBST(MU_LTLIBOBJS) | ... | @@ -976,15 +1058,6 @@ AC_SUBST(MU_LTLIBOBJS) |
976 | 1058 | ||
977 | MU_FINISH | 1059 | MU_FINISH |
978 | 1060 | ||
979 | AC_SUBST(SIEVE_MODDIR) | ||
980 | SIEVE_MODDIR='$(libdir)/$(PACKAGE)' | ||
981 | |||
982 | AC_SUBST(MU_COMMON_LIBRARIES) | ||
983 | MU_COMMON_LIBRARIES='$(LTLIBINTL) $(LTLIBICONV)' | ||
984 | |||
985 | AC_SUBST(MU_COMMON_INCLUDES) | ||
986 | MU_COMMON_INCLUDES='-I${srcdir} -I${top_srcdir}/include -I${top_srcdir}/lib -I${top_builddir} -I${top_builddir}/include -I${top_builddir}/include/mailutils/gnu -I${top_srcdir}/mailbox' | ||
987 | |||
988 | ### Display the status | 1061 | ### Display the status |
989 | 1062 | ||
990 | AC_CONFIG_COMMANDS([status],[ | 1063 | AC_CONFIG_COMMANDS([status],[ |
... | @@ -995,7 +1068,7 @@ GNU Mailutils configured with the following settings: | ... | @@ -995,7 +1068,7 @@ GNU Mailutils configured with the following settings: |
995 | 1068 | ||
996 | Use PAM........................ $status_pam | 1069 | Use PAM........................ $status_pam |
997 | Use -ltdl...................... $status_ltdl | 1070 | Use -ltdl...................... $status_ltdl |
998 | Use Berkeley DB2............... $status_bdb2 | 1071 | Use Berkeley DB................ $status_bdb |
999 | Use NDBM....................... $status_ndbm | 1072 | Use NDBM....................... $status_ndbm |
1000 | Use DBM........................ $status_dbm | 1073 | Use DBM........................ $status_dbm |
1001 | Use GDBM....................... $status_gdbm | 1074 | Use GDBM....................... $status_gdbm |
... | @@ -1030,7 +1103,11 @@ EOF | ... | @@ -1030,7 +1103,11 @@ EOF |
1030 | ], | 1103 | ], |
1031 | [status_pam=$status_pam | 1104 | [status_pam=$status_pam |
1032 | status_ltdl=$status_ltdl | 1105 | status_ltdl=$status_ltdl |
1033 | status_bdb2=$status_bdb2 | 1106 | if test $status_bdb = no; then |
1107 | status_bdb=$status_bdb | ||
1108 | else | ||
1109 | status_bdb="v. $status_bdb" | ||
1110 | fi | ||
1034 | status_ndbm=$status_ndbm | 1111 | status_ndbm=$status_ndbm |
1035 | status_dbm=$status_dbm | 1112 | status_dbm=$status_dbm |
1036 | status_gdbm=$status_gdbm | 1113 | status_gdbm=$status_gdbm | ... | ... |
-
Please register or sign in to post a comment