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