Bugzilla – Bug 738
Swig should not be invoked with CPPFLAGS
Last modified: 2016-01-25 09:08:10 CET
Created attachment 320 [details]
Makefile.in: Pass PYTHON_CPPFLAGS to swig instead of CPPFLAGS
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.
Committed, thank you for the patch.
Best regards, Wouter