2018-02-04 18:07:12 -08:00
|
|
|
#!/bin/bash
|
2008-01-19 15:08:39 -08:00
|
|
|
|
2022-03-04 02:11:01 -08:00
|
|
|
# set environment variables used by scripts/make.sh
|
2008-01-19 15:08:39 -08:00
|
|
|
|
2018-02-04 18:07:12 -08:00
|
|
|
# People run ./configure out of habit, so do "defconfig" for them.
|
|
|
|
|
|
|
|
if [ "$(basename "$0")" == configure ]
|
|
|
|
then
|
|
|
|
echo "Assuming you want 'make defconfig', but you should probably check the README."
|
|
|
|
make defconfig
|
|
|
|
exit $?
|
|
|
|
fi
|
|
|
|
|
2022-03-04 02:11:01 -08:00
|
|
|
# Warn about stuff, disable stupid warnings, be 8-bit clean for utf8.
|
2022-07-01 04:28:11 -07:00
|
|
|
[ "${CFLAGS/-funsigned-char//}" == "$CFLAGS" ] &&
|
2022-09-14 00:43:39 -07:00
|
|
|
CFLAGS+=" -Wall -Wundef -Werror=implicit-function-declaration -Wno-char-subscripts -Wno-pointer-sign -funsigned-char"
|
2022-03-04 02:11:01 -08:00
|
|
|
|
|
|
|
# Set default values if variable not already set
|
2022-03-22 12:21:08 -07:00
|
|
|
: ${CC:=cc} ${HOSTCC:=cc} ${GENDIR:=generated} ${KCONFIG_CONFIG:=.config}
|
2022-04-12 15:22:18 -07:00
|
|
|
: ${UNSTRIPPED:=$GENDIR/unstripped} ${OUTNAME:=toybox${TARGET:+-$TARGET}}
|
2022-03-04 02:11:01 -08:00
|
|
|
: ${OPTIMIZE:=-Os -ffunction-sections -fdata-sections -fno-asynchronous-unwind-tables -fno-strict-aliasing}
|
|
|
|
|
2015-02-28 10:39:16 -08:00
|
|
|
# We accept LDFLAGS, but by default don't have anything in it
|