configure/cmake: Hook up Emscripten threads (disabled by default).

Fixes #3795.
This commit is contained in:
Ryan C. Gordon
2021-04-04 00:16:30 -04:00
parent 354cabd4a7
commit a81fe27271
4 changed files with 103 additions and 50 deletions

93
configure vendored
View File

@@ -771,6 +771,7 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
@@ -986,6 +987,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE}'
@@ -1238,6 +1240,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1375,7 +1386,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@@ -1528,6 +1539,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -1682,8 +1694,9 @@ Optional Features:
--enable-ibus enable IBus support [default=yes]
--enable-fcitx enable fcitx support [default=yes]
--enable-joystick-mfi include macOS MFI joystick support [default=yes]
--enable-pthreads use POSIX threads for multi-threading [default=yes]
--enable-pthread-sem use pthread semaphores [default=yes]
--enable-pthreads use POSIX threads for multi-threading
[default=maybe]
--enable-pthread-sem use pthread semaphores [default=maybe]
--enable-directx use DirectX for Windows audio/video [default=yes]
--enable-xinput use Xinput for Windows [default=yes]
--enable-wasapi use the Windows WASAPI audio driver [default=yes]
@@ -20257,34 +20270,8 @@ else
$as_echo_n "(cached) " >&6
else
# One or both of the vars are not set, and there is no cached value.
ac_x_includes=no
ac_x_libraries=no
# Do we need to do anything special at all?
ac_save_LIBS=$LIBS
LIBS="-lX11 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <X11/Xlib.h>
int
main ()
{
XrmInitialize ()
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
# We can compile and link X programs with no special options.
ac_x_includes=
ac_x_libraries=
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS="$ac_save_LIBS"
# If that didn't work, only try xmkmf and filesystem searches
# for native compilation.
if test x"$ac_x_includes" = xno && test "$cross_compiling" = no; then :
rm -f -r conftest.dir
ac_x_includes=no ac_x_libraries=no
rm -f -r conftest.dir
if mkdir conftest.dir; then
cd conftest.dir
cat >Imakefile <<'_ACEOF'
@@ -20323,7 +20310,7 @@ _ACEOF
rm -f -r conftest.dir
fi
# Standard set of common directories for X headers.
# Standard set of common directories for X headers.
# Check X11 before X11Rn because it is often a symlink to the current release.
ac_x_header_dirs='
/usr/X11/include
@@ -20350,8 +20337,6 @@ ac_x_header_dirs='
/usr/local/include/X11R5
/usr/local/include/X11R4
/opt/X11/include
/usr/X386/include
/usr/x386/include
/usr/XFree86/include/X11
@@ -20425,17 +20410,15 @@ rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi # $ac_x_libraries = no
fi
# Record the results.
case $ac_x_includes,$ac_x_libraries in #(
no,* | *,no | *\'*) :
no,* | *,no | *\'*)
# Didn't find X, or a directory has "'" in its name.
ac_cv_have_x="have_x=no" ;; #(
*) :
ac_cv_have_x="have_x=no";; #(
*)
# Record where we found X for the cache.
ac_cv_have_x="have_x=yes\
ac_x_includes='$ac_x_includes'\
ac_x_libraries='$ac_x_libraries'" ;;
ac_x_libraries='$ac_x_libraries'"
esac
fi
;; #(
@@ -23541,20 +23524,39 @@ $as_echo "#define SDL_JOYSTICK_MFI 1" >>confdefs.h
CheckPTHREAD()
{
# Check whether --enable-pthreads was given.
case "$host" in
*-*-emscripten*)
enable_pthreads_default=no
;;
*)
enable_pthreads_default=yes
;;
esac
# Check whether --enable-pthreads was given.
if test "${enable_pthreads+set}" = set; then :
enableval=$enable_pthreads;
else
enable_pthreads=yes
enable_pthreads=maybe
fi
# Check whether --enable-pthread-sem was given.
if test "${enable_pthread_sem+set}" = set; then :
enableval=$enable_pthread_sem;
else
enable_pthread_sem=yes
enable_pthread_sem=maybe
fi
if test x$enable_pthreads = xmaybe; then
enable_pthreads=$enable_pthreads_default
fi
if test x$enable_pthread_sem = xmaybe; then
enable_pthread_sem=$enable_pthreads
fi
case "$host" in
*-*-android*)
pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
@@ -23620,6 +23622,10 @@ fi
pthread_cflags="-D_REENTRANT"
pthread_lib=""
;;
*-*-emscripten*)
pthread_cflags="-D_REENTRANT -pthread"
pthread_lib="-pthread"
;;
*)
pthread_cflags="-D_REENTRANT"
pthread_lib="-lpthread"
@@ -25868,6 +25874,7 @@ $as_echo "#define SDL_AUDIO_DRIVER_EMSCRIPTEN 1" >>confdefs.h
CheckDummyVideo
CheckDiskAudio
CheckDummyAudio
CheckPTHREAD
CheckDLOPEN
CheckClockGettime
CheckEmscriptenGLES