diff --git a/CHANGES.md b/CHANGES.md index 3dba53aa70..6b0f0531e5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,7 @@ Features -------- * [#757](https://github.com/java-native-access/jna/issues/757): Build android archive (AAR) - [@matthiasblaesing](https://github.com/matthiasblaesing). * [#767](https://github.com/java-native-access/jna/pull/767): Add Win32 API mapping for Shlwapi PathIsUNC - [@ivanwick](https://github.com/ivanwick). +* [#753](https://github.com/java-native-access/jna/issues/753): Support arm hardfloat and softfloat by introducing armel as platform (ARM EABI Little-endian) - [@matthiasblaesing](https://github.com/matthiasblaesing). Bug Fixes --------- diff --git a/ant-elfanalyser-src/com/sun/jna/BuildArmSoftFloatDetector.java b/ant-elfanalyser-src/com/sun/jna/BuildArmSoftFloatDetector.java new file mode 100644 index 0000000000..fe43f9543e --- /dev/null +++ b/ant-elfanalyser-src/com/sun/jna/BuildArmSoftFloatDetector.java @@ -0,0 +1,53 @@ + +package com.sun.jna; + +import java.io.File; +import java.io.IOException; +import org.apache.tools.ant.Project; + +/** + * Ant task to expose the arm soft-/hardfloat detection routines of the JNA core + * for the build script. + * + *

The build script is expected to build a minimal set of classes that are + * required to execute this. At the time of writing these are:

+ * + * + */ +public class BuildArmSoftFloatDetector { + + private String targetProperty; + private Project project; + + public void setProject(Project proj) { + project = proj; + } + + /** + * targetProperty receives the name of the property, that should take the + * new property + * + * @param targetProperty + */ + public void setTargetProperty(String targetProperty) { + this.targetProperty = targetProperty; + } + + public void execute() throws IOException { + boolean result = false; + // On linux /proc/self/exe is a symblink to the currently executing + // binary (the JVM) + File self = new File("/proc/self/exe"); + try { + // The self.getCanonicalPath() resolves the symblink to the backing + // realfile and passes that to the detection routines + ELFAnalyser ahfd = ELFAnalyser.analyse(self.getCanonicalPath()); + result = ahfd.isArmSoftFloat(); + } catch (IOException ex) { + result = false; + } + project.setNewProperty(targetProperty, Boolean.toString(result)); + } +} diff --git a/build.xml b/build.xml index b024b2060f..b2c67b6ce7 100644 --- a/build.xml +++ b/build.xml @@ -208,6 +208,17 @@ + + + + + + + + + + + @@ -230,7 +241,15 @@ + + + + + + + + @@ -424,6 +443,8 @@ com/sun/jna/linux-x86-64/libjnidispatch.so; processor=x86-64;osname=linux, com/sun/jna/linux-arm/libjnidispatch.so; processor=arm;osname=linux, +com/sun/jna/linux-armel/libjnidispatch.so; +processor=armel;osname=linux, com/sun/jna/linux-aarch64/libjnidispatch.so; processor=aarch64;osname=linux, com/sun/jna/linux-ia64/libjnidispatch.so; @@ -468,6 +489,9 @@ osname=macosx;processor=x86;processor=x86-64;processor=ppc + @@ -666,6 +690,7 @@ osname=macosx;processor=x86;processor=x86-64;processor=ppc + @@ -1318,6 +1343,4 @@ osname=macosx;processor=x86;processor=x86-64;processor=ppc - - - + \ No newline at end of file diff --git a/lib/ant.jar b/lib/ant.jar new file mode 100644 index 0000000000..3bebb5c883 Binary files /dev/null and b/lib/ant.jar differ diff --git a/lib/native/linux-armel.jar b/lib/native/linux-armel.jar new file mode 100644 index 0000000000..1319f4edf5 Binary files /dev/null and b/lib/native/linux-armel.jar differ diff --git a/nbproject/project.xml b/nbproject/project.xml index 4f75977b70..6a29d18789 100644 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -3,6 +3,9 @@ org.netbeans.modules.ant.freeform + JNA + +