[cp-patches] RFC: [gjdoc] patches for gjdoc-0.7.7 for improved portability

Frederick C. Druseikis fdruseikis at sc.rr.com
Sun Jun 18 20:11:37 UTC 2006


Greetings,

With JamVM now sporting an improved GC, I am able to run gjdoc on the 
OpenBSD platform.  The attached patches were needed to complete the 
port; they might improve the portability of gjdoc to other non-GNU 
platforms:

m4/ac_prog_java.m4
m4/ac_prog_javac.m4

these patches resolve a bug in detecting alternative java runtimes: 
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22857
AC_PATH_PROG with correct parameters results in the full path

Makefile.in

suggests an alternative to "cp -u", which is not available on the 
OpenBSD platform.

gjdoc.sh.in

suggests an alternative for argument processing in gjdoc.sh -- 
specifically removes the use of "head -c" and substr and len extensions 
to "expr" for parsing -J options

Regards,
Fred Druseikis


-------------- next part --------------
$OpenBSD$
--- m4/ac_prog_java.m4.orig	Wed Feb  9 13:13:27 2005
+++ m4/ac_prog_java.m4	Sat Jun 17 21:57:13 2006
@@ -8,7 +8,7 @@ AC_REQUIRE([AC_EXEEXT])dnl
 if test x$JAVAPREFIX = x; then
         test x$JAVA = x && AC_CHECK_PROGS(JAVA, kaffe$EXEEXT gij$EXEEXT java$EXEEXT)
 else
-        test x$JAVA = x && AC_CHECK_PROGS(JAVA, kaffe$EXEEXT gij$EXEEXT java$EXEEXT, $JAVAPREFIX)
+        test x$JAVA = x && AC_PATH_PROGS(JAVA, kaffe$EXEEXT gij$EXEEXT java$EXEEXT,, $JAVAPREFIX)
 fi
 test x$JAVA = x && AC_MSG_ERROR([no acceptable Java virtual machine found in \$PATH])
 AC_PROG_JAVA_WORKS


-------------- next part --------------
$OpenBSD$
--- m4/ac_prog_javac.m4.orig	Sat Feb 12 07:16:53 2005
+++ m4/ac_prog_javac.m4	Sat Jun 17 22:04:54 2006
@@ -6,7 +6,7 @@ AC_REQUIRE([AC_EXEEXT])dnl
 if test "x$JAVAPREFIX" = x; then
         test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, "gcj$EXEEXT -C" jikes$EXEEXT ejc$EXEEXT guavac$EXEEXT javac$EXEEXT)
 else
-        test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, "gcj$EXEEXT -C" jikes$EXEEXT ejc$EXEEXT guavac$EXEEXT javac$EXEEXT, $JAVAPREFIX)
+        test "x$JAVAC" = x && AC_PATH_PROGS(JAVAC, "gcj$EXEEXT -C" jikes$EXEEXT ejc$EXEEXT guavac$EXEEXT javac$EXEEXT,, $JAVAPREFIX)
 fi
 test "x$JAVAC" = x && AC_MSG_ERROR([no acceptable Java compiler found in \$PATH])
 AC_PROG_JAVAC_WORKS


-------------- next part --------------
$OpenBSD$
--- Makefile.in.orig	Mon Dec 19 03:47:05 2005
+++ Makefile.in	Sun Jun 18 00:07:14 2006
@@ -3755,7 +3755,7 @@ com-sun-tools-doclets-Taglet-$(VERSION).
 
 gnu-classpath-tools-gjdoc-$(VERSION).jar: $(srcdir)/gjdoc.manifest src/resources/version.properties $(gnu_classpath_tools_gjdoc_jar_CLASSES) $(gnu_classpath_tools_gjdoc_jar_GENCLASSES) $(gjdoc_resources_src)
 	for res in $(gjdoc_resources) ; \
-	do  cp -u $(srcdir)/src/resources/$$res $$res ; done
+	do  test $(srcdir)/src/resources/$$res -nt $$res && cp $(srcdir)/src/resources/$$res $$res ; done
 	$(JAR) cfm $@ $(srcdir)/gjdoc.manifest \
 	$(gjdoc_resources) \
 	-C src/resources version.properties \
@@ -3839,7 +3839,7 @@ dist-hook:
 	-find $(distdir)/src/resources -name CVS -exec rm -rf {} \;
 
 install-data-hook:
- at ENABLE_NATIVE_FALSE@	$(INSTALL) --mode 755 gjdoc.sh $(DESTDIR)$(bindir)/gjdoc
+ at ENABLE_NATIVE_FALSE@	$(INSTALL) -m 755 gjdoc.sh $(DESTDIR)$(bindir)/gjdoc
 
 uninstall-hook:
 @ENABLE_NATIVE_FALSE@	rm -f $(bindir)/gjdoc


-------------- next part --------------
$OpenBSD$
--- gjdoc.sh.in.orig	Sat May 21 18:38:20 2005
+++ gjdoc.sh.in	Sun Jun 18 09:10:28 2006
@@ -38,12 +38,16 @@ fi
 gjdocpath=${datadir}/java/com-sun-javadoc-${version}.jar:${datadir}/java/com-sun-tools-doclets-Taglet-${version}.jar:${datadir}/java/gnu-classpath-tools-gjdoc-${version}.jar:${ANTLR_JAR}:${CLASSPATH}
 
 for i in ${1+"$@"}; do
-    if test "`echo "$i" | head -c 2`" = "-J"; then
-        len=`expr length "$i"`
-        vmparams="$vmparams '`expr substr "$i" 3 $len`'"
-    else
-        gjdocparams="$gjdocparams '$i'"
-    fi
+	case "$i" in
+		-J* )
+        	param="`expr \"$i\" : '-J\(.*\)'`"
+        	vmparams="$vmparams '$param'"
+			;;
+
+		* )
+        	gjdocparams="$gjdocparams '$i'"
+			;;
+	esac
 done
 
 exec ${SHELL} -c "exec ${JAVA} ${vmparams} -classpath ${gjdocpath} gnu.classpath.tools.gjdoc.Main ${gjdocparams}"




More information about the Classpath-patches mailing list