changeset 155:07924a054c63

Use autoconf to generate build.properties and jrunscript 2011-03-07 Omair Majid <omajid@redhat.com> * acinclude.m4 (IT_FIND_RHINO_JAR): Set RHINO_AVAILABLE to true or false appropriately. * build.properties.in: New file. * jrunscript.in: New file. * configure.ac: Add build.properties and jrunscript to AC_CONFIG_FILES. * Makefile.am (.PHONY): Remove clean-jrunscript. (build.properties): Remove target. (stamps/netx.stamp): Remove dependency on build.properties. (clean-netx): Do not delete build.properties. (jrunscript): Remove target. (check-pac-functions): Remove dependency on jrunscript. (clean-tests): Remove dependency on clean-jrunscript. (clean-jrunscript): Remove target.
author Omair Majid <omajid@redhat.com>
date Mon, 07 Mar 2011 17:09:22 -0500
parents 2446ec028f75
children 9a504cfa4f64
files ChangeLog Makefile.am acinclude.m4 build.properties.in configure.ac jrunscript.in
diffstat 6 files changed, 40 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Mar 07 14:48:01 2011 -0500
+++ b/ChangeLog	Mon Mar 07 17:09:22 2011 -0500
@@ -1,3 +1,20 @@
+2011-03-07  Omair Majid  <omajid@redhat.com>
+
+	* acinclude.m4 (IT_FIND_RHINO_JAR): Set RHINO_AVAILABLE to true or false
+	appropriately.
+	* build.properties.in: New file.
+	* jrunscript.in: New file.
+	* configure.ac: Add build.properties and jrunscript to AC_CONFIG_FILES.
+	* Makefile.am
+	(.PHONY): Remove clean-jrunscript.
+	(build.properties): Remove target.
+	(stamps/netx.stamp): Remove dependency on build.properties.
+	(clean-netx): Do not delete build.properties.
+	(jrunscript): Remove target.
+	(check-pac-functions): Remove dependency on jrunscript.
+	(clean-tests): Remove dependency on clean-jrunscript.
+	(clean-jrunscript): Remove target.
+
 2011-03-07  Omair Majid  <omajid@redhat.com>
 
 	* NEWS: Update.
--- a/Makefile.am	Mon Mar 07 14:48:01 2011 -0500
+++ b/Makefile.am	Mon Mar 07 17:09:22 2011 -0500
@@ -105,7 +105,7 @@
 
 .PHONY: clean-IcedTeaPlugin clean-add-netx clean-add-netx-debug clean-add-plugin clean-add-plugin-debug \
  clean-bootstrap-directory clean-native-ecj clean-desktop-files clean-netx-docs clean-docs clean-plugin-docs \
- clean-tests clean-jrunscript check-local
+ clean-tests check-local
 
 install-exec-local:
 	${mkinstalldirs} $(DESTDIR)$(bindir) $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/ $(DESTDIR)$(libdir)
@@ -255,16 +255,7 @@
 	sed -i '/RhinoBasedPacEvaluator/ d' $@
 endif
 
-build.properties:
-	echo "# This contains build-time settings " > $@
-if WITH_RHINO
-	echo "rhino.available=true" >> $@
-else
-	echo "rhino.available=false" >> $@
-endif
-
-stamps/netx.stamp: netx-source-files.txt stamps/bootstrap-directory.stamp \
- build.properties
+stamps/netx.stamp: netx-source-files.txt stamps/bootstrap-directory.stamp
 	mkdir -p $(NETX_DIR)
 	$(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \
 	    -d $(NETX_DIR) \
@@ -297,7 +288,6 @@
 
 clean-netx:
 	rm -rf $(NETX_DIR)
-	rm -f build.properties
 	rm -f stamps/netx-dist.stamp
 	rm -f netx-source-files.txt
 	rm -f stamps/netx.stamp
@@ -406,23 +396,11 @@
 # check
 # ==========================
 
-jrunscript:
-if WITH_RHINO
-	echo '$(BOOT_DIR)/bin/java -cp $(RHINO_JAR) org.mozilla.javascript.tools.shell.Main $$@' > jrunscript
-	chmod u+x jrunscript
-else
-	echo "jrunscript requires rhino support"
-	exit 1
-endif
-
-check-pac-functions: stamps/bootstrap-directory.stamp jrunscript
+check-pac-functions: stamps/bootstrap-directory.stamp
 	./jrunscript $(abs_top_srcdir)/tests/netx/pac/pac-funcs-test.js \
 	  $$(readlink -f $(abs_top_srcdir)/netx/net/sourceforge/jnlp/runtime/pac-funcs.js)
 
-clean-tests: clean-jrunscript
-
-clean-jrunscript:
-	rm -f jrunscript
+clean-tests:
 
 # plugin tests
 
--- a/acinclude.m4	Mon Mar 07 14:48:01 2011 -0500
+++ b/acinclude.m4	Mon Mar 07 17:09:22 2011 -0500
@@ -297,7 +297,13 @@
   if test x"${RHINO_JAR}" = "xno"; then
     RHINO_JAR=
   fi
+  if test -n ${RHINO_JAR} ; then
+    RHINO_AVAILABLE=true
+  else
+    RHINO_AVAILABLE=false
+  fi
   AC_SUBST(RHINO_JAR)
+  AC_SUBST(RHINO_AVAILABLE)
 ])
 
 AC_DEFUN_ONCE([IT_CHECK_PLUGIN],
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build.properties.in	Mon Mar 07 17:09:22 2011 -0500
@@ -0,0 +1,2 @@
+# build-time settings
+rhino.available=@RHINO_AVAILABLE@
--- a/configure.ac	Mon Mar 07 14:48:01 2011 -0500
+++ b/configure.ac	Mon Mar 07 17:09:22 2011 -0500
@@ -80,4 +80,7 @@
 IT_CHECK_FOR_CLASS(SUN_APPLET_APPLETIMAGEREF, [sun.applet.AppletImageRef])
 IT_CHECK_FOR_APPLETVIEWERPANEL_HOLE
 
+AC_CONFIG_FILES([jrunscript], [chmod u+x jrunscript])
+AC_CONFIG_FILES([build.properties])
+
 AC_OUTPUT
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jrunscript.in	Mon Mar 07 17:09:22 2011 -0500
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+if [ x"@RHINO_JAR@" == x ] ; then
+  echo "jrunscript requires rhino support"
+  exit 1
+fi
+
+@JAVA@ -cp "@RHINO_JAR@" org.mozilla.javascript.tools.shell.Main $@