2 #*******************************************************************************
3 # Copyright (c) 2007, 2010 Association for Decentralized Information Management
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Eclipse Public License v1.0
7 # which accompanies this distribution, and is available at
8 # http://www.eclipse.org/legal/epl-v10.html
11 # VTT Technical Research Centre of Finland - initial API and implementation
12 #*******************************************************************************
14 if [ -z $JAVA_HOME ]; then
15 echo "JAVA_HOME is not defined, it is needed to find JNI headers (jni.h + jni_md.h)"
19 kernel=`uname -s | tr "[:upper:]" "[:lower:]"`
20 arch=`uname -m | tr "[:upper:]" "[:lower:]"`
37 extraparams="-m32 -Os"
48 extraparams="-dynamiclib -arch x86_64"
52 options="${extraparams} -Wall -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux -std=c99 -Wall -W -Wundef -Wno-implicit-function-declaration -fPIC -shared"
53 output="../src/libfastlz-${kernel}-${arch}"
57 output="${output}.dylib"
63 echo "Kernel: $kernel"
64 echo "Architecture: $arch"
65 echo "Output library: $output"
66 echo "Compiler options: $options"
68 gcc ${options} -o ${output} fastlz.c jniWrapper.c
70 size=`ls -l $output | cut -d " " -f 5`
71 echo "library size before stripping: $size"
75 size=`ls -l $output | cut -d " " -f 5`
76 echo "library size after stripping: $size"
78 gcc ${extraparams} -o fastlz_test fastlz.c fastlz_read.c fastlz_write.c fastlz_test.c