changeset 1480:48c20674b2e4

built-time variables propaagted to rust lunchers * Makefile.am: preprocessing hardoced_paths.rs.in for each binary and creating libs * rust-launcher/launchers.rs: now uses new, future lib * rust-launcher/hardoced_paths.rs.in: source for all hardcoded libs we currently use
author Jiri Vanek <jvanek@redhat.com>
date Tue, 12 Dec 2017 15:09:45 +0100
parents 64ed9b72cfa0
children fa0d3ea23a8f
files ChangeLog Makefile.am rust-launcher/hardoced_paths.rs.in rust-launcher/launchers.rs
diffstat 4 files changed, 52 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Dec 12 14:58:51 2017 +0100
+++ b/ChangeLog	Tue Dec 12 15:09:45 2017 +0100
@@ -1,3 +1,9 @@
+2017-12-11  Jiri Vanek <jvanek at redhat.com>
+
+	* Makefile.am: preprocessing hardoced_paths.rs.in for each binary and creating libs
+	* rust-launcher/launchers.rs: now uses new, future lib
+	* rust-launcher/hardoced_paths.rs.in: source for all hardcoded libs we currently use
+
 2017-12-08  Jiri Vanek <jvanek at redhat.com>
 
 	Added possibility to turn off https preference via deployment properties
--- a/Makefile.am	Tue Dec 12 14:58:51 2017 +0100
+++ b/Makefile.am	Tue Dec 12 15:09:45 2017 +0100
@@ -874,17 +874,33 @@
 
 
 if ENABLE_NATIVE_LAUNCHERS
-launcher.build/$(javaws): rust-launcher/launchers.rs
-	mkdir -p launcher.build
-	$(RUSTC) -o $@ $<
+launcher.in/libhardoced_paths_$(javaws).rs: rust-launcher/hardoced_paths.rs.in
+	mkdir -p launcher.in
+	MAIN_CLASS=net.sourceforge.jnlp.runtime.Boot ;\
+	BIN_LOCATION=$(bindir)/$(javaws).sh ;\
+	PROGRAM_NAME=$(javaws) ;\
+	$(edit_launcher_script) < $< > $@
 
-launcher.build/$(itweb_settings): rust-launcher/launchers.rs
+launcher.in/libhardoced_paths_$(itweb_settings).rs: rust-launcher/hardoced_paths.rs.in
+	mkdir -p launcher.in
+	MAIN_CLASS=net.sourceforge.jnlp.controlpanel.CommandLine ;\
+	BIN_LOCATION=$(bindir)/$(itweb_settings).sh ;\
+	PROGRAM_NAME=$(itweb_settings) ;\
+	$(edit_launcher_script) < $< > $@
+
+launcher.in/libhardoced_paths_$(policyeditor).rs: rust-launcher/hardoced_paths.rs.in
+	mkdir -p launcher.in
+	MAIN_CLASS=net.sourceforge.jnlp.security.policyeditor.PolicyEditor ;\
+	BIN_LOCATION=$(bindir)/$(policyeditor).sh ;\
+	PROGRAM_NAME=$(policyeditor) ;\
+	$(edit_launcher_script) < $< > $@
+
+launcher.in/libhardoced_paths_$(javaws).rlib launcher.in/libhardoced_paths_$(itweb_settings).rlib launcher.in/libhardoced_paths_$(policyeditor).rlib: %.rlib: %.rs
+	$(RUSTC) --crate-type=lib -o $@ $<
+
+launcher.build/$(javaws) launcher.build/$(itweb_settings) launcher.build/$(policyeditor): launcher.build/%: launcher.in/libhardoced_paths_%.rlib rust-launcher/launchers.rs
 	mkdir -p launcher.build
-	$(RUSTC) -o $@ $<
-
-launcher.build/$(policyeditor): rust-launcher/launchers.rs
-	mkdir -p launcher.build
-	$(RUSTC) -o $@ $<
+	$(RUSTC) --extern hardcoded_paths=$< -o $@ rust-launcher/launchers.rs
 endif
 
 if ENABLE_SHELL_LAUNCHERS
@@ -942,6 +958,7 @@
 	rm -f launcher.build/$(javaws)
 	rm -f launcher.build/$(itweb_settings)
 	rm -f launcher.build/$(policyeditor)
+	rm -f launcher.in
 endif
 if ENABLE_SHELL_LAUNCHERS
 	rm -f launcher.build/$(javaws).sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rust-launcher/hardoced_paths.rs.in	Tue Dec 12 15:09:45 2017 +0100
@@ -0,0 +1,13 @@
+/*legacy variables*/
+pub static PROGRAM_NAME: &'static str = "@PROGRAM_NAME@";
+pub static LAUNCHER_BOOTCLASSPATH: &'static str = "@LAUNCHER_BOOTCLASSPATH@";
+pub static JAVAWS_SPLASH_LOCATION: &'static str = "@JAVAWS_SPLASH_LOCATION@";
+pub static JAVA: &'static str = "@JAVA@";
+pub static JRE: &'static str = "@JRE@";
+pub static MAIN_CLASS: &'static str = "@MAIN_CLASS@";
+pub static BIN_LOCATION: &'static str = "@BIN_LOCATION@";
+pub static NETX_JAR: &'static str = "@NETX_JAR@";
+pub static PLUGIN_JAR: &'static str = "@PLUGIN_JAR@";
+pub static JSOBJECT_JAR: &'static str = "@JSOBJECT_JAR@";
+
+/*new variables*/
--- a/rust-launcher/launchers.rs	Tue Dec 12 14:58:51 2017 +0100
+++ b/rust-launcher/launchers.rs	Tue Dec 12 15:09:45 2017 +0100
@@ -1,3 +1,9 @@
+/*extern crate hardcoded_paths;*/
+extern crate hardcoded_paths;
+
 fn main() {
-    println!("Hello, world!");
+    println!("{}",hardcoded_paths::PROGRAM_NAME);
+    println!("{}",hardcoded_paths::MAIN_CLASS);
+    println!("{}",hardcoded_paths::JAVA);
+    println!("{}",hardcoded_paths::JRE);
 }