Skip to content

Commit aabc03c

Browse files
committed
configure: detect emcc
and fix failing probes because of -Werror -Wlimited-postlink-optimizations Fixes the configure & make part of GH #1073
1 parent dab1089 commit aabc03c

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

autogen.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
# (by default: copies are made only if necessary).
88
#
99
# Tested with:
10-
# - autoconf (GNU Autoconf) 2.65, 2.69
11-
# - automake (GNU automake) 1.14 - 1.16.1
12-
# - ltmain.sh (GNU libtool) 2.2.6b - 2.4.6
10+
# - autoconf (GNU Autoconf) 2.65, 2.69, 2.72
11+
# - automake (GNU automake) 1.12 - 1.17
12+
# - ltmain.sh (GNU libtool) 2.2.6b - 2.5.4
1313

14+
cd "$(dirname "$0")" || exit 1
1415
set -x
1516
rm -rf autom4te.cache config.status
1617
if test -d .git -a -f build-aux/git-version-gen; then

configure.ac

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,12 @@ skipping unstable DWG features, unknown DWG versions and objects.])
247247
fi
248248
AM_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
250256
dnl Disable unwanted warnings here
251257
enable_Werror=no
252258
ax_enable_compile_warnings=yes
@@ -255,7 +261,7 @@ ax_cv_check_cflags__Wswitch_enum=no
255261
dnl wasm does not support -fstack-protector yet
256262
if 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
259265
then
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
270282
fi
271283
dnl if test x$ax_cv_check_cflags__Wunused_but_set_variable = xyes; then
272284
dnl WARN_CFLAGS="$WARN_CFLAGS -Wno-unused-but-set-variable"

0 commit comments

Comments
 (0)