[cp-patches] FYI: Allow building of gjdoc to be disabled

Andrew John Hughes gnu_andrew at member.fsf.org
Fri Jun 13 09:16:15 UTC 2008


This patch adds a --disable-gjdoc option so that Classpath can still be
built without this (and thus doesn't require the new antlr dependency).
Building GJDoc is still enabled by default.  It also adds a check for
mkdir -p to configure.ac and replaces the implicit use in our makefiles
with @MKDIR_P@
(see http://www.gnu.org/software/autoconf/manual/autoconf.html#Particular-Programs).

ChangeLog:

2008-06-13  Andrew John Hughes  <gnu_andrew at member.fsf.org>

	* configure.ac:
	Add --enable-gjdoc option and check
	for mkdir -p.
	* examples/Makefile.am,
	* lib/Makefile.am,
	* lib/copy-vmresources.sh.in:
	Use @MKDIR_P at .
	* tools/Makefile.am:
	Allow building GJDoc to be disabled
	and use @MKDIR_P at .

-- 
Andrew :)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint = F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8
-------------- next part --------------
Index: configure.ac
===================================================================
RCS file: /sources/classpath/classpath/configure.ac,v
retrieving revision 1.233
diff -u -u -r1.233 configure.ac
--- configure.ac	11 Jun 2008 21:41:30 -0000	1.233
+++ configure.ac	13 Jun 2008 02:38:07 -0000
@@ -259,6 +259,19 @@
               [COMPILE_GMP=yes])
 
 dnl -----------------------------------------------------------
+dnl GJDoc (enabled by default)
+dnl -----------------------------------------------------------
+AC_ARG_ENABLE([gjdoc],
+              [AS_HELP_STRING(--disable-gjdoc,compile GJDoc (disabled by --disable-gjdoc) [default=yes])],
+              [case "${enableval}" in
+                yes) COMPILE_GJDOC=yes ;;
+                no) COMPILE_GJDOC=no ;;
+                *) COMPILE_GJDOC=yes ;;
+              esac],
+              [COMPILE_GJDOC=yes])
+AM_CONDITIONAL(CREATE_GJDOC, test "x${COMPILE_GJDOC}" = xyes)
+
+dnl -----------------------------------------------------------
 dnl Sets the native libraries installation dir
 dnl -----------------------------------------------------------
 AC_ARG_WITH([native-libdir],
@@ -349,6 +362,7 @@
 
 AC_PROG_LN_S
 AC_PROG_INSTALL
+AC_PROG_MKDIR_P
 
 dnl -----------------------------------------------------------
 dnl Checks for programs.
@@ -361,7 +375,10 @@
 AC_PROG_CC
 AM_PROG_CC_C_O
 AC_PROG_CPP
-AC_PROG_ANTLR(2,7,1)
+
+if test "x${COMPILE_GJDOC}" = xyes; then
+  AC_PROG_ANTLR(2,7,1)
+fi
 
 # Handle -Werror default case.
 if test "$ENABLE_WERROR" = default; then
@@ -1075,8 +1092,7 @@
 tools/gorbd
 tools/grmid
 tools/grmic
-tools/gjavah
-tools/gjdoc])
+tools/gjavah])
 AC_CONFIG_COMMANDS([gappletviewer],[chmod 755 tools/gappletviewer])
 AC_CONFIG_COMMANDS([gjarsigner],[chmod 755 tools/gjarsigner])
 AC_CONFIG_COMMANDS([gkeytool],[chmod 755 tools/gkeytool])
@@ -1089,8 +1105,12 @@
 AC_CONFIG_COMMANDS([grmid],[chmod 755 tools/grmid])
 AC_CONFIG_COMMANDS([grmic],[chmod 755 tools/grmic])
 AC_CONFIG_COMMANDS([gjavah], [chmod 755 tools/gjavah])
+if test "x${COMPILE_GJDOC}" = xyes
+then
+AC_CONFIG_FILES([tools/gjdoc])
 AC_CONFIG_COMMANDS([gjdoc], [chmod 755 tools/gjdoc])
 fi
+fi
 
 AC_CONFIG_COMMANDS([gen-classlist],[chmod 755 lib/gen-classlist.sh])
 AC_CONFIG_COMMANDS([copy-vmresources],[chmod 755 lib/copy-vmresources.sh])
