# the OSTYPE and ARCHTYPE variables.
rm -f $mft $mftt $mftepcp $mftepcp2 $look_mf-t
-(echo "OSTYPE=$ostype"; echo "ARCHTYPE=$archtype"; echo "") > $mft || exit 1
# Now concatenate the files to the temporary file. Copy the files using sed to
# remove comments, blank lines, and trailing white space.
st=' '
+{
+echo "OSTYPE=$ostype"
+echo "ARCHTYPE=$archtype"
+echo ""
+
for f in OS/Makefile-Default \
OS/Makefile-$ostype \
Local/Makefile \
# 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
+ sed -e "/^#/d" \
+ -e "/^[$st]*\$/d" \
+ -e "s/[$st]*\$//" \
+ -e "s/[$st]*\\(\\+\\?=\\)[$st]*/\\1/" \
+ ../$f || exit 1
echo "# End of $f"
echo ""
fi
-done \
- | sed 's/^TMPDIR=/EXIM_&/' \
- > $mft || exit 1
+done | sed 's/^TMPDIR=/EXIM_&/'
+} > $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.
-sed -n "s/^[$st]*PKG_CONFIG_PATH[$st]*[+]*=[$st]*//p" $mft | \
- sed "s/[$st]*\$//" >> $mftepcp
+sed -n "s/^PKG_CONFIG_PATH[$st]*[+]*=[$st]*//p" $mft > $mftepcp
if test -s ./$mftepcp
then
# expand any wildcards and strip spaces, to make it a real PATH-like variable
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
+ | while IFS== read name value; do # find the BASE for BASE_PC
egrep "^${name%_PC}=" $mft && echo "$name=$value"
done
-} | sed "s/[$st]*=/='/" \
- | sed "s/\$/'/" \
+} | sed "s/=\\(.*\\)/='\\1'/" \
| sort | uniq > $mftt
if test -s $mftt
then