Skip to content

Commit

Permalink
Upgrade Emscripten + build fixes
Browse files Browse the repository at this point in the history
- Upgraded to 3.1.47.
 - EM_CACHE override leads to some new issues with package search in sysroot, probably because sysroot is hardcoded in PKG_CONFIG* variables. Use Docker's path mapping mechanism instead.
 - Added temporary workaround for new issue from emscripten-core/emscripten#16836.
  • Loading branch information
RReverser committed Oct 17, 2023
1 parent 83ccedd commit cfe8ef6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM emscripten/emsdk:3.1.3
RUN apt-get update && apt-get install -qqy autoconf autopoint pkg-config
FROM emscripten/emsdk:3.1.47
RUN apt-get update && apt-get install -qqy autoconf autopoint pkg-config libtool libtool-bin
WORKDIR /src
ENV EM_CACHE /src/deps/.emcache
CMD ["sh", "-c", "emmake make -j`nproc`"]
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
SYSROOT = $(EM_CACHE)/sysroot
SYSROOT = /emsdk/upstream/emscripten/cache/sysroot

# Add custom sysroot to library & macro search paths.
export LDFLAGS += -L$(SYSROOT)/lib
export ACLOCAL_PATH := $(SYSROOT)/share/aclocal:$(ACLOCAL_PATH)

# Common linking flags for all targets.
export LDFLAGS += -s DYNAMIC_EXECUTION=0 -s AUTO_JS_LIBRARIES=0 -s AUTO_NATIVE_LIBRARIES=0
# Temporary workaround for https://github.com/emscripten-core/emscripten/issues/16836.
export LDFLAGS += -Wl,-u,ntohs

# Common compilation & linking flags for all langs and targets.
COMMON_FLAGS = -Os -flto
Expand Down
7 changes: 3 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA

if [ -z "$CI" ]
then
if [ -z "$CI" ]; then
DOCKER_INTERACTIVE_OPTS="-it"
else
DOCKER_INTERACTIVE_OPTS=""
fi

docker build -t web-gphoto2 - < Dockerfile
docker build -t web-gphoto2 - <Dockerfile
docker run --rm $DOCKER_INTERACTIVE_OPTS \
-v $PWD:/src \
-u $(id -u):$(id -g) \
-v $PWD/deps/.emcache:/emsdk/upstream/emscripten/cache \
web-gphoto2 \
$@

0 comments on commit cfe8ef6

Please sign in to comment.