Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 430200 - media-libs/libsdl - ./configure in cross-emerge uses wrong/host --prefix flag because $prefix is hard-coded
Summary: media-libs/libsdl - ./configure in cross-emerge uses wrong/host --prefix flag...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Games (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Embedded Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-06 17:31 UTC by Leonardo
Modified: 2012-08-08 15:14 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Error in emerging media-libs/smpeg because of hard-coded --prefix (file_430200.txt,27.10 KB, text/plain)
2012-08-08 13:35 UTC, Leonardo
Details
Difference between /usr/include/SDL and /usr/x86_64-w64-mingw32/usr/include/SDL (file_430200.txt,7.75 KB, text/plain)
2012-08-08 13:45 UTC, Leonardo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Leonardo 2012-08-06 17:31:32 UTC
Hello.

When compiling something in using a <ctarget>-emerge, ./configure gets runned with a --prefix=/usr flag instead of --prefix=/usr/<ctarget>/usr. This breaks  packages that ships a *-config script and packages that ships header files tailored to the target system.

For instance, libsdl ships a sdl-config script that have --prefix hard-coded (much like others) to anything that was defined when it was compiled. When using /usr/<ctarget>/usr/bin/sdl-config --cflags, it reports "-I/usr/include/SDL --prefix=/usr".

SDL also ships a SDL_config.h file with contains features of the target system, like #define HAVE_ICONV 1. That define is true on my host system, but its false on the target (in this case, x86_64-w64-mingw32).

This set-up breaks compilation of smpeg (for instance): by using --prefix=/usr (reported by sdl-config) and SDL.h from the host instead of the target, HAVE_ICONV gets defined by sysroot's SDL_config.h and then it tries to include iconv.h, which cannot be found.
Comment 1 Leonardo 2012-08-07 12:32:36 UTC
Please notice that I was using libsdl *as an example*, it is not game-related. Every package cross-compiled gets ./configure runned with --prefix=/usr. Another example of broken *-config is libpng.
Comment 2 SpanKY gentoo-dev 2012-08-08 02:28:22 UTC
--prefix=/usr is correct

use .pc files rather than xxx-config scripts to avoid the path problem
Comment 3 Leonardo 2012-08-08 13:35:23 UTC
Created attachment 320698 [details]
Error in emerging media-libs/smpeg because of hard-coded --prefix
Comment 4 Leonardo 2012-08-08 13:45:51 UTC
Created attachment 320700 [details]
Difference between /usr/include/SDL and /usr/x86_64-w64-mingw32/usr/include/SDL
Comment 5 Leonardo 2012-08-08 13:49:15 UTC
(In reply to comment #2)
> --prefix=/usr is correct
I can understand that. The problem with it is that xxx-config scripts reports wrong include paths, that other packages are using to configure themselves. This is not a problem exclusive to SDL, note that this affects anything that are using xxx-config scripts, and I believe that a whole lot of other packages relies on them reporting correct paths and configure flags.

> 
> use .pc files rather than xxx-config scripts to avoid the path problem
I am not using either. I am trying to emerge something.
What do I do when emerging media-libs/smpeg (for instance), then? hack it to use .pc files? What about other packages that might eventually break?

xxx-config scripts have to return the correct include path which is NOT the sysroot include path, and again, this problem is not related only to sdl (as I stated earlier, libpng has the same problem).
Comment 6 SpanKY gentoo-dev 2012-08-08 15:14:00 UTC
(In reply to comment #5)

then you fix those packages to use the .pc files.  changing --prefix is wrong.

crossdev comes with a cross-fix-root script which can help automate this munging, but the intention is to not do that anymore and convert everyone over to .pc files.