emscripten-core / emscripten-core/emscripten
Documentation for porting Unix-style build process (configure/make)
- Lingua principale
- C++
- Stelle
- 27.6k
- Fork
- 3.6k
- Merge medio
- 1g 14h
- PR unite (30g)
- 125
Descrizione
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 `--prefix` to install multiple libraries into one pseudo system root
* set include, library paths and `PKG_CONFIG_PATH` var to point into that root, allowing libraries to find each other
* use `emconfigure` along with `EMCONFIGURE_JS=2` to 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 `emconfigure` instead of `emmake`? 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 `-lfoo` when the default static library generation created `libfoo.a`.
* Shared libraries can produce `.so` or `.dylib` files based on the build system, which are actually LLVM bitcode (same as .bc)
* Not sure how to force the autoconf stack to produce a `.bc` extension for a static library...?
* recent versions of autoconf support asmjs-unknown-unknown and wasm32-unknown-unknown host triples, so you can pass `--host=asmjs` or `--host=wasm32` on 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 `configure` script, you need to run it through a shell, and other mysteries
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia esaminando gli aspetti relativi a configure/make, emconfigure, emmake, EMCONFIGURE_JS, host-triple, linking, dipendenze e Windows elencati nell’issue. Il lavoro di documentazione sarà completato quando questi problemi di portabilità e i passaggi di build consigliati saranno risolti e riepilogati in una pagina di documentazione, includendo indicazioni per più librerie e dipendenze.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- shell, wasm
- Ambito
- build-system, documentation
- Tipo di issue
- Documentazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100