| Summary: | media-lib/libpng-1.6.3-r1:0 - fix support for cross-compiling | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Rafal Lalik <rafallalik> |
| Component: | [OLD] Core system | Assignee: | Gentoo's Team for Core System packages <base-system> |
| Status: | RESOLVED NEEDINFO | ||
| Severity: | normal | CC: | msporysz06, nikoli |
| Priority: | Normal | Keywords: | PATCH |
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: | Fixes the ebuild to pass proper INCLUDES to the Makefile | ||
vapier, any chance you could take a look at this? i really don't like the approach of carrying such a hack in the ebuild forever :/ i'm reading the libpng configure script and not seeing a problem. i also don't understand the issue as described -- if you've changed SYSROOT, then your gcc needs the right flags to set --sysroot so it'll search the right place. hacking various packages to bypass that is not the way to go. |
Created attachment 355878 [details, diff] Fixes the ebuild to pass proper INCLUDES to the Makefile While cross-compiling libpng its configure script searches for zlib.h inside gcc default "/usr/${CHOST}/usr/include" path. If CBUILD == CHOST ?= CTARGET it works fine but for CBUILD != CHOST ?= CTARGET it fails as usually SYSROOT for CHOST is different than /usr/${CHOST}. It will actually always fails when SYSROOT != /usr/${CHOST} even if SYSROOT is exported and --sysroot=${SYSROOT} is passed as a gcc argument. libpng's Makefile can accept additional variable INCLUDES attached later to the all gcc calls and thus proper include path can be passed there. In my patch I propose to modify the src_compile() call to export INCLUDES variable when cross-compiling is detected. Tested with arm cross-compiling. Before this changes it did not work: - cross compiling configuration: CBUILD=x86_64 CHOST=arm CTARGET=arm - configure found incorrect zlib.h in /usr/${CHOST}/usr/include instead of ${SYSROOT}/usr/include - after removing zlib from /usr/${CHOST}/usr/include, proper ${SYSROOT}/usr/include/zlib.h was not found Rafal