#!/bin/sh # detect the system UNAME=`uname` EXT="so"; if ( test "WIN32" = "$TARGET" ) then CC="gcc"; CFLAGS="-funsigned-char -O2"; LD="ld"; LDFLAGS="-Bshareable -lm"; elif ( test $UNAME = "IRIX" ) then CC="cc"; CFLAGS="-KPIC -O2"; LD="ld"; LDFLAGS="-U"; elif ( test $UNAME = "IRIX64" ) then CC="cc"; CFLAGS="-KPIC -O2"; LD="ld"; LDFLAGS="-U"; elif ( test $UNAME = "FreeBSD" ) then CC="gcc"; CFLAGS="-fPIC -funsigned-char -O2"; LD="ld"; LDFLAGS="-Bshareable"; elif ( test $UNAME = "Linux" ) then MNAME=`uname -m`; if (test $MNAME = "x86_64" ) then UNAME="Linux64"; fi CC="gcc"; CFLAGS="-fPIC -funsigned-char -O2"; CFLAGS="-fPIC -funsigned-char -g"; LD="ld"; LDFLAGS="-Bshareable"; elif ( test $UNAME = "SunOS" ) then CC="cc"; CFLAGS="-O"; LD="ld"; LDFLAGS="-r"; elif ( test $UNAME = "Darwin" ) then MNAME=`uname -m`; if (test $MNAME = "i386" ) then UNAME="Darwin-i386"; fi CC="cc"; CFLAGS="-fPIC -funsigned-char -O2 -fno-common"; LD="cc"; LDFLAGS="-bundle -bundle_loader ../../blender.app/Contents/MacOS/blender -lm"; EXT="so"; fi if ( test "$#" = "1" ) then if ( test -f $1 ) then BASE_FILE=`echo $1 | sed -e "1 s/\.c//g"`; else BASE_FILE=$1; fi CFILE="$BASE_FILE.c" if (test "$TARGET" = "WIN32" ) then DLLFILE="$BASE_FILE.dll"; fi OFILE="$BASE_FILE.$UNAME.o" SOFILE="$BASE_FILE.$UNAME.$EXT" else if ( test -f $1$2 ) then BASE_FILE=`echo $2 | sed -e "1 s/\.c//g"`; else BASE_FILE=$2; fi CFILE="$1$BASE_FILE.c" if (test "$TARGET" = "WIN32" ) then DLLFILE="$BASE_FILE.dll"; fi OFILE="$BASE_FILE.$UNAME.o" SOFILE="$BASE_FILE.$UNAME.$EXT" fi INCLUDES= if ( test -f plugin.h ) then INCLUDES=-I.; MYROOT="." elif ( test -f "include/plugin.h" ) then INCLUDES=-Iinclude/ MYROOT="." elif ( test -f "../plugin.h" ) then INCLUDES=-I..; MYROOT=".." elif ( test -f "../include/plugin.h" ) then INCLUDES=-I../include MYROOT=".." elif ( test -f "../../include/plugin.h" ) then INCLUDES=-I../../include MYROOT="../.." else echo "Couldn't find plugin.h"; exit; fi LIBM=`fgrep "#include " $CFILE` LIBC=`fgrep "#include