source: core/c/jbigi/build_jbigi.sh @ bc7ab391

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

+x the c build files

  • Property mode set to 100755
File size: 1.5 KB
Line 
1#!/bin/sh
2# When executed in Mingw: Produces an jbigi.dll
3# When executed in Linux: Produces an libjbigi.so
4
5CC="gcc"
6
7case `uname -sr` in
8MINGW*)
9        JAVA_HOME="c:/software/j2sdk1.4.2_05"
10        COMPILEFLAGS="-Wall"
11        INCLUDES="-I. -I../../jbigi/include -I$JAVA_HOME/include/win32/ -I$JAVA_HOME/include/"
12        LINKFLAGS="-shared -Wl,--kill-at"
13        LIBFILE="jbigi.dll";;
14CYGWIN*)
15        JAVA_HOME="c:/software/j2sdk1.4.2_05"
16        COMPILEFLAGS="-Wall -mno-cygwin"
17        INCLUDES="-I. -I../../jbigi/include -I$JAVA_HOME/include/win32/ -I$JAVA_HOME/include/"
18        LINKFLAGS="-shared -Wl,--kill-at"
19        LIBFILE="jbigi.dll";;
20Darwin*)
21        JAVA_HOME="/Library/Java/Home"
22        COMPILEFLAGS="-Wall"
23        INCLUDES="-I. -I../../jbigi/include -I$JAVA_HOME/include"
24        LINKFLAGS="-dynamiclib -framework JavaVM"
25        LIBFILE="libjbigi.jnilib";;
26*)
27        COMPILEFLAGS="-fPIC -Wall"
28        INCLUDES="-I. -I../../jbigi/include -I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
29        LINKFLAGS="-shared -Wl,-soname,libjbigi.so"
30        LIBFILE="libjbigi.so";;
31esac
32
33#To link dynamically to GMP (use libgmp.so or gmp.lib), uncomment the first line below
34#To link statically to GMP, uncomment the second line below
35if test $1 = "dynamic"
36then
37        echo "Building jbigi lib that is dynamically linked to GMP" 
38        LIBPATH="-L.libs"
39        INCLUDELIBS="-lgmp"
40else
41        echo "Building jbigi lib that is statically linked to GMP"
42        STATICLIBS=".libs/libgmp.a"
43fi
44
45echo "Compiling C code..."
46rm -f jbigi.o $LIBFILE
47$CC -c $COMPILEFLAGS $INCLUDES ../../jbigi/src/jbigi.c
48$CC $LINKFLAGS $INCLUDES $INCLUDELIBS -o $LIBFILE jbigi.o $STATICLIBS
Note: See TracBrowser for help on using the repository browser.