Tue Jan 14 17:24:42 2014 UTC ()
Add a compat sem_timedwait() for __NetBSD_Version__ < 699000400 to fix
build on NetBSD 6 (and possibly earlier)
No change for systems which would have built anyway, so no PKGREVISION bump


(abs)
diff -r1.38 -r1.39 pkgsrc/lang/openjdk7/distinfo
diff -r1.3 -r1.4 pkgsrc/lang/openjdk7/options.mk
diff -r1.10 -r1.11 pkgsrc/lang/openjdk7/patches/patch-aa

cvs diff -r1.38 -r1.39 pkgsrc/lang/openjdk7/Attic/distinfo (expand / switch to context diff)
--- pkgsrc/lang/openjdk7/Attic/distinfo 2014/01/08 13:09:38 1.38
+++ pkgsrc/lang/openjdk7/Attic/distinfo 2014/01/14 17:24:42 1.39
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.38 2014/01/08 13:09:38 jperkin Exp $
+$NetBSD: distinfo,v 1.39 2014/01/14 17:24:42 abs Exp $
 
 SHA1 (openjdk7/UnlimitedJCEPolicyJDK7.zip) = 7d3c9ee89536b82cd21c680088b1bced16017253
 RMD160 (openjdk7/UnlimitedJCEPolicyJDK7.zip) = a4a6a284579f43d2df3532d279e143d2f03c2c3f
@@ -64,7 +64,7 @@
 RMD160 (openjdk7/rhino1_7R3.zip) = 3fdc3e1540d0fa35ba7dec1bf34a70b0d41cedd0
 Size (openjdk7/rhino1_7R3.zip) = 4651597 bytes
 SHA1 (patch-Makefile) = a9e415d19c2a8edb96a60ffdf81c804476a8e2f6
-SHA1 (patch-aa) = 656265823146be3fd6efee470fccff5fdc4b2a59
+SHA1 (patch-aa) = 69da3f571d37bb461f1d3edb342a56e63a2872af
 SHA1 (patch-ab) = 35d5a4a4aa32f8b92ba82f583a2d31f2b7af7998
 SHA1 (patch-ac) = 7a7853d8d0fd451e64a6fc39c28bd2bd8173adc6
 SHA1 (patch-ae) = 0bc7f2cf43835ce7d1e30e09a570e46a952a03e8

cvs diff -r1.3 -r1.4 pkgsrc/lang/openjdk7/Attic/options.mk (expand / switch to context diff)
--- pkgsrc/lang/openjdk7/Attic/options.mk 2011/08/21 22:57:54 1.3
+++ pkgsrc/lang/openjdk7/Attic/options.mk 2014/01/14 17:24:42 1.4
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.3 2011/08/21 22:57:54 tnn Exp $
+# $NetBSD: options.mk,v 1.4 2014/01/14 17:24:42 abs Exp $
 
 PKG_OPTIONS_VAR=		PKG_OPTIONS.openjdk7
 PKG_SUPPORTED_OPTIONS=		sun-jre-jce # jdk-zero-vm
@@ -16,7 +16,7 @@
 PLIST.jce=	yes
 USE_TOOLS+=	pax
 #
-.if !exists(${DISTDIR}/${DIST_SUBDIR}/${JCE_DISTFILE})
+.  if !exists(${DISTDIR}/${DIST_SUBDIR}/${JCE_DISTFILE})
 FETCH_MESSAGE+= "Please download the Java(TM) Cryptography Extension (JCE) Unlimited"
 FETCH_MESSAGE+= "Strength Jurisdiction Policy Files 7 '${JCE_DISTFILE}' from:"
 FETCH_MESSAGE+= "	http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html"
@@ -24,7 +24,7 @@
 FETCH_MESSAGE+= "       ${DISTDIR}/${DIST_SUBDIR}/${JCE_DISTFILE}"
 FETCH_MESSAGE+= ""
 FETCH_MESSAGE+= " Then resume this build by running '"${MAKE:Q}"' again."
-.endif
+.  endif
 #
 post-install:
 	cd ${WRKDIR}/UnlimitedJCEPolicy && pax -rw -pp . ${DESTDIR}${JAVA_HOME}/jre/lib/security

cvs diff -r1.10 -r1.11 pkgsrc/lang/openjdk7/patches/Attic/patch-aa (expand / switch to context diff)
--- pkgsrc/lang/openjdk7/patches/Attic/patch-aa 2014/01/02 01:16:35 1.10
+++ pkgsrc/lang/openjdk7/patches/Attic/patch-aa 2014/01/14 17:24:42 1.11
@@ -1,6 +1,7 @@
-$NetBSD: patch-aa,v 1.10 2014/01/02 01:16:35 ryoon Exp $
+$NetBSD: patch-aa,v 1.11 2014/01/14 17:24:42 abs Exp $
 
 DragonFly support.
+Add workaround for missing  sem_timedwait() in NetBSD < 6.99.4
 
 --- hotspot/src/os/bsd/vm/os_bsd.cpp.orig	2014-01-01 05:50:05.000000000 +0000
 +++ hotspot/src/os/bsd/vm/os_bsd.cpp
@@ -55,7 +56,41 @@
      {EM_ALPHA,       EM_ALPHA,   ELFCLASS64, ELFDATA2LSB, (char*)"Alpha"},
      {EM_MIPS_RS3_LE, EM_MIPS_RS3_LE, ELFCLASS32, ELFDATA2LSB, (char*)"MIPSel"},
      {EM_MIPS,        EM_MIPS,    ELFCLASS32, ELFDATA2MSB, (char*)"MIPS"},
-@@ -3880,7 +3883,7 @@ OSReturn os::set_native_priority(Thread*
+@@ -2818,6 +2821,33 @@ bool Semaphore::timedwait(unsigned int s
+ 
+ #else
+ 
++#if defined(__NetBSD__) && (__NetBSD_Version__ < 699000400)
++static inline int sem_timedwait(sem_t *sem, struct timespec *ts) {
++  struct timespec onems = { 0, 1000000 };
++  struct timespec total = { 0, 0 };
++  struct timespec unslept;
++  struct timespec elapsed;
++  struct timespec tmp;
++
++  while (timespeccmp(ts, &total, >)) {
++    if (sem_trywait(sem) == 0)
++      return 0;
++
++    if (errno != EAGAIN)
++      return -1;
++
++    (void)nanosleep(&onems, &unslept);
++
++    timespecsub(&onems, &unslept, &elapsed);
++    timespecadd(&total, &elapsed, &tmp);
++    total.tv_sec = tmp.tv_sec;
++    total.tv_nsec = tmp.tv_nsec;
++  }
++  errno = ETIMEDOUT;
++  return -1;
++}
++#endif /* __NetBSD__ */
++
+ bool Semaphore::trywait() {
+   return sem_trywait(&_semaphore) == 0;
+ }
+@@ -3880,7 +3910,7 @@ OSReturn os::set_native_priority(Thread*
  #ifdef __OpenBSD__
    // OpenBSD pthread_setprio starves low priority threads
    return OS_OK;
@@ -64,7 +99,7 @@
    int ret = pthread_setprio(thread->osthread()->pthread_id(), newpri);
    return (ret == 0) ? OS_OK : OS_ERR;
  #elif defined(__APPLE__) || defined(__NetBSD__)
-@@ -3909,7 +3912,7 @@ OSReturn os::get_native_priority(const T
+@@ -3909,7 +3939,7 @@ OSReturn os::get_native_priority(const T
    }
  
    errno = 0;