source: core/c/jcpuid/build.sh @ 1850e89

Last change on this file since 1850e89 was 1850e89, checked in by mkvore-commit <mkvore-commit@…>, 11 years ago

removes a bug in SAM v1 and v2 (introduced when merging with v3)

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