Bug 738

Summary: Swig should not be invoked with CPPFLAGS
Product: unbound Reporter: Robert Edmonds <edmonds>
Component: serverAssignee: unbound team <unbound-team>
Status: RESOLVED FIXED    
Severity: minor CC: cathya, wouter
Priority: P5    
Version: unspecified   
Hardware: All   
OS: Linux   
Attachments: Makefile.in: Pass PYTHON_CPPFLAGS to swig instead of CPPFLAGS

Description Robert Edmonds 2016-01-23 21:58:15 CET
Created attachment 320 [details]
Makefile.in: Pass PYTHON_CPPFLAGS to swig instead of CPPFLAGS

Hi,

Debian (and derivatives) have started injecting gcc >= 4.9's -Wdate-time into CPPFLAGS by default as of dpkg 1.18.4, as part of the Reproducible Builds effort. For more details, see https://wiki.debian.org/ReproducibleBuilds/TimestampsFromCPPMacros, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=805872.

This causes build failures with a very small number of packages in Debian that includes Unbound, due to the unfiltered use of $(CPPFLAGS) in the arguments to swig. See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=809055 for the Debian bug tracking the issue in the Unbound package.

If I understand correctly, per Swig upstream's comments, Swig should not really be invoked with CPPFLAGS, only a few flags that look like C preprocessor flags like -I, -D, -U are actually supported.

The attached patch should fix this, by importing the Autoconf variable PYTHON_CPPFLAGS into the Makefile and using $(PYTHON_CPPFLAGS) instead of $(CPPFLAGS) for the arguments to the Swig command.

Thanks!
Comment 1 Wouter Wijngaards 2016-01-25 09:08:10 CET
Hi Robert,

Committed, thank you for the patch.

Best regards, Wouter