--- classpath-0.91-pre/m4/acinclude.m4.orig 2006-04-19 05:28:00.000000000 +0200 +++ classpath-0.91-pre/m4/acinclude.m4 2006-04-19 07:00:18.000000000 +0200 @@ -314,7 +314,11 @@ if test x"${FASTJAR}" != x; then ZIP="" fi - + if test "x${FASTJAR}" = x && test "x${ZIP}" = x; then + have_zip=no + else + have_zip=yes + fi AC_ARG_WITH([glibj], [AS_HELP_STRING([--with-glibj],[define what to install (zip|flat|both|none|build) [default=zip]])], [ @@ -346,22 +350,40 @@ install_class_files=no use_zip=yes ]) + if test "x${use_zip}" = xyes && test "x${have_zip}" = xno; then + AC_MSG_ERROR([zip or fastjar required]) + fi AM_CONDITIONAL(INSTALL_GLIBJ_ZIP, test "x${use_zip}" = xyes) AM_CONDITIONAL(INSTALL_CLASS_FILES, test "x${install_class_files}" = xyes) AM_CONDITIONAL(BUILD_CLASS_FILES, test "x${build_class_files}" = xyes) AC_ARG_ENABLE([examples], - [AS_HELP_STRING(--enable-examples,enable build of the examples [default=yes])], + [AS_HELP_STRING(--enable-examples,enable build and install of examples [default=yes])], [case "${enableval}" in yes) EXAMPLESDIR="examples" ;; no) EXAMPLESDIR="" ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-examples) ;; esac], [EXAMPLESDIR="examples"]) - if test "x${use_zip}" = xno && test "x${install_class_files}" = xno; then - EXAMPLESDIR="" + AC_MSG_CHECKING([whether to enable examples]) + if test "x${EXAMPLESDIR}" != x; then + AC_MSG_RESULT([yes]) + if test "x${use_zip}" = xno && test "x${install_class_files}" = xno; then + AC_MSG_WARN([disabling examples because --enable-examples is incompatible with --with-glibj=no]) + EXAMPLESDIR="" + fi + else + AC_MSG_RESULT([no]) fi AC_SUBST(EXAMPLESDIR) + if test "x${have_zip}" = xno; then + AC_MSG_WARN([examples.zip will not be built because neither zip nor fastjar could be found]) + EXAMPLE_ZIP="" + else + EXAMPLE_ZIP="examples.zip" + fi + AC_SUBST(EXAMPLE_ZIP) + AM_CONDITIONAL(BUILD_EXAMPLE_ZIP, test "x${EXAMPLE_ZIP}" != x) ]) dnl ----------------------------------------------------------- --- classpath-0.91-pre/examples/Makefile.am.orig 2006-04-19 05:37:20.000000000 +0200 +++ classpath-0.91-pre/examples/Makefile.am 2006-04-19 06:35:50.000000000 +0200 @@ -27,11 +27,14 @@ EXAMPLE_C_FILES = $(srcdir)/gnu/classpath/examples/*/*.c # The zip files with classes we want to produce. -EXAMPLE_ZIP = examples.zip +EXAMPLE_ZIP = @EXAMPLE_ZIP@ # Extra objects that will not exist until configure-time BUILT_SOURCES = $(EXAMPLE_ZIP) +# Files to clean +CLEANFILES = $(EXAMPLE_ZIP) + # the png icons we use in some of the examples. EXAMPLE_ICONS = $(srcdir)/gnu/classpath/examples/icons/*.png @@ -89,6 +92,7 @@ cp -p $$file $(distdir)/$$f; \ done +if BUILD_EXAMPLE_ZIP # 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. @@ -101,7 +105,8 @@ if test "$(FASTJAR)" != ""; then $(FASTJAR) cf ../$(EXAMPLE_ZIP) .; fi; \ cd ..) rm -rf classes +endif -# Zip file be gone! (and make sure the classes are gone too) +# Make sure that the classes are gone clean-local: - rm -rf $(EXAMPLE_ZIP) classes + rm -rf classes