$mfb
do if test -r ../$f
then echo "# From $f"
- sed "/^#/d;/^[$st]*\$/d;s/[$st]*\$//" ../$f || exit 1
+ # remove comments, leading/trailing spaces, spaces around assignment ops
+ # (There should be not need to check for [$st]* anymore in
+ # the following lines
+ sed "/^#/d;/^[$st]*\$/d;s/[$st]*\$//;s/[$st]*\\(\\+\\?=\\)[$st]*/\\1/" ../$f || exit 1
echo "# End of $f"
echo ""
fi
done \
| sed 's/^TMPDIR=/EXIM_&/' \
- >> $mft || exit 1
-
+ > $mft || exit 1
# handle PKG_CONFIG_PATH because we need it in our env, and we want to handle
# wildcards; note that this logic means all setting _appends_ values, never
# replacing; if that's a problem, we can revisit.
# handle pkg-config
# beware portability of extended regexps with sed.
-egrep "^[$st]*(AUTH|LOOKUP)_[A-Z0-9_]*[$st]*=[$st]*" $mft | \
- sed "s/[$st]*=/='/" | \
- sed "s/\$/'/" > $mftt
-egrep "^[$st]*((USE_(OPENSSL|GNUTLS)_PC)|SUPPORT_TLS|USE_GNUTLS|PCRE_CONFIG|AVOID_GNUTLS_PKCS11)[$st]*=[$st]*" $mft | \
- sed "s/[$st]*=/='/" | \
- sed "s/\$/'/" >> $mftt
+{
+ egrep "^(AUTH|LOOKUP)_[A-Z0-9_]=" $mft
+ egrep "^(USE_GNUTLS|PCRE_CONFIG|AVOID_GNUTLS_PKCS11)=" $mft
+ egrep "^[A-Z][A-Z0-9_]+_PC=" $mft \
+ | while IFS== read name value; do
+ egrep "^${name%_PC}=" $mft && echo "$name=$value"
+ done
+} | sed "s/[$st]*=/='/" \
+ | sed "s/\$/'/" \
+ | sort | uniq > $mftt
if test -s $mftt
then
(
echo "CFLAGS += $cflags"
echo "AUTH_LIBS += $libs"
else
- echo >&2 "Don't know how to handle pkg-config for $var"
+ echo "CFLAGS += $cflags"
+ echo "LIBS += $libs"
fi
fi
;;