source: core/c/jcpuid/build.sh @ c9c35a3

Last change on this file since c9c35a3 was c9c35a3, checked in by kytv <kytv@…>, 10 years ago

jcpuid: minor edits so that compilation will work with Debian kFreeBSD

  • Property mode set to 100755
File size: 1.5 KB
Line 
1#/bin/sh
2
3case `uname -sr` in
4MINGW*)
5        echo "Building windows .dll's";;
6CYGWIN*)
7        echo "Building windows .dll's";;
8Linux*)
9        echo "Building linux .so's";;
10FreeBSD*)
11        echo "Building freebsd .so's";;
12*kFreeBSD*)
13        echo "Building kFreebsd .so's";;
14*)
15        echo "Unsupported build environment"
16        exit;;
17esac
18
19rm -rf lib
20mkdir lib
21mkdir lib/freenet
22mkdir lib/freenet/support
23mkdir lib/freenet/support/CPUInformation
24
25CC="gcc"
26
27case `uname -sr` in
28MINGW*)
29        JAVA_HOME="/c/software/j2sdk1.4.2_05"
30        COMPILEFLAGS="-Wall"
31        INCLUDES="-I. -Iinclude -I$JAVA_HOME/include/ -I$JAVA_HOME/include/win32/"
32        LINKFLAGS="-shared -static -static-libgcc -Wl,--kill-at"
33        LIBFILE="lib/freenet/support/CPUInformation/jcpuid-x86-windows.dll";;
34FreeBSD*)
35        COMPILEFLAGS="-Wall"
36        INCLUDES="-I. -Iinclude -I$JAVA_HOME/include/ -I$JAVA_HOME/include/freebsd/"
37        LINKFLAGS="-shared -static -Wl,-soname,libjcpuid-x86-freebsd.so"
38        LIBFILE="lib/freenet/support/CPUInformation/libjcpuid-x86-freebsd.so";;
39*kFreeBSD*|Linux*)
40        COMPILEFLAGS="-fPIC -Wall"
41        INCLUDES="-I. -Iinclude -I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
42        LINKFLAGS="-shared -Wl,-soname,libjcpuid-x86-linux.so"
43        LIBFILE="lib/freenet/support/CPUInformation/libjcpuid-x86-linux.so";;
44esac
45
46echo "Compiling C code..."
47rm -f $LIBFILE
48$CC $COMPILEFLAGS $LINKFLAGS $INCLUDES src/*.c -o $LIBFILE
49strip $LIBFILE
50echo Built $LIBFILE
51
52#g++ -shared -static -static-libgcc -Iinclude -I$JAVA_HOME/include \
53#    -I$JAVA_HOME/include/linux src/*.cpp \
54#    -o lib/freenet/support/CPUInformation/libjcpuid-x86-linux.so
Note: See TracBrowser for help on using the repository browser.