I decided to port some program, that uses zlib, using emscripten. Configuration fails, because it complains no zlib is present on my system.
But:
>ls ~/.emscripten_ports/
freetype libpng sdl2 sdl2-image.zip sdl2-ttf.zip zlib
freetype.zip libpng.zip sdl2-image sdl2-ttf sdl2.zip zlib.zip
And:
> ls ~/.emscripten_cache/asmjs/
dlmalloc.bc libc.bc libcxx_noexcept.a sdl2.bc sdl2-ttf.bc
freetype.bc libcxx.a libpng.bc sdl2-image.bc wasm-libc.bc
gl.bc libcxxabi.bc ports-builds sdl2-image-png.bc zlib.bc
And:
> ls ~/.emscripten_cache/asmjs/ports-builds/
freetype include libpng sdl2 sdl2-image sdl2-ttf zlib
I can specify path to zlib with --with-libzlib=dir
How to configure this project? If this information was helpful, I would compile lincity.
I have compiled zlib by myself, using emscripten.
emconfigure ./configure --prefix=$PATH_TO_SYSTEM_DIR_IN_EMSCRIPTEN
emmake make
emmake make install
I don't know it works, but configure of lincity doesn't complain about missing zlib. It complains about missing libxml-2 and libxml-2 requires python2, so I give up. Put this in an answer?
-s USE_ZLIB=1
compiler option (maybe pass it asCFLAGS
/CXXFLAGS
and/orLDFLAGS
). You can see other options ofemcc
here.libxml-2
: it may require "target" python2 (that is, to be built by Emscripten) that may be not trivial, but it may require "host" python2 at build-time (that is, generate something on your build machine before compilation), that should be much simpler and according to Ubuntu package dependencies for built and source packages it looks like the second is right. Another point,./configure
usually have options such as--disable-FEATURENAME
that can disable optional features / dependencies.