Hello,

I'm trying to build Japhar on my Debian GNU/Linux (sid) system.  The
first problem I ran into was that the Debian `libnspr4' package places
the shared libraries in /usr/lib, but places the headers in
/usr/include/nspr.  The --with-nspr configure option didn't cover this
case, so I broke it into two separate options, and added an attempt to
automatically find them.  The patch is attached.

The second problem was that a function in gc.c didn't match its
prototype; a patch is attached.

Index: configure.in
===================================================================
RCS file: /cvsroot/hungry/java/japhar/configure.in,v
retrieving revision 1.188
diff -u -r1.188 configure.in
--- configure.in	2001/01/07 15:21:59	1.188
+++ configure.in	2001/01/30 20:47:38
@@ -125,32 +125,6 @@
   ])
 
 dnl
-dnl get path to nspr install dir. 
-dnl
-AC_ARG_WITH(nspr,
- [  --with-nspr             Specify the path to NSPR.],
-  [
-   CFLAGS="-I${with_nspr}/include $CFLAGS"
-   JAPHAR_CFLAGS="-I${with_nspr}/include $JAPHAR_CFLAGS"
-   LDFLAGS="-L${with_nspr}/lib $LDFLAGS"
-
-   AC_MSG_CHECKING(for version of NSPR at ${with_nspr})
-   if test -f ${with_nspr}/lib/libnspr3.so; then 
-     AC_MSG_RESULT(NSPR V3)
-     NSPRVER="3"
-   else 
-    if test -f ${with_nspr}/lib/libnspr4.so; then
-      AC_MSG_RESULT(NSPR V4)
-      NSPRVER="4"
-    else
-      AC_MSG_ERROR(${with_nspr} is not a valid NSPR distribution)
-    fi
-  fi
-
-   AC_SUBST(NSPRVER)  
-  ])
-
-dnl
 dnl get path to sports model install dir.
 dnl
 AC_ARG_WITH(sm,
@@ -302,25 +276,61 @@
 
 AC_CHECK_LIB(c_r, pthread_create)
 AC_CHECK_LIB(pthread, pthread_create)
-AC_CHECK_LIB(nspr${NSPRVER}, PR_CreateThread)
-AC_CHECK_LIB(plds${NSPRVER}, PL_NewHashTable)
-AC_CHECK_LIB(plc${NSPRVER}, PL_strdup)
-if test "x${ac_cv_lib_nspr3_PR_CreateThread}" = xno &&
-   test "x${ac_cv_lib_nspr4_PR_CreateThread}" = xno ; then
-  nspr_missing=yes
-fi
-if test "x${ac_cv_lib_plds3_PL_NewHashTable}" = xno &&
-   test "x${ac_cv_lib_plds4_PL_NewHashTable}" = xno; then
-  nspr_missing=yes
-fi
-if test "x${ac_cv_lib_plc3_PL_strdup}" = xno &&
-   test "x${ac_cv_lib_plc4_PL_strdup}" = xno; then
-  nspr_missing=yes
-fi
 
-if test "x${NSPRVER}" = x || test "x$nspr_missing" = xyes; then
-  AC_MSG_ERROR(could not find NSPR install)
-fi
+AC_ARG_WITH(nspr-includes,
+ [  --with-nspr-includes             Specify the path to NSPR header files.],
+  [
+   CFLAGS="-I${with_nspr_includes} $CFLAGS"
+   JAPHAR_CFLAGS="-I${with_nspr_includes} $JAPHAR_CFLAGS"
+  ],
+  [
+   nspr_header_path=no
+
+   for x in /usr/include/nspr/ /usr/include/ /usr/local/include/ \
+            /usr/local/include/nspr/; do
+     AC_MSG_CHECKING("for NSPR headers in ${x}")
+     if test "x${nspr_header_path}" = xno && test -f "${x}nspr.h"; then
+       nspr_header_path=$x
+       AC_MSG_RESULT("${x}nspr.h")
+       break
+     fi
+   done
+   if test "x${nspr_header_path}" = xno; then
+     AC_MSG_ERROR(Could not find NSPR header files.  Try --with-nspr-includes.)
+   fi
+   CFLAGS="-I${nspr_header_path} $CFLAGS"
+   JAPHAR_CFLAGS="-I${nspr_header_path} $JAPHAR_CFLAGS "
+  ])
+
+AC_ARG_WITH(nspr-libs,
+ [  --with-nspr-libs               Specifty the path to NSPR library files.],
+  [
+   LDFLAGS="-L${with_nspr_libs} $LDFLAGS"
+  ],
+  [
+   nspr_ver=no
+   nspr_missing=no
+   AC_CHECK_LIB(nspr4, PR_CreateThread,nspr_ver=4)
+   if test $nspr_ver = no; then
+   AC_CHECK_LIB(nspr3, PR_CreateThread,nspr_ver=3)
+   fi
+   AC_CHECK_LIB(plds${nspr_ver}, PL_NewHashTable)
+   AC_CHECK_LIB(plc${nspr_ver}, PL_strdup)   
+   if test $nspr_ver = no; then
+   nspr_missing=yes
+   fi
+   if test "x${ac_cv_lib_plds3_PL_NewHashTable}" = xno &&
+      test "x${ac_cv_lib_plds4_PL_NewHashTable}" = xno; then
+      nspr_missing=yes
+   fi
+   if test "x${ac_cv_lib_plc3_PL_strdup}" = xno &&
+      test "x${ac_cv_lib_plc4_PL_strdup}" = xno; then
+      nspr_missing=yes
+   fi
+   if test "x$nspr_missing" = xyes; then
+      AC_MSG_ERROR(Could not find NSPR library files.  Try --with-nspr-libs)
+   fi
+  ])
 
 if test "x$with_sm" != "x"; then
   AC_CHECK_LIB(sm, SM_InitGC)
Index: lib/libruntime/gc.c
===================================================================
RCS file: /cvsroot/hungry/java/japhar/lib/libruntime/gc.c,v
retrieving revision 1.23
diff -u -r1.23 gc.c
--- gc.c	2000/08/08 23:16:41	1.23
+++ gc.c	2001/01/30 20:48:22
@@ -86,7 +86,7 @@
 }
 
 PR_IMPLEMENT( void* )
-HVM_Strdup (void *ptr)
+HVM_Strdup (const void *ptr)
 {
   void *result;
 #if WITH_SPORTSMODEL

Reply via email to