Hi Mattia,
On 06/27/2015 05:59 AM, Mattia Rizzolo wrote:
> Hi subversion, unbound and swig maintainers,
> we in the Reproducible Builds effort use a non default dpkg which export
> -Wdate-time through dpkg-buildflags.
thanks for that great effort. I think this is urgently needed and I
often wonder if it is a good idea to install a given binary.
Most of the time I do not think much about using apt-get install
something and more about installers from github that are not packaged,
but this project really gives me a reason to trust Debian more. Thanks! :-)
> There are package that pass CPPFLAGS (for example) quite unchanged to swig.
I already noticed that before and was wondering if it is a good idea.
SWIG should mostly care for defines for the preprocessor and include
paths, but of course the easy way is to just pass everything on.
> Sadly swig does not recognize -Wdate-time and choke and fail on it badly, e.g.
>
> /usr/bin/swig -I. -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/include/python2.7
> -I/usr/include/python2.7 -o pythonmod/interface.h -python
> ./pythonmod/interface.i
> swig error : Unrecognized option -Wdate-time
> Use 'swig -help' for available options.
> Makefile:369: recipe for target 'pythonmod/interface.h' failed
> make[1]: *** [pythonmod/interface.h] Error 1
A link to the documentation would have been helpful:
https://gcc.gnu.org/gcc-4.9/changes.html#languages (changelog, seems not
to be in the docs yet).
warns when the |__DATE__|, |__TIME__|or |__TIMESTAMP__|macros are used.
Seriously, I did not even know about this macros. Wouldn't it make more
sense to just fill those from a common constant? I bet this will often
be used for library build information.
> a. swig stops failing so badly on unrecognized options. If you really want to
> validate the options at least stop failing on unrecognized -W? Seems quite
> logical to pass CPPFLAGS to swig to me, and as such sounds sane
IMO just skipping over all -W options in the swig command line parser
would be sane. I will take this upstream though as I'd rather not have
this as special Debian feature as it might make matters better for
Debian and worse for other distributions in case upstream relies on this
feature.
> b. people stop passing CPPFLAGS to swig. I've already saw a "CPPFLAGS cleaner"
> on subversion's configure script. Please I don't want to see another
Given that the goal is to pass gcc (more generally c compiler options)
to swig I don't think this is a wrong as it sounds. The original reason
is that swig command line mixes options native to swig with C compiler
options which should IMHO really be passed separately. Something like
-W,l passing to the linker in gcc could be used to pass preprocessor
options to swig.
> Even if I do have preference I don't have a strong opinion on this, so if you
> agree this is not a bug in swig (which I could even accept, given that the
> accepted flags are well documented), I'll just clone+reassign this bug around.
I will reword this slightly (linking to this original text) and take it
upstream.
Greetings, Torsten