From 7396254adcf5e105e83285e2b7802603026f4917 Mon Sep 17 00:00:00 2001 From: Jeff Wallace <wallace.je@husky.neu.edu> Date: Wed, 4 Sep 2013 14:07:01 -0400 Subject: [PATCH] Added updated build files for building datamodel with native libs on mac. --- bindings/java/build-unix.xml | 13 ++++ bindings/java/build-windows.xml | 59 +++++++++++++++++++ bindings/java/build.xml | 59 +------------------ .../org/sleuthkit/datamodel/LibraryUtils.java | 3 - 4 files changed, 73 insertions(+), 61 deletions(-) diff --git a/bindings/java/build-unix.xml b/bindings/java/build-unix.xml index 52e8df9ca..cd0ef4934 100644 --- a/bindings/java/build-unix.xml +++ b/bindings/java/build-unix.xml @@ -37,13 +37,26 @@ <property environment="env"/> <copy file="./jni/.libs/libtsk_jni.dylib" tofile="./libtsk_jni.jnilib"/> </target> + + <target name="copyMacLibs" depends="testTSKLibs" if="tsk_dylib.present"> + <property environment="env"/> + <property name="jni.dylib" location="${basedir}/jni/.libs/libtsk_jni.dylib" /> + <property name="jni.jnilib" value="libtsk_jni.jnilib" /> + <copy file="${jni.dylib}" tofile="${x86_64}/mac/${jni.jnilib}"/> + </target> <!-- Non-OS X --> <target name="copyTskLibs_so" depends="testTSKLibs" if="tsk_so.present"> <property environment="env"/> <copy file="./jni/.libs/libtsk_jni.so" tofile="./libtsk_jni.so"/> </target> + + <target name="copyUnixLibs" depends="testTSKLibs" if="tsk_so.present"> + <!-- does nothing for now --> + </target> + <target name="copyLibs" depends="copyUnixLibs,copyMacLibs" /> + <target name="copyTSKLibs" depends="copyTskLibs_so,copyTskLibs_dylib"> <!-- depends targets take care of the actual copying since the file differs on OS X and Linux --> <!-- This assumes that TSK, libewf, and zlib have been installed on the system and those libraries will be with normal loading approaches --> diff --git a/bindings/java/build-windows.xml b/bindings/java/build-windows.xml index f39120063..375e389d1 100644 --- a/bindings/java/build-windows.xml +++ b/bindings/java/build-windows.xml @@ -33,4 +33,63 @@ <sysproperty key="types" value="${test-types}"/> </java> </target> + + <target name="copyLibs" depends="copyWinLibs" description="Copy native libs to the correct folder" /> + + <target name="copyWinLibs" depends="copyWinLibs64,copyWinLibs32" description="Copy windows dlls to the correct location." /> + + <target name="checkLibDirs"> + <available property="win64.exists" type="dir" file="${basedir}/../../win32/x64/Release" /> + <available property="win32.exists" type="dir" file="${basedir}/../../win32/Release" /> + </target> + + <target name="copyWinLibs64" depends="checkLibDirs" if="win64.exists"> + <property name="win64dir" location="${basedir}/../../win32/x64/Release" /> + <fileset dir="${win64dir}" id="win64dlls"> + <include name="*.dll" /> + </fileset> + <copy todir="${amd64}/win"> + <fileset refid="win64dlls" /> + </copy> + <copy todir="${x86_64}/win"> + <fileset refid="win64dlls" /> + </copy> + <fileset dir="${crt}/win64" id="crt64dlls"> + <include name="*.dll" /> + </fileset> + <copy todir="${amd64}/win"> + <fileset refid="crt64dlls" /> + </copy> + <copy todir="${x86_64}/win"> + <fileset refid="crt64dlls" /> + </copy> + </target> + + <target name="copyWinLibs32" depends="checkLibDirs" if="win32.exists"> + <property name="win32dir" location="${basedir}/../../win32/Release" /> + <fileset dir="${win32dir}" id="win32dlls"> + <include name="*.dll" /> + </fileset> + <copy todir="${i386}/win"> + <fileset refid="win32dlls" /> + </copy> + <copy todir="${x86}/win"> + <fileset refid="win32dlls" /> + </copy> + <copy todir="${i586}/win"> + <fileset refid="win32dlls" /> + </copy> + <fileset dir="${crt}/win32" id="crt32dlls"> + <include name="*.dll" /> + </fileset> + <copy todir="${i386}/win"> + <fileset refid="crt32dlls" /> + </copy> + <copy todir="${x86}/win"> + <fileset refid="crt32dlls" /> + </copy> + <copy todir="${i586}/win"> + <fileset refid="crt32dlls" /> + </copy> + </target> </project> diff --git a/bindings/java/build.xml b/bindings/java/build.xml index d790b0705..f159a739d 100755 --- a/bindings/java/build.xml +++ b/bindings/java/build.xml @@ -50,6 +50,7 @@ <mkdir dir="${x86}/win" /> <mkdir dir="${x86_64}" /> <mkdir dir="${x86_64}/win" /> + <mkdir dir="${x86_64}/mac" /> <mkdir dir="${i386}" /> <mkdir dir="${i386}/win" /> <mkdir dir="${i586}" /> @@ -64,7 +65,6 @@ <property name="ivy.jar.dir" value="${ivy.home}/lib" /> <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" /> - <target name="download-ivy" unless="offline"> <available file="${ivy.jar.file}" property="ivy.available"/> <antcall target="-download-ivy" /> @@ -112,64 +112,7 @@ pattern="lib/[artifact]-[revision](-[classifier]).[ext]" /> <jar jarfile="${dist}/Tsk_DataModel.jar" basedir="${build}"/> </target> - <target name="copyLibs" depends="copyWinLibs" description="Copy native libs to the correct folder" /> - - <target name="copyWinLibs" depends="copyWinLibs64,copyWinLibs32" description="Copy windows dlls to the correct location." /> - - <target name="checkLibDirs"> - <available property="win64.exists" type="dir" file="${basedir}/../../win32/x64/Release" /> - <available property="win32.exists" type="dir" file="${basedir}/../../win32/Release" /> - </target> - <target name="copyWinLibs64" depends="checkLibDirs" if="win64.exists"> - <property name="win64dir" location="${basedir}/../../win32/x64/Release" /> - <fileset dir="${win64dir}" id="win64dlls"> - <include name="*.dll" /> - </fileset> - <copy todir="${amd64}/win"> - <fileset refid="win64dlls" /> - </copy> - <copy todir="${x86_64}/win"> - <fileset refid="win64dlls" /> - </copy> - <fileset dir="${crt}/win64" id="crt64dlls"> - <include name="*.dll" /> - </fileset> - <copy todir="${amd64}/win"> - <fileset refid="crt64dlls" /> - </copy> - <copy todir="${x86_64}/win"> - <fileset refid="crt64dlls" /> - </copy> - </target> - - <target name="copyWinLibs32" depends="checkLibDirs" if="win32.exists"> - <property name="win32dir" location="${basedir}/../../win32/Release" /> - <fileset dir="${win32dir}" id="win32dlls"> - <include name="*.dll" /> - </fileset> - <copy todir="${i386}/win"> - <fileset refid="win32dlls" /> - </copy> - <copy todir="${x86}/win"> - <fileset refid="win32dlls" /> - </copy> - <copy todir="${i586}/win"> - <fileset refid="win32dlls" /> - </copy> - <fileset dir="${crt}/win32" id="crt32dlls"> - <include name="*.dll" /> - </fileset> - <copy todir="${i386}/win"> - <fileset refid="crt32dlls" /> - </copy> - <copy todir="${x86}/win"> - <fileset refid="crt32dlls" /> - </copy> - <copy todir="${i586}/win"> - <fileset refid="crt32dlls" /> - </copy> - </target> <target name="jni" depends="compile" description="make the jni.h file"> <javah classpath = "${build}" outputFile="jni/dataModel_SleuthkitJNI.h" force="yes"> diff --git a/bindings/java/src/org/sleuthkit/datamodel/LibraryUtils.java b/bindings/java/src/org/sleuthkit/datamodel/LibraryUtils.java index 4f7d76e87..cac821e8c 100644 --- a/bindings/java/src/org/sleuthkit/datamodel/LibraryUtils.java +++ b/bindings/java/src/org/sleuthkit/datamodel/LibraryUtils.java @@ -145,11 +145,8 @@ public static void loadLibrary(Lib library) { in.close(); out.close(); - System.out.println(libTemp.getAbsolutePath()); System.load(libTemp.getAbsolutePath()); } catch (IOException e) { - System.out.println("IO Exception:"); - System.out.println(System.getProperty("java.io.tmpdir")); e.printStackTrace(); } } -- GitLab