configure: add asmjs-unknown-emscripten target

This commit is contained in:
Johan Euphrosine 2023-07-12 01:34:55 +09:00
parent a11d2cbaa1
commit f5793bbefb
5 changed files with 15 additions and 6 deletions

View File

@ -49,7 +49,7 @@ jobs:
- name: Build - name: Build
run: | run: |
source ./emsdk/emsdk_env.sh source ./emsdk/emsdk_env.sh
emconfigure ./configure --without-cairo --without-opengl --without-x --disable-readline emconfigure ./configure --without-cairo --without-opengl --without-x --disable-readline --target=asmjs-unknown-emscripten
emmake make emmake make
- name: archive wasm bundle - name: archive wasm bundle
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3

2
configure vendored
View File

@ -9,4 +9,4 @@
# script itself. It also sets up CFLAGS without the default optimizer # script itself. It also sets up CFLAGS without the default optimizer
# flag (-O2). # flag (-O2).
( CFLAGS="-g -Wno-int-conversion -Wno-implicit-int"; export CFLAGS; cd scripts ; ./configure "$@" ) ( CFLAGS="-g"; export CFLAGS; cd scripts ; ./configure "$@" )

8
scripts/configure vendored
View File

@ -7773,12 +7773,12 @@ fi
case $target in case $target in
*-linux*) *-linux*)
$as_echo "#define linux 1" >>confdefs.h $as_echo "#define linux 1" >>confdefs.h
$as_echo "#define SYSV 1" >>confdefs.h
$as_echo "#define ISC 1" >>confdefs.h $as_echo "#define ISC 1" >>confdefs.h
case $target in case $target in
*x86_64*) *x86_64*)
CFLAGS="${CFLAGS} -fPIC -Werror=implicit-function-declaration" CFLAGS="${CFLAGS} -m64 -fPIC -Werror=implicit-function-declaration"
;; ;;
esac esac
if test $usingOGL ; then if test $usingOGL ; then
@ -7790,6 +7790,10 @@ case $target in
gr_libs="$gr_libs -lbsd" gr_libs="$gr_libs -lbsd"
fi fi
;; ;;
*-emscripten*)
$as_echo "#define linux 1" >>confdefs.h
CFLAGS="${CFLAGS} -fPIC -Werror=implicit-function-declaration -Wno-int-conversion -Wno-implicit-int"
;;
*solaris*) *solaris*)
$as_echo "#define SYSV 1" >>confdefs.h $as_echo "#define SYSV 1" >>confdefs.h

View File

@ -1353,6 +1353,7 @@ dnl ----------------------------------------------------------------
case $target in case $target in
*-linux*) *-linux*)
AC_DEFINE(linux) AC_DEFINE(linux)
AC_DEFINE(SYSV)
dnl Defining "ISC" prevents compiler failure on redefinition of "wchar_t" dnl Defining "ISC" prevents compiler failure on redefinition of "wchar_t"
AC_DEFINE(ISC) AC_DEFINE(ISC)
dnl 64-bit support for AMD Opteron dnl 64-bit support for AMD Opteron
@ -1370,6 +1371,10 @@ case $target in
gr_libs="$gr_libs -lbsd" gr_libs="$gr_libs -lbsd"
fi fi
;; ;;
*-emscripten*)
AC_DEFINE(linux)
CFLAGS="${CFLAGS} -fPIC -Werror=implicit-function-declaration -Wno-int-conversion -Wno-implicit-int"
;;
*solaris*) *solaris*)
AC_DEFINE(SYSV) AC_DEFINE(SYSV)
;; ;;

View File

@ -54,7 +54,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
#define SIGIOT SIGABRT /* io-trap signal redefined */ #define SIGIOT SIGABRT /* io-trap signal redefined */
#endif #endif
#ifdef linux #if defined(linux) || defined(EMSCRIPTEN)
#if SIGBUS == SIGUNUSED #if SIGBUS == SIGUNUSED
#undef SIGBUS #undef SIGBUS
#define SIGBUS SIGUSR1 #define SIGBUS SIGUSR1
@ -547,7 +547,7 @@ sigCrash(signum)
char *msg; char *msg;
extern bool AbortFatal; extern bool AbortFatal;
#ifndef linux #if !defined(linux) && !defined(EMSCRIPTEN)
if (magicNumber == 1239987) { if (magicNumber == 1239987) {
/* Things aren't screwed up that badly, try to reset the terminal */ /* Things aren't screwed up that badly, try to reset the terminal */
magicNumber = 0; magicNumber = 0;