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 echo "LOOKUP_${mod_name}_INCLUDE = \$(LOOKUP_${lookup_name}_INCLUDE)"
51 echo "LOOKUP_${mod_name}_LIBS = \$(LOOKUP_${lookup_name}_LIBS)"
52 elif want_at_all "$lookup_name"
54 echo "OBJ += ${mod_name}.o"
61 sed -n "1,/$tag_marker/p" < "$input"
64 CDB DBM:dbmdb DNSDB DSEARCH IBASE LSEARCH MYSQL NIS NISPLUS ORACLE \
65 PASSWD PGSQL SQLITE TESTDB WHOSON
67 emit_module_rule $name_mod
75 sed -n "/$tag_marker/,\$p" < "$input"
81 # vim: set ft=sh sw=2 :