1*49cdfc7eSAndroid Build Coastguard Worker#!/bin/sh 2*49cdfc7eSAndroid Build Coastguard Worker 3*49cdfc7eSAndroid Build Coastguard WorkerOS=`uname -s` 4*49cdfc7eSAndroid Build Coastguard WorkerSUPPORTED="Linux SunOS HP-UX FreeBSD" 5*49cdfc7eSAndroid Build Coastguard Worker 6*49cdfc7eSAndroid Build Coastguard Workerfor i in `echo "$SUPPORTED"` 7*49cdfc7eSAndroid Build Coastguard Workerdo 8*49cdfc7eSAndroid Build Coastguard Worker if [ "$OS" = "$i" ]; then 9*49cdfc7eSAndroid Build Coastguard Worker supported="yes" 10*49cdfc7eSAndroid Build Coastguard Worker break 11*49cdfc7eSAndroid Build Coastguard Worker fi 12*49cdfc7eSAndroid Build Coastguard Workerdone 13*49cdfc7eSAndroid Build Coastguard Worker 14*49cdfc7eSAndroid Build Coastguard Workerif [ "$supported" != "yes" ]; then 15*49cdfc7eSAndroid Build Coastguard Worker echo "Only this list are supported for now: $SUPPORTED" 16*49cdfc7eSAndroid Build Coastguard Worker exit 1 17*49cdfc7eSAndroid Build Coastguard Workerfi 18*49cdfc7eSAndroid Build Coastguard Worker 19*49cdfc7eSAndroid Build Coastguard WorkerLIBS="-lpthread" 20*49cdfc7eSAndroid Build Coastguard WorkerFLAGS="" 21*49cdfc7eSAndroid Build Coastguard Worker 22*49cdfc7eSAndroid Build Coastguard Workercase "$OS" in 23*49cdfc7eSAndroid Build Coastguard Worker "SunOS") 24*49cdfc7eSAndroid Build Coastguard Worker LIBS="${LIBS} -lmalloc"; 25*49cdfc7eSAndroid Build Coastguard Worker FLAGS="${FLAGS} -D_solaris";; 26*49cdfc7eSAndroid Build Coastguard Worker "FreeBSD") 27*49cdfc7eSAndroid Build Coastguard Worker FLAGS="${FLAGS} -D_freebsd";; 28*49cdfc7eSAndroid Build Coastguard Workeresac 29*49cdfc7eSAndroid Build Coastguard Worker 30*49cdfc7eSAndroid Build Coastguard Workercat <<EOF > Makefile 31*49cdfc7eSAndroid Build Coastguard Workerall: ebizzy 32*49cdfc7eSAndroid Build Coastguard Worker 33*49cdfc7eSAndroid Build Coastguard Workerebizzy: ebizzy.c 34*49cdfc7eSAndroid Build Coastguard Worker gcc -Wall -Wshadow ${LIBS} ${FLAGS} -o ebizzy ebizzy.c 35*49cdfc7eSAndroid Build Coastguard Worker 36*49cdfc7eSAndroid Build Coastguard Workerclean: 37*49cdfc7eSAndroid Build Coastguard Worker rm -f ebizzy Makefile 38*49cdfc7eSAndroid Build Coastguard WorkerEOF 39*49cdfc7eSAndroid Build Coastguard Worker 40*49cdfc7eSAndroid Build Coastguard Workerecho "Type 'make' to compile" 41*49cdfc7eSAndroid Build Coastguard Worker 42