New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation for porting Unix-style build process (configure/make) #6509
Comments
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant. |
Any progress on this? |
Nope. But lets keep this open |
I would argue this involves source changes, not just additional docs. In my experience, emcc tries very hard to appear as if it's not a cross-compiler. The large number of hacks and spoofs employed by both emscripten and autotools is what makes using them together so difficult. |
You can see some tricks I'm doing to make projects compile without having to hack them: I have been working on this toy thing that lets you create "virtual build environments" based on bubblewrap. The aim is to be able to quickly create environments for compiling packages to weird platforms (such as emscripten or android for example), with little to no changes to the usual build workflow. In fact this leverages the work already done by arch linux packagers and lets you compile a emscripten package by running makepkg as you normally would. The drawbacks are that it assumes arch linux base, or at least system with pacman installed. The pacman / makepkg requirement probably wont change since it's the main attraction here. example workflow: pacbox emscripten toolchain-emscripten
cower -dd zlib-git
cd zlib-git
pacbox emscripten makepkg -ci --skippgpcheck This builds zlib from git and installs it to the container's filesystem. After that you can compile any program that depends on zlib as usual and so on. You could even distribute the compiled binary packages to others, so they can install them without compiling. |
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant. |
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant. |
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:
CFLAGS
,PKG_CONFIG_PATH
, and other env variables usually should be done as parameters to configure:emconfigure configure --blah CFLAGS="-s WASM=1"
etc--prefix
to install multiple libraries into one pseudo system rootPKG_CONFIG_PATH
var to point into that root, allowing libraries to find each otheremconfigure
along withEMCONFIGURE_JS=2
to make sure configure script code is built for the JS target and not for native!emconfigure
instead ofemmake
? For libffi's test suite, this gets them built as node scripts. Not sure this is really ideal though.-lfoo
when the default static library generation createdlibfoo.a
..so
or.dylib
files based on the build system, which are actually LLVM bitcode (same as .bc).bc
extension for a static library...?--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.configure
script, you need to run it through a shell, and other mysteriesThe text was updated successfully, but these errors were encountered: