ReadyTalk / avian

[INACTIVE] Avian is a lightweight virtual machine and class library designed to provide a useful subset of Java's features, suitable for building self-contained applications.
https://readytalk.github.io/avian/
Other
1.22k stars 172 forks source link

avian fails to build with java 10.0.1 due to java version parsing #559

Closed ianatha closed 3 years ago

ianatha commented 6 years ago

Using the latest Oracle Java 10.0.1 JDK, on a Mac, make fails due to some assumptions regarding version strings.

ianatha commented 6 years ago

Quick and ugly workaround:

diff --git a/makefile b/makefile
index 7a68bccb..f40249dc 100755
--- a/makefile
+++ b/makefile
@@ -8,7 +8,7 @@ get-java-version = $(shell "$1" -version 2>&1 \
                | sed -e 's/.*version "1.\([^.]*\).*/\1/' \
                                        -e 's/.*version "9.*/9/')

-java-version := $(call get-java-version,$(JAVA_HOME)/bin/java)
+java-version := "8"

 build-arch := $(shell uname -m \
        | sed 's/^i.86$$/i386/' \
@@ -1811,7 +1811,7 @@ $(generated-code): %.cpp: $(src)/types.def $(generator) $(classpath-dep)
 $(classpath-dep): $(classpath-sources) $(classpath-jar-dep)
        @echo "compiling classpath classes"
        @mkdir -p $(classpath-build)
-       $(javac) -source 1.$(java-version) -target 1.$(java-version) \
+       $(javac) -source $(java-version) -target $(java-version) \
                -d $(classpath-build) -bootclasspath $(boot-classpath) \
                $(classpath-sources)
        @touch $(@)
@@ -1887,10 +1887,10 @@ $(test-dep): $(test-sources) $(test-library)
        @mkdir -p $(test-build)
        files="$(shell $(MAKE) -s --no-print-directory build=$(build) $(test-classes))"; \
        if test -n "$${files}"; then \
-               $(javac) -source 1.$(java-version) -target 1.$(java-version) \
+               $(javac) -source $(java-version) -target $(java-version) \
                        -classpath $(test-build) -d $(test-build) -bootclasspath $(boot-classpath) $${files}; \
        fi
-       $(javac) -source 1.2 -target 1.1 -XDjsrlimit=0 -d $(test-build) \
+       $(javac) -source 1.6 -target 1.6 -XDjsrlimit=0 -d $(test-build) \
                -bootclasspath $(boot-classpath) test/Subroutine.java
        @touch $(@)

@@ -1899,7 +1899,7 @@ $(test-extra-dep): $(test-extra-sources)
        @mkdir -p $(test-build)
        files="$(shell $(MAKE) -s --no-print-directory build=$(build) $(test-extra-classes))"; \
        if test -n "$${files}"; then \
-               $(javac) -source 1.$(java-version) -target 1.$(java-version) \
+               $(javac) -source $(java-version) -target $(java-version) \
                        -d $(test-build) -bootclasspath $(boot-classpath) $${files}; \
        fi
        @touch $(@)
ianatha commented 3 years ago

closing abandoned issue :(