configure.ac |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 1cabf62a78a5d0cdef38dd16ad35fb20ab182529
Author:     Tor Lillqvist <t...@collabora.com>
AuthorDate: Thu Jan 12 15:45:11 2023 +0200
Commit:     Tor Lillqvist <t...@collabora.com>
CommitDate: Thu Feb 23 18:23:03 2023 +0000

    Adapt to newer Emscripten SDK
    
    The __EMSCRIPTEN_major__, minor, and tiny macros are no longer
    predefined but only defined in <emscripten/version.h>. So grep that
    instead of running emcc -dM -E.
    
    Change-Id: I2383a906f9c746784449cd4606f653ab722b54de
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145407
    Tested-by: Jenkins
    Reviewed-by: Tor Lillqvist <t...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147516
    Tested-by: Tor Lillqvist <t...@collabora.com>

diff --git a/configure.ac b/configure.ac
index 75543fcdb289..05534dc6a8c2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1403,10 +1403,14 @@ 
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])
-    EMSCRIPTEN_DEFINES=$(echo | emcc -dM -E - | $GREP __EMSCRIPTEN_)
-    EMSCRIPTEN_MAJOR=$(echo "$EMSCRIPTEN_DEFINES" | $SED -ne 
's/.*__EMSCRIPTEN_major__ //p')
-    EMSCRIPTEN_MINOR=$(echo "$EMSCRIPTEN_DEFINES" | $SED -ne 
's/.*__EMSCRIPTEN_minor__ //p')
-    EMSCRIPTEN_TINY=$(echo "$EMSCRIPTEN_DEFINES" | $SED -ne 
's/.*__EMSCRIPTEN_tiny__ //p')
+    AS_IF([test -z "$EMSDK"],
+          [AC_MSG_ERROR([No \$EMSDK environment variable.])])
+    
EMSCRIPTEN_VERSION_H=$EMSDK/upstream/emscripten/cache/sysroot/include/emscripten/version.h
+    AS_IF([test ! -f "$EMSCRIPTEN_VERSION_H"],
+          [AC_MSG_ERROR([Could not find the <emscripten/version.h> in the 
Emscripten SDK.])])
+    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')
+    EMSCRIPTEN_TINY=$($GREP __EMSCRIPTEN_tiny__ "$EMSCRIPTEN_VERSION_H" | $SED 
-ne 's/.*__EMSCRIPTEN_tiny__ //p')
     
EMSCRIPTEN_VERSION="${EMSCRIPTEN_MAJOR}.${EMSCRIPTEN_MINOR}.${EMSCRIPTEN_TINY}"
 
     check_semantic_version_three_prefixed EMSCRIPTEN MIN

Reply via email to