r10937: Automated commit for Debian build of clsql upstream-version-3.6.0
[clsql/s11.git] / uffi / make.sh
blob843aa4793ee8cf7d51e2c2939b94391786f953af
1 #!/bin/sh
3 case "`uname`" in
4 Linux) os_linux=1 ;;
5 GNU) os_linux=1 ;;
6 FreeBSD) os_freebsd=1 ;;
7 GNU/kFreeBSD) os_gnukfreebsd=1;;
8 Darwin) os_darwin=1 ;;
9 SunOS) os_sunos=1 ;;
10 AIX) os_aix=1 ;;
11 *) echo "Unable to identify uname " `uname`
12 exit 1 ;;
13 esac
15 if [ "$os_linux" -o "$os_freebsd" -o "$os_gnukfreebsd" ]; then
16 gcc -fPIC -DPIC -c $SOURCE -o $OBJECT
17 ld -shared -soname=$BASE $LDFLAGS $OBJECT -o $SHARED_LIB
18 elif [ "$os_darwin" ]; then
19 cc -dynamic -c $SOURCE -o $OBJECT
20 ld -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress -o $BASE.dylib $OBJECT
21 ld -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress /usr/lib/libz.dylib -o z.dylib
23 elif [ "$os_sunos" ]; then
24 cc -KPIC -c $SOURCE -o $OBJECT
25 cc -G $OBJECT -o $SHARED_LIB
27 elif [ "$os_aix" ]; then
28 gcc -c -D_BSD -D_NO_PROTO -D_NONSTD_TYPES -D_MBI=void $SOURCE
29 make_shared -o $SHARED_LIB $OBJECT
32 exit 0