From d5c5352476cb09bc5fc660c33f981d7bc72a063d Mon Sep 17 00:00:00 2001 From: "Heiko Schlittermann (HS12-RIPE)" Date: Sat, 23 May 2020 21:19:10 +0200 Subject: [PATCH] Build: Allow arbitrary *_PC settings in EDITME --- src/scripts/Configure-Makefile | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/scripts/Configure-Makefile b/src/scripts/Configure-Makefile index 61368ecb3..4dd7c9bf9 100755 --- a/src/scripts/Configure-Makefile +++ b/src/scripts/Configure-Makefile @@ -112,14 +112,16 @@ for f in OS/Makefile-Default \ $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. @@ -147,12 +149,16 @@ rm -f ./$mftepcp ./$mftepcp2 # 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 ( @@ -225,7 +231,8 @@ 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 ;; -- 2.30.2