configure.ac | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
New commits: commit c37b0a694a32537ed4c216106b5c98a79222f3c9 Author: Stephan Bergmann <[email protected]> AuthorDate: Mon Feb 5 11:42:32 2024 +0100 Commit: Stephan Bergmann <[email protected]> CommitDate: Mon Feb 5 14:31:41 2024 +0100 Allow to build against a non-EMSDK Emscripten installation built from source The EMSDK variable was only used to find the Emscripten version.h file, but for a build from source there would be no value it could be set to in order to find the installation's cache/sysroot/include/emscripten/version.h at the $EMSDK/upstream/emscripten/cache/sysroot/include/emscripten/version.h location where configure.ac wants to look for it. (And using the configure.ac code that does not use version.h at all wouldn't work either, as the only EMSCRIPTEN_DEFINES found with at least a contemporary emcc would be just an unhelpful __EMSCRIPTEN__=1, but no version information.) So allow to explicitly set EMSCRIPTEN_VERSION_H in autogen.input to use that for the version check. Change-Id: Ic64ecfaefb3b5830f82e577b100a6e7becc73953 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162994 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <[email protected]> diff --git a/configure.ac b/configure.ac index 44f626618d6e..1f31be2e512b 100644 --- a/configure.ac +++ b/configure.ac @@ -1382,9 +1382,11 @@ EMSCRIPTEN_MIN_VERSION="${EMSCRIPTEN_MIN_MAJOR}.${EMSCRIPTEN_MIN_MINOR}.${EMSCRI if test "$_os" = "Emscripten"; then AC_MSG_CHECKING([if Emscripten is at least $EMSCRIPTEN_MIN_VERSION]) - AS_IF([test -z "$EMSDK"], - [AC_MSG_ERROR([No \$EMSDK environment variable.])]) - EMSCRIPTEN_VERSION_H=$EMSDK/upstream/emscripten/cache/sysroot/include/emscripten/version.h + if test -z "$EMSCRIPTEN_VERSION_H"; then + AS_IF([test -z "$EMSDK"], + [AC_MSG_ERROR([No \$EMSDK environment variable.])]) + EMSCRIPTEN_VERSION_H=$EMSDK/upstream/emscripten/cache/sysroot/include/emscripten/version.h + fi if test -f "$EMSCRIPTEN_VERSION_H"; then EMSCRIPTEN_MAJOR=$($GREP __EMSCRIPTEN_major__ "$EMSCRIPTEN_VERSION_H" | $SED -ne 's/.*__EMSCRIPTEN_major__ //p') EMSCRIPTEN_MINOR=$($GREP __EMSCRIPTEN_minor__ "$EMSCRIPTEN_VERSION_H" | $SED -ne 's/.*__EMSCRIPTEN_minor__ //p')
