:: bzip3 / PORTING.md 1.1 KB raw

1
2
## General problems
3
4
1. `Makefile.am:8: error: 'pkgconfig_DATA' is used but 'pkgconfigdir' is undefined` => please install pkgconfig.
5
6
## Windows
7
8
Cross-compiling Windows binaries is supported:
9
10
```console
11
# For x86_64 (64bit)
12
$ ./configure CC=x86_64-w64-mingw32-gcc --host x86_64-w64-mingw32 --enable-static-exe
13
$ make
14
15
# For i686 (32bit)
16
$ ./configure CC=i866-w64-mingw32-gcc --host i686-w64-mingw32 --enable-static-exe
17
$ make
18
```
19
20
Static builds are recommended to avoid the pthread dynamic linking issue. If a dynamic library is desired, consider defining `BZIP3_DLL_EXPORT` or `BZIP3_DLL_IMPORT`.
21
22
## M1 MacOS
23
24
Make sure that you run `./configure` with `--disable-arch-native`.
25
26
## Emscripten
27
28
Assuming that asm.js code is desired:
29
30
```
31
emconfigure ./configure --without-pthread --host none-none-none CC=emcc "CFLAGS=-O2 -DBZIP3_VISIBLE=\"__attribute__((used))\""
32
make src/bzip3-libbz3.o
33
emcc -O2 src/bzip3-libbz3.o -o libbz3.js -sWASM=0 --memory-init-file 0 -sFILESYSTEM=0 -sALLOW_MEMORY_GROWTH -s 'EXPORTED_RUNTIME_METHODS=["UTF8ToString"]'
34
```
35
36
asm.js code size: 118KB (v1.1.7), 34K gzipped.
37
wasm+js stub code size: 76KB (v1.1.7), 26K gzipped.
38
tab: 248 wrap: offon