Index: examples/Makefile.am
===================================================================
RCS file: /sources/classpath/classpath/examples/Makefile.am,v
retrieving revision 1.24
diff -u -u -r1.24 Makefile.am
--- examples/Makefile.am	12 Feb 2008 22:30:21 -0000	1.24
+++ examples/Makefile.am	13 Jun 2008 02:38:07 -0000
@@ -85,9 +85,9 @@
 # class files. Always regenerate all .class files and remove them immediatly.
 # And copy the png icons we use to the classes dir so they get also included.
 $(EXAMPLE_ZIP): $(EXAMPLE_JAVA_FILES)
-	mkdir -p classes/gnu/classpath/examples/icons
+	@MKDIR_P@ classes/gnu/classpath/examples/icons
 	cp $(EXAMPLE_ICONS) classes/gnu/classpath/examples/icons
-	mkdir -p classes/gnu/classpath/examples/swing
+	@MKDIR_P@ classes/gnu/classpath/examples/swing
 	cp $(EXAMPLE_HTML) classes/gnu/classpath/examples/swing
 	$(JCOMPILER) -d classes $(EXAMPLE_JAVA_FILES) 
 	(cd classes; \
Index: lib/Makefile.am
===================================================================
RCS file: /sources/classpath/classpath/lib/Makefile.am,v
retrieving revision 1.144
diff -u -u -r1.144 Makefile.am
--- lib/Makefile.am	11 Jun 2008 21:36:32 -0000	1.144
+++ lib/Makefile.am	13 Jun 2008 02:38:15 -0000
@@ -77,18 +77,18 @@
 resources: copy-vmresources.sh
 	@list=`cd $(top_srcdir)/resource && $(FIND) gnu java javax org -name \*\.properties -print -o -name \*\.css -print`; for p in $$list; do \
           dirname=`dirname $$p`; \
-          if ! test -d "$$dirname"; then mkdir -p "$$dirname"; fi; \
+          if ! test -d "$$dirname"; then @MKDIR_P@ "$$dirname"; fi; \
 	  cp $(top_srcdir)/resource/$$p $$p; \
 	done
 	@list=`cd $(top_srcdir)/resource && $(FIND) META-INF -name CVS -prune -o -name \*\.in -prune -o -type f -print`; for p in $$list; do \
           dirname=`dirname $$p`; \
-          if ! test -d "$$dirname"; then mkdir -p "$$dirname"; fi; \
+          if ! test -d "$$dirname"; then @MKDIR_P@ "$$dirname"; fi; \
 	  cp $(top_srcdir)/resource/$$p $$p; \
 	done
 	@$(SHELL) ./copy-vmresources.sh
 	@list=`cd $(top_srcdir) && $(FIND) gnu/javax/swing/plaf/gtk/icons -name *.png -type f -print`; for p in $$list; do \
           dirname=`dirname $$p`; \
-          if ! test -d "$$dirname"; then mkdir -p "$$dirname"; fi; \
+          if ! test -d "$$dirname"; then @MKDIR_P@ "$$dirname"; fi; \
 	  cp $(top_srcdir)/$$p $$p; \
 	done
 	touch resources
@@ -96,7 +96,7 @@
 classes: genclasses
 
 $(top_builddir)/gnu/java/locale/LocaleData.java: $(top_srcdir)/scripts/generate-locale-list.sh 
-	mkdir -p $(top_builddir)/gnu/java/locale
+	@MKDIR_P@ $(top_builddir)/gnu/java/locale
 	$(top_srcdir)/scripts/generate-locale-list.sh > $(top_builddir)/gnu/java/locale/LocaleData.java
 
 genclasses: gen-classlist.sh standard.omit $(top_builddir)/gnu/java/locale/LocaleData.java gen-xpath-parser
@@ -154,7 +154,7 @@
 	-rm -rf lists
 
 dist-hook:
-	mkdir -p $(distdir)
+	@MKDIR_P@ $(distdir)
 	cp -pdfR $(top_srcdir)/gnu $(top_srcdir)/java $(top_srcdir)/javax $(top_srcdir)/org $(top_srcdir)/sun $(top_srcdir)/vm $(top_srcdir)/resource $(distdir)/..
 # Delete not wanted files.
 	$(FIND) $(distdir)/../gnu $(distdir)/../java $(distdir)/../javax $(distdir)/../org $(distdir)/../sun $(distdir)/../vm $(distdir)/../resource -name CVS -print | xargs rm -fr
Index: lib/copy-vmresources.sh.in
===================================================================
RCS file: /sources/classpath/classpath/lib/copy-vmresources.sh.in,v
retrieving revision 1.7
diff -u -u -r1.7 copy-vmresources.sh.in
--- lib/copy-vmresources.sh.in	18 Jul 2006 13:41:06 -0000	1.7
+++ lib/copy-vmresources.sh.in	13 Jun 2008 02:38:15 -0000
@@ -11,7 +11,7 @@
 		(cd $p/META-INF; 
 		 dirs=`find . -name "CVS" -prune -o -type d -print`;
 		 for u in ${dirs}; do
-			 mkdir -p ${destMetaDir}/${u};
+			 @MKDIR_P@ ${destMetaDir}/${u};
 		 done;
 		 files=`find . -name "CVS" -prune -o -name "*.in" -prune -o -type f -print`;
 		 for u in ${files}; do
@@ -31,7 +31,7 @@
   	  resnewdirs=`echo ${resdirs} | uniq`;
 
   	  for u in ${resnewdirs}; do
-  		  mkdir -p ${destResDir}/${u};
+  		  @MKDIR_P@ ${destResDir}/${u};
   	  done
   
 	  for f in ${resfiles}; do
Index: tools/Makefile.am
===================================================================
RCS file: /sources/classpath/classpath/tools/Makefile.am,v
retrieving revision 1.49
diff -u -u -r1.49 Makefile.am
--- tools/Makefile.am	13 Jun 2008 00:31:39 -0000	1.49
+++ tools/Makefile.am	13 Jun 2008 02:38:18 -0000
@@ -6,14 +6,20 @@
 # Setup the compiler to use the GNU Classpath library we just built.
 JCOMPILER = $(JAVAC) $(JAVACFLAGS) -source 1.5 -target 1.5 -encoding UTF-8 -bootclasspath $(GLIBJ_BOOTCLASSPATH) -classpath $(GLIBJ_CLASSPATH)
 
+if CREATE_GJDOC
 USE_JAVAC_FLAGS = -classpath $(CLASSPATH):$(srcdir):$(ANTLR_JAR):generated:. $(JAVAC_FLAGS)
+else
+USE_JAVAC_FLAGS = -classpath $(CLASSPATH):$(srcdir):. $(JAVAC_FLAGS)
+endif
 
 if CREATE_WRAPPERS
 bin_SCRIPTS =
 bin_PROGRAMS = gappletviewer gjarsigner gkeytool \
 	gjar gnative2ascii gserialver gjavah grmiregistry \
-	gtnameserv gorbd grmid grmic gjdoc
-
+	gtnameserv gorbd grmid grmic
+if CREATE_GJDOC
+bin_PROGRAMS += gjdoc
+endif
 
 AM_CPPFLAGS = -Wall \
 	-I$(top_srcdir)/include \
@@ -90,7 +96,10 @@
 else
 bin_SCRIPTS = gappletviewer gjarsigner gkeytool \
 	gjar gnative2ascii gserialver gjavah grmiregistry \
-	gtnameserv gorbd grmid grmic gjdoc
+	gtnameserv gorbd grmid grmic
+if CREATE_GJDOC
+bin_SCRIPTS += gjdoc
+endif
 bin_PROGRAMS =
 ## FIXME: revisit this with a newer automake.
 gappletviewer: gappletviewer.in
@@ -105,11 +114,13 @@
 gorbd: gorbd.in
 grmid: grmid.in
 grmic: grmic.in
+if CREATE_GJDOC
 gjdoc: gjdoc.in
 endif
+endif
 EXTRA_DIST = toolwrapper.c gappletviewer.in gjarsigner.in gkeytool.in \
 	gjar.in gnative2ascii.in gserialver.in gjavah.in grmiregistry.in \
-	gtnameserv.in gorbd.in grmid.in grmic.in
+	gtnameserv.in gorbd.in grmid.in grmic.in gjdoc.in
 
 # All our example java source files
 TOOLS_JAVA_FILES = $(srcdir)/gnu/classpath/tools/*/*.java \
@@ -247,6 +258,14 @@
 	$(gnu_classpath_tools_gjdoc_jar_RNGS) $(gnu_classpath_tools_gjdoc_jar_TXTS) \
 	$(gnu_classpath_tools_gjdoc_jar_XHTML) $(gnu_classpath_tools_gjdoc_jar_XSLS)
 
+if !CREATE_GJDOC
+GJDOC_EX = -path '*gnu/classpath/tools/gjdoc' -prune -o \
+	-path '*gnu/classpath/tools/doclets' -prune -o \
+	-path '*com/sun/javadoc' -prune -o \
+	-path '*com/sun/tools/doclets' -prune -o \
+	-path '*com/sun/tools/javadoc' -prune -o
+endif
+
 # The zip files with classes we want to produce.
 TOOLS_ZIP = tools.zip
 
@@ -284,10 +303,13 @@
 # so they get also included.
 $(TOOLS_ZIP): $(ALL_TOOLS_FILES)
 	@rm -rf classes asm generated
-	mkdir -p classes asm generated/gnu/classpath/tools/gjdoc/expr
+	@MKDIR_P@ classes asm 
+if CREATE_GJDOC
 ## Generate antlr sources.
+	@MKDIR_P@ generated/gnu/classpath/tools/gjdoc/expr
 	$(ANTLR) -o generated/gnu/classpath/tools/gjdoc/expr \
 	  $(srcdir)/gnu/classpath/tools/gjdoc/expr/java-expression.g
+endif
 ## Compile ASM separately as it is latin-1 encoded.
 	find $(srcdir)/external/asm -name '*.java' -print > asm.lst
 	AC=`echo $(JCOMPILER) | sed -e 's/UTF-8/ISO-8859-1/g'`; \
@@ -295,29 +317,32 @@
 	find $(srcdir)/gnu/classpath/tools \
 	     $(srcdir)/com/sun/javadoc \
 	     $(srcdir)/com/sun/tools/doclets \
+	     $(srcdir)/com/sun/tools/javadoc \
 	     $(srcdir)/com/sun/tools/javac \
 	     $(srcdir)/com/sun/tools/javah \
-	     $(srcdir)/com/sun/tools/javadoc \
 	     $(srcdir)/sun/rmi/rmic \
+	     $(GJDOC_EX) \
 	     -name '*.java' -print > classes.lst
 	$(JCOMPILER) $(USE_JAVAC_FLAGS) -g -d classes @classes.lst
 	cat classes.lst asm.lst > all-classes.lst
 ## Copy over tools resource files.
 	@list=`cd $(srcdir)/resource && find gnu/classpath/tools com/sun/tools/javac \
-	       sun/rmi/rmic -name \*.properties -print -o -name \*.jav -print`; \
+	       sun/rmi/rmic $(GJDOC_EX) -name \*.properties -print -o -name \*.jav -print`; \
 	for p in $$list; do \
 	  dirname=classes/`dirname $$p`; \
-	  if ! test -d "$$dirname"; then mkdir -p "$$dirname"; fi; \
+	  if ! test -d "$$dirname"; then @MKDIR_P@ "$$dirname"; fi; \
 	  echo "  cp $(srcdir)/resource/$$p classes/$$p"; \
 	  cp $(srcdir)/resource/$$p classes/$$p; \
 	done
+if CREATE_GJDOC
 ## Copy over gjdoc resource files.
 	for res in $(gjdoc_resources); do \
 	  dir=classes/`dirname $$res`; \
-	  if ! test -d "$$dir"; then mkdir -p "$$dir"; fi; \
+	  if ! test -d "$$dir"; then @MKDIR_P@ "$$dir"; fi; \
 	  echo "  cp $(srcdir)/resource/gnu/classpath/tools/gjdoc/$$res classes/$$res"; \
 	  cp $(srcdir)/resource/gnu/classpath/tools/gjdoc/$$res classes/$$res; \
 	done 
+endif
 ## First add classpath tools stuff.
 	(cd classes; \
 	if test "$(ZIP)" != ""; then $(ZIP) -r ../$(TOOLS_ZIP) .; fi; \


More information about the Classpath-patches mailing list