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

Last change on this file since f7f05cf was f7f05cf, checked in by zzz <zzz@…>, 16 years ago

imported Iakin's public domain jcpuid library allowing the detection of CPU types from java
imported Iakin's modifications to jbigi to use the jcpuid library in detecting what jbigi implementation to load
imported and slightly updated Iakin's scripts to build jbigi for lots of architectures
(yay iakin!)

  • Property mode set to 100644
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*)
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
23CPP="g++"
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 -static-libgcc -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 -static -static-libgcc -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$CPP $LINKFLAGS $INCLUDES src/*.cpp -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.