Skip to content

Commit

Permalink
ensure native bits get built for 'native' target and for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
twall committed Jul 3, 2013
1 parent 9c2aebc commit 9744928
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
5 changes: 3 additions & 2 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
referenced. (not really common)


* eliminate type conversion contexts; these are almost entirely unused and
more complicated than just wrapping a native mapping in a utility function
* direct non-primitive array arguments (String[], Pointer[], NativeMapped[])

* auto-generate direct mappings/bindings on a per-method basis (perform a
method register on first call to an interface-mapped function) with
Expand All @@ -64,12 +67,10 @@
and forth multiple times). This also makes it easer to perform conversions
(no native changes required).

* direct/raw non-primitive array arguments (String[], Pointer[], NativeMapped[])
* ppc64 direct/raw failures (multiple)
* direct calls on ppc to varargs (callbacks) with FP args fail; avoid them for
now
* Callback.PostCallWrite.write() cf PostCallRead
* eliminate type conversion contexts; these are almost entirely unused

* universal GCC build w/cross-compile (needs cross compilers...)
* return Pointer.SIZE/LONG_SIZE/WCHAR_SIZE in bits (for consistency with 1.5)
Expand Down
23 changes: 16 additions & 7 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
(cross-compile currently only configured/tested on w32ce-arm and
android-arm/-x86)
Use ANT_OPTS=-Dskip-native to skip building native parts.
Use ANT_OPTS=-Dskip-native=false to build native parts, or directly
invoke the native or test targets
Use ANT_OPTS=-Dheadless to run tests headless
Use ANT_OPTS=-Drelease to stage a final, non-snapshot version
-->
Expand Down Expand Up @@ -78,9 +79,6 @@
<property name="impl.title" value="com.sun.jna"/>
<property name="impl.vendor" value="${spec.vendor}"/>
<property name="impl.version" value="${jna.version} (b${jna.build})"/>
<condition property="jni.valid" value="true">
<isset property="skip-native"/>
</condition>

<!-- Set up restrictions for w32ce, based on JavaME/CDC -->
<condition property="compatibility" value="1.4">
Expand Down Expand Up @@ -138,6 +136,13 @@

<target name="-dynamic-properties">

<condition property="-native" value="true">
<not><isset property="build-native"/></not>
</condition>
<condition property="jni.valid" value="true">
<isset property="-native"/>
</condition>

<replaceregexp match="(&lt;version&gt;).*(&lt;/version&gt;)"
replace="\1${jna.version}\2"
file="${pom}"/>
Expand Down Expand Up @@ -501,7 +506,7 @@ osname=macosx;processor=x86;processor=x86-64;processor=ppc
</subant>
</target>

<target name="javah" depends="compile" unless="skip-native">
<target name="javah" depends="compile" unless="-native">
<javah classpath="${classes}" destdir="${build.native}" force="yes">
<class name="com.sun.jna.Function"/>
<class name="com.sun.jna.Native"/>
Expand Down Expand Up @@ -612,7 +617,7 @@ osname=macosx;processor=x86;processor=x86-64;processor=ppc
file="${rsrc}" byline="true"/>
</target>

<target name="native" depends="-setup,javah,-native-api-check,rsrc" unless="skip-native"
<target name="native" depends="-enable-native,-setup,javah,-native-api-check,rsrc" unless="-native"
description="Build native libraries. Use 'ant -DCC=xxx' to build using a compiler other than gcc">
<property name="comment" value="# auto-generated by ant"/>
<replaceregexp match="^JNA_JNI_VERSION=.*"
Expand Down Expand Up @@ -832,9 +837,13 @@ osname=macosx;processor=x86;processor=x86-64;processor=ppc
<chmod file="${shared}/*.dll" perm="+x"/>
</target>

<target name="-enable-native" unless="-native">
<property name="build-native" value="true"/>
</target>

<!-- When running tests from an IDE, be sure to set jna.library.path -->
<!-- to where the test library (testlib) is found. -->
<target name="test" depends="jar,compile-tests" unless="cross-compile"
<target name="test" depends="-enable-native,jar,compile-tests" unless="cross-compile"
description="Run all unit tests">
<property name="test.fork" value="yes"/>
<property name="reports.junit" location="${reports}/junit"/>
Expand Down

0 comments on commit 9744928

Please sign in to comment.