opensc-java icon indicating copy to clipboard operation
opensc-java copied to clipboard

build-without-ivy.xml and build.xml do not initiate JNI re-build

Open mouse07410 opened this issue 9 years ago • 1 comments

The current scripts only use pre-built shared libraries. Not good for me, because their hardcoded paths are wrong - but I cannot force the build to re-do this.

mouse07410 avatar Aug 19 '16 03:08 mouse07410

Following your guidance, here's the complete diff:

$ git diff
diff --git a/build-without-ivy.xml b/build-without-ivy.xml
index 7f6a368..46d23d6 100644
--- a/build-without-ivy.xml
+++ b/build-without-ivy.xml
@@ -27,6 +27,7 @@

        <target name="compile">
                <mkdir dir="${build}/bin"/>
+               <mkdir dir="${basedir}/java/lib"/>
                <javac encoding="8859_1" srcdir="${basedir}/java/src" destdir="${build}/bin">
                        <classpath refid="project.class.path"/>
                        <exclude name="**/.git"/>
diff --git a/jni/build/macosx/release/config.data b/jni/build/macosx/release/config.data
index 0e9d543..7bc6406 100644
--- a/jni/build/macosx/release/config.data
+++ b/jni/build/macosx/release/config.data
@@ -1,7 +1,18 @@
 #
 # Default makefile variable settings.
 #
+ac CC=clang
+ac CPP=clang -E
+ac CXX=clang++
 ac CFLAGS=-O2 -Wall
 ac CXXFLAGS=-O2 -Wall
 ac JNI_CFLAGS=-I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/darwin
 ac LIBDYN=dylib
+ac DYN_LDFLAGS=-shared -dynamiclib
+ac SSL_LDFLAGS=-L/opt/local/lib
+ac SSL_LIBS=-lcrypto -lssl
+ac SSL_CFLAGS=-I/opt/local/include
+ac OPENSC_LDFLAGS=-L/Library/OpenSC/lib
+ac OPENSC_LIBS=-lopensc
+ac PKCS11_CFLAGS=-I/opt/local/include
+ac PKCS11_LDFLAGS=-L/opt/local/lib

To re-build the native shared library on Mac OS X I had to do (as you mentioned)

$ cd jni/build/macosx/release
$ perl ../../../src/scripts/config.pl
. . . . .
$ make

P.S. Similar config.data for macosx/debug, except replacing "-O2" with "-g".

mouse07410 avatar Aug 25 '16 20:08 mouse07410