Line 0
Link Here
|
|
|
1 |
diff --git a/Configure.pl b/Configure.pl |
2 |
index 2064ac8..73e2d27 100755 |
3 |
--- a/Configure.pl |
4 |
+++ b/Configure.pl |
5 |
@@ -34,6 +34,7 @@ MAIN: { |
6 |
'no-clean', |
7 |
'with-parrot=s', 'gen-parrot:s', 'parrot-config=s', 'parrot-option=s@', |
8 |
'with-moar=s', 'gen-moar:s', 'moar-option=s@', |
9 |
+ 'with-asm=s', 'with-asm-tree=s', 'with-jline=s', 'with-jna=s', |
10 |
'make-install!', 'makefile-timing!', |
11 |
'git-protocol=s', |
12 |
'git-depth=s', 'git-reference=s',); |
13 |
@@ -50,6 +51,53 @@ MAIN: { |
14 |
"Use --prefix to specify a directory in which parrot is installed."; |
15 |
} |
16 |
|
17 |
+ if ($options{'with-asm'}) { |
18 |
+ if ($options{'with-asm'} ne '-') { |
19 |
+ $config{'asm'} = $options{'with-asm'}; |
20 |
+ } |
21 |
+ } else { |
22 |
+ $config{'asm'} = "3rdparty/asm/asm-4.1.jar"; |
23 |
+ } |
24 |
+ if ($options{'with-asm-tree'}) { |
25 |
+ if ($options{'with-asm-tree'} ne '-') { |
26 |
+ $config{'asmtree'} = $options{'with-asm-tree'}; |
27 |
+ } |
28 |
+ } else { |
29 |
+ $config{'asmtree'} = "3rdparty/asm/asm-tree-4.1.jar"; |
30 |
+ } |
31 |
+ if ($options{'with-jline'}) { |
32 |
+ if ($options{'with-jline'} ne '-') { |
33 |
+ $config{'jline'} = $options{'with-jline'}; |
34 |
+ } |
35 |
+ } else { |
36 |
+ $config{'jline'} = "3rdparty/jline/jline-1.0.jar"; |
37 |
+ } |
38 |
+ if ($options{'with-jna'}) { |
39 |
+ if ($options{'with-jna'} ne '-') { |
40 |
+ $config{'jna'} = $options{'with-jna'}; |
41 |
+ } |
42 |
+ } else { |
43 |
+ $config{'jna'} = "3rdparty/jna/jna.jar"; |
44 |
+ } |
45 |
+ |
46 |
+ if ($^O eq 'MSWin32') { |
47 |
+ $config{'asmfile'} = $config{'asm'}; |
48 |
+ $config{'asmfile'} =~ s/.*\\//; |
49 |
+ $config{'jlinefile'} = $config{'jline'}; |
50 |
+ $config{'jlinefile'} =~ s/.*\\//; |
51 |
+ } else { |
52 |
+ $config{'asmfile'} = $config{'asm'}; |
53 |
+ $config{'asmfile'} =~ s/.*\///; |
54 |
+ $config{'jlinefile'} = $config{'jline'}; |
55 |
+ $config{'jlinefile'} =~ s/.*\///; |
56 |
+ } |
57 |
+ |
58 |
+ fill_template_file( |
59 |
+ 'tools/build/install-jvm-runner.pl.in', |
60 |
+ 'tools/build/install-jvm-runner.pl', |
61 |
+ %config, |
62 |
+ ); |
63 |
+ |
64 |
my $default_backend; |
65 |
my @backends; |
66 |
my %backends; |
67 |
@@ -357,6 +405,11 @@ General Options: |
68 |
--gen-moar Download and build a copy of MoarVM to use |
69 |
--moar-option='--option=value' |
70 |
Options to pass to MoarVM configuration for --gen-moar |
71 |
+ --with-asm='/path/to/jar' |
72 |
+ --with-asm-tree='/path/to/jar' |
73 |
+ --with-jline='/path/to/jar' |
74 |
+ --with-jna='/path/to/jar' |
75 |
+ Provide paths to already installed jars |
76 |
--git-protocol={ssh,https,git} |
77 |
Protocol to use for git clone. Default: https |
78 |
--make-install Immediately run `MAKE install` after configuring |
79 |
diff --git a/tools/build/Makefile-JVM.in b/tools/build/Makefile-JVM.in |
80 |
index 27959ad..c19965a 100644 |
81 |
--- a/tools/build/Makefile-JVM.in |
82 |
+++ b/tools/build/Makefile-JVM.in |
83 |
@@ -2,7 +2,6 @@ BAT = @bat@ |
84 |
JAVA = java |
85 |
JAVAC = javac |
86 |
JAR = jar |
87 |
-ASM = 3rdparty/asm/ |
88 |
J_RUNNER = nqp-j$(BAT) |
89 |
|
90 |
NQP_JAR_DIR = $(NQP_LANG_DIR)/runtime |
91 |
@@ -18,7 +17,11 @@ RUNTIME_JAVAS = \ |
92 |
|
93 |
RUNTIME_JAR = nqp-runtime.jar |
94 |
|
95 |
-THIRDPARTY_JARS = $(ASM)asm-4.1.jar@cpsep@$(ASM)asm-tree-4.1.jar@cpsep@3rdparty/jline/jline-1.0.jar@cpsep@3rdparty/jna/jna.jar |
96 |
+ASM = @asm@ |
97 |
+ASMTREE = @asmtree@ |
98 |
+JLINE = @jline@ |
99 |
+JNA = @jna@ |
100 |
+THIRDPARTY_JARS = $(ASM)@cpsep@$(ASMTREE)@cpsep@$(JLINE)@cpsep@$(JNA) |
101 |
J_STAGE0 = src/vm/jvm/stage0 |
102 |
J_STAGE1 = $(JVM_BUILD_DIR)/stage1 |
103 |
J_STAGE2 = $(JVM_BUILD_DIR)/stage2 |
104 |
@@ -80,8 +83,8 @@ j-install: j-all |
105 |
$(MKPATH) $(DESTDIR)$(BIN_DIR) |
106 |
$(MKPATH) $(DESTDIR)$(NQP_JAR_DIR) |
107 |
$(MKPATH) $(DESTDIR)$(NQP_LIB_DIR) |
108 |
- $(CP) 3rdparty/asm/asm-4.1.jar 3rdparty/asm/asm-tree-4.1.jar $(DESTDIR)$(NQP_JAR_DIR) |
109 |
- $(CP) 3rdparty/jline/jline-1.0.jar 3rdparty/jna/jna.jar $(DESTDIR)$(NQP_JAR_DIR) |
110 |
+ $(CP) $(ASM) $(ASMTREE) $(DESTDIR)$(NQP_JAR_DIR) |
111 |
+ $(CP) $(JLINE) $(JNA) $(DESTDIR)$(NQP_JAR_DIR) |
112 |
$(CP) $(RUNTIME_JAR) $(DESTDIR)$(NQP_JAR_DIR) |
113 |
$(CP) $(NQP_MO_JAR) $(MODULE_LOADER_JAR) $(DESTDIR)$(NQP_LIB_DIR) |
114 |
$(CP) $(CORE_SETTING_JAR) $(QASTNODE_JAR) $(QREGEX_JAR) $(DESTDIR)$(NQP_LIB_DIR) |
115 |
diff --git a/tools/build/install-jvm-runner.pl b/tools/build/install-jvm-runner.pl |
116 |
deleted file mode 100644 |
117 |
index 14541d6..0000000 |
118 |
--- a/tools/build/install-jvm-runner.pl |
119 |
+++ /dev/null |
120 |
@@ -1,44 +0,0 @@ |
121 |
-#!/usr/bin/perl |
122 |
-# Copyright (C) 2013, The Perl Foundation. |
123 |
- |
124 |
-use strict; |
125 |
-use warnings; |
126 |
-use 5.008; |
127 |
-use File::Spec; |
128 |
- |
129 |
-my ($destdir, $prefix) = @ARGV; |
130 |
-my $realpath = $destdir.$prefix; |
131 |
- |
132 |
-unless (File::Spec->file_name_is_absolute($prefix)) { |
133 |
- $prefix = File::Spec->rel2abs($prefix); |
134 |
-} |
135 |
- |
136 |
-if ($^O eq 'MSWin32') { |
137 |
- my $jar_dir = File::Spec->catfile($prefix, 'share', 'nqp', 'runtime'); |
138 |
- my $lib_dir = File::Spec->catfile($prefix, 'share', 'nqp', 'lib'); |
139 |
- my $install_to = File::Spec->catfile($realpath, 'bin', 'nqp-j.bat'); |
140 |
- |
141 |
- open my $fh, ">", $install_to |
142 |
- or die "Could not open $install_to: $!"; |
143 |
- print $fh '@java -Xss1m -Xmx512m -Xbootclasspath/a:' . $jar_dir . '\\nqp-runtime.jar;' . |
144 |
- "$jar_dir\\asm-4.1.jar;$jar_dir\\jline-1.0.jar;$lib_dir\\nqp.jar -cp $lib_dir nqp %*\n"; |
145 |
- close $fh |
146 |
- or die "Could not close $install_to: $!"; |
147 |
-} |
148 |
-else { |
149 |
- my $nqp_dir = File::Spec->catfile($prefix, qw/share nqp/); |
150 |
- my $jar_dir = File::Spec->catfile('${NQP_DIR}', 'runtime'); |
151 |
- my $lib_dir = File::Spec->catfile('${NQP_DIR}', 'lib'); |
152 |
- my $jars = "$jar_dir/nqp-runtime.jar:$jar_dir/asm-4.1.jar:$jar_dir/jline-1.0.jar:$lib_dir/nqp.jar"; |
153 |
- my $install_to = File::Spec->catfile($realpath, 'bin', 'nqp-j'); |
154 |
- |
155 |
- open my $fh, ">", $install_to |
156 |
- or die "Could not open $install_to: $!"; |
157 |
- print $fh "#!/bin/sh\n"; |
158 |
- print $fh ": \${NQP_DIR:=\"$nqp_dir\"}\n"; |
159 |
- print $fh ": \${NQP_JARS:=\"$jars\"}\n"; |
160 |
- print $fh "exec java -Xss1m -Xmx512m -Xbootclasspath/a:\${NQP_JARS} -cp $lib_dir nqp \"\$\@\"\n"; |
161 |
- close $fh |
162 |
- or die "Could not close $install_to: $!"; |
163 |
- chmod 0755, $install_to; |
164 |
-} |
165 |
diff --git a/tools/build/install-jvm-runner.pl.in b/tools/build/install-jvm-runner.pl.in |
166 |
new file mode 100644 |
167 |
index 0000000..92a1109 |
168 |
--- /dev/null |
169 |
+++ b/tools/build/install-jvm-runner.pl.in |
170 |
@@ -0,0 +1,44 @@ |
171 |
+#!/usr/bin/perl |
172 |
+# Copyright (C) 2013, The Perl Foundation. |
173 |
+ |
174 |
+use strict; |
175 |
+use warnings; |
176 |
+use 5.008; |
177 |
+use File::Spec; |
178 |
+ |
179 |
+my ($destdir, $prefix) = @ARGV; |
180 |
+my $realpath = $destdir.$prefix; |
181 |
+ |
182 |
+unless (File::Spec->file_name_is_absolute($prefix)) { |
183 |
+ $prefix = File::Spec->rel2abs($prefix); |
184 |
+} |
185 |
+ |
186 |
+if ($^O eq 'MSWin32') { |
187 |
+ my $jar_dir = File::Spec->catfile($prefix, 'share', 'nqp', 'runtime'); |
188 |
+ my $lib_dir = File::Spec->catfile($prefix, 'share', 'nqp', 'lib'); |
189 |
+ my $install_to = File::Spec->catfile($realpath, 'bin', 'nqp-j.bat'); |
190 |
+ |
191 |
+ open my $fh, ">", $install_to |
192 |
+ or die "Could not open $install_to: $!"; |
193 |
+ print $fh '@java -Xss1m -Xmx512m -Xbootclasspath/a:' . $jar_dir . '\\nqp-runtime.jar;' . |
194 |
+ "$jar_dir\\@asmfile@;$jar_dir\\@jlinefile@;$lib_dir\\nqp.jar -cp $lib_dir nqp %*\n"; |
195 |
+ close $fh |
196 |
+ or die "Could not close $install_to: $!"; |
197 |
+} |
198 |
+else { |
199 |
+ my $nqp_dir = File::Spec->catfile($prefix, qw/share nqp/); |
200 |
+ my $jar_dir = File::Spec->catfile('${NQP_DIR}', 'runtime'); |
201 |
+ my $lib_dir = File::Spec->catfile('${NQP_DIR}', 'lib'); |
202 |
+ my $jars = "$jar_dir/nqp-runtime.jar:$jar_dir/@asmfile@:$jar_dir/@jlinefile@:$lib_dir/nqp.jar"; |
203 |
+ my $install_to = File::Spec->catfile($realpath, 'bin', 'nqp-j'); |
204 |
+ |
205 |
+ open my $fh, ">", $install_to |
206 |
+ or die "Could not open $install_to: $!"; |
207 |
+ print $fh "#!/bin/sh\n"; |
208 |
+ print $fh ": \${NQP_DIR:=\"$nqp_dir\"}\n"; |
209 |
+ print $fh ": \${NQP_JARS:=\"$jars\"}\n"; |
210 |
+ print $fh "exec java -Xss1m -Xmx512m -Xbootclasspath/a:\${NQP_JARS} -cp $lib_dir nqp \"\$\@\"\n"; |
211 |
+ close $fh |
212 |
+ or die "Could not close $install_to: $!"; |
213 |
+ chmod 0755, $install_to; |
214 |
+} |