@@ -406,6 +406,7 @@ slirp="yes"
406
406
oss_lib=" "
407
407
bsd=" no"
408
408
linux=" no"
409
+ emscripten=" no"
409
410
solaris=" no"
410
411
profiler=" no"
411
412
cocoa=" no"
@@ -620,7 +621,9 @@ int main(void) { return 0; }
620
621
EOF
621
622
}
622
623
623
- if check_define __linux__ ; then
624
+ if check_define __EMSCRIPTEN__; then
625
+ targetos=' Emscripten'
626
+ elif check_define __linux__ ; then
624
627
targetos=" Linux"
625
628
elif check_define _WIN32 ; then
626
629
targetos=' MINGW32'
672
675
if test ! -z " $cpu " ; then
673
676
# command line argument
674
677
:
678
+ elif check_define __EMSCRIPTEN__ ; then
679
+ cpu=" emscripten"
675
680
elif check_define __i386__ ; then
676
681
cpu=" i386"
677
682
elif check_define __x86_64__ ; then
@@ -747,6 +752,10 @@ case "$cpu" in
747
752
supported_cpu=" yes"
748
753
cross_cc_sparc=$host_cc
749
754
;;
755
+ emscripten)
756
+ supported_cpu=" yes"
757
+ cross_cc_emscripten=$host_cc
758
+ ;;
750
759
* )
751
760
# This will result in either an error or falling back to TCI later
752
761
ARCH=unknown
@@ -872,6 +881,13 @@ Linux)
872
881
QEMU_INCLUDES=" -I\$ (SRC_PATH)/linux-headers -I$( pwd) /linux-headers $QEMU_INCLUDES "
873
882
supported_os=" yes"
874
883
;;
884
+ Emscripten)
885
+ emscripten=" yes"
886
+ docs=" no"
887
+ glusterfs=" no"
888
+ QEMU_CFLAGS=" $QEMU_CFLAGS -m32 -s USE_ZLIB=1"
889
+ supported_os=" yes"
890
+ ;;
875
891
esac
876
892
877
893
if [ " $bsd " = " yes" ] ; then
@@ -1509,6 +1525,12 @@ case "$cpu" in
1509
1525
cross_cc_i386=$cc
1510
1526
cross_cc_cflags_i386=$CPU_CFLAGS
1511
1527
;;
1528
+ emscripten)
1529
+ CPU_CFLAGS=" -m32"
1530
+ LDFLAGS=" -m32 $LDFLAGS "
1531
+ cross_cc_emscripten=$cc
1532
+ cross_cc_emscripten=$CPU_CFLAGS
1533
+ ;;
1512
1534
# No special flags required for other host CPUs
1513
1535
esac
1514
1536
@@ -1876,7 +1898,7 @@ static __thread int tls_var;
1876
1898
int main(void) { return tls_var; }
1877
1899
EOF
1878
1900
1879
- if ! compile_prog " -Werror" " " ; then
1901
+ if (test " $emscripten " ! = " yes " ) && ! compile_prog " -Werror" " " ; then
1880
1902
error_exit " Your compiler does not support the __thread specifier for " \
1881
1903
" Thread-Local Storage (TLS). Please upgrade to a version that does."
1882
1904
fi
@@ -3479,7 +3501,10 @@ for i in $glib_modules; do
3479
3501
LIBS=" $glib_libs $LIBS "
3480
3502
libs_qga=" $glib_libs $libs_qga "
3481
3503
else
3482
- error_exit " glib-$glib_req_ver $i is required to compile QEMU"
3504
+ if test " $emscripten " ! = " yes"
3505
+ then
3506
+ error_exit " glib-$glib_req_ver $i is required to compile QEMU"
3507
+ fi
3483
3508
fi
3484
3509
done
3485
3510
@@ -6053,6 +6078,12 @@ if test "$supported_os" = "no"; then
6053
6078
echo " us upstream at [email protected] ."
6054
6079
fi
6055
6080
6081
+ if test " $emscripten " = " yes"
6082
+ then
6083
+ vector16=" no"
6084
+ eventfd=" no"
6085
+ fi
6086
+
6056
6087
config_host_mak=" config-host.mak"
6057
6088
6058
6089
echo " # Automatically generated by configure - do not modify" > config-all-disas.mak
0 commit comments