I want to cross compile bzip under linux to target mingw32. But bzip2 use path like "sys\stat.h",which should be "sys/stat.h" in linux. some project(like mingw-cross-env.nongnu.org) fix it by following commands: $(SED) -i 's,sys\\stat\.h,sys/stat.h,g' '$(1)/bzip2.c' $(SED) -i 's,WINAPI,,g' '$(1)/bzlib.h' Maybe bzip2 should also add this fix in ebuild. Reproducible: Always Steps to Reproduce: 1.i686-pc-mingw32-emerge bzip2 Actual Results: bzip2.c:132:25: fatal error: sys\stat.h: No such file or directory compilation terminated. Expected Results: emerge should pass. http://hg.savannah.gnu.org/hgweb/mingw-cross-env/file/f2d627bab920/src/bzip2.mk define $(PKG)_BUILD 23 $(SED) -i 's,sys\\stat\.h,sys/stat.h,g' '$(1)/bzip2.c' 24 $(SED) -i 's,WINAPI,,g' '$(1)/bzlib.h' 25 $(MAKE) -C '$(1)' -j '$(JOBS)' libbz2.a \ 26 PREFIX='$(PREFIX)/$(TARGET)' \ 27 CC='$(TARGET)-gcc' \ 28 AR='$(TARGET)-ar' \ 29 RANLIB='$(TARGET)-ranlib' 30 $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib' 31 $(INSTALL) -m644 '$(1)/libbz2.a' '$(PREFIX)/$(TARGET)/lib/' 32 $(INSTALL) -d '$(PREFIX)/$(TARGET)/include' 33 $(INSTALL) -m644 '$(1)/bzlib.h' '$(PREFIX)/$(TARGET)/include/' 34 endef
should be all set now in the tree; thanks for the report! Commit message: Make it build for mingw targets http://sources.gentoo.org/app-arch/bzip2/bzip2-1.0.6-r3.ebuild?r1=1.10&r2=1.11 http://sources.gentoo.org/app-arch/bzip2/files/bzip2-1.0.6-mingw.patch?rev=1.1