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
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.