holzschu / a-Shell-commands

shell commands, pre-compiled to webAssembly, ready to use in a-Shell
598 stars 22 forks source link

pkg-config #52

Open macOneOone opened 4 months ago

macOneOone commented 4 months ago

Hello @holzschu,

Hope you're doing fine.

I was trying to install mysqlclient and I found the error pkg-config not found.

Is it possible to add the pkg-config software or script?

holzschu commented 4 months ago

Hi, I tried (both pkg-config and pkgconf), and failed: pkg-config needs glib, and glib tries to compile sockets (that's the issue with being a generic library), pkgconf compiles, but crashes inexplicably when running.

You can also compile mysqlclient on your Mac, with the complete SDK here: https://github.com/holzschu/wasi-sdk/releases/tag/wasi-sdk-aShell-19 and setting the environment variable PKG_CONFIG. I use:

env CC=.../wasi-sdk/bin/clang \
AR=.../wasi-sdk/bin/ar \
LD=../wasi-sdk/bin/wasm-ld \
RANLIB=.../wasi-sdk/bin/ranlib \
CPPFLAGS="-isysroot .../wasi-sdk/share/wasi-sysroot/  -D_WASI_EMULATED_SIGNAL -D_WASI_EMULATED_PROCESS_CLOCKS -D_WASI_EMULATED_GETPID -mllvm -wasm-enable-sjlj -fwasm-exceptions " \
LDFLAGS="-lwasi-emulated-signal -lwasi-emulated-process-clocks -lwasi-emulated-getpid -L$PWD/lib -lpng16 -lfreetype -lunwind -lz -lsetjmp" \
PKG_CONFIG_PATH=$PWD/pkgconfig \
./configure --host wasm32