emscripten-core / emscripten-core/emscripten

Documentation for porting Unix-style build process (configure/make)

Offen
#6,509 7 Kommentare 8 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
good first bug help wanted wontfix
Vorherrschende Sprache
C++
Sterne
27.6k
Forks
3.6k
Ø Merge
1 T. 14 Std.
Gemergte PRs (30 T.)
125

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginnen Sie mit der Prüfung der im Issue aufgeführten Aspekte zu configure/make, emconfigure, emmake, EMCONFIGURE_JS, host-triple, Linking, Abhängigkeiten und Windows. Die Dokumentationsarbeit ist abgeschlossen, wenn diese Portierungsaspekte und die empfohlenen Build-Schritte gelöst und auf einer Dokumentationsseite zusammengefasst sind, einschließlich Anleitungen für mehrere Bibliotheken und Abhängigkeiten.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
shell, wasm
Bereich
build-system, documentation
Issue-Typ
Dokumentation
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.