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'
12 # We always do something now, since there should always be a lookup,
13 # and now we need to run in order to put the OBJ+= rules in.
15 if grep -q "^CFLAGS_DYNAMIC[ $tab]*=" "$defs_source"
17 # we have a definition, we're good to go
18 : # noop (true) statement for bash compatibility
20 echo >&2 "Missing CFLAGS_DYNAMIC inhibits building dynamic module lookup"
28 grep -q "^LOOKUP_${dyn_name}[ $tab]*=[ $tab]*2" "$defs_source"
33 grep -q "^LOOKUP_${want_name}[ $tab]*=[ $tab]*." "$defs_source"
37 local lookup_name="$1"
39 if [ "${lookup_name%:*}" = "$lookup_name" ]
41 mod_name=$(echo $lookup_name | tr A-Z a-z)
43 mod_name="${lookup_name#*:}"
44 lookup_name="${lookup_name%:*}"
47 if want_dynamic "$lookup_name"
49 echo "MODS += ${mod_name}.so"
50 grep "^LOOKUP_${lookup_name}_" "$defs_source"
51 echo "LOOKUP_${mod_name}_INCLUDE = \$(LOOKUP_${lookup_name}_INCLUDE)"
52 echo "LOOKUP_${mod_name}_LIBS = \$(LOOKUP_${lookup_name}_LIBS)"
53 elif want_at_all "$lookup_name"
55 echo "OBJ += ${mod_name}.o"
62 sed -n "1,/$tag_marker/p" < "$input"
65 CDB DBM:dbmdb DNSDB DSEARCH IBASE LSEARCH MYSQL NIS NISPLUS ORACLE \
66 PASSWD PGSQL SQLITE TESTDB WHOSON
68 emit_module_rule $name_mod
76 sed -n "/$tag_marker/,\$p" < "$input"
82 # vim: set ft=sh sw=2 :