summarylogtreecommitdiffstats
path: root/0001-build-Attempt-GDBM-1.15-compatibility.patch
blob: c6be884804e59326fac008c11fd627bec53ec476 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
From f2626c5f6c2c3737daab90503fd18ca7208791ec Mon Sep 17 00:00:00 2001
Message-Id: <f2626c5f6c2c3737daab90503fd18ca7208791ec.1529708748.git.jan.steffens@gmail.com>
From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
Date: Sat, 23 Jun 2018 01:05:20 +0200
Subject: [PATCH] build: Attempt GDBM 1.15 compatibility

---
 configure.ac                      |  3 +++
 service-type-database/Makefile.am | 34 +++++++++++++++----------------
 2 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/configure.ac b/configure.ac
index 72d6147..ee25ba1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -772,18 +772,21 @@ if test "x$HAVE_GDBM" = "xyes" ; then
         AC_MSG_ERROR([*** libgdbm not found ***])
     fi
     AC_DEFINE([HAVE_GDBM],[],[Support for GDBM])
+
+    AC_CHECK_MEMBER([gdbm_recovery.duplicate_keys], [have_gdbm_1_15=yes], [], [[#include <gdbm.h>]])
 else
     if test "x$HAVE_DBM" = "xyes" ; then
         AC_CHECK_HEADERS(ndbm.h, have_dbm=true, have_dbm=false)
 
         if ! $have_dbm ; then
             AC_MSG_ERROR([*** dbm not found ***])
         fi
         AC_DEFINE([HAVE_DBM],[],[Support for DBM])
     fi
 fi
 AM_CONDITIONAL(HAVE_GDBM, test "x$HAVE_GDBM" = "xyes")
 AM_CONDITIONAL(HAVE_DBM, test "x$HAVE_DBM" = "xyes")
+AM_CONDITIONAL(HAVE_DBM_SPLIT, [test "x$have_gdbm_1_15" = "xyes" || test "x$HAVE_DBM" = "xyes"])
 
 #
 # libdaemon
diff --git a/service-type-database/Makefile.am b/service-type-database/Makefile.am
index f9fa082..0fe4af1 100644
--- a/service-type-database/Makefile.am
+++ b/service-type-database/Makefile.am
@@ -22,32 +22,32 @@ pkglibdatadir=$(libdir)/avahi
 pkglibdata_DATA=
 
 if HAVE_PYTHON
-if HAVE_GDBM
 
 noinst_SCRIPTS=build-db
+
+if HAVE_DBM_SPLIT
+
+pkglibdata_DATA+=service-types.db.pag service-types.db.dir
+
+service-types.db.pag: service-types.db
+	$(AM_V_GEN)mv service-types.db.coming.pag service-types.db.pag
+service-types.db.dir: service-types.db
+	$(AM_V_GEN)mv service-types.db.coming.dir service-types.db.dir
+service-types.db: service-types
+	$(AM_V_GEN)$(PYTHON) build-db $< $@.coming && \
+	if test -f "$@.coming"; then mv $@.coming $@; fi
+
+CLEANFILES = service-types.db*
+
+else
+
 pkglibdata_DATA+=service-types.db
 
 service-types.db: service-types
 	$(AM_V_GEN)$(PYTHON) build-db $< $@.coming && \
 	mv $@.coming $@
 
 CLEANFILES = service-types.db
 
-endif
-if HAVE_DBM
-
-noinst_SCRIPTS=build-db
-pkglibdata_DATA+=service-types.db.pag service-types.db.dir
-
-service-types.db.pag: service-types.db
-	$(AM_V_GEN)mv service-types.db.coming.pag service-types.db.pag
-service-types.db.dir: service-types.db
-	$(AM_V_GEN)mv service-types.db.coming.dir service-types.db.dir
-service-types.db: service-types build-db
-	$(AM_V_GEN)$(PYTHON) build-db $< $@.coming && \
-	if test -f "$@.coming"; then mv $@.coming $@; fi
-
-CLEANFILES = service-types.db*
-
 endif
 endif
-- 
2.18.0