mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 844784: Update NSPR to NSPR_4_10_4_BETA4. Also includes the changes
for bug 972125, bug 963033, bug 767759, bug 971152, bug 936320, and bug 969061.
This commit is contained in:
parent
a0552d8202
commit
2bc90a2cb8
@ -1 +1 @@
|
||||
NSPR_4_10_4_BETA3
|
||||
NSPR_4_10_4_BETA4
|
||||
|
@ -10,3 +10,4 @@
|
||||
*/
|
||||
|
||||
#error "Do not include this header file."
|
||||
|
||||
|
255
nsprpub/configure
vendored
255
nsprpub/configure
vendored
@ -54,6 +54,8 @@ ac_help="$ac_help
|
||||
--enable-debug-rtl Use the MSVC debug runtime library"
|
||||
ac_help="$ac_help
|
||||
--enable-n32 Enable n32 ABI support (IRIX only)"
|
||||
ac_help="$ac_help
|
||||
--enable-x32 Enable x32 ABI support (x86_64 only)"
|
||||
ac_help="$ac_help
|
||||
--enable-64bit Enable 64-bit support (on certain platforms)"
|
||||
ac_help="$ac_help
|
||||
@ -672,7 +674,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
|
||||
fi
|
||||
|
||||
echo $ac_n "checking host system type""... $ac_c" 1>&6
|
||||
echo "configure:676: checking host system type" >&5
|
||||
echo "configure:678: checking host system type" >&5
|
||||
|
||||
host_alias=$host
|
||||
case "$host_alias" in
|
||||
@ -693,7 +695,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
||||
echo "$ac_t""$host" 1>&6
|
||||
|
||||
echo $ac_n "checking target system type""... $ac_c" 1>&6
|
||||
echo "configure:697: checking target system type" >&5
|
||||
echo "configure:699: checking target system type" >&5
|
||||
|
||||
target_alias=$target
|
||||
case "$target_alias" in
|
||||
@ -711,7 +713,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
||||
echo "$ac_t""$target" 1>&6
|
||||
|
||||
echo $ac_n "checking build system type""... $ac_c" 1>&6
|
||||
echo "configure:715: checking build system type" >&5
|
||||
echo "configure:717: checking build system type" >&5
|
||||
|
||||
build_alias=$build
|
||||
case "$build_alias" in
|
||||
@ -743,6 +745,7 @@ USE_PTHREADS=
|
||||
USE_USER_PTHREADS=
|
||||
USE_NSPR_THREADS=
|
||||
USE_N32=
|
||||
USE_X32=
|
||||
USE_64=
|
||||
USE_CPLUS=
|
||||
USE_IPV6=
|
||||
@ -787,7 +790,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:791: checking for $ac_word" >&5
|
||||
echo "configure:794: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -931,7 +934,7 @@ case "$target" in
|
||||
|
||||
if test -z "$android_toolchain" ; then
|
||||
echo $ac_n "checking for android toolchain directory""... $ac_c" 1>&6
|
||||
echo "configure:935: checking for android toolchain directory" >&5
|
||||
echo "configure:938: checking for android toolchain directory" >&5
|
||||
|
||||
kernel_name=`uname -s | tr "[:upper:]" "[:lower:]"`
|
||||
|
||||
@ -957,7 +960,7 @@ echo "configure:935: checking for android toolchain directory" >&5
|
||||
|
||||
if test -z "$android_platform" ; then
|
||||
echo $ac_n "checking for android platform directory""... $ac_c" 1>&6
|
||||
echo "configure:961: checking for android platform directory" >&5
|
||||
echo "configure:964: checking for android platform directory" >&5
|
||||
|
||||
case "$target_cpu" in
|
||||
arm)
|
||||
@ -1173,6 +1176,18 @@ if test "${enable_n32+set}" = set; then
|
||||
fi
|
||||
|
||||
|
||||
# Check whether --enable-x32 or --disable-x32 was given.
|
||||
if test "${enable_x32+set}" = set; then
|
||||
enableval="$enable_x32"
|
||||
if test "$enableval" = "yes"; then
|
||||
USE_X32=1
|
||||
else if test "$enableval" = "no"; then
|
||||
USE_X32=
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Check whether --enable-64bit or --disable-64bit was given.
|
||||
if test "${enable_64bit+set}" = set; then
|
||||
enableval="$enable_64bit"
|
||||
@ -1315,7 +1330,7 @@ if test -z "$SKIP_PATH_CHECKS"; then
|
||||
# Extract the first word of "$WHOAMI whoami", so it can be a program name with args.
|
||||
set dummy $WHOAMI whoami; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1319: checking for $ac_word" >&5
|
||||
echo "configure:1334: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_WHOAMI'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1387,13 +1402,13 @@ if test "$target" != "$host" -o -n "$CROSS_COMPILE"; then
|
||||
_SAVE_LDFLAGS="$LDFLAGS"
|
||||
|
||||
echo $ac_n "checking for $host compiler""... $ac_c" 1>&6
|
||||
echo "configure:1391: checking for $host compiler" >&5
|
||||
echo "configure:1406: checking for $host compiler" >&5
|
||||
for ac_prog in $HOST_CC gcc cc /usr/ucb/cc
|
||||
do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1397: checking for $ac_word" >&5
|
||||
echo "configure:1412: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_HOST_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1439,16 +1454,16 @@ test -n "$HOST_CC" || HOST_CC=""""
|
||||
LDFLAGS="$HOST_LDFLAGS"
|
||||
|
||||
echo $ac_n "checking whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works""... $ac_c" 1>&6
|
||||
echo "configure:1443: checking whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works" >&5
|
||||
echo "configure:1458: checking whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works" >&5
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1445 "configure"
|
||||
#line 1460 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() {
|
||||
return 0;
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1452: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1467: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
echo "$ac_t""yes" 1>&6
|
||||
else
|
||||
@ -1483,7 +1498,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1487: checking for $ac_word" >&5
|
||||
echo "configure:1502: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1517,7 +1532,7 @@ test -n "$CC" || CC="echo"
|
||||
# Extract the first word of "gcc", so it can be a program name with args.
|
||||
set dummy gcc; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1521: checking for $ac_word" >&5
|
||||
echo "configure:1536: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1547,7 +1562,7 @@ if test -z "$CC"; then
|
||||
# Extract the first word of "cc", so it can be a program name with args.
|
||||
set dummy cc; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1551: checking for $ac_word" >&5
|
||||
echo "configure:1566: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1598,7 +1613,7 @@ fi
|
||||
# Extract the first word of "cl", so it can be a program name with args.
|
||||
set dummy cl; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1602: checking for $ac_word" >&5
|
||||
echo "configure:1617: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1630,7 +1645,7 @@ fi
|
||||
fi
|
||||
|
||||
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
|
||||
echo "configure:1634: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
|
||||
echo "configure:1649: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
|
||||
|
||||
ac_ext=c
|
||||
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
|
||||
@ -1641,12 +1656,12 @@ cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
cat > conftest.$ac_ext << EOF
|
||||
|
||||
#line 1645 "configure"
|
||||
#line 1660 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
main(){return(0);}
|
||||
EOF
|
||||
if { (eval echo configure:1650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
if { (eval echo configure:1665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
ac_cv_prog_cc_works=yes
|
||||
# If we can't run a trivial program, we are probably using a cross compiler.
|
||||
if (./conftest; exit) 2>/dev/null; then
|
||||
@ -1672,12 +1687,12 @@ if test $ac_cv_prog_cc_works = no; then
|
||||
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
|
||||
fi
|
||||
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
|
||||
echo "configure:1676: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "configure:1691: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
|
||||
cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
|
||||
echo "configure:1681: checking whether we are using GNU C" >&5
|
||||
echo "configure:1696: checking whether we are using GNU C" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1686,7 +1701,7 @@ else
|
||||
yes;
|
||||
#endif
|
||||
EOF
|
||||
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1690: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1705: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
ac_cv_prog_gcc=yes
|
||||
else
|
||||
ac_cv_prog_gcc=no
|
||||
@ -1705,7 +1720,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS=
|
||||
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
|
||||
echo "configure:1709: checking whether ${CC-cc} accepts -g" >&5
|
||||
echo "configure:1724: checking whether ${CC-cc} accepts -g" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1742,7 +1757,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1746: checking for $ac_word" >&5
|
||||
echo "configure:1761: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1778,7 +1793,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1782: checking for $ac_word" >&5
|
||||
echo "configure:1797: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1810,7 +1825,7 @@ test -n "$CXX" || CXX="gcc"
|
||||
|
||||
|
||||
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
|
||||
echo "configure:1814: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
|
||||
echo "configure:1829: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
|
||||
|
||||
ac_ext=C
|
||||
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
|
||||
@ -1821,12 +1836,12 @@ cross_compiling=$ac_cv_prog_cxx_cross
|
||||
|
||||
cat > conftest.$ac_ext << EOF
|
||||
|
||||
#line 1825 "configure"
|
||||
#line 1840 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main(){return(0);}
|
||||
EOF
|
||||
if { (eval echo configure:1830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
if { (eval echo configure:1845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
ac_cv_prog_cxx_works=yes
|
||||
# If we can't run a trivial program, we are probably using a cross compiler.
|
||||
if (./conftest; exit) 2>/dev/null; then
|
||||
@ -1852,12 +1867,12 @@ if test $ac_cv_prog_cxx_works = no; then
|
||||
{ echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
|
||||
fi
|
||||
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
|
||||
echo "configure:1856: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "configure:1871: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
|
||||
cross_compiling=$ac_cv_prog_cxx_cross
|
||||
|
||||
echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
|
||||
echo "configure:1861: checking whether we are using GNU C++" >&5
|
||||
echo "configure:1876: checking whether we are using GNU C++" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1866,7 +1881,7 @@ else
|
||||
yes;
|
||||
#endif
|
||||
EOF
|
||||
if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1870: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1885: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
ac_cv_prog_gxx=yes
|
||||
else
|
||||
ac_cv_prog_gxx=no
|
||||
@ -1885,7 +1900,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}"
|
||||
ac_save_CXXFLAGS="$CXXFLAGS"
|
||||
CXXFLAGS=
|
||||
echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
|
||||
echo "configure:1889: checking whether ${CXX-g++} accepts -g" >&5
|
||||
echo "configure:1904: checking whether ${CXX-g++} accepts -g" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1930,7 +1945,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1934: checking for $ac_word" >&5
|
||||
echo "configure:1949: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -1965,7 +1980,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1969: checking for $ac_word" >&5
|
||||
echo "configure:1984: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2000,7 +2015,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:2004: checking for $ac_word" >&5
|
||||
echo "configure:2019: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2035,7 +2050,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:2039: checking for $ac_word" >&5
|
||||
echo "configure:2054: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2070,7 +2085,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:2074: checking for $ac_word" >&5
|
||||
echo "configure:2089: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2105,7 +2120,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:2109: checking for $ac_word" >&5
|
||||
echo "configure:2124: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2140,7 +2155,7 @@ else
|
||||
# Extract the first word of "gcc", so it can be a program name with args.
|
||||
set dummy gcc; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:2144: checking for $ac_word" >&5
|
||||
echo "configure:2159: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2170,7 +2185,7 @@ if test -z "$CC"; then
|
||||
# Extract the first word of "cc", so it can be a program name with args.
|
||||
set dummy cc; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:2174: checking for $ac_word" >&5
|
||||
echo "configure:2189: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2221,7 +2236,7 @@ fi
|
||||
# Extract the first word of "cl", so it can be a program name with args.
|
||||
set dummy cl; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:2225: checking for $ac_word" >&5
|
||||
echo "configure:2240: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2253,7 +2268,7 @@ fi
|
||||
fi
|
||||
|
||||
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
|
||||
echo "configure:2257: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
|
||||
echo "configure:2272: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
|
||||
|
||||
ac_ext=c
|
||||
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
|
||||
@ -2264,12 +2279,12 @@ cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
cat > conftest.$ac_ext << EOF
|
||||
|
||||
#line 2268 "configure"
|
||||
#line 2283 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
main(){return(0);}
|
||||
EOF
|
||||
if { (eval echo configure:2273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
if { (eval echo configure:2288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
ac_cv_prog_cc_works=yes
|
||||
# If we can't run a trivial program, we are probably using a cross compiler.
|
||||
if (./conftest; exit) 2>/dev/null; then
|
||||
@ -2295,12 +2310,12 @@ if test $ac_cv_prog_cc_works = no; then
|
||||
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
|
||||
fi
|
||||
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
|
||||
echo "configure:2299: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "configure:2314: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
|
||||
cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
|
||||
echo "configure:2304: checking whether we are using GNU C" >&5
|
||||
echo "configure:2319: checking whether we are using GNU C" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2309,7 +2324,7 @@ else
|
||||
yes;
|
||||
#endif
|
||||
EOF
|
||||
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2313: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2328: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
ac_cv_prog_gcc=yes
|
||||
else
|
||||
ac_cv_prog_gcc=no
|
||||
@ -2328,7 +2343,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS=
|
||||
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
|
||||
echo "configure:2332: checking whether ${CC-cc} accepts -g" >&5
|
||||
echo "configure:2347: checking whether ${CC-cc} accepts -g" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2368,7 +2383,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:2372: checking for $ac_word" >&5
|
||||
echo "configure:2387: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2400,7 +2415,7 @@ test -n "$CXX" || CXX="gcc"
|
||||
|
||||
|
||||
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
|
||||
echo "configure:2404: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
|
||||
echo "configure:2419: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
|
||||
|
||||
ac_ext=C
|
||||
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
|
||||
@ -2411,12 +2426,12 @@ cross_compiling=$ac_cv_prog_cxx_cross
|
||||
|
||||
cat > conftest.$ac_ext << EOF
|
||||
|
||||
#line 2415 "configure"
|
||||
#line 2430 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main(){return(0);}
|
||||
EOF
|
||||
if { (eval echo configure:2420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
if { (eval echo configure:2435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
ac_cv_prog_cxx_works=yes
|
||||
# If we can't run a trivial program, we are probably using a cross compiler.
|
||||
if (./conftest; exit) 2>/dev/null; then
|
||||
@ -2442,12 +2457,12 @@ if test $ac_cv_prog_cxx_works = no; then
|
||||
{ echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
|
||||
fi
|
||||
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
|
||||
echo "configure:2446: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "configure:2461: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
|
||||
cross_compiling=$ac_cv_prog_cxx_cross
|
||||
|
||||
echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
|
||||
echo "configure:2451: checking whether we are using GNU C++" >&5
|
||||
echo "configure:2466: checking whether we are using GNU C++" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2456,7 +2471,7 @@ else
|
||||
yes;
|
||||
#endif
|
||||
EOF
|
||||
if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:2460: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:2475: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
ac_cv_prog_gxx=yes
|
||||
else
|
||||
ac_cv_prog_gxx=no
|
||||
@ -2475,7 +2490,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}"
|
||||
ac_save_CXXFLAGS="$CXXFLAGS"
|
||||
CXXFLAGS=
|
||||
echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
|
||||
echo "configure:2479: checking whether ${CXX-g++} accepts -g" >&5
|
||||
echo "configure:2494: checking whether ${CXX-g++} accepts -g" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2509,7 +2524,7 @@ fi
|
||||
fi
|
||||
fi
|
||||
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
|
||||
echo "configure:2513: checking how to run the C preprocessor" >&5
|
||||
echo "configure:2528: checking how to run the C preprocessor" >&5
|
||||
# On Suns, sometimes $CPP names a directory.
|
||||
if test -n "$CPP" && test -d "$CPP"; then
|
||||
CPP=
|
||||
@ -2524,13 +2539,13 @@ else
|
||||
# On the NeXT, cc -E runs the code through the compiler's parser,
|
||||
# not just through cpp.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2528 "configure"
|
||||
#line 2543 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:2534: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:2549: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
@ -2541,13 +2556,13 @@ else
|
||||
rm -rf conftest*
|
||||
CPP="${CC-cc} -E -traditional-cpp"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2545 "configure"
|
||||
#line 2560 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:2551: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:2566: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
@ -2558,13 +2573,13 @@ else
|
||||
rm -rf conftest*
|
||||
CPP="${CC-cc} -nologo -E"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2562 "configure"
|
||||
#line 2577 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:2568: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:2583: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
@ -2591,7 +2606,7 @@ echo "$ac_t""$CPP" 1>&6
|
||||
# Extract the first word of "ranlib", so it can be a program name with args.
|
||||
set dummy ranlib; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:2595: checking for $ac_word" >&5
|
||||
echo "configure:2610: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2623,7 +2638,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:2627: checking for $ac_word" >&5
|
||||
echo "configure:2642: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_AS'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2664,7 +2679,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:2668: checking for $ac_word" >&5
|
||||
echo "configure:2683: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_AR'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2705,7 +2720,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:2709: checking for $ac_word" >&5
|
||||
echo "configure:2724: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2746,7 +2761,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:2750: checking for $ac_word" >&5
|
||||
echo "configure:2765: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_STRIP'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2787,7 +2802,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:2791: checking for $ac_word" >&5
|
||||
echo "configure:2806: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_WINDRES'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2855,7 +2870,7 @@ else
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for gcc -pipe support""... $ac_c" 1>&6
|
||||
echo "configure:2859: checking for gcc -pipe support" >&5
|
||||
echo "configure:2874: checking for gcc -pipe support" >&5
|
||||
if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
|
||||
echo '#include <stdio.h>' > dummy-hello.c
|
||||
echo 'int main() { printf("Hello World\n"); return 0; }' >> dummy-hello.c
|
||||
@ -2870,14 +2885,14 @@ if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
|
||||
_SAVE_CFLAGS=$CFLAGS
|
||||
CFLAGS="$CFLAGS -pipe"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2874 "configure"
|
||||
#line 2889 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <stdio.h>
|
||||
int main() {
|
||||
printf("Hello World\n");
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2881: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:2896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
_res_gcc_pipe="yes"
|
||||
else
|
||||
@ -2907,16 +2922,16 @@ _SAVE_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction"
|
||||
|
||||
echo $ac_n "checking whether C compiler supports -fprofile-generate""... $ac_c" 1>&6
|
||||
echo "configure:2911: checking whether C compiler supports -fprofile-generate" >&5
|
||||
echo "configure:2926: checking whether C compiler supports -fprofile-generate" >&5
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2913 "configure"
|
||||
#line 2928 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() {
|
||||
return 0;
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2920: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:2935: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
PROFILE_GEN_CFLAGS="-fprofile-generate"
|
||||
result="yes"
|
||||
@ -2939,7 +2954,7 @@ CFLAGS="$_SAVE_CFLAGS"
|
||||
|
||||
if test "$GNU_CC"; then
|
||||
echo $ac_n "checking for visibility(hidden) attribute""... $ac_c" 1>&6
|
||||
echo "configure:2943: checking for visibility(hidden) attribute" >&5
|
||||
echo "configure:2958: checking for visibility(hidden) attribute" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_visibility_hidden'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2963,7 +2978,7 @@ echo "$ac_t""$ac_cv_visibility_hidden" 1>&6
|
||||
EOF
|
||||
|
||||
echo $ac_n "checking for visibility pragma support""... $ac_c" 1>&6
|
||||
echo "configure:2967: checking for visibility pragma support" >&5
|
||||
echo "configure:2982: checking for visibility pragma support" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_visibility_pragma'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -3016,7 +3031,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:3020: checking for $ac_word" >&5
|
||||
echo "configure:3035: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -3341,14 +3356,14 @@ no)
|
||||
_SAVE_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$arch_flag"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 3345 "configure"
|
||||
#line 3360 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() {
|
||||
return sizeof(__thumb2__);
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:3352: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:3367: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
MOZ_THUMB2=1
|
||||
else
|
||||
@ -3424,16 +3439,16 @@ if test -n "$align_flag"; then
|
||||
_SAVE_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $align_flag"
|
||||
echo $ac_n "checking whether alignment flag ($align_flag) is supported""... $ac_c" 1>&6
|
||||
echo "configure:3428: checking whether alignment flag ($align_flag) is supported" >&5
|
||||
echo "configure:3443: checking whether alignment flag ($align_flag) is supported" >&5
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 3430 "configure"
|
||||
#line 3445 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() {
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:3437: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:3452: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
:
|
||||
else
|
||||
echo "configure: failed program was:" >&5
|
||||
@ -3450,16 +3465,16 @@ if test -n "$all_flags"; then
|
||||
_SAVE_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$all_flags"
|
||||
echo $ac_n "checking whether the chosen combination of compiler flags ($all_flags) works""... $ac_c" 1>&6
|
||||
echo "configure:3454: checking whether the chosen combination of compiler flags ($all_flags) works" >&5
|
||||
echo "configure:3469: checking whether the chosen combination of compiler flags ($all_flags) works" >&5
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 3456 "configure"
|
||||
#line 3471 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() {
|
||||
return 0;
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:3463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:3478: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
echo "$ac_t""yes" 1>&6
|
||||
else
|
||||
@ -3516,17 +3531,17 @@ EOF
|
||||
DSO_LDOPTS='-brtl -bnortllib -bM:SRE -bnoentry -bexpall -blibpath:/usr/lib:/lib'
|
||||
ac_safe=`echo "sys/atomic_op.h" | sed 'y%./+-%__p_%'`
|
||||
echo $ac_n "checking for sys/atomic_op.h""... $ac_c" 1>&6
|
||||
echo "configure:3520: checking for sys/atomic_op.h" >&5
|
||||
echo "configure:3535: checking for sys/atomic_op.h" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 3525 "configure"
|
||||
#line 3540 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sys/atomic_op.h>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:3530: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:3545: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
@ -3683,7 +3698,7 @@ EOF
|
||||
_DEBUG_FLAGS='-gdwarf-2 -O0'
|
||||
MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@'
|
||||
echo $ac_n "checking for gethostbyaddr in -lbind""... $ac_c" 1>&6
|
||||
echo "configure:3687: checking for gethostbyaddr in -lbind" >&5
|
||||
echo "configure:3702: checking for gethostbyaddr in -lbind" >&5
|
||||
ac_lib_var=`echo bind'_'gethostbyaddr | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@ -3691,7 +3706,7 @@ else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lbind $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 3695 "configure"
|
||||
#line 3710 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
@ -3702,7 +3717,7 @@ int main() {
|
||||
gethostbyaddr()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:3706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
if { (eval echo configure:3721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
@ -3911,17 +3926,17 @@ EOF
|
||||
fi
|
||||
ac_safe=`echo "crt_externs.h" | sed 'y%./+-%__p_%'`
|
||||
echo $ac_n "checking for crt_externs.h""... $ac_c" 1>&6
|
||||
echo "configure:3915: checking for crt_externs.h" >&5
|
||||
echo "configure:3930: checking for crt_externs.h" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 3920 "configure"
|
||||
#line 3935 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <crt_externs.h>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:3925: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:3940: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
@ -4528,6 +4543,10 @@ EOF
|
||||
x86_64)
|
||||
if test -n "$USE_64"; then
|
||||
PR_MD_ASFILES=os_Linux_x86_64.s
|
||||
elif test -n "$USE_X32"; then
|
||||
PR_MD_ASFILES=os_Linux_x86_64.s
|
||||
CC="$CC -mx32"
|
||||
CXX="$CXX -mx32"
|
||||
else
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define i386 1
|
||||
@ -4971,17 +4990,17 @@ EOF
|
||||
_OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000"
|
||||
ac_safe=`echo "machine/builtins.h" | sed 'y%./+-%__p_%'`
|
||||
echo $ac_n "checking for machine/builtins.h""... $ac_c" 1>&6
|
||||
echo "configure:4975: checking for machine/builtins.h" >&5
|
||||
echo "configure:4994: checking for machine/builtins.h" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 4980 "configure"
|
||||
#line 4999 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <machine/builtins.h>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:4985: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:5004: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
@ -5540,7 +5559,7 @@ case $target in
|
||||
;;
|
||||
*)
|
||||
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
|
||||
echo "configure:5544: checking for dlopen in -ldl" >&5
|
||||
echo "configure:5563: checking for dlopen in -ldl" >&5
|
||||
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@ -5548,7 +5567,7 @@ else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-ldl $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 5552 "configure"
|
||||
#line 5571 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
@ -5559,7 +5578,7 @@ int main() {
|
||||
dlopen()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:5563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
if { (eval echo configure:5582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
@ -5576,17 +5595,17 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
|
||||
echo "$ac_t""yes" 1>&6
|
||||
ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
|
||||
echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
|
||||
echo "configure:5580: checking for dlfcn.h" >&5
|
||||
echo "configure:5599: checking for dlfcn.h" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 5585 "configure"
|
||||
#line 5604 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <dlfcn.h>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:5590: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:5609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
@ -5619,13 +5638,13 @@ esac
|
||||
|
||||
if test $ac_cv_prog_gcc = yes; then
|
||||
echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
|
||||
echo "configure:5623: checking whether ${CC-cc} needs -traditional" >&5
|
||||
echo "configure:5642: checking whether ${CC-cc} needs -traditional" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
ac_pattern="Autoconf.*'x'"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 5629 "configure"
|
||||
#line 5648 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <sgtty.h>
|
||||
Autoconf TIOCGETP
|
||||
@ -5643,7 +5662,7 @@ rm -f conftest*
|
||||
|
||||
if test $ac_cv_prog_gcc_traditional = no; then
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 5647 "configure"
|
||||
#line 5666 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <termio.h>
|
||||
Autoconf TCGETA
|
||||
@ -5669,12 +5688,12 @@ LIBS="$LIBS $OS_LIBS"
|
||||
for ac_func in dladdr gettid lchown setpriority strerror syscall
|
||||
do
|
||||
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
|
||||
echo "configure:5673: checking for $ac_func" >&5
|
||||
echo "configure:5692: checking for $ac_func" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 5678 "configure"
|
||||
#line 5697 "configure"
|
||||
#include "confdefs.h"
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char $ac_func(); below. */
|
||||
@ -5697,7 +5716,7 @@ $ac_func();
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:5701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
if { (eval echo configure:5720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_$ac_func=yes"
|
||||
else
|
||||
@ -5749,7 +5768,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:5753: checking for $ac_word" >&5
|
||||
echo "configure:5772: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_CCACHE'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -5808,7 +5827,7 @@ hpux*)
|
||||
if test -z "$GNU_CC"; then
|
||||
|
||||
echo $ac_n "checking for +Olit support""... $ac_c" 1>&6
|
||||
echo "configure:5812: checking for +Olit support" >&5
|
||||
echo "configure:5831: checking for +Olit support" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_hpux_usable_olit_option'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -5850,7 +5869,7 @@ wince*)
|
||||
*)
|
||||
|
||||
echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
|
||||
echo "configure:5854: checking for pthread_create in -lpthreads" >&5
|
||||
echo "configure:5873: checking for pthread_create in -lpthreads" >&5
|
||||
echo "
|
||||
#include <pthread.h>
|
||||
void *foo(void *v) { return v; }
|
||||
@ -5872,7 +5891,7 @@ echo "
|
||||
echo "$ac_t""no" 1>&6
|
||||
|
||||
echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
|
||||
echo "configure:5876: checking for pthread_create in -lpthread" >&5
|
||||
echo "configure:5895: checking for pthread_create in -lpthread" >&5
|
||||
echo "
|
||||
#include <pthread.h>
|
||||
void *foo(void *v) { return v; }
|
||||
@ -5894,7 +5913,7 @@ echo "
|
||||
echo "$ac_t""no" 1>&6
|
||||
|
||||
echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
|
||||
echo "configure:5898: checking for pthread_create in -lc_r" >&5
|
||||
echo "configure:5917: checking for pthread_create in -lc_r" >&5
|
||||
echo "
|
||||
#include <pthread.h>
|
||||
void *foo(void *v) { return v; }
|
||||
@ -5916,7 +5935,7 @@ echo "
|
||||
echo "$ac_t""no" 1>&6
|
||||
|
||||
echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6
|
||||
echo "configure:5920: checking for pthread_create in -lc" >&5
|
||||
echo "configure:5939: checking for pthread_create in -lc" >&5
|
||||
echo "
|
||||
#include <pthread.h>
|
||||
void *foo(void *v) { return v; }
|
||||
@ -6034,7 +6053,7 @@ if test -n "$USE_PTHREADS"; then
|
||||
rm -f conftest*
|
||||
ac_cv_have_dash_pthread=no
|
||||
echo $ac_n "checking whether ${CC-cc} accepts -pthread""... $ac_c" 1>&6
|
||||
echo "configure:6038: checking whether ${CC-cc} accepts -pthread" >&5
|
||||
echo "configure:6057: checking whether ${CC-cc} accepts -pthread" >&5
|
||||
echo 'int main() { return 0; }' | cat > conftest.c
|
||||
${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
|
||||
if test $? -eq 0; then
|
||||
@ -6057,7 +6076,7 @@ echo "configure:6038: checking whether ${CC-cc} accepts -pthread" >&5
|
||||
ac_cv_have_dash_pthreads=no
|
||||
if test "$ac_cv_have_dash_pthread" = "no"; then
|
||||
echo $ac_n "checking whether ${CC-cc} accepts -pthreads""... $ac_c" 1>&6
|
||||
echo "configure:6061: checking whether ${CC-cc} accepts -pthreads" >&5
|
||||
echo "configure:6080: checking whether ${CC-cc} accepts -pthreads" >&5
|
||||
echo 'int main() { return 0; }' | cat > conftest.c
|
||||
${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
|
||||
if test $? -eq 0; then
|
||||
|
@ -22,6 +22,7 @@ USE_PTHREADS=
|
||||
USE_USER_PTHREADS=
|
||||
USE_NSPR_THREADS=
|
||||
USE_N32=
|
||||
USE_X32=
|
||||
USE_64=
|
||||
USE_CPLUS=
|
||||
USE_IPV6=
|
||||
@ -396,6 +397,15 @@ AC_ARG_ENABLE(n32,
|
||||
fi
|
||||
fi ])
|
||||
|
||||
AC_ARG_ENABLE(x32,
|
||||
[ --enable-x32 Enable x32 ABI support (x86_64 only)],
|
||||
[ if test "$enableval" = "yes"; then
|
||||
USE_X32=1
|
||||
else if test "$enableval" = "no"; then
|
||||
USE_X32=
|
||||
fi
|
||||
fi ])
|
||||
|
||||
AC_ARG_ENABLE(64bit,
|
||||
[ --enable-64bit Enable 64-bit support (on certain platforms)],
|
||||
[ if test "$enableval" = "yes"; then
|
||||
@ -1867,6 +1877,10 @@ tools are selected during the Xcode/Developer Tools installation.])
|
||||
x86_64)
|
||||
if test -n "$USE_64"; then
|
||||
PR_MD_ASFILES=os_Linux_x86_64.s
|
||||
elif test -n "$USE_X32"; then
|
||||
PR_MD_ASFILES=os_Linux_x86_64.s
|
||||
CC="$CC -mx32"
|
||||
CXX="$CXX -mx32"
|
||||
else
|
||||
AC_DEFINE(i386)
|
||||
PR_MD_ASFILES=os_Linux_x86.s
|
||||
|
@ -20,7 +20,7 @@
|
||||
#define IS_BIG_ENDIAN 1
|
||||
#endif
|
||||
|
||||
#ifdef __x86_64__
|
||||
#ifdef __LP64__
|
||||
#define IS_64
|
||||
#endif
|
||||
|
||||
|
@ -26,6 +26,8 @@
|
||||
#define _PR_SI_ARCHITECTURE "ppc"
|
||||
#elif defined(__arm__)
|
||||
#define _PR_SI_ARCHITECTURE "arm"
|
||||
#elif defined(__aarch64__)
|
||||
#define _PR_SI_ARCHITECTURE "aarch64"
|
||||
#else
|
||||
#error "Unknown CPU architecture"
|
||||
#endif
|
||||
@ -122,7 +124,7 @@ extern PRInt32 _PR_Darwin_x86_64_AtomicAdd(PRInt32 *ptr, PRInt32 val);
|
||||
#define _MD_ATOMIC_ADD(ptr, val) _PR_Darwin_x86_64_AtomicAdd(ptr, val)
|
||||
#endif /* __x86_64__ */
|
||||
|
||||
#ifdef __arm__
|
||||
#if defined(__arm__) || defined(__aarch64__)
|
||||
#define _PR_HAVE_ATOMIC_OPS
|
||||
#define _MD_INIT_ATOMIC()
|
||||
#define _MD_ATOMIC_INCREMENT(val) OSAtomicIncrement32(val)
|
||||
@ -136,7 +138,7 @@ static inline PRInt32 _MD_ATOMIC_SET(PRInt32 *val, PRInt32 newval)
|
||||
return oldval;
|
||||
}
|
||||
#define _MD_ATOMIC_ADD(ptr, val) OSAtomicAdd32(val, ptr)
|
||||
#endif /* __arm__ */
|
||||
#endif /* __arm__ || __aarch64__ */
|
||||
|
||||
#define USE_SETJMP
|
||||
|
||||
|
@ -110,7 +110,7 @@ long __cdecl _InterlockedExchangeAdd(long volatile *Addend, long Value);
|
||||
(defined(__powerpc__) && !defined(__powerpc64__)) || \
|
||||
(defined(__arm__) && \
|
||||
defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)) || \
|
||||
defined(__alpha))))
|
||||
defined(__aarch64__) || defined(__alpha))))
|
||||
|
||||
/*
|
||||
* Because the GCC manual warns that some processors may support
|
||||
|
@ -539,6 +539,8 @@ NSPR_API(void) _PR_PauseCPU(void);
|
||||
_PR_MD_UNLOCK(&(_lock)->ilock);
|
||||
|
||||
extern void _PR_UnblockLockWaiter(PRLock *lock);
|
||||
extern PRStatus _PR_InitLock(PRLock *lock);
|
||||
extern void _PR_FreeLock(PRLock *lock);
|
||||
|
||||
#define _PR_LOCK_PTR(_qp) \
|
||||
((PRLock*) ((char*) (_qp) - offsetof(PRLock,links)))
|
||||
@ -550,8 +552,11 @@ extern void _PR_UnblockLockWaiter(PRLock *lock);
|
||||
#define _PR_CVAR_UNLOCK(_cvar) \
|
||||
_PR_MD_UNLOCK(&(_cvar)->ilock);
|
||||
|
||||
extern PRStatus _PR_InitCondVar(PRCondVar *cvar, PRLock *lock);
|
||||
extern void _PR_FreeCondVar(PRCondVar *cvar);
|
||||
extern PRStatus _PR_WaitCondVar(
|
||||
PRThread *thread, PRCondVar *cvar, PRLock *lock, PRIntervalTime timeout);
|
||||
extern void _PR_NotifyCondVar(PRCondVar *cvar, PRThread *me);
|
||||
extern PRUint32 _PR_CondVarToString(PRCondVar *cvar, char *buf, PRUint32 buflen);
|
||||
|
||||
NSPR_API(void) _PR_Notify(PRMonitor *mon, PRBool all, PRBool sticky);
|
||||
@ -1420,8 +1425,6 @@ struct PRLock {
|
||||
#endif
|
||||
};
|
||||
|
||||
extern void _PR_InitLocks(void);
|
||||
|
||||
struct PRCondVar {
|
||||
PRLock *lock; /* associated lock that protects the condition */
|
||||
#if defined(_PR_PTHREADS)
|
||||
@ -1446,10 +1449,6 @@ struct PRCondVar {
|
||||
struct PRMonitor {
|
||||
const char* name; /* monitor name for debugging */
|
||||
#if defined(_PR_PTHREADS)
|
||||
PRIntn notifyTimes; /* number of pending notifies for waitCV.
|
||||
* The special value -1 means a broadcast
|
||||
* (PR_NotifyAll). */
|
||||
|
||||
pthread_mutex_t lock; /* lock is only held when accessing fields
|
||||
* of the PRMonitor, instead of being held
|
||||
* while the monitor is entered. The only
|
||||
@ -1468,9 +1467,20 @@ struct PRMonitor {
|
||||
* signal entryCV, and releases the reference
|
||||
* after signaling entryCV. */
|
||||
#else /* defined(_PR_PTHREADS) */
|
||||
PRCondVar *cvar; /* associated lock and condition variable queue */
|
||||
PRLock lock; /* lock is only held when accessing fields
|
||||
* of the PRMonitor, instead of being held
|
||||
* while the monitor is entered. The only
|
||||
* exception is notifyTimes, which is
|
||||
* protected by the monitor. */
|
||||
PRThread *owner; /* the owner of the monitor or invalid */
|
||||
PRCondVar entryCV; /* for threads waiting to enter the monitor */
|
||||
|
||||
PRCondVar waitCV; /* for threads waiting on the monitor */
|
||||
#endif /* defined(_PR_PTHREADS) */
|
||||
PRUint32 entryCount; /* # of times re-entered */
|
||||
PRIntn notifyTimes; /* number of pending notifies for waitCV.
|
||||
* The special value -1 means a broadcast
|
||||
* (PR_NotifyAll). */
|
||||
};
|
||||
|
||||
/************************************************************************/
|
||||
@ -1490,8 +1500,6 @@ struct PRSemaphore {
|
||||
#endif /* defined(_PR_BTHREADS) */
|
||||
};
|
||||
|
||||
NSPR_API(void) _PR_InitSem(void);
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
struct PRSem {
|
||||
@ -1765,6 +1773,7 @@ struct PRDirUTF16 {
|
||||
};
|
||||
#endif /* MOZ_UNICODE */
|
||||
|
||||
extern void _PR_InitLocks(void);
|
||||
extern void _PR_InitSegs(void);
|
||||
extern void _PR_InitStacks(void);
|
||||
extern void _PR_InitTPD(void);
|
||||
@ -1782,7 +1791,6 @@ extern void _PR_InitDtoa(void);
|
||||
extern void _PR_InitTime(void);
|
||||
extern void _PR_InitMW(void);
|
||||
extern void _PR_InitRWLocks(void);
|
||||
extern void _PR_NotifyCondVar(PRCondVar *cvar, PRThread *me);
|
||||
extern void _PR_CleanupThread(PRThread *thread);
|
||||
extern void _PR_CleanupCallOnce(void);
|
||||
extern void _PR_CleanupMW(void);
|
||||
|
@ -145,7 +145,7 @@ PR_IMPLEMENT(PRCounterHandle)
|
||||
break;
|
||||
}
|
||||
qnp = (QName *)PR_NEXT_LINK( &qnp->link );
|
||||
} while( qnp != (QName *)PR_LIST_HEAD( &qNameList ));
|
||||
} while( qnp != (QName *)&qNameList );
|
||||
}
|
||||
/*
|
||||
** If we did not find a matching QName,
|
||||
@ -174,7 +174,7 @@ PR_IMPLEMENT(PRCounterHandle)
|
||||
*/
|
||||
PR_ASSERT( strcmp(rnp->name, rName));
|
||||
rnp = (RName *)PR_NEXT_LINK( &rnp->link );
|
||||
} while( rnp != (RName *)PR_LIST_HEAD( &qnp->rNameList ));
|
||||
} while( rnp != (RName *)&qnp->rNameList );
|
||||
}
|
||||
|
||||
/* Get a new RName structure; initialize its members */
|
||||
|
@ -2228,10 +2228,6 @@ PR_IMPLEMENT(PRStatus) PR_StringToNetAddr(const char *string, PRNetAddr *addr)
|
||||
#if !defined(_PR_HAVE_GETADDRINFO)
|
||||
return pr_StringToNetAddrFB(string, addr);
|
||||
#else
|
||||
#if defined(_PR_INET6_PROBE)
|
||||
if (!_pr_ipv6_is_present())
|
||||
return pr_StringToNetAddrFB(string, addr);
|
||||
#endif
|
||||
/*
|
||||
* getaddrinfo with AI_NUMERICHOST is much slower than pr_inet_aton on some
|
||||
* platforms, such as Mac OS X (bug 404399), Linux glibc 2.10 (bug 344809),
|
||||
@ -2241,6 +2237,11 @@ PR_IMPLEMENT(PRStatus) PR_StringToNetAddr(const char *string, PRNetAddr *addr)
|
||||
if (!strchr(string, '%'))
|
||||
return pr_StringToNetAddrFB(string, addr);
|
||||
|
||||
#if defined(_PR_INET6_PROBE)
|
||||
if (!_pr_ipv6_is_present())
|
||||
return pr_StringToNetAddrFB(string, addr);
|
||||
#endif
|
||||
|
||||
return pr_StringToNetAddrGAI(string, addr);
|
||||
#endif
|
||||
}
|
||||
|
@ -222,7 +222,7 @@ PR_IMPLEMENT(PRTraceHandle)
|
||||
break;
|
||||
}
|
||||
qnp = (QName *)PR_NEXT_LINK( &qnp->link );
|
||||
} while( qnp != (QName *)PR_LIST_HEAD( &qNameList ));
|
||||
} while( qnp != (QName *)&qNameList );
|
||||
}
|
||||
/*
|
||||
** If we did not find a matching QName,
|
||||
@ -251,7 +251,7 @@ PR_IMPLEMENT(PRTraceHandle)
|
||||
*/
|
||||
PR_ASSERT( strcmp(rnp->name, rName));
|
||||
rnp = (RName *)PR_NEXT_LINK( &rnp->link );
|
||||
} while( rnp != (RName *)PR_LIST_HEAD( &qnp->rNameList ));
|
||||
} while( rnp != (RName *)&qnp->rNameList );
|
||||
}
|
||||
|
||||
/* Get a new RName structure; initialize its members */
|
||||
|
@ -3400,6 +3400,8 @@ PR_EXTERN(PRStatus) _pr_push_ipv6toipv4_layer(PRFileDesc *fd);
|
||||
extern PRBool _pr_ipv6_is_present(void);
|
||||
PR_IMPLEMENT(PRBool) _pr_test_ipv6_socket()
|
||||
{
|
||||
int osfd;
|
||||
|
||||
#if defined(DARWIN)
|
||||
/*
|
||||
* Disable IPv6 if Darwin version is less than 7.0.0 (OS X 10.3). IPv6 on
|
||||
@ -3412,24 +3414,18 @@ PR_IMPLEMENT(PRBool) _pr_test_ipv6_socket()
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(LINUX)
|
||||
/* If /proc/net/if_inet6 exists, the Linux kernel supports IPv6. */
|
||||
int rv = access("/proc/net/if_inet6", F_OK);
|
||||
return (rv == 0);
|
||||
#else
|
||||
/*
|
||||
* HP-UX only: HP-UX IPv6 Porting Guide (dated February 2001)
|
||||
* suggests that we call open("/dev/ip6", O_RDWR) to determine
|
||||
* whether IPv6 APIs and the IPv6 stack are on the system.
|
||||
* Our portable test below seems to work fine, so I am using it.
|
||||
*/
|
||||
PRInt32 osfd = socket(AF_INET6, SOCK_STREAM, 0);
|
||||
osfd = socket(AF_INET6, SOCK_STREAM, 0);
|
||||
if (osfd != -1) {
|
||||
close(osfd);
|
||||
return PR_TRUE;
|
||||
}
|
||||
return PR_FALSE;
|
||||
#endif
|
||||
}
|
||||
#endif /* _PR_INET6_PROBE */
|
||||
#endif
|
||||
|
@ -429,11 +429,12 @@ PR_IMPLEMENT(PRStatus) PR_NotifyAllCondVar(PRCondVar *cvar)
|
||||
|
||||
/*
|
||||
* Notifies just get posted to the monitor. The actual notification is done
|
||||
* when the monitor is exited so that MP systems don't contend for a monitor
|
||||
* that they can't enter.
|
||||
* when the monitor is fully exited so that MP systems don't contend for a
|
||||
* monitor that they can't enter.
|
||||
*/
|
||||
static void pt_PostNotifyToMonitor(PRMonitor *mon, PRBool broadcast)
|
||||
{
|
||||
PR_ASSERT(NULL != mon);
|
||||
PR_ASSERT_CURRENT_THREAD_IN_MONITOR(mon);
|
||||
|
||||
/* mon->notifyTimes is protected by the monitor, so we don't need to
|
||||
@ -504,6 +505,7 @@ PR_IMPLEMENT(PRMonitor*) PR_NewMonitor(void)
|
||||
mon->notifyTimes = 0;
|
||||
mon->entryCount = 0;
|
||||
mon->refCount = 1;
|
||||
mon->name = NULL;
|
||||
return mon;
|
||||
|
||||
error3:
|
||||
@ -653,7 +655,7 @@ PR_IMPLEMENT(PRStatus) PR_ExitMonitor(PRMonitor *mon)
|
||||
PR_IMPLEMENT(PRStatus) PR_Wait(PRMonitor *mon, PRIntervalTime timeout)
|
||||
{
|
||||
PRStatus rv;
|
||||
PRInt16 saved_entries;
|
||||
PRUint32 saved_entries;
|
||||
pthread_t saved_owner;
|
||||
|
||||
PR_ASSERT(mon != NULL);
|
||||
@ -708,14 +710,12 @@ PR_IMPLEMENT(PRStatus) PR_Wait(PRMonitor *mon, PRIntervalTime timeout)
|
||||
|
||||
PR_IMPLEMENT(PRStatus) PR_Notify(PRMonitor *mon)
|
||||
{
|
||||
PR_ASSERT(NULL != mon);
|
||||
pt_PostNotifyToMonitor(mon, PR_FALSE);
|
||||
return PR_SUCCESS;
|
||||
} /* PR_Notify */
|
||||
|
||||
PR_IMPLEMENT(PRStatus) PR_NotifyAll(PRMonitor *mon)
|
||||
{
|
||||
PR_ASSERT(NULL != mon);
|
||||
pt_PostNotifyToMonitor(mon, PR_TRUE);
|
||||
return PR_SUCCESS;
|
||||
} /* PR_NotifyAll */
|
||||
|
@ -446,31 +446,37 @@ PR_IMPLEMENT(PRCondVar*) PR_NewCondVar(PRLock *lock)
|
||||
{
|
||||
PRCondVar *cvar;
|
||||
|
||||
PR_ASSERT(lock != NULL);
|
||||
|
||||
cvar = PR_NEWZAP(PRCondVar);
|
||||
if (cvar) {
|
||||
#ifdef _PR_GLOBAL_THREADS_ONLY
|
||||
if(_PR_MD_NEW_CV(&cvar->md)) {
|
||||
PR_DELETE(cvar);
|
||||
PR_SetError(PR_INSUFFICIENT_RESOURCES_ERROR, 0);
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
if (_PR_MD_NEW_LOCK(&(cvar->ilock)) == PR_FAILURE) {
|
||||
PR_DELETE(cvar);
|
||||
PR_SetError(PR_INSUFFICIENT_RESOURCES_ERROR, 0);
|
||||
return NULL;
|
||||
}
|
||||
cvar->lock = lock;
|
||||
PR_INIT_CLIST(&cvar->condQ);
|
||||
|
||||
if (_PR_InitCondVar(cvar, lock) != PR_SUCCESS) {
|
||||
PR_DELETE(cvar);
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
|
||||
}
|
||||
return cvar;
|
||||
}
|
||||
|
||||
PRStatus _PR_InitCondVar(PRCondVar *cvar, PRLock *lock)
|
||||
{
|
||||
PR_ASSERT(lock != NULL);
|
||||
|
||||
#ifdef _PR_GLOBAL_THREADS_ONLY
|
||||
if(_PR_MD_NEW_CV(&cvar->md)) {
|
||||
PR_SetError(PR_INSUFFICIENT_RESOURCES_ERROR, 0);
|
||||
return PR_FAILURE;
|
||||
}
|
||||
#endif
|
||||
if (_PR_MD_NEW_LOCK(&(cvar->ilock)) != PR_SUCCESS) {
|
||||
PR_SetError(PR_INSUFFICIENT_RESOURCES_ERROR, 0);
|
||||
return PR_FAILURE;
|
||||
}
|
||||
cvar->lock = lock;
|
||||
PR_INIT_CLIST(&cvar->condQ);
|
||||
return PR_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
** Destroy a condition variable. There must be no thread
|
||||
** waiting on the condvar. The caller is responsible for guaranteeing
|
||||
@ -478,6 +484,12 @@ PR_IMPLEMENT(PRCondVar*) PR_NewCondVar(PRLock *lock)
|
||||
**
|
||||
*/
|
||||
PR_IMPLEMENT(void) PR_DestroyCondVar(PRCondVar *cvar)
|
||||
{
|
||||
_PR_FreeCondVar(cvar);
|
||||
PR_DELETE(cvar);
|
||||
}
|
||||
|
||||
void _PR_FreeCondVar(PRCondVar *cvar)
|
||||
{
|
||||
PR_ASSERT(cvar->condQ.next == &cvar->condQ);
|
||||
|
||||
@ -485,8 +497,6 @@ PR_IMPLEMENT(void) PR_DestroyCondVar(PRCondVar *cvar)
|
||||
_PR_MD_FREE_CV(&cvar->md);
|
||||
#endif
|
||||
_PR_MD_FREE_LOCK(&(cvar->ilock));
|
||||
|
||||
PR_DELETE(cvar);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -160,16 +160,24 @@ PR_IMPLEMENT(PRLock*) PR_NewLock(void)
|
||||
|
||||
lock = PR_NEWZAP(PRLock);
|
||||
if (lock) {
|
||||
if (_PR_MD_NEW_LOCK(&lock->ilock) == PR_FAILURE) {
|
||||
PR_DELETE(lock);
|
||||
return(NULL);
|
||||
}
|
||||
PR_INIT_CLIST(&lock->links);
|
||||
PR_INIT_CLIST(&lock->waitQ);
|
||||
if (_PR_InitLock(lock) != PR_SUCCESS) {
|
||||
PR_DELETE(lock);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return lock;
|
||||
}
|
||||
|
||||
PRStatus _PR_InitLock(PRLock *lock)
|
||||
{
|
||||
if (_PR_MD_NEW_LOCK(&lock->ilock) != PR_SUCCESS) {
|
||||
return PR_FAILURE;
|
||||
}
|
||||
PR_INIT_CLIST(&lock->links);
|
||||
PR_INIT_CLIST(&lock->waitQ);
|
||||
return PR_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
** Destroy the given lock "lock". There is no point in making this race
|
||||
** free because if some other thread has the pointer to this lock all
|
||||
@ -177,11 +185,16 @@ PR_IMPLEMENT(PRLock*) PR_NewLock(void)
|
||||
*/
|
||||
PR_IMPLEMENT(void) PR_DestroyLock(PRLock *lock)
|
||||
{
|
||||
PR_ASSERT(lock->owner == 0);
|
||||
_PR_MD_FREE_LOCK(&lock->ilock);
|
||||
_PR_FreeLock(lock);
|
||||
PR_DELETE(lock);
|
||||
}
|
||||
|
||||
void _PR_FreeLock(PRLock *lock)
|
||||
{
|
||||
PR_ASSERT(lock->owner == 0);
|
||||
_PR_MD_FREE_LOCK(&lock->ilock);
|
||||
}
|
||||
|
||||
extern PRThread *suspendAllThread;
|
||||
/*
|
||||
** Lock the lock.
|
||||
|
@ -7,33 +7,91 @@
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/*
|
||||
* Notifies just get posted to the monitor. The actual notification is done
|
||||
* when the monitor is fully exited so that MP systems don't contend for a
|
||||
* monitor that they can't enter.
|
||||
*/
|
||||
static void _PR_PostNotifyToMonitor(PRMonitor *mon, PRBool broadcast)
|
||||
{
|
||||
PR_ASSERT(mon != NULL);
|
||||
PR_ASSERT_CURRENT_THREAD_IN_MONITOR(mon);
|
||||
|
||||
/* mon->notifyTimes is protected by the monitor, so we don't need to
|
||||
* acquire mon->lock.
|
||||
*/
|
||||
if (broadcast)
|
||||
mon->notifyTimes = -1;
|
||||
else if (mon->notifyTimes != -1)
|
||||
mon->notifyTimes += 1;
|
||||
}
|
||||
|
||||
static void _PR_PostNotifiesFromMonitor(PRCondVar *cv, PRIntn times)
|
||||
{
|
||||
PRStatus rv;
|
||||
|
||||
/*
|
||||
* Time to actually notify any waits that were affected while the monitor
|
||||
* was entered.
|
||||
*/
|
||||
PR_ASSERT(cv != NULL);
|
||||
PR_ASSERT(times != 0);
|
||||
if (times == -1) {
|
||||
rv = PR_NotifyAllCondVar(cv);
|
||||
PR_ASSERT(rv == PR_SUCCESS);
|
||||
} else {
|
||||
while (times-- > 0) {
|
||||
rv = PR_NotifyCondVar(cv);
|
||||
PR_ASSERT(rv == PR_SUCCESS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Create a new monitor.
|
||||
*/
|
||||
PR_IMPLEMENT(PRMonitor*) PR_NewMonitor()
|
||||
{
|
||||
PRMonitor *mon;
|
||||
PRCondVar *cvar;
|
||||
PRLock *lock;
|
||||
PRStatus rv;
|
||||
|
||||
if (!_pr_initialized) _PR_ImplicitInitialization();
|
||||
|
||||
mon = PR_NEWZAP(PRMonitor);
|
||||
if (mon) {
|
||||
lock = PR_NewLock();
|
||||
if (!lock) {
|
||||
PR_DELETE(mon);
|
||||
return 0;
|
||||
}
|
||||
|
||||
cvar = PR_NewCondVar(lock);
|
||||
if (!cvar) {
|
||||
PR_DestroyLock(lock);
|
||||
PR_DELETE(mon);
|
||||
return 0;
|
||||
}
|
||||
mon->cvar = cvar;
|
||||
mon->name = NULL;
|
||||
if (mon == NULL) {
|
||||
PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
rv = _PR_InitLock(&mon->lock);
|
||||
PR_ASSERT(rv == PR_SUCCESS);
|
||||
if (rv != PR_SUCCESS)
|
||||
goto error1;
|
||||
|
||||
mon->owner = NULL;
|
||||
|
||||
rv = _PR_InitCondVar(&mon->entryCV, &mon->lock);
|
||||
PR_ASSERT(rv == PR_SUCCESS);
|
||||
if (rv != PR_SUCCESS)
|
||||
goto error2;
|
||||
|
||||
rv = _PR_InitCondVar(&mon->waitCV, &mon->lock);
|
||||
PR_ASSERT(rv == PR_SUCCESS);
|
||||
if (rv != PR_SUCCESS)
|
||||
goto error3;
|
||||
|
||||
mon->notifyTimes = 0;
|
||||
mon->entryCount = 0;
|
||||
mon->name = NULL;
|
||||
return mon;
|
||||
|
||||
error3:
|
||||
_PR_FreeCondVar(&mon->entryCV);
|
||||
error2:
|
||||
_PR_FreeLock(&mon->lock);
|
||||
error1:
|
||||
PR_Free(mon);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PR_IMPLEMENT(PRMonitor*) PR_NewNamedMonitor(const char* name)
|
||||
@ -51,9 +109,14 @@ PR_IMPLEMENT(PRMonitor*) PR_NewNamedMonitor(const char* name)
|
||||
*/
|
||||
PR_IMPLEMENT(void) PR_DestroyMonitor(PRMonitor *mon)
|
||||
{
|
||||
PR_DestroyLock(mon->cvar->lock);
|
||||
PR_DestroyCondVar(mon->cvar);
|
||||
PR_DELETE(mon);
|
||||
PR_ASSERT(mon != NULL);
|
||||
_PR_FreeCondVar(&mon->waitCV);
|
||||
_PR_FreeCondVar(&mon->entryCV);
|
||||
_PR_FreeLock(&mon->lock);
|
||||
#if defined(DEBUG)
|
||||
memset(mon, 0xaf, sizeof(PRMonitor));
|
||||
#endif
|
||||
PR_Free(mon);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -61,12 +124,28 @@ PR_IMPLEMENT(void) PR_DestroyMonitor(PRMonitor *mon)
|
||||
*/
|
||||
PR_IMPLEMENT(void) PR_EnterMonitor(PRMonitor *mon)
|
||||
{
|
||||
if (mon->cvar->lock->owner == _PR_MD_CURRENT_THREAD()) {
|
||||
mon->entryCount++;
|
||||
} else {
|
||||
PR_Lock(mon->cvar->lock);
|
||||
mon->entryCount = 1;
|
||||
PRThread *me = _PR_MD_CURRENT_THREAD();
|
||||
PRStatus rv;
|
||||
|
||||
PR_ASSERT(mon != NULL);
|
||||
PR_Lock(&mon->lock);
|
||||
if (mon->entryCount != 0) {
|
||||
if (mon->owner == me)
|
||||
goto done;
|
||||
while (mon->entryCount != 0) {
|
||||
rv = PR_WaitCondVar(&mon->entryCV, PR_INTERVAL_NO_TIMEOUT);
|
||||
PR_ASSERT(rv == PR_SUCCESS);
|
||||
}
|
||||
}
|
||||
/* and now I have the monitor */
|
||||
PR_ASSERT(mon->notifyTimes == 0);
|
||||
PR_ASSERT(mon->owner == NULL);
|
||||
mon->owner = me;
|
||||
|
||||
done:
|
||||
mon->entryCount += 1;
|
||||
rv = PR_Unlock(&mon->lock);
|
||||
PR_ASSERT(rv == PR_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -76,16 +155,28 @@ PR_IMPLEMENT(void) PR_EnterMonitor(PRMonitor *mon)
|
||||
*/
|
||||
PR_IMPLEMENT(PRBool) PR_TestAndEnterMonitor(PRMonitor *mon)
|
||||
{
|
||||
if (mon->cvar->lock->owner == _PR_MD_CURRENT_THREAD()) {
|
||||
mon->entryCount++;
|
||||
return PR_TRUE;
|
||||
} else {
|
||||
if (PR_TestAndLock(mon->cvar->lock)) {
|
||||
mon->entryCount = 1;
|
||||
return PR_TRUE;
|
||||
}
|
||||
PRThread *me = _PR_MD_CURRENT_THREAD();
|
||||
PRStatus rv;
|
||||
|
||||
PR_ASSERT(mon != NULL);
|
||||
PR_Lock(&mon->lock);
|
||||
if (mon->entryCount != 0) {
|
||||
if (mon->owner == me)
|
||||
goto done;
|
||||
rv = PR_Unlock(&mon->lock);
|
||||
PR_ASSERT(rv == PR_SUCCESS);
|
||||
return PR_FALSE;
|
||||
}
|
||||
return PR_FALSE;
|
||||
/* and now I have the monitor */
|
||||
PR_ASSERT(mon->notifyTimes == 0);
|
||||
PR_ASSERT(mon->owner == NULL);
|
||||
mon->owner = me;
|
||||
|
||||
done:
|
||||
mon->entryCount += 1;
|
||||
rv = PR_Unlock(&mon->lock);
|
||||
PR_ASSERT(rv == PR_SUCCESS);
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -93,12 +184,36 @@ PR_IMPLEMENT(PRBool) PR_TestAndEnterMonitor(PRMonitor *mon)
|
||||
*/
|
||||
PR_IMPLEMENT(PRStatus) PR_ExitMonitor(PRMonitor *mon)
|
||||
{
|
||||
if (mon->cvar->lock->owner != _PR_MD_CURRENT_THREAD()) {
|
||||
PRThread *me = _PR_MD_CURRENT_THREAD();
|
||||
PRStatus rv;
|
||||
|
||||
PR_ASSERT(mon != NULL);
|
||||
PR_Lock(&mon->lock);
|
||||
/* the entries should be > 0 and we'd better be the owner */
|
||||
PR_ASSERT(mon->entryCount > 0);
|
||||
PR_ASSERT(mon->owner == me);
|
||||
if (mon->entryCount == 0 || mon->owner != me)
|
||||
{
|
||||
rv = PR_Unlock(&mon->lock);
|
||||
PR_ASSERT(rv == PR_SUCCESS);
|
||||
return PR_FAILURE;
|
||||
}
|
||||
if (--mon->entryCount == 0) {
|
||||
return PR_Unlock(mon->cvar->lock);
|
||||
|
||||
mon->entryCount -= 1; /* reduce by one */
|
||||
if (mon->entryCount == 0)
|
||||
{
|
||||
/* and if it transitioned to zero - notify an entry waiter */
|
||||
/* make the owner unknown */
|
||||
mon->owner = NULL;
|
||||
if (mon->notifyTimes != 0) {
|
||||
_PR_PostNotifiesFromMonitor(&mon->waitCV, mon->notifyTimes);
|
||||
mon->notifyTimes = 0;
|
||||
}
|
||||
rv = PR_NotifyCondVar(&mon->entryCV);
|
||||
PR_ASSERT(rv == PR_SUCCESS);
|
||||
}
|
||||
rv = PR_Unlock(&mon->lock);
|
||||
PR_ASSERT(rv == PR_SUCCESS);
|
||||
return PR_SUCCESS;
|
||||
}
|
||||
|
||||
@ -108,17 +223,29 @@ PR_IMPLEMENT(PRStatus) PR_ExitMonitor(PRMonitor *mon)
|
||||
*/
|
||||
PR_IMPLEMENT(PRIntn) PR_GetMonitorEntryCount(PRMonitor *mon)
|
||||
{
|
||||
return (mon->cvar->lock->owner == _PR_MD_CURRENT_THREAD()) ?
|
||||
mon->entryCount : 0;
|
||||
PRThread *me = _PR_MD_CURRENT_THREAD();
|
||||
PRStatus rv;
|
||||
PRIntn count = 0;
|
||||
|
||||
PR_Lock(&mon->lock);
|
||||
if (mon->owner == me)
|
||||
count = mon->entryCount;
|
||||
rv = PR_Unlock(&mon->lock);
|
||||
PR_ASSERT(rv == PR_SUCCESS);
|
||||
return count;
|
||||
}
|
||||
|
||||
/*
|
||||
** If the current thread is in |mon|, this assertion is guaranteed to
|
||||
** succeed. Otherwise, the behavior of this function is undefined.
|
||||
*/
|
||||
PR_IMPLEMENT(void) PR_AssertCurrentThreadInMonitor(PRMonitor *mon)
|
||||
{
|
||||
PR_ASSERT_CURRENT_THREAD_OWNS_LOCK(mon->cvar->lock);
|
||||
#if defined(DEBUG) || defined(FORCE_PR_ASSERT)
|
||||
PRStatus rv;
|
||||
|
||||
PR_Lock(&mon->lock);
|
||||
PR_ASSERT(mon->entryCount != 0 &&
|
||||
mon->owner == _PR_MD_CURRENT_THREAD());
|
||||
rv = PR_Unlock(&mon->lock);
|
||||
PR_ASSERT(rv == PR_SUCCESS);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@ -135,25 +262,50 @@ PR_IMPLEMENT(void) PR_AssertCurrentThreadInMonitor(PRMonitor *mon)
|
||||
**
|
||||
** Returns PR_FAILURE if the caller has not locked the lock associated
|
||||
** with the condition variable.
|
||||
** This routine can return PR_PENDING_INTERRUPT if the waiting thread
|
||||
** This routine can return PR_PENDING_INTERRUPT_ERROR if the waiting thread
|
||||
** has been interrupted.
|
||||
*/
|
||||
PR_IMPLEMENT(PRStatus) PR_Wait(PRMonitor *mon, PRIntervalTime ticks)
|
||||
{
|
||||
PRUintn entryCount;
|
||||
PRStatus status;
|
||||
PRThread *me = _PR_MD_CURRENT_THREAD();
|
||||
PRStatus rv;
|
||||
PRUint32 saved_entries;
|
||||
PRThread *saved_owner;
|
||||
|
||||
if (mon->cvar->lock->owner != me) return PR_FAILURE;
|
||||
PR_ASSERT(mon != NULL);
|
||||
PR_Lock(&mon->lock);
|
||||
/* the entries better be positive */
|
||||
PR_ASSERT(mon->entryCount > 0);
|
||||
/* and it better be owned by us */
|
||||
PR_ASSERT(mon->owner == _PR_MD_CURRENT_THREAD()); /* XXX return failure */
|
||||
|
||||
entryCount = mon->entryCount;
|
||||
/* tuck these away 'till later */
|
||||
saved_entries = mon->entryCount;
|
||||
mon->entryCount = 0;
|
||||
saved_owner = mon->owner;
|
||||
mon->owner = NULL;
|
||||
/* If we have pending notifies, post them now. */
|
||||
if (mon->notifyTimes != 0) {
|
||||
_PR_PostNotifiesFromMonitor(&mon->waitCV, mon->notifyTimes);
|
||||
mon->notifyTimes = 0;
|
||||
}
|
||||
rv = PR_NotifyCondVar(&mon->entryCV);
|
||||
PR_ASSERT(rv == PR_SUCCESS);
|
||||
|
||||
status = _PR_WaitCondVar(me, mon->cvar, mon->cvar->lock, ticks);
|
||||
rv = PR_WaitCondVar(&mon->waitCV, ticks);
|
||||
PR_ASSERT(rv == PR_SUCCESS);
|
||||
|
||||
mon->entryCount = entryCount;
|
||||
while (mon->entryCount != 0) {
|
||||
rv = PR_WaitCondVar(&mon->entryCV, PR_INTERVAL_NO_TIMEOUT);
|
||||
PR_ASSERT(rv == PR_SUCCESS);
|
||||
}
|
||||
PR_ASSERT(mon->notifyTimes == 0);
|
||||
/* reinstate the interesting information */
|
||||
mon->entryCount = saved_entries;
|
||||
mon->owner = saved_owner;
|
||||
|
||||
return status;
|
||||
rv = PR_Unlock(&mon->lock);
|
||||
PR_ASSERT(rv == PR_SUCCESS);
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -163,9 +315,7 @@ PR_IMPLEMENT(PRStatus) PR_Wait(PRMonitor *mon, PRIntervalTime ticks)
|
||||
*/
|
||||
PR_IMPLEMENT(PRStatus) PR_Notify(PRMonitor *mon)
|
||||
{
|
||||
PRThread *me = _PR_MD_CURRENT_THREAD();
|
||||
if (mon->cvar->lock->owner != me) return PR_FAILURE;
|
||||
PR_NotifyCondVar(mon->cvar);
|
||||
_PR_PostNotifyToMonitor(mon, PR_FALSE);
|
||||
return PR_SUCCESS;
|
||||
}
|
||||
|
||||
@ -176,9 +326,7 @@ PR_IMPLEMENT(PRStatus) PR_Notify(PRMonitor *mon)
|
||||
*/
|
||||
PR_IMPLEMENT(PRStatus) PR_NotifyAll(PRMonitor *mon)
|
||||
{
|
||||
PRThread *me = _PR_MD_CURRENT_THREAD();
|
||||
if (mon->cvar->lock->owner != me) return PR_FAILURE;
|
||||
PR_NotifyAllCondVar(mon->cvar);
|
||||
_PR_PostNotifyToMonitor(mon, PR_TRUE);
|
||||
return PR_SUCCESS;
|
||||
}
|
||||
|
||||
@ -188,10 +336,9 @@ PRUint32 _PR_MonitorToString(PRMonitor *mon, char *buf, PRUint32 buflen)
|
||||
{
|
||||
PRUint32 nb;
|
||||
|
||||
if (mon->cvar->lock->owner) {
|
||||
if (mon->owner) {
|
||||
nb = PR_snprintf(buf, buflen, "[%p] owner=%d[%p] count=%ld",
|
||||
mon, mon->cvar->lock->owner->id,
|
||||
mon->cvar->lock->owner, mon->entryCount);
|
||||
mon, mon->owner->id, mon->owner, mon->entryCount);
|
||||
} else {
|
||||
nb = PR_snprintf(buf, buflen, "[%p]", mon);
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ static void ListCounters(void)
|
||||
while ( rh != NULL )
|
||||
{
|
||||
PR_GET_COUNTER_NAME_FROM_HANDLE( rh, qname, rname, desc );
|
||||
tCtr = PR_GET_COUNTER(tCtr, rh);
|
||||
PR_GET_COUNTER(tCtr, rh);
|
||||
PR_LOG( lm, msgLevel,
|
||||
( "QName: %s RName: %s Desc: %s Value: %ld\n",
|
||||
qn, rn, dn, tCtr ));
|
||||
|
Loading…
Reference in New Issue
Block a user