After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 684637 - libxslt-1.1.27: --with-python build fails with "Python.h: No such file or directory"
libxslt-1.1.27: --with-python build fails with "Python.h: No such file or dir...
Status: RESOLVED FIXED
Product: libxslt
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2012-09-22 21:43 UTC by Alexandre Rostovtsev
Modified: 2012-11-21 06:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (1.39 KB, patch)
2012-09-22 21:50 UTC, Alexandre Rostovtsev
none Details | Review

Description Alexandre Rostovtsev 2012-09-22 21:43:47 UTC
Commit a2cd8a03 moved the includes in python/Makefile.am from INCLUDES to AM_CPPFLAGS. This change breaks the build when using --with-python.

This happens because automake does not use AM_CPPFLAGS for tagets which have a target-specific *_CPPFLAGS variable. And at least when using automake-1.12.3 on Gentoo, a basic definition of libxsltmod_la_CPPFLAGS automatically gets added python/Makefile.am:

libxsltmod_la_CPPFLAGS = -shared

As a result, the rule for building libxsltmod_la-libxslt.lo gets expanded to

libxsltmod_la-libxslt.lo: libxslt.c
	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxsltmod_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libxsltmod_la-libxslt.lo `test -f 'libxslt.c' || echo '$(srcdir)/'`libxslt.c

and the build fails with

/bin/sh ../libtool  --tag=CC   --mode=compile x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I..  -shared  -I/usr/include/libxml2 -march=native -O2 -pipe -Wall -c -o libxsltmod_la-libxslt.lo `test -f 'libxslt.c' || echo './'`libxslt.c
libtool: compile:  x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/libxml2 -march=native -O2 -pipe -Wall -c libxslt.c  -fPIC -DPIC -o .libs/libxsltmod_la-libxslt.o
libxslt.c:14:20: fatal error: Python.h: No such file or directory
compilation terminated.

The build failure can be avoided by appending the includes to libxsltmod_la_CPPFLAGS instead of assigning to AM_CPPFLAGS.
Comment 1 Alexandre Rostovtsev 2012-09-22 21:50:22 UTC
Created attachment 225003 [details] [review]
proposed patch
Comment 2 Daniel Veillard 2012-11-21 06:36:12 UTC
I'm surprized by the automatic addition, but we can try to cope
with this. The patch as is is actually broken because it use
+= while libxsltmod_la_CPPFLAGS is never set earlier in the
makefile.am . So i am changing this to = , i assume that the
automatic addition you are mentioning is intelligent enough to
detect if there is already a declaration, if not we it's broken
and that need fixing, not libxslt Makefiles.

So applied with that small change:

http://git.gnome.org/browse/libxslt/commit/?id=358bd4e46c2a17b7856401e206150bd17b538cfe

 thanks,

Daniel