summaryrefslogtreecommitdiff
path: root/src/scripts
diff options
context:
space:
mode:
authorTodd Lyons <tlyons@exim.org>2013-10-01 09:24:19 -0700
committerTodd Lyons <tlyons@exim.org>2013-10-01 09:32:24 -0700
commit9bdd29ad5c5d394229753b114f6f288893f616f4 (patch)
treed830c7b8003a53597daa060625aa0ed260b9c556 /src/scripts
parent9cb1785a68901ce990c7581bd465d0931edf166e (diff)
Bugzilla 1217: Experimental Redis lookup
Add want_experimental() test in the script to create the lookups Makefile to ease detection of requested Experimental features, and simplify the #ifdef guards in the redis.c.
Diffstat (limited to 'src/scripts')
-rwxr-xr-xsrc/scripts/MakeLinks1
-rwxr-xr-xsrc/scripts/lookups-Makefile17
2 files changed, 18 insertions, 0 deletions
diff --git a/src/scripts/MakeLinks b/src/scripts/MakeLinks
index a9abdab25..2eb8a967e 100755
--- a/src/scripts/MakeLinks
+++ b/src/scripts/MakeLinks
@@ -38,6 +38,7 @@ ln -s ../../src/lookups/ldap.h ldap.h
ln -s ../../src/lookups/ldap.c ldap.c
ln -s ../../src/lookups/lsearch.c lsearch.c
ln -s ../../src/lookups/mysql.c mysql.c
+ln -s ../../src/lookups/redis.c redis.c
ln -s ../../src/lookups/nis.c nis.c
ln -s ../../src/lookups/nisplus.c nisplus.c
ln -s ../../src/lookups/oracle.c oracle.c
diff --git a/src/scripts/lookups-Makefile b/src/scripts/lookups-Makefile
index e7aeaa08a..51fbd944b 100755
--- a/src/scripts/lookups-Makefile
+++ b/src/scripts/lookups-Makefile
@@ -76,6 +76,15 @@ want_at_all() {
grep -q "^[ $tab]*$re" "$defs_source"
}
+# Adapted want_at_all above to work for EXPERIMENTAL features
+want_experimental() {
+ local want_name="$1"
+ local re="EXPERIMENTAL_${want_name}[ $tab]*=[ $tab]*."
+ env | grep -q "^$re"
+ if [ $? -eq 0 ]; then return 0; fi
+ grep -q "^[ $tab]*$re" "$defs_source"
+}
+
# The values of these variables will be emitted into the Makefile.
MODS=""
@@ -139,6 +148,14 @@ fi
OBJ="${OBJ} spf.o"
+# Because the variable is EXPERIMENTAL_REDIS and not LOOKUP_REDIS we
+# use a different function to check for EXPERIMENTAL_* features
+# requested. Don't use the SPF method with dummy functions above.
+if want_experimental REDIS
+then
+ OBJ="${OBJ} redis.o"
+fi
+
echo "MODS = $MODS"
echo "OBJ = $OBJ"