3 # We turn the configure-built build-$foo/lookups/Makefile.predynamic into Makefile
5 input=lookups/Makefile.predynamic
6 target=lookups/Makefile
8 tag_marker='MAGIC-TAG-MODS-OBJ-RULES-GO-HERE'
11 if grep -q "^LOOKUP.*=[ $tab]*2" "$defs_source"
15 echo "No dynamic module loading support"
20 if grep -q "^CFLAGS_DYNAMIC[ $tab]*=" "$defs_source"
22 # we have a definition, we're good to go
24 echo >&2 "Missing CFLAGS_DYNAMIC inhibits building dynamic module lookup"
32 grep -q "^LOOKUP_${dyn_name}[ $tab]*=[ $tab]*2" "$defs_source"
37 grep -q "^LOOKUP_${want_name}[ $tab]*=[ $tab]*." "$defs_source"
41 local lookup_name="$1"
43 if [ "${lookup_name%:*}" = "$lookup_name" ]
45 mod_name=$(echo $lookup_name | tr A-Z a-z)
47 mod_name="${lookup_name#*:}"
48 lookup_name="${lookup_name%:*}"
51 if want_dynamic "$lookup_name"
53 echo "MODS += ${mod_name}.so"
54 echo "LOOKUP_${mod_name}_INCLUDE = \$(LOOKUP_${lookup_name}_INCLUDE)"
55 echo "LOOKUP_${mod_name}_LIBS = \$(LOOKUP_${lookup_name}_LIBS)"
56 elif want_at_all "$lookup_name"
58 echo "OBJ += ${mod_name}.o"
65 sed -n "1,/$tag_marker/p" < "$input"
68 CDB DBM:dbmdb DNSDB DSEARCH IBASE LSEARCH MYSQL NIS NISPLUS ORACLE \
69 PASSWD PGSQL SQLITE TESTDB WHOSON
71 emit_module_rule $name_mod
79 sed -n "/$tag_marker/,\$p" < "$input"
85 # vim: set ft=sh sw=2 :