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.
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.
--prefix=/usr is correct use .pc files rather than xxx-config scripts to avoid the path problem
Created attachment 320698 [details] Error in emerging media-libs/smpeg because of hard-coded --prefix
Created attachment 320700 [details] Difference between /usr/include/SDL and /usr/x86_64-w64-mingw32/usr/include/SDL
(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).
(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.