scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

config (582B)


      1 #!/bin/sh
      2 
      3 case `uname` in
      4 OpenBSD)
      5 	echo TOOL=${TOOL:-clang} HOST=bsd ARFLAGS="${ARFLAGS:--rv}" NOPIE_LDFLAGS=-no-pie
      6 	;;
      7 NetBSD)
      8 	#TODO: send a patch to NetBSD to solve this problem
      9 	echo HOST=bsd ARFLAGS="${ARFLAGS:--rv}"
     10 	;;
     11 *BSD)
     12 	echo HOST=bsd
     13 	;;
     14 Linux)
     15 	echo TOOL=${TOOL:-gnu} HOST=linux
     16 	;;
     17 Plan9)
     18 	echo TOOL=${TOOL:-plan9} HOST=plan9
     19 	;;
     20 esac
     21 
     22 
     23 for i
     24 do
     25 	case $1 in
     26 	-c)
     27 
     28 		mach=`uname -m`
     29 
     30 		case $mach in
     31 		amd64|x86_64)
     32 			mach=amd64
     33 			;;
     34 		esac
     35 
     36 		sys=`uname -s | tr 'A-Z' 'a-z'`
     37 		echo CONF=$mach-$sys
     38 		;;
     39 	*)
     40 		echo usage: config [-c] >&2
     41 		exit 1
     42 		;;
     43 	esac
     44 done