* [PATCH]: Add GCJ
@ 2015-01-23 10:46 Ricardo Wurmus
2015-01-23 21:09 ` Ludovic Courtès
0 siblings, 1 reply; 4+ messages in thread
From: Ricardo Wurmus @ 2015-01-23 10:46 UTC (permalink / raw
To: Guix-devel
[-- Attachment #1: Type: text/plain, Size: 1044 bytes --]
Hi Guix,
this patch adds the GNU Compiler for Java to the gcc module. We need
GCJ to build IcedTea6 / OpenJDK, which in turn could be used to build
IcedTea7.
GCJ unfortunately has a binary dependency, the Eclipse Compiler for
Java. GCJ expects to be given the path of the ecj.jar at compile time.
ECJ is provided as ecj-bootstrap-4.8. I don't know if GCJ is built such
that this ECJ binary is no longer required at the end (but I know that
IcedTea6 also needs the ECJ jar). For IcedTea6 we could compile ECJ
from source with GCJ, but I don't know how to deal with GCJ's dependency
on ECJ. Having it depend on a binary is ugly.
GCJ is built with options to create symlinks to function as a primitive
JDK. It does not provide wrappers for javap and javac, so these are
added in an extra phase. I took the javac perl wrapper from Gentoo, but
I suppose a script in Guile might be nicer (there is no official
upstream source for the wrapper script, so we might as well roll our
own).
Anyway, your comments are very welcome.
-- Ricardo
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-GCJ.patch --]
[-- Type: text/x-patch, Size: 7870 bytes --]
From 56f43a9042853aca79f60808a51d328dfbe420a3 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Date: Tue, 23 Dec 2014 12:31:50 +0100
Subject: [PATCH] gnu: Add GCJ
* gnu/packages/gcc.scm (gcj-4.8, ecj-bootstrap-4.8): New variable.
* gnu/packages/javac.in: New file.
---
gnu/packages/gcc.scm | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++-
gnu/packages/javac.in | 61 ++++++++++++++++++++++++++++++++
2 files changed, 156 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/javac.in
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 276b986..67308bc 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -19,16 +19,18 @@
(define-module (gnu packages gcc)
#:use-module ((guix licenses)
- #:select (gpl3+ gpl2+ lgpl2.1+ lgpl2.0+))
+ #:select (epl1.0 gpl3+ gpl2+ lgpl2.1+ lgpl2.0+))
#:use-module (gnu packages)
#:use-module (gnu packages bootstrap)
#:use-module (gnu packages compression)
#:use-module (gnu packages multiprecision)
#:use-module (gnu packages texinfo)
#:use-module (gnu packages elf)
+ #:use-module ((gnu packages perl) #:select (perl))
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system gnu)
+ #:use-module (guix build-system trivial)
#:use-module (guix utils)
#:use-module (ice-9 regex))
@@ -336,6 +338,98 @@ Go. It also includes runtime support libraries for these languages.")
;; a cyclic dependency. <http://debbugs.gnu.org/18101>
#:separate-lib-output? #f))
+(define-public gcj-4.8
+ (package (inherit gcc-4.8)
+ (name "gcj")
+ (inputs
+ (append (package-inputs gcc-4.8)
+ `(("fastjar" ,fastjar)
+ ("perl" ,perl)
+ ("javac.in" ,(search-path %load-path
+ "gnu/packages/javac.in"))
+ ("ecj-bootstrap" ,ecj-bootstrap-4.8))))
+ ;; Suppress the separate "lib" output, because otherwise the
+ ;; "lib" and "out" outputs would refer to each other, creating
+ ;; a cyclic dependency. <http://debbugs.gnu.org/18101>
+ (outputs
+ (delete "lib" (package-outputs gcc-4.8)))
+ (arguments
+ (substitute-keyword-arguments `(#:modules ((guix build gnu-build-system)
+ (guix build utils)
+ (ice-9 regex)
+ (srfi srfi-1)
+ (srfi srfi-26))
+ ,@(package-arguments gcc-4.8))
+ ((#:configure-flags flags)
+ `(let ((ecj (string-append (assoc-ref %build-inputs "ecj-bootstrap")
+ "/share/java/ecj.jar")))
+ (append (list "--enable-java-home"
+ "--enable-gjdoc"
+ (string-append "--with-ecj-jar=" ecj))
+ (cons "--enable-languages=java"
+ (remove (cut string-match "--enable-languages.*" <>)
+ ,flags)))))
+ ((#:phases phases)
+ `(alist-cons-after
+ 'install 'install-javac-and-javap-wrappers
+ (lambda _
+ (let* ((javac (assoc-ref %build-inputs "javac.in"))
+ (ecj (assoc-ref %build-inputs "ecj-bootstrap"))
+ (gcj (assoc-ref %outputs "out"))
+ (gcjbin (string-append gcj "/bin/"))
+ (jvm (string-append gcj "/lib/jvm/"))
+ (target (string-append jvm "/bin/javac")))
+
+ (symlink (string-append gcjbin "jcf-dump")
+ (string-append jvm "/bin/javap"))
+
+ ;; Create javac wrapper from the template javac.in by
+ ;; replacing the @VARIABLES@ with paths.
+ (copy-file javac target)
+ (patch-shebang target)
+ (substitute* target
+ (("@JAVA@")
+ (string-append jvm "/bin/java"))
+ (("@ECJ_JAR@")
+ (string-append ecj "/share/java/ecj.jar"))
+ (("@RT_JAR@")
+ (string-append jvm "/jre/lib/rt.jar"))
+ (("@TOOLS_JAR@")
+ (string-append jvm "/lib/tools.jar")))
+ (chmod target #o755)
+ #t))
+ ,phases))))))
+
+(define-public ecj-bootstrap-4.8
+ (package
+ (name "ecj-bootstrap")
+ (version "4.8")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "ftp://sourceware.org/pub/java/ecj-" version ".jar"))
+ (sha256
+ (base32
+ "10fpqfbdzff1zcbxzh66xc8xbij9saykcj4xzm19wk9p3n7i5zcq"))))
+ (build-system trivial-build-system)
+ (arguments
+ `(#:modules ((guix build utils))
+ #:builder (begin
+ (use-modules (guix build utils))
+ (let* ((source (assoc-ref %build-inputs "source"))
+ (output (assoc-ref %outputs "out"))
+ (javadir (string-append output "/share/java")))
+ (begin
+ (mkdir-p javadir)
+ (copy-file source
+ (string-append javadir "/ecj.jar"))
+ #t)))))
+ (home-page "http://www.eclipse.org")
+ (synopsis "Eclipse Java bytecode compiler")
+ (description
+ "ECJ is the Java bytecode compiler of the Eclipse Platform. It is also
+known as the JDT Core batch compiler.")
+ (license epl1.0)))
+
(define-public gcc-objc-4.8
(custom-gcc gcc-4.8 "gcc-objc" '("objc")))
diff --git a/gnu/packages/javac.in b/gnu/packages/javac.in
new file mode 100644
index 0000000..adb4dc1
--- /dev/null
+++ b/gnu/packages/javac.in
@@ -0,0 +1,61 @@
+#!/usr/bin/perl -w
+
+# Taken from Gentoo:
+# http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-java/gcj-jdk/files/javac.in
+
+use strict;
+use constant NO_DUP_ARGS => qw(-source -target -d -encoding);
+use constant STRIP_ARGS => qw(-Werror -implicit:none -J-Xbootclasspath/p:);
+
+my $ECJ_WARNINGS="-nowarn";
+
+my ( @bcoption, @source15, @target15, @cp );
+push @bcoption, '-bootclasspath', '@RT_JAR@:@TOOLS_JAR@'
+ unless grep {$_ eq '-bootclasspath'} @ARGV;
+push @source15, '-source', '1.5'
+ unless grep {$_ eq '-source'} @ARGV;
+push @target15, '-target', '1.5'
+ unless grep {$_ eq '-target'} @ARGV;
+push @cp, '-cp', '.'
+ unless grep {$_ =~ '\-c(p|lasspath)'} @ARGV or $ENV{CLASSPATH};
+my @ecj_parms = ($ECJ_WARNINGS, @bcoption, @source15, @target15, @cp);
+
+# Work around ecj's inability to handle duplicate command-line
+# options and unknown javac options.
+sub gen_ecj_opts
+{
+ my @new_args = @{$_[0]};
+
+ for my $opt (NO_DUP_ARGS)
+ {
+ my @indices = reverse grep {$new_args[$_] eq $opt} 0..$#new_args;
+ if (@indices > 1) {
+ shift @indices; # keep last instance only
+ splice @new_args, $_, 2 for @indices;
+ }
+ }
+
+ for my $opt (STRIP_ARGS)
+ {
+ my @indices = reverse grep {$new_args[$_] eq $opt} 0..$#new_args;
+ splice @new_args, $_, 1 for @indices;
+ }
+
+ return \@new_args;
+}
+
+sub split_vm_args
+{
+ my @new_args = @{$_[0]};
+
+ my @vm_args = map { substr $_, 2 } grep $_ =~ /^-J/, @new_args;
+ my @javac_args = grep $_ !~ /^-J/, @new_args;
+
+ return (\@vm_args, \@javac_args);
+}
+
+my ($vm_args, $javac_args) = split_vm_args (gen_ecj_opts( \@ARGV ));
+my @CLASSPATH = ('@ECJ_JAR@');
+push @CLASSPATH, split /:/, $ENV{"CLASSPATH"} if exists $ENV{"CLASSPATH"};
+$ENV{"CLASSPATH"} = join ':', @CLASSPATH;
+exec '@JAVA@', @$vm_args, 'org.eclipse.jdt.internal.compiler.batch.Main', @ecj_parms, @$javac_args;
--
1.9.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH]: Add GCJ
2015-01-23 10:46 [PATCH]: Add GCJ Ricardo Wurmus
@ 2015-01-23 21:09 ` Ludovic Courtès
2015-01-26 12:57 ` Ricardo Wurmus
0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2015-01-23 21:09 UTC (permalink / raw
To: Ricardo Wurmus; +Cc: Guix-devel
Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> skribis:
> this patch adds the GNU Compiler for Java to the gcc module. We need
> GCJ to build IcedTea6 / OpenJDK, which in turn could be used to build
> IcedTea7.
Nice!
> GCJ unfortunately has a binary dependency, the Eclipse Compiler for
> Java. GCJ expects to be given the path of the ecj.jar at compile time.
> ECJ is provided as ecj-bootstrap-4.8. I don't know if GCJ is built such
> that this ECJ binary is no longer required at the end (but I know that
> IcedTea6 also needs the ECJ jar). For IcedTea6 we could compile ECJ
> from source with GCJ, but I don't know how to deal with GCJ's dependency
> on ECJ. Having it depend on a binary is ugly.
Well it’s a bootstrapping issue–same problem as for GHC, MIT/GNU Scheme,
or the whole distro actually. I wouldn’t be surprised if ecj.jar cannot
be avoided at all.
> GCJ is built with options to create symlinks to function as a primitive
> JDK. It does not provide wrappers for javap and javac, so these are
> added in an extra phase. I took the javac perl wrapper from Gentoo, but
> I suppose a script in Guile might be nicer (there is no official
> upstream source for the wrapper script, so we might as well roll our
> own).
Yeah, something nice to have for later. :-)
> From 56f43a9042853aca79f60808a51d328dfbe420a3 Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
> Date: Tue, 23 Dec 2014 12:31:50 +0100
> Subject: [PATCH] gnu: Add GCJ
>
> * gnu/packages/gcc.scm (gcj-4.8, ecj-bootstrap-4.8): New variable.
> * gnu/packages/javac.in: New file.
You need something like this in gnu-system.am:
MISC_DISTRO_FILES = gnu/packages/javac.in
and in Makefile.am, change the nobase_dist_guilemodule_DATA line to:
nobase_dist_guilemodule_DATA = \
$(MODULES) $(KCONFIGS) $(EXAMPLES) \
$(MISC_DISTRO_FILES)
> + (inputs
> + (append (package-inputs gcc-4.8)
> + `(("fastjar" ,fastjar)
> + ("perl" ,perl)
> + ("javac.in" ,(search-path %load-path
> + "gnu/packages/javac.in"))
> + ("ecj-bootstrap" ,ecj-bootstrap-4.8))))
Minor issue: I would avoid comma alignment and use quasiquote +
unquote-splicing rather than ‘append’.
> +(define-public ecj-bootstrap-4.8
> + (package
> + (name "ecj-bootstrap")
> + (version "4.8")
> + (source (origin
> + (method url-fetch)
> + (uri (string-append "ftp://sourceware.org/pub/java/ecj-" version ".jar"))
> + (sha256
> + (base32
> + "10fpqfbdzff1zcbxzh66xc8xbij9saykcj4xzm19wk9p3n7i5zcq"))))
It’s enough to make it an ‘origin’, and to keep it private:
(define ecj-bootstrap-4.8
(origin
(method ...)
...))
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH]: Add GCJ
2015-01-23 21:09 ` Ludovic Courtès
@ 2015-01-26 12:57 ` Ricardo Wurmus
2015-01-26 20:26 ` Ludovic Courtès
0 siblings, 1 reply; 4+ messages in thread
From: Ricardo Wurmus @ 2015-01-26 12:57 UTC (permalink / raw
To: Ludovic Courtès; +Cc: Guix-devel
[-- Attachment #1: Type: text/plain, Size: 1762 bytes --]
Ludovic Courtès writes:
>> From 56f43a9042853aca79f60808a51d328dfbe420a3 Mon Sep 17 00:00:00 2001
>> From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
>> Date: Tue, 23 Dec 2014 12:31:50 +0100
>> Subject: [PATCH] gnu: Add GCJ
>>
>> * gnu/packages/gcc.scm (gcj-4.8, ecj-bootstrap-4.8): New variable.
>> * gnu/packages/javac.in: New file.
>
> You need something like this in gnu-system.am:
>
> MISC_DISTRO_FILES = gnu/packages/javac.in
>
> and in Makefile.am, change the nobase_dist_guilemodule_DATA line to:
>
> nobase_dist_guilemodule_DATA = \
> $(MODULES) $(KCONFIGS) $(EXAMPLES) \
> $(MISC_DISTRO_FILES)
>
>> + (inputs
>> + (append (package-inputs gcc-4.8)
>> + `(("fastjar" ,fastjar)
>> + ("perl" ,perl)
>> + ("javac.in" ,(search-path %load-path
>> + "gnu/packages/javac.in"))
>> + ("ecj-bootstrap" ,ecj-bootstrap-4.8))))
>
> Minor issue: I would avoid comma alignment and use quasiquote +
> unquote-splicing rather than ‘append’.
>
>> +(define-public ecj-bootstrap-4.8
>> + (package
>> + (name "ecj-bootstrap")
>> + (version "4.8")
>> + (source (origin
>> + (method url-fetch)
>> + (uri (string-append "ftp://sourceware.org/pub/java/ecj-" version ".jar"))
>> + (sha256
>> + (base32
>> + "10fpqfbdzff1zcbxzh66xc8xbij9saykcj4xzm19wk9p3n7i5zcq"))))
>
> It’s enough to make it an ‘origin’, and to keep it private:
>
> (define ecj-bootstrap-4.8
> (origin
> (method ...)
> ...))
Attached is a new patch that incorporates all of your suggestions.
~~ Ricardo
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-GCJ.patch --]
[-- Type: text/x-patch, Size: 7633 bytes --]
From f1839e241a3b3478f0ae56abefac7c626ff690aa Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Date: Tue, 23 Dec 2014 12:31:50 +0100
Subject: [PATCH] gnu: Add GCJ
* gnu/packages/gcc.scm (gcj-4.8, ecj-bootstrap-4.8): New variables.
* gnu/packages/javac.in: New file.
* gnu-system.am (MISC_DISTRO_FILES): Add it.
* Makefile.am (nobase_dist_guilemodule_DATA): Add MISC_DISTRO_FILES.
---
Makefile.am | 4 ++-
gnu-system.am | 2 ++
gnu/packages/gcc.scm | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++
gnu/packages/javac.in | 61 ++++++++++++++++++++++++++++++++++++++++++
4 files changed, 139 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/javac.in
diff --git a/Makefile.am b/Makefile.am
index e15afd2..50f1a7c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -128,7 +128,9 @@ EXAMPLES = \
GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go guix/tests.go
-nobase_dist_guilemodule_DATA = $(MODULES) $(KCONFIGS) $(EXAMPLES)
+nobase_dist_guilemodule_DATA = \
+ $(MODULES) $(KCONFIGS) $(EXAMPLES) \
+ $(MISC_DISTRO_FILES)
nobase_nodist_guilemodule_DATA = $(GOBJECTS) guix/config.scm
# Do we need to provide our own non-broken (srfi srfi-37) module?
diff --git a/gnu-system.am b/gnu-system.am
index 85e3d5e..94d10ff 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -517,6 +517,8 @@ dist_patch_DATA = \
gnu/packages/patches/xfce4-panel-plugins.patch \
gnu/packages/patches/xmodmap-asprintf.patch
+MISC_DISTRO_FILES = gnu/packages/javac.in
+
bootstrapdir = $(guilemoduledir)/gnu/packages/bootstrap
bootstrap_x86_64_linuxdir = $(bootstrapdir)/x86_64-linux
bootstrap_i686_linuxdir = $(bootstrapdir)/i686-linux
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 276b986..6143f5b 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -26,9 +26,11 @@
#:use-module (gnu packages multiprecision)
#:use-module (gnu packages texinfo)
#:use-module (gnu packages elf)
+ #:use-module ((gnu packages perl) #:select (perl))
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system gnu)
+ #:use-module (guix build-system trivial)
#:use-module (guix utils)
#:use-module (ice-9 regex))
@@ -336,6 +338,77 @@ Go. It also includes runtime support libraries for these languages.")
;; a cyclic dependency. <http://debbugs.gnu.org/18101>
#:separate-lib-output? #f))
+(define-public gcj-4.8
+ (package (inherit gcc-4.8)
+ (name "gcj")
+ (inputs
+ `(("fastjar" ,fastjar)
+ ("perl" ,perl)
+ ("javac.in" ,(search-path %load-path
+ "gnu/packages/javac.in"))
+ ("ecj-bootstrap" ,ecj-bootstrap-4.8)
+ ,@(package-inputs gcc-4.8)))
+ ;; Suppress the separate "lib" output, because otherwise the
+ ;; "lib" and "out" outputs would refer to each other, creating
+ ;; a cyclic dependency. <http://debbugs.gnu.org/18101>
+ (outputs
+ (delete "lib" (package-outputs gcc-4.8)))
+ (arguments
+ (substitute-keyword-arguments `(#:modules ((guix build gnu-build-system)
+ (guix build utils)
+ (ice-9 regex)
+ (srfi srfi-1)
+ (srfi srfi-26))
+ ,@(package-arguments gcc-4.8))
+ ((#:configure-flags flags)
+ `(let ((ecj (assoc-ref %build-inputs "ecj-bootstrap")))
+ `("--enable-java-home"
+ "--enable-gjdoc"
+ ,(string-append "--with-ecj-jar=" ecj)
+ "--enable-languages=java"
+ ,@(remove (cut string-match "--enable-languages.*" <>)
+ ,flags))))
+ ((#:phases phases)
+ `(alist-cons-after
+ 'install 'install-javac-and-javap-wrappers
+ (lambda _
+ (let* ((javac (assoc-ref %build-inputs "javac.in"))
+ (ecj (assoc-ref %build-inputs "ecj-bootstrap"))
+ (gcj (assoc-ref %outputs "out"))
+ (gcjbin (string-append gcj "/bin/"))
+ (jvm (string-append gcj "/lib/jvm/"))
+ (target (string-append jvm "/bin/javac")))
+
+ (symlink (string-append gcjbin "jcf-dump")
+ (string-append jvm "/bin/javap"))
+
+ (copy-file ecj (string-append gcj "/share/java/ecj.jar"))
+
+ ;; Create javac wrapper from the template javac.in by
+ ;; replacing the @VARIABLES@ with paths.
+ (copy-file javac target)
+ (patch-shebang target)
+ (substitute* target
+ (("@JAVA@")
+ (string-append jvm "/bin/java"))
+ (("@ECJ_JAR@")
+ (string-append gcj "/share/java/ecj.jar"))
+ (("@RT_JAR@")
+ (string-append jvm "/jre/lib/rt.jar"))
+ (("@TOOLS_JAR@")
+ (string-append jvm "/lib/tools.jar")))
+ (chmod target #o755)
+ #t))
+ ,phases))))))
+
+(define ecj-bootstrap-4.8
+ (origin
+ (method url-fetch)
+ (uri "ftp://sourceware.org/pub/java/ecj-4.8.jar")
+ (sha256
+ (base32
+ "10fpqfbdzff1zcbxzh66xc8xbij9saykcj4xzm19wk9p3n7i5zcq"))))
+
(define-public gcc-objc-4.8
(custom-gcc gcc-4.8 "gcc-objc" '("objc")))
diff --git a/gnu/packages/javac.in b/gnu/packages/javac.in
new file mode 100644
index 0000000..adb4dc1
--- /dev/null
+++ b/gnu/packages/javac.in
@@ -0,0 +1,61 @@
+#!/usr/bin/perl -w
+
+# Taken from Gentoo:
+# http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-java/gcj-jdk/files/javac.in
+
+use strict;
+use constant NO_DUP_ARGS => qw(-source -target -d -encoding);
+use constant STRIP_ARGS => qw(-Werror -implicit:none -J-Xbootclasspath/p:);
+
+my $ECJ_WARNINGS="-nowarn";
+
+my ( @bcoption, @source15, @target15, @cp );
+push @bcoption, '-bootclasspath', '@RT_JAR@:@TOOLS_JAR@'
+ unless grep {$_ eq '-bootclasspath'} @ARGV;
+push @source15, '-source', '1.5'
+ unless grep {$_ eq '-source'} @ARGV;
+push @target15, '-target', '1.5'
+ unless grep {$_ eq '-target'} @ARGV;
+push @cp, '-cp', '.'
+ unless grep {$_ =~ '\-c(p|lasspath)'} @ARGV or $ENV{CLASSPATH};
+my @ecj_parms = ($ECJ_WARNINGS, @bcoption, @source15, @target15, @cp);
+
+# Work around ecj's inability to handle duplicate command-line
+# options and unknown javac options.
+sub gen_ecj_opts
+{
+ my @new_args = @{$_[0]};
+
+ for my $opt (NO_DUP_ARGS)
+ {
+ my @indices = reverse grep {$new_args[$_] eq $opt} 0..$#new_args;
+ if (@indices > 1) {
+ shift @indices; # keep last instance only
+ splice @new_args, $_, 2 for @indices;
+ }
+ }
+
+ for my $opt (STRIP_ARGS)
+ {
+ my @indices = reverse grep {$new_args[$_] eq $opt} 0..$#new_args;
+ splice @new_args, $_, 1 for @indices;
+ }
+
+ return \@new_args;
+}
+
+sub split_vm_args
+{
+ my @new_args = @{$_[0]};
+
+ my @vm_args = map { substr $_, 2 } grep $_ =~ /^-J/, @new_args;
+ my @javac_args = grep $_ !~ /^-J/, @new_args;
+
+ return (\@vm_args, \@javac_args);
+}
+
+my ($vm_args, $javac_args) = split_vm_args (gen_ecj_opts( \@ARGV ));
+my @CLASSPATH = ('@ECJ_JAR@');
+push @CLASSPATH, split /:/, $ENV{"CLASSPATH"} if exists $ENV{"CLASSPATH"};
+$ENV{"CLASSPATH"} = join ':', @CLASSPATH;
+exec '@JAVA@', @$vm_args, 'org.eclipse.jdt.internal.compiler.batch.Main', @ecj_parms, @$javac_args;
--
1.9.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH]: Add GCJ
2015-01-26 12:57 ` Ricardo Wurmus
@ 2015-01-26 20:26 ` Ludovic Courtès
0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2015-01-26 20:26 UTC (permalink / raw
To: Ricardo Wurmus; +Cc: Guix-devel
Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> skribis:
> Attached is a new patch that incorporates all of your suggestions.
>
> ~~ Ricardo
>
>
> From f1839e241a3b3478f0ae56abefac7c626ff690aa Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
> Date: Tue, 23 Dec 2014 12:31:50 +0100
> Subject: [PATCH] gnu: Add GCJ
>
> * gnu/packages/gcc.scm (gcj-4.8, ecj-bootstrap-4.8): New variables.
> * gnu/packages/javac.in: New file.
> * gnu-system.am (MISC_DISTRO_FILES): Add it.
> * Makefile.am (nobase_dist_guilemodule_DATA): Add MISC_DISTRO_FILES.
OK to push, thank you.
Ludo’.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-01-26 20:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-23 10:46 [PATCH]: Add GCJ Ricardo Wurmus
2015-01-23 21:09 ` Ludovic Courtès
2015-01-26 12:57 ` Ricardo Wurmus
2015-01-26 20:26 ` Ludovic Courtès
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.