The patch "nspr.diff" adds a standalone and up-to-date NSPR library.
It is always built statically. For the patches:
nspr-00--done--nspr-configure-in--m68k-is-not-m68020-60.patch I
believe it's been accepted
nspr-02--hold--ifdef-have-dlfcn-h.patch: it's been submitted and
hopefully accepted
nspr-03--todo--barf-fork-call.patch: hack: I don't think s/fork/vfork/
would work here, and since I don't need it to work I took the easy way
out
I should point out that while Mozilla thinks NSPR and NSS should go
hand-in-hand (per the current lib/nss directory which tries to build
both) I found things became much easier when I split those two and
built them separately (NSPR uses autoconf, abet incorrectly; NSS uses
GNU make; NSS+NSPR uses GNU make to invoke autoconf ). The patch
"wip-nss.diff" (do not apply) hints at how I'm getting lib/nss to use
the previously built NSPR
Andrew
diff --git a/lib/nspr/.gitignore b/lib/nspr/.gitignore
new file mode 100644
index 000..dc3f997
--- /dev/null
+++ b/lib/nspr/.gitignore
@@ -0,0 +1,2 @@
+/build
+/downloads
diff --git a/lib/nspr/makefile b/lib/nspr/makefile
new file mode 100644
index 000..e195237
--- /dev/null
+++ b/lib/nspr/makefile
@@ -0,0 +1,20 @@
+URL = https://ftp.mozilla.org/pub/nspr/releases/v4.11/src/nspr-4.11.tar.gz
+
+NVR = $(subst -, , $(patsubst %.tar.gz,%,$(notdir $(URL
+PKG = $(word 1,$(NVR))
+VERSION = $(word 2,$(NVR))
+SRCDIR = $(PKG)-$(VERSION)
+BUILDDIR = $(SRCDIR)/nspr
+
+# $(AUTORECONF) is run from $(SRCDIR), not $(BUILDDIR)
+AUTORECONF = cd nspr ; autoconf
+
+include $(ROOTDIR)/tools/automake.inc
+
+# Disable build of shared library. Should this be controled by
+# automake.mk somehow?
+MAKEVARS = 'SHARED_LIBRARY='
+
+# When it comes to the definition of build, host, and target, Mozilla
+# are still living in the 90's: target->[] build->host host->target.
+CONFIGURE_OPTS:=$(patsubst --build=%,--host=%,$(patsubst
--host=%,--target=%,$(patsubst --target=%,,$(CONFIGURE_OPTS
diff --git
a/lib/nspr/patches/nspr-00--done--nspr-configure-in--m68k-is-not-m68020-60.patch
b/lib/nspr/patches/nspr-00--done--nspr-configure-in--m68k-is-not-m68020-60.patch
new file mode 100644
index 000..bbdced2
--- /dev/null
+++
b/lib/nspr/patches/nspr-00--done--nspr-configure-in--m68k-is-not-m68020-60.patch
@@ -0,0 +1,11 @@
+--- nspr-4.10.9/nspr/configure.in.orig 2015-11-25 15:17:14.732725317 -0500
nspr-4.10.9/nspr/configure.in 2015-11-25 20:09:38.299725384 -0500
+@@ -1857,8 +1865,4 @@
+ fi
+ ;;
+-m68k)
+-CFLAGS="$CFLAGS -m68020-60"
+-CXXFLAGS="$CXXFLAGS -m68020-60"
+-;;
+ esac
+ ;;
diff --git a/lib/nspr/patches/nspr-02--hold--ifdef-have-dlfcn-h.patch
b/lib/nspr/patches/nspr-02--hold--ifdef-have-dlfcn-h.patch
new file mode 100644
index 000..7f80842
--- /dev/null
+++ b/lib/nspr/patches/nspr-02--hold--ifdef-have-dlfcn-h.patch
@@ -0,0 +1,57 @@
+--- nspr-4.11/nspr/configure.in.orig 2015-12-02 12:38:53.626997958 -0500
nspr-4.11/nspr/configure.in2015-12-02 13:55:03.438024691 -0500
+@@ -2518,8 +2518,9 @@
+ *-darwin*|*-beos*|*-os2*)
+ ;;
+ *)
++dnl define HAVE_DLFCN_H when present
+ AC_CHECK_LIB(dl, dlopen,
+-[AC_CHECK_HEADER(dlfcn.h,
++[AC_CHECK_HEADERS(dlfcn.h,
+ OS_LIBS="-ldl $OS_LIBS")])
+ ;;
+ esac
+--- nspr-4.11/nspr/pr/include/md/_linux.h.orig 2015-12-02 14:06:23.694020882
-0500
nspr-4.11/nspr/pr/include/md/_linux.h 2015-12-02 14:07:37.706046831
-0500
+@@ -74,10 +74,12 @@
+ #undefHAVE_STACK_GROWING_UP
+
+ /*
+- * Elf linux supports dl* functions
++ * Elf linux supports dl* functions but uClinux may not.
+ */
++#if defined(HAVE_DLFCN_H)
+ #define HAVE_DLL
+ #define USE_DLFCN
++#endif
+ #if defined(ANDROID)
+ #define NO_DLOPEN_NULL
+ #endif
+--- nspr-4.11/nspr/pr/src/pthreads/ptthread.c.orig 2015-11-18
07:36:52.0 -0500
nspr-4.11/nspr/pr/src/pthreads/ptthread.c 2015-12-02 14:15:10.850057366
-0500
+@@ -19,7 +19,9 @@
+ #include
+ #include
+ #include
++#ifdef HAVE_DLFCN_H
+ #include
++#endif
+
+ #ifdef SYMBIAN
+ /* In Open C sched_get_priority_min/max do not work properly, so we undefine
+@@ -1764,6 +1766,7 @@
+ int (*dynamic_pthread_setname_np)(pthread_t, const char*);
+ #endif
+
++#if defined(HAVE_DLL)
+ *(void**)(_pthread_setname_np) =
+ dlsym(RTLD_DEFAULT, "pthread_setname_np");
+ if (!dynamic_pthread_setname_np)
+@@ -1801,6 +1804,7 @@
+ PR_SetError(PR_UNKNOWN_ERROR, result);
+ return PR_FAILURE;
+ }
++#endif /* HAVE_DLL */
+ return PR_SUCCESS;
+ }
+
diff --git a/lib/nspr/patches/nspr-03--todo--barf-fork-call.patch
b/lib/nspr/patches/nspr-03--todo--barf-fork-call.patch
new file mode 100644
index 000..5c17255
--- /dev/null
+++ b/lib/nspr/patches/nspr-03--todo--barf-fork-call.patch
@@ -0,0 +1,31 @@
+For moment, when no fork() replace the call with a barf.
+Should, perhaps, eventually look at changing the code to
+be vfork proof.
+