From: Heiko Schlittermann (HS12-RIPE) Date: Sat, 23 May 2020 19:04:49 +0000 (+0200) Subject: Build: cleanup Configure-Makefile X-Git-Url: https://git.exim.org/users/heiko/exim.git/commitdiff_plain/48740258309009c850a2006ad4e2c25dd30996f4 Build: cleanup Configure-Makefile --- diff --git a/src/scripts/Configure-Makefile b/src/scripts/Configure-Makefile index 4dd7c9bf9..3f1dcbac6 100755 --- a/src/scripts/Configure-Makefile +++ b/src/scripts/Configure-Makefile @@ -91,7 +91,6 @@ look_mf_post=${look_mf}.postdynamic # 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. @@ -103,6 +102,11 @@ rm -f $mft $mftt $mftepcp $mftepcp2 $look_mf-t st=' ' +{ +echo "OSTYPE=$ostype" +echo "ARCHTYPE=$archtype" +echo "" + for f in OS/Makefile-Default \ OS/Makefile-$ostype \ Local/Makefile \ @@ -115,18 +119,21 @@ do if test -r ../$f # 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 @@ -153,11 +160,10 @@ rm -f ./$mftepcp ./$mftepcp2 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