emscripten-core/emscripten
Voir sur GitHubDocumentation for porting Unix-style build process (configure/make)
Open
#6 509 ouverte le 7 mai 2018
good first bughelp wantedwontfix
Métriques du dépôt
- Stars
- (27 361 stars)
- Métriques de merge PR
- (Merge moyen 19j 10h) (147 PRs mergées en 30 j)
Description
Documentation on doing builds of existing libraries with Unix-style configure/make build processes is a bit scarce, and there are some tricks. Would be nice to add a documentation page summarizing porting concerns.
A few things off the top of my head:
- passing
CFLAGS,PKG_CONFIG_PATH, and other env variables usually should be done as parameters to configure:emconfigure configure --blah CFLAGS="-s WASM=1"etc - recommended build steps for multiple libraries / dependencies
- using out-of-tree build directories for your sanity
- use
--prefixto install multiple libraries into one pseudo system root - set include, library paths and
PKG_CONFIG_PATHvar to point into that root, allowing libraries to find each other
- use
emconfigurealong withEMCONFIGURE_JS=2to make sure configure script code is built for the JS target and not for native!- (I'm not sure why the default is to build anything as native, it produces incorrect results for all kinds of detections.)
- running test compilations through
emconfigureinstead ofemmake? For libffi's test suite, this gets them built as node scripts. Not sure this is really ideal though.
- issues with dynamic linking vs static linking?
- I've sometimes had trouble with
-lfoowhen the default static library generation createdlibfoo.a. - Shared libraries can produce
.soor.dylibfiles based on the build system, which are actually LLVM bitcode (same as .bc) - Not sure how to force the autoconf stack to produce a
.bcextension for a static library...?
- I've sometimes had trouble with
- recent versions of autoconf support asmjs-unknown-unknown and wasm32-unknown-unknown host triples, so you can pass
--host=asmjsor--host=wasm32on the configure line to flip things into a mode where they know they're cross-compiling! This can help programs know what they're targeting, for instance my in-progress port of libffi needs this or it'll try to build x86_64 assembly stuff. - best way to obtain proper dependencies? installing autoconf/automake/pkg-config/libtool/etc on Linux, on Mac, and on Windows?
- how to get anything working on Windows??
- note you can't just exec() a
configurescript, you need to run it through a shell, and other mysteries
- note you can't just exec() a