summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2008-06-27 00:18:36 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2008-06-27 00:18:36 +0000
commitd6e4f9fb2457086bac87975672c0c11f2d88f67f (patch)
tree3aa87b047cd3ff8fb7e79056d5c3c220486acde3
parent1b56c841903c989e75d6878c07524b7970fba65c (diff)
downloadclasspath-d6e4f9fb2457086bac87975672c0c11f2d88f67f.tar.gz
Generalise --with-fastjar to --with-jar and allow it to be turned off.
2008-06-27 Andrew John Hughes <gnu_andrew@member.fsf.org> PR classpath/36637: * examples/Makefile.am, * lib/Makefile.am: Use new conditional and $(JAR). * m4/acinclude.m4: Replace --with-fastjar with a general --with-jar check that can be turned off. * tools/Makefile.am: Use new conditional and $(JAR).
-rw-r--r--ChangeLog12
-rw-r--r--examples/Makefile.am10
-rw-r--r--lib/Makefile.am26
-rw-r--r--m4/acinclude.m447
-rwxr-xr-xtools/Makefile.am15
5 files changed, 82 insertions, 28 deletions
diff --git a/ChangeLog b/ChangeLog
index 694c2ec9e..e617aece3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2008-06-27 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ PR classpath/36637:
+ * examples/Makefile.am,
+ * lib/Makefile.am:
+ Use new conditional and $(JAR).
+ * m4/acinclude.m4:
+ Replace --with-fastjar with a general
+ --with-jar check that can be turned off.
+ * tools/Makefile.am:
+ Use new conditional and $(JAR).
+
2008-06-26 Andrew John Hughes <gnu_andrew@member.fsf.org>
PR classpath/36636:
diff --git a/examples/Makefile.am b/examples/Makefile.am
index a5ad99921..409269b2e 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -84,6 +84,13 @@ dist-hook:
# To generate the example zip just depend on the sources and ignore the
# 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.
+
+if WITH_JAR
+CREATE_EXAMPLE_ZIP=$(JAR) cf ../$(EXAMPLE_ZIP) .
+else
+CREATE_EXAMPLE_ZIP=$(ZIP) -r ../$(EXAMPLE_ZIP) .
+endif
+
$(EXAMPLE_ZIP): $(EXAMPLE_JAVA_FILES)
@mkdir_p@ classes/gnu/classpath/examples/icons
cp $(EXAMPLE_ICONS) classes/gnu/classpath/examples/icons
@@ -91,8 +98,7 @@ $(EXAMPLE_ZIP): $(EXAMPLE_JAVA_FILES)
cp $(EXAMPLE_HTML) classes/gnu/classpath/examples/swing
$(JCOMPILER) -d classes $(EXAMPLE_JAVA_FILES)
(cd classes; \
- if test "$(ZIP)" != ""; then $(ZIP) -r ../$(EXAMPLE_ZIP) .; fi; \
- if test "$(FASTJAR)" != ""; then $(FASTJAR) cf ../$(EXAMPLE_ZIP) .; fi; \
+ $(CREATE_EXAMPLE_ZIP); \
cd ..)
rm -rf classes
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 888c65965..a29f6b5f1 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -13,18 +13,16 @@ JCOMPILER = $(JAVAC) $(JAVACFLAGS) $(JAVAC_MEM_OPT) -source 1.5 -target 1.5 -boo
if CREATE_COLLECTIONS
COLLECTIONS = collections.jar
+if WITH_JAR
+CREATE_COLLECTIONS_JAR=$(JAR) cf $@ $(COLLECTIONS_PREFIX)
+else
+CREATE_COLLECTIONS_JAR=$(ZIP) -r -D $@ $(COLLECTIONS_PREFIX) > /dev/null
+endif
+
collections.jar: mkcollections.pl
./mkcollections.pl $(top_srcdir)
-#if FOUND_GCJ
-# $(GCJ) -C `$(FIND) $(COLLECTIONS_PREFIX) -name '*.java' -type f -print`
-#else
$(JCOMPILER) `$(FIND) $(COLLECTIONS_PREFIX) -name '*.java' -type f -print`
-#endif
- if test "$(FASTJAR)" != ""; then \
- "$(FASTJAR)" cf $@ $(COLLECTIONS_PREFIX); \
- else \
- echo "fastjar not found" > collections.jar; \
- fi
+ $(CREATE_COLLECTIONS_JAR)
endif # CREATE_COLLECTIONS
if INSTALL_GLIBJ_ZIP
@@ -68,10 +66,14 @@ glibj.zip:
else
-glibj.zip: classes compile-classes resources
- if test "$(ZIP)" != ""; then $(ZIP) -r -D glibj.zip gnu java javax org sun META-INF > /dev/null; fi
- if test "$(FASTJAR)" != ""; then "$(FASTJAR)" cf glibj.zip gnu java javax org sun META-INF; fi
+if WITH_JAR
+CREATE_GLIBJ_ZIP=$(JAR) cf glibj.zip gnu java javax org sun META-INF
+else
+CREATE_GLIBJ_ZIP=$(ZIP) -r -D glibj.zip gnu java javax org sun META-INF > /dev/null
+endif
+glibj.zip: classes compile-classes resources
+ $(CREATE_GLIBJ_ZIP)
endif # USE_PREBUILT_GLIBJ_ZIP
resources: copy-vmresources.sh
diff --git a/m4/acinclude.m4 b/m4/acinclude.m4
index 1161f524c..7990e6360 100644
--- a/m4/acinclude.m4
+++ b/m4/acinclude.m4
@@ -55,18 +55,45 @@ dnl -----------------------------------------------------------
AC_DEFUN([CLASSPATH_WITH_GLIBJ],
[
AC_PATH_PROG(ZIP, zip)
- AC_ARG_WITH([fastjar],
- [AS_HELP_STRING([--with-fastjar=PATH], [define to use a fastjar style tool])],
+
+ AC_MSG_CHECKING(for a jar-like tool)
+ AC_ARG_WITH([jar],
+ [AS_HELP_STRING([--with-jar=PATH], [define to use a jar style tool])],
[
- AC_MSG_CHECKING([for user supplied fastjar])
- FASTJAR=${withval}
- AC_MSG_RESULT([${FASTJAR}])
- ],
- [AC_PATH_PROGS([FASTJAR], [fastjar gjar jar])])
-dnl We disable ZIP by default if we find fastjar.
- if test x"${FASTJAR}" != x; then
- ZIP=""
+ case "${withval}" in
+ yes)
+ JAR=yes
+ ;;
+ no)
+ JAR=no
+ AC_MSG_RESULT(${JAR})
+ ;;
+ *)
+ if test -f "${withval}"; then
+ JAR="${withval}"
+ AC_MSG_RESULT(${JAR})
+ else
+ AC_MSG_RESULT([not found])
+ AC_MSG_ERROR([The jar tool ${withval} was not found.])
+ fi
+ ;;
+ esac
+ ],
+ [
+ JAR=yes
+ ])
+ if test x"${JAR}" = "xyes"; then
+ AC_MSG_RESULT([trying fastjar, gjar and jar])
+ AC_PATH_PROGS([JAR], [fastjar gjar jar])
+ if test x"${RHINO_JAR}" = "xyes"; then
+ AC_MSG_RESULT([not found])
+ fi
+ fi
+ if test x"${JAR}" = "xno" && test x"${ZIP}" = ""; then
+ AC_MSG_ERROR([No zip or jar tool found.])
fi
+ AM_CONDITIONAL(WITH_JAR, test x"${JAR}" != "xno" && test x"${JAR}" != "xyes")
+ AC_SUBST(JAR)
AC_ARG_WITH([glibj],
[AS_HELP_STRING([--with-glibj],[define what to install (zip|flat|both|none|build) [default=zip]])],
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 1a86ce95c..0d57f50c3 100755
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -343,15 +343,22 @@ if CREATE_GJDOC
cp $(srcdir)/resource/gnu/classpath/tools/gjdoc/$$res classes/$$res; \
done
endif
+
+if WITH_JAR
+CREATE_TOOLS_ZIP=$(JAR) cf ../$(TOOLS_ZIP) .
+UPDATE_TOOLS_ZIP=$(JAR) uf ../$(TOOLS_ZIP) .
+else
+CREATE_TOOLS_ZIP=$(ZIP) -r ../$(TOOLS_ZIP) .
+UPDATE_TOOLS_ZIP=$(ZIP) -u -r ../$(TOOLS_ZIP) .
+endif
+
## First add classpath tools stuff.
(cd classes; \
- if test "$(ZIP)" != ""; then $(ZIP) -r ../$(TOOLS_ZIP) .; fi; \
- if test "$(FASTJAR)" != ""; then "$(FASTJAR)" cf ../$(TOOLS_ZIP) .; fi; \
+ $(CREATE_TOOLS_ZIP); \
cd ..)
## Now add ASM classes.
(cd asm; \
- if test "$(ZIP)" != ""; then $(ZIP) -u -r ../$(TOOLS_ZIP) .; fi; \
- if test "$(FASTJAR)" != ""; then "$(FASTJAR)" uf ../$(TOOLS_ZIP) .; fi; \
+ $(UPDATE_TOOLS_ZIP); \
cd ..)
rm -rf classes