Skip to content

Commit

Permalink
Use separate WASM and JS files for cockle (emscripten-forge#1278)
Browse files Browse the repository at this point in the history
* Use separate WASM and JS files for cockle

* Bump build numbers
  • Loading branch information
ianthomas23 authored Aug 15, 2024
1 parent 86a7d74 commit 8c9b1d3
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
3 changes: 1 addition & 2 deletions recipes/recipes_emscripten/cockle_fs/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ emcc fs.c -o fs.js \
-sEXPORTED_RUNTIME_METHODS=FS,PATH,ERRNO_CODES,PROXYFS \
-sFORCE_FILESYSTEM=1 \
-sMODULARIZE=1 \
-sSINGLE_FILE=1 \
-lproxyfs.js


mkdir -p $PREFIX/bin
cp fs.js $PREFIX/bin/fs.js
cp fs.{js,wasm} $PREFIX/bin/
2 changes: 1 addition & 1 deletion recipes/recipes_emscripten/cockle_fs/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package:


build:
number: 1
number: 2

requirements:
build:
Expand Down
8 changes: 4 additions & 4 deletions recipes/recipes_emscripten/coreutils/build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

echo "lets go"
ls
ls
./bootstrap --skip-po
emconfigure ./configure \
--enable-single-binary \
Expand All @@ -13,9 +13,9 @@ emconfigure ./configure \
gl_cv_func_sleep_works=yes


echo "sed"
echo "sed"
sed -i 's|$(MAKE) src/make-prime-list$(EXEEXT)|gcc src/make-prime-list.c -o src/make-prime-list$(EXEEXT) -Ilib/|' Makefile
export CFLAGS="-O2 --minify=0 -sALLOW_MEMORY_GROWTH=1 -sENVIRONMENT=web,worker -sEXPORTED_RUNTIME_METHODS=callMain,FS,ENV,getEnvStrings,TTY -sFORCE_FILESYSTEM=1 -sINVOKE_RUN=0 -sMODULARIZE=1 -sSINGLE_FILE=1"
export CFLAGS="-O2 --minify=0 -sALLOW_MEMORY_GROWTH=1 -sENVIRONMENT=web,worker -sEXPORTED_RUNTIME_METHODS=FS,ENV,getEnvStrings,TTY -sFORCE_FILESYSTEM=1 -sMODULARIZE=1"

make EXEEXT=.js CFLAGS="$CFLAGS" -k -j4 || true

Expand All @@ -24,4 +24,4 @@ ls
ls src/coreutils.js

mkdir -p $PREFIX/bin
cp src/coreutils.js $PREFIX/bin/coreutils.js
cp src/coreutils.{js,wasm} $PREFIX/bin/
2 changes: 1 addition & 1 deletion recipes/recipes_emscripten/coreutils/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ source:
git: https://github.com/coreutils/coreutils
tag: v9.5
build:
number: 3
number: 4

requirements:
build:
Expand Down
6 changes: 3 additions & 3 deletions recipes/recipes_emscripten/grep/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ emconfigure ./configure \
ac_cv_have_decl_alarm=no \
gl_cv_func_sleep_works=yes

export CFLAGS="-O2 --minify=0 -sALLOW_MEMORY_GROWTH=1 -sENVIRONMENT=web,worker -sEXPORTED_RUNTIME_METHODS=callMain,FS,ENV,getEnvStrings,TTY -sFORCE_FILESYSTEM=1 -sINVOKE_RUN=0 -sMODULARIZE=1 -sSINGLE_FILE=1 -sERROR_ON_UNDEFINED_SYMBOLS=0"
emmake make all CFLAGS="$CFLAGS" EXEEXT=.js
export CFLAGS="-O2 --minify=0 -sALLOW_MEMORY_GROWTH=1 -sENVIRONMENT=web,worker -sEXPORTED_RUNTIME_METHODS=FS,ENV,getEnvStrings,TTY -sFORCE_FILESYSTEM=1 -sMODULARIZE=1 -sERROR_ON_UNDEFINED_SYMBOLS=0"
emmake make all CFLAGS="$CFLAGS" EXEEXT=.js

ls

mkdir -p $PREFIX/bin
cp src/grep.js $PREFIX/bin/grep.js
cp src/grep.{js,wasm} $PREFIX/bin/
4 changes: 2 additions & 2 deletions recipes/recipes_emscripten/grep/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ package:
# url: https://ftp.gnu.org/gnu/grep/grep-3.11.tar.xz
# sha256: 1db2aedde89d0dea42b16d9528f894c8d15dae4e190b59aecc78f5a951276eab
# url: https://github.com/Distrotech/grep
# branch:
# branch:
build:
number: 3
number: 4

requirements:
build:
Expand Down

0 comments on commit 8c9b1d3

Please sign in to comment.