@@ -247,6 +247,12 @@ skipping unstable DWG features, unknown DWG versions and objects.])
247247fi
248248AM_CONDITIONAL([ IS_RELEASE] , [ test x$ax_is_release = xyes] )
249249
250+ dnl Detect emscripten
251+ if test `basename "$CC"` = emcc; then
252+ ac_cv_prog_cc_emcc=yes
253+ else
254+ ac_cv_prog_cc_emcc=no
255+ fi
250256dnl Disable unwanted warnings here
251257enable_Werror=no
252258ax_enable_compile_warnings=yes
@@ -255,7 +261,7 @@ ax_cv_check_cflags__Wswitch_enum=no
255261dnl wasm does not support -fstack-protector yet
256262if test x$enable_shared = xyes && \
257263 test x$ac_compiler_gnu = xyes && \
258- test x$CC != xemcc
264+ test x$ac_cv_prog_cc_emcc != xyes
259265then
260266 AX_COMPILER_FLAGS ( [ WARN_CFLAGS] ,[ AM_LDFLAGS] ,[ $ax_is_release] ,
261267 [ -fno-semantic-interposition -fwrapv -fno-common -fvisibility=hidden \
@@ -267,6 +273,12 @@ else
267273 AX_COMPILER_FLAGS ( [ WARN_CFLAGS] ,[ AM_LDFLAGS] ,[ $ax_is_release] ,
268274 [ -fwrapv -fno-common -fvisibility=hidden -fno-strict-aliasing \
269275 -fno-delete-null-pointer-checks -Wno-alloc-size] )
276+ if test x$ac_cv_prog_cc_emcc = xyes; then
277+ enable_werror=no
278+ dnl AM_LDFLAGS="-s ALLOW_MEMORY_GROWTH=1"
279+ AM_LDFLAGS=""
280+ CFLAGS="$CFLAGS -Wno-limited-postlink-optimizations -Wno-cast-align"
281+ fi
270282fi
271283dnl if test x$ax_cv_check_cflags__Wunused_but_set_variable = xyes; then
272284dnl WARN_CFLAGS="$WARN_CFLAGS -Wno-unused-but-set-variable"
0 commit comments