source: core/c/jcpuid/build.sh @ 527c9ba5

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

Add support to jbigi/jcpuid for Solaris/SunOS

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