1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-22 08:58:47 +00:00

devel/nspr: use localtime_r and PTHREAD_MUTEX_ADAPTIVE_NP

This commit is contained in:
Jan Beich 2017-03-27 16:06:19 +00:00
parent c0b13833aa
commit af066db7e9
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=437055
3 changed files with 73 additions and 0 deletions

View File

@ -3,6 +3,7 @@
PORTNAME= nspr
DISTVERSION= 4.14
PORTREVISION= 1
CATEGORIES= devel
MASTER_SITES= MOZILLA/${PORTNAME}/releases/v${PORTVERSION}/src

View File

@ -0,0 +1,55 @@
--- configure~
+++ configure
@@ -6730,6 +6730,8 @@ tools are selected during the Xcode/Developer Tools installation." "$LINENO" 5
$as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
+ $as_echo "#define HAVE_POINTER_LOCALTIME_R 1" >>confdefs.h
+
CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
if test "$MOZ_OBJFORMAT" = "elf"; then
@@ -7340,6 +7342,8 @@ $as_echo "$as_me: WARNING: Unknown version of the Microsoft (R) Manifest Tool."
$as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
+ $as_echo "#define HAVE_POINTER_LOCALTIME_R 1" >>confdefs.h
+
if test -z "$USE_NSPR_THREADS"; then
USE_PTHREADS=1
fi
@@ -7396,6 +7400,8 @@ $as_echo "$as_me: WARNING: Unknown version of the Microsoft (R) Manifest Tool."
$as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
+ $as_echo "#define HAVE_POINTER_LOCALTIME_R 1" >>confdefs.h
+
CFLAGS="$CFLAGS -ansi -Wall"
CXXFLAGS="$CXXFLAGS -ansi -Wall"
DLL_SUFFIX=so.1.0
--- configure.in~
+++ configure.in
@@ -1554,6 +1554,7 @@ tools are selected during the Xcode/Developer Tools installation.])
AC_DEFINE(FREEBSD)
AC_DEFINE(HAVE_BSD_FLOCK)
AC_DEFINE(HAVE_SOCKLEN_T)
+ AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
if test "$MOZ_OBJFORMAT" = "elf"; then
@@ -2114,6 +2115,7 @@ tools are selected during the Xcode/Developer Tools installation.])
AC_DEFINE(NETBSD)
AC_DEFINE(HAVE_BSD_FLOCK)
AC_DEFINE(HAVE_SOCKLEN_T)
+ AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
if test -z "$USE_NSPR_THREADS"; then
USE_PTHREADS=1
fi
@@ -2162,6 +2164,7 @@ tools are selected during the Xcode/Developer Tools installation.])
AC_DEFINE(OPENBSD)
AC_DEFINE(HAVE_BSD_FLOCK)
AC_DEFINE(HAVE_SOCKLEN_T)
+ AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
CFLAGS="$CFLAGS -ansi -Wall"
CXXFLAGS="$CXXFLAGS -ansi -Wall"
DLL_SUFFIX=so.1.0

View File

@ -0,0 +1,17 @@
--- pr/src/pthreads/ptsynch.c~
+++ pr/src/pthreads/ptsynch.c
@@ -55,12 +55,11 @@ void _PR_InitLocks(void)
rv = _PT_PTHREAD_MUTEXATTR_INIT(&_pt_mattr);
PR_ASSERT(0 == rv);
-#ifdef LINUX
-#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
+#if (defined(LINUX) && (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) || \
+ (defined(FREEBSD) && __FreeBSD_version > 700055)
rv = pthread_mutexattr_settype(&_pt_mattr, PTHREAD_MUTEX_ADAPTIVE_NP);
PR_ASSERT(0 == rv);
#endif
-#endif
rv = _PT_PTHREAD_CONDATTR_INIT(&_pt_cvar_attr);
PR_ASSERT(0 == rv);