X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/51a87a4dd1f2999485da7fe50c313e821dcc8dba..7b162fc84e202a16b89fa11224737ffbdd240bc8:/src/scripts/drivers-Makefile diff --git a/src/scripts/drivers-Makefile b/src/scripts/drivers-Makefile index 2dd958043..4b2bf245b 100755 --- a/src/scripts/drivers-Makefile +++ b/src/scripts/drivers-Makefile @@ -6,6 +6,7 @@ class=${CLASS:?} classdef=${CLASSDEF:?} drnames="${DRNAMES:?}" +egrep="${EGREP:?}" # We turn the configure-built build-$foo/$class/Makefile.predynamic into Makefile. # This is used for router and transport drivers, called from scripts/Configure-Makefile. @@ -95,19 +96,30 @@ fi # command-line, not just check the Makefile. want_dynamic() { - local dyn_name="$1" + local dyn_name="${1#_}" local re="(${classdef}|EXPERIMENTAL)_${dyn_name}[ $tab]*=[ $tab]*2" - env | grep -E -q "^$re" + env | ${egrep} -q "^$re" if [ $? -eq 0 ]; then return 0; fi - grep -E -q "^[ $tab]*$re" "$defs_source" + ${egrep} -q "^[ $tab]*$re" "$defs_source" +} + +want_not_disabled() { + local want_name="${1#_}" + [ "$want_name" = "$1" ] && return 1; + local re="DISABLED_${want_name}[ $tab]*=[ $tab]*." + env | ${egrep} -q "^$re" + [ $? -ne 0 ] && return 0 + ${egrep} -q "^[ $tab]*$re" "$defs_source" + [ $? -ne 0 ] && return 0 + return 1 } want_at_all() { local want_name="$1" local re="(${classdef}|EXPERIMENTAL)_${want_name}[ $tab]*=[ $tab]*." - env | grep -E -q "^$re" + env | ${egrep} -q "^$re" if [ $? -eq 0 ]; then return 0; fi - grep -E -q "^[ $tab]*$re" "$defs_source" + ${egrep} -q "^[ $tab]*$re" "$defs_source" } # The values of these variables will be emitted into the Makefile. @@ -135,20 +147,21 @@ emit_module_rule() { echo >&2 "Missing CFLAGS_DYNAMIC prevents building dynamic $name" exit 1 fi - MODS="${MODS} ${mod_name}.so" + MODS="${MODS} ${mod_name#_}.so" grep "^${classdef}_${name}_PC" "$defs_source" 1>&2 pkgconf=$(grep "^${classdef}_${name}_PC" "$defs_source") if [ $? -eq 0 ]; then pkgconf=$(echo $pkgconf | sed 's/^.*= *//') - echo "${classdef}_${mod_name}_INCLUDE = $(pkg-config --cflags $pkgconf)" - echo "${classdef}_${mod_name}_LIBS = $(pkg-config --libs $pkgconf)" + echo "${classdef}_${mod_name#_}_INCLUDE = $(pkg-config --cflags $pkgconf)" + echo "${classdef}_${mod_name#_}_LIBS = $(pkg-config --libs $pkgconf)" else grep "^${classdef}_${name}_" "$defs_source" - echo "${classdef}_${mod_name}_INCLUDE = \$(${classdef}_${name}_INCLUDE)" - echo "${classdef}_${mod_name}_LIBS = \$(${classdef}_${name}_LIBS)" + echo "${classdef}_${mod_name#_}_INCLUDE = \$(${classdef}_${name}_INCLUDE)" + echo "${classdef}_${mod_name#_}_LIBS = \$(${classdef}_${name}_LIBS)" fi - elif want_at_all "$name" - then + elif want_not_disabled "$name"; then + OBJ="${OBJ} ${mod_name#_}.o" + elif want_at_all "$name"; then OBJ="${OBJ} ${mod_name}.o" fi }