1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
|
#!/bin/sh
#
# Minimal configuration script to update features header and makefile.
MSP430LIBC_PRINTF_INT64=1
MSP430LIBC_PRINTF_INT32=1
MSP430LIBC_IEEE754_ERRORS=0
MSP430LIBC_VERSION=`cat .version`
MSP430LIBC_PREFIX=/msp430/install/dev
if [ -z "${MSP430LIBC_VERSION}" ] ; then
echo 1>&2 "$0: No version information; something went wrong"
exit 1
fi
usage () {
(
if [ $# -gt 0 ] ; then
echo "$0: Unrecognized argument(s) " "${@}"
fi
cat <<EOText
Minimal configuration script for msp430-libc to update the features
header msp430libc.h and the Makefile.
This script must be run from the root directory of the source area.
There is no support for separated builds at this time.
--disable-printf-int64 : Remove 64-bit integer support to printf formats
--disable-printf-int32 : Remove 32-bit integer support from printf formats
--enable-ieee754-errors : Use IEEE 754 error checking in libfp functions
--prefix=/path/for/install : Where to install (now ${MSP430LIBC_PREFIX})
Use --disable-foo to counter --enable-foo.
EOText
) 1>&2
}
while [ $# -gt 0 ] ; do
case ${1} in
--enable-printf-int64)
MSP430LIBC_PRINTF_INT64=1
;;
--disable-printf-int64)
MSP430LIBC_PRINTF_INT64=0
;;
--enable-printf-int32)
MSP430LIBC_PRINTF_INT32=1
;;
--disable-printf-int32)
MSP430LIBC_PRINTF_INT32=0
;;
--enable-ieee754-errors)
MSP430LIBC_IEEE754_ERRORS=1
;;
--disable-ieee754-errors)
MSP430LIBC_IEEE754_ERRORS=0
;;
--prefix=*)
MSP430LIBC_PREFIX=$(echo ${1} | sed -e 's/^--prefix=//')
;;
--prefix)
shift
MSP430LIBC_PREFIX="${1}"
;;
--help)
usage
exit 0
;;
*)
usage "${@}"
exit 1
esac
shift
done
if [ -z "${MSP430LIBC_PREFIX}" ] ; then
usage
exit 1
fi
cat >configure.sed <<EOText
s#@MSP430LIBC_VERSION@#${MSP430LIBC_VERSION}#g
s#@MSP430LIBC_PREFIX@#${MSP430LIBC_PREFIX}#g
s#@MSP430LIBC_PRINTF_INT64@#${MSP430LIBC_PRINTF_INT64}#g
s#@MSP430LIBC_PRINTF_INT32@#${MSP430LIBC_PRINTF_INT32}#g
s#@MSP430LIBC_IEEE754_ERRORS@#${MSP430LIBC_IEEE754_ERRORS}#g
EOText
for f in include/msp430libc.h src/Makefile ; do
sed -f configure.sed < ${f}.in > ${f}
done
|