config (1032B)
1 #!/bin/sh 2 3 exec > $$.tmp 4 trap "rm -f $$.tmp" EXIT INT TERM 5 6 arch=`uname -m` 7 sys=`uname -s | tr 'A-Z' 'a-z'` 8 9 case $sys in 10 openbsd) 11 echo TOOL=${TOOL:-clang} 12 echo HOST=obsd 13 echo ARFLAGS="${ARFLAGS:--rv}" 14 echo NOPIE_LDFLAGS=-no-pie 15 ;; 16 netbsd) 17 #TODO: send a patch to NetBSD to solve this problem 18 echo TOOL=${TOOL:-gnu} 19 echo HOST=bsd 20 echo ARFLAGS="${ARFLAGS:--rv}" 21 ;; 22 freebsd) 23 echo TOOL=${TOOL:-clang} 24 echo HOST=bsd 25 ;; 26 darwin) 27 echo HOST=bsd 28 echo RANLIB_FLAGS="${RANLIB_FLAGS:--c}" 29 ;; 30 minix) 31 echo RANLIB="${RANLIB:-ar t}" 32 ;; 33 *bsd) 34 echo HOST=bsd 35 ;; 36 linux) 37 echo TOOL=${TOOL:-gnu} 38 echo HOST=linux 39 ;; 40 plan9) 41 echo TOOL=${TOOL:-plan9} 42 echo HOST=plan9 43 ;; 44 *) 45 echo TOOL=${TOOL:-unix} 46 echo HOST=${HOST:-posix} 47 esac 48 49 50 case $arch in 51 x86_64) 52 arch=amd64 53 ;; 54 aarch64) 55 arch=arm64 56 ;; 57 esac 58 59 echo CONF=${CONF:-$arch-$sys} 60 echo CROSS_COMPILE=$CROSS_COMPILE 61 echo DESTDIR=$DESTDIR 62 echo PREFIX=${PREFIX:=/usr/local} 63 echo LIBPREFIX=${LIBPREFIX:-$PREFIX} 64 echo LIBPROFILE=${LIBPROFILE:-scc} 65 echo STD=${STD:-c99} 66 67 mv $$.tmp config.mk