3 # We turn the configure-built build-$foo/lookups/Makefile.predynamic into Makefile
5 if [ -x /usr/xpg4/bin/sh ] && [ -z "$EXIM_BLOCK_XPG4_LOOP" ]
7 EXIM_BLOCK_XPG4_LOOP=yes
8 export EXIM_BLOCK_XPG4_LOOP
9 PATH="/usr/xpg4/bin:$PATH"
11 exec /usr/xpg4/bin/sh "$0" "$@"
14 input=lookups/Makefile.predynamic
15 target=lookups/Makefile
17 tag_marker='MAGIC-TAG-MODS-OBJ-RULES-GO-HERE'
21 # We always do something now, since there should always be a lookup,
22 # and now we need to run in order to put the OBJ=$(OBJ)+ rules in.
24 if grep -q "^CFLAGS_DYNAMIC[ $tab]*=" "$defs_source"
26 # we have a definition, we're good to go
29 echo >&2 "Missing CFLAGS_DYNAMIC inhibits building dynamic module lookup"
37 grep -q "^LOOKUP_${dyn_name}[ $tab]*=[ $tab]*2" "$defs_source"
42 grep -q "^LOOKUP_${want_name}[ $tab]*=[ $tab]*." "$defs_source"
45 # The values of these variables will be emitted into the Makefile.
51 local lookup_name="$1"
53 if [ "${lookup_name%:*}" = "$lookup_name" ]
55 mod_name=$(echo $lookup_name | tr A-Z a-z)
57 mod_name="${lookup_name#*:}"
58 lookup_name="${lookup_name%:*}"
61 if want_dynamic "$lookup_name"
63 if [ -z "$enable_dynamic" ]; then
64 echo >&2 "Inhibited dynamic modules prevents building dynamic $lookup_name"
67 MODS="${MODS} ${mod_name}.so"
68 grep "^LOOKUP_${lookup_name}_" "$defs_source"
69 echo "LOOKUP_${mod_name}_INCLUDE = \$(LOOKUP_${lookup_name}_INCLUDE)"
70 echo "LOOKUP_${mod_name}_LIBS = \$(LOOKUP_${lookup_name}_LIBS)"
71 elif want_at_all "$lookup_name"
73 OBJ="${OBJ} ${mod_name}.o"
80 sed -n "1,/$tag_marker/p" < "$input"
83 CDB DBM:dbmdb DNSDB DSEARCH IBASE LSEARCH MYSQL NIS NISPLUS ORACLE \
84 PASSWD PGSQL SQLITE TESTDB WHOSON
86 emit_module_rule $name_mod
94 # Because the variable is EXPERIMENTAL_SPF and not LOOKUP_SPF we
95 # always include spf.o and compile a dummy if EXPERIMENTAL_SPF is not
103 sed -n "/$tag_marker/,\$p" < "$input"
109 # vim: set ft=sh sw=2 :