Summary: | games-action/extreme-tuxracer-0.6.0 compile fails with media-libs/libsdl-1.2.15-r5: SDL_platform.h: No such file or directory | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Ulrich Müller <ulm> |
Component: | [OLD] Library | Assignee: | Gentoo Games <games> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | multilib+disabled |
Priority: | Normal | Keywords: | STABLE |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | https://sourceforge.net/apps/phpbb/extremetuxracer/viewtopic.php?f=4&t=105 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 512430 | ||
Attachments: |
build.log
Patch fixing the issue in etr |
Description
Ulrich Müller
2014-05-16 09:47:38 UTC
(In reply to Ulrich Müller from comment #0) > Not sure who is to blame, but here are some observations: > > 1. extreme-tuxracer compiles fine with libsdl-1.2.15-r4 > > 2. configure writes the following flags to the Makefile: > CFLAGS = -march=core2 -O2 -ggdb -pipe -I/usr/include/SDL -D_GNU_SOURCE=1 > -D_REENTRANT -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL > -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL > CXXFLAGS = -march=core2 -O2 -ggdb -pipe -I/usr/include/freetype2 -std=c++11 > So, CFLAGS correctly inherits -I/usr/include/SDL from SDL_CFLAGS, while > CXXFLAGS doesn't. 3. SDL header files include their siblings as "SDL_platform.h" instead of <SDL/SDL_platform.h> I can reproduce this with this simple program: #include <SDL/SDL_config.h> int main() { return 0; } Sadly, I don't see a good solution here. I can think of two possible workarounds: 1. wrap relatively #included headers as well -- SDL_platform.h in this case, 2. replace the relative #include with <SDL/*.h>. I'll try to find out how multilib-portage solves this. Workaround #1 would require the following change: --- libsdl-1.2.15-r5.ebuild 15 May 2014 16:15:03 -0000 1.4 +++ libsdl-1.2.15-r6.ebuild 16 May 2014 18:56:19 -0000 @@ -63,13 +63,19 @@ S=${WORKDIR}/SDL-${PV} MULTILIB_WRAPPED_HEADERS=( + /usr/include/SDL/begin_code.h + /usr/include/SDL/close_code.h /usr/include/SDL/SDL_byteorder.h /usr/include/SDL/SDL_config.h /usr/include/SDL/SDL_endian.h + /usr/include/SDL/SDL_error.h /usr/include/SDL/SDL_getenv.h /usr/include/SDL/SDL_keysym.h + /usr/include/SDL/SDL_platform.h + /usr/include/SDL/SDL_stdinc.h /usr/include/SDL/SDL_syswm.h /usr/include/SDL/SDL_types.h + /usr/include/SDL/SDL_version.h ) pkg_setup() { Short version: (In reply to Ulrich Müller from comment #0) > x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. > -DETR_DATA_DIR=\"/usr/share/games\" -march=core2 -O2 -ggdb -pipe > -I/usr/include/freetype2 -std=c++11 -c -o audio.o audio.cpp is missing -I/usr/include/SDL as you already have outlined in > 2. configure writes the following flags to the Makefile: > CFLAGS = -march=core2 -O2 -ggdb -pipe -I/usr/include/SDL -D_GNU_SOURCE=1 > -D_REENTRANT -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL > -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL > CXXFLAGS = -march=core2 -O2 -ggdb -pipe -I/usr/include/freetype2 -std=c++11 > So, CFLAGS correctly inherits -I/usr/include/SDL from SDL_CFLAGS, while > CXXFLAGS doesn't. so the proper fix is including that part in CXXFLAGS too. If you want a longer version, tell me. ;-) Yes, fixing the build system to add the relevant flags to CXXFLAGS would be a proper thing to do, and would solve the issue at hand. However, we need to think of the more generic issue. Do we support building against SDL without using sdl-config/pkg-config? That is, do we expect plain #include <SDL/SDL_config.h> to work without -I/usr/include/SDL? If we do, then we need to apply additional hacks on top of SDL. And in fact, we need to consider that in the future more packages may suffer similar issues, and not have extra -I workarounds in place. In this case, I think the only reasonable solution would be to wrap the included headers or force #include <>. However, it should be noted that packages suffering this are quite unlikely since #include "" are pretty rare in system headers, and the wrapped headers do not #include non-system headers often. Upstreamed with patch 'attached'. Created attachment 377084 [details, diff]
Patch fixing the issue in etr
+ 17 May 2014; Julian Ospald <hasufell@gentoo.org> + extreme-tuxracer-0.6.0.ebuild, +files/extreme-tuxracer-0.6.0-libsdl.patch: + fix build failure wrt #510474 (In reply to Michał Górny from comment #7) SDL_CFLAGS are just preprocessor flags, so it should really be in CPPFLAGS. it probably doesn't break with this package though if it only builds C++ files. |