configure: infer static linking of libwinpthread for MinGW

Merge to v6.3
This commit is contained in:
Matthew Flatt 2015-10-20 08:31:29 -06:00
parent dad2804412
commit dfab18fe47
2 changed files with 51 additions and 0 deletions

46
racket/src/configure vendored
View File

@ -4674,6 +4674,52 @@ $as_echo "#define HAVE_STDINT_H 1" >>confdefs.h
if `which ${host}-dlltool > /dev/null` ; then
DLLTOOL="${host}-dlltool"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lwinpthread" >&5
$as_echo_n "checking for pthread_create in -lwinpthread... " >&6; }
if ${ac_cv_lib_winpthread_pthread_create+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lwinpthread $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char pthread_create ();
int
main ()
{
return pthread_create ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_winpthread_pthread_create=yes
else
ac_cv_lib_winpthread_pthread_create=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_winpthread_pthread_create" >&5
$as_echo "$ac_cv_lib_winpthread_pthread_create" >&6; }
if test "x$ac_cv_lib_winpthread_pthread_create" = xyes; then :
has_winpthread=yes
else
has_winpthread=no
fi
if test "${has_winpthread}" == "yes" ; then
LIBS="${LIBS} -Wl,-Bstatic -lwinpthread"
fi
case "$build_os" in
*cygwin*)
PWD="cygpath -m \\\`pwd\\\`"

View File

@ -796,6 +796,11 @@ case "$host_os" in
if `which ${host}-dlltool > /dev/null` ; then
DLLTOOL="${host}-dlltool"
fi
AC_CHECK_LIB(winpthread, pthread_create, has_winpthread=yes, has_winpthread=no)
if test "${has_winpthread}" == "yes" ; then
LIBS="${LIBS} -Wl,-Bstatic -lwinpthread"
fi
case "$build_os" in
*cygwin*)
PWD="cygpath -m \\\`pwd\\\`"