The issues seem to be that ./configure is setting IFS=' ' without
unsetting the value again. This means tabs in CFLAGS also break
./configure. And the variables aren't escaped for config.mk.

This is not a proper patch only a proof of concept to fix the build of
skalibs with newlines in CFLAGS:

--- a/configure
+++ b/configure
@@ -59,12 +59,10 @@ EOF
 # generally not a good idea to use echo.
 # See http://etalabs.net/sh_tricks.html
 echo () {
-  IFS=' '
   printf %s\\n "$*"
 }
 
 echon () {
-  IFS=' '
   printf %s "$*"
 }
 
@@ -133,8 +131,7 @@ iscached ()
   if test -r "$tmps" && grep -q "^${1}: " "$tmps" ; then
     grep "^${1}: " "$tmps" | tail -n 1 |
     {
-      IFS=' '
-      read -r k v ldlibs
+      IFS=' ' read -r k v ldlibs
       if test -n "$ldlibs" ; then
         echo "  ... user-provided: $v with linker args: $ldlibs"
         echo "$ldlibs" >&3
@@ -705,7 +702,9 @@ CC := ${CC_AUTO}
 CPPFLAGS_AUTO := $CPPFLAGS_AUTO
 CPPFLAGS := $CPPFLAGS $CPPFLAGS_POST
 CFLAGS_AUTO := $CFLAGS_AUTO
-CFLAGS := $CFLAGS $CFLAGS_POST
+CFLAGS := $CFLAGS ${CFLAGS_POST//'
+'/'\
+'}
 LDFLAGS_AUTO := $LDFLAGS_AUTO
 LDFLAGS := $LDFLAGS $LDFLAGS_POST
 LDFLAGS_NOSHARED := $LDFLAGS_NOSHARED

Reply via email to