Bug 7874

Summary: subversion-native compile failure with missing serf header on paths containing "-D"
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Paul Gortmaker <paulg>
Component: devtools / tool chainAssignee: Jose Lamego <jose.a.lamego>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: meta.mr.watcher, meta.watcher
Version: unspecified   
Target Milestone: 1.9 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Paul Gortmaker 2015-06-10 22:54:31 UTC
If you create a project with a dash and a capital "D", you will get a build failure on subversion-native.  For example, "/home/paul/My-Demo"

This happens because subversion serf.m4 contains this line:

 http://svn.apache.org/repos/asf/subversion/branches/master-passphrase/build/ac-macros/serf.m4

SVN_SERF_INCLUDES=[`$PKG_CONFIG $serf_major --cflags | $SED -e 's/-D[^ ]*//g'`]

Presumably the sed was to remove "-Dfoo=bar" type stuff from cflags, but it also mangles any "-I/path/with/a/dash/dee/my-Dir/include" too.  Which then means you won't get the include path to the serf.h and the compile will fail.

A possible sed expression to fix this would be:

echo "-Dcrap -I/home/here/foo-D/paul -Dbar=foo"| sed -e 's/[[:space:]]-D[^ ]*//g' -e 's/^-D[^ ]*//g'
-I/home/here/foo-D/paul

compared to the failure of the original:

echo "-Dcrap -I/home/here/foo-D/paul -Dbar=foo" | sed -e 's/-D[^ ]*//g'  
 -I/home/here/foo 

[possible sed regex courtesy of seebs]
Comment 1 Jose Lamego 2015-07-14 17:08:17 UTC
The patch is merged by subversion upstream with replacing '[[:space:]]' with ' '.

http://svn.apache.org/viewvc/subversion/trunk/build/ac-macros/serf.m4?r1=1594156&r2=1689824