3 # This sets environment variables used by scripts/make.sh
5 # People run ./configure out of habit, so do "defconfig" for them.
7 if [ "$(basename "$0")" == configure ]
9 echo "Assuming you want 'make defconfig', but you should probably check the README."
15 [ -z "$CROSS_COMPILE" ] && CROSS_COMPILE="$CROSS"
17 # CFLAGS and OPTIMIZE are different so you can add extra CFLAGS without
18 # disabling default optimizations
19 [ -z "$CFLAGS" ] && CFLAGS="-Wall -Wundef -Wno-char-subscripts -Werror=implicit-function-declaration"
20 # Required for our expected ABI. we're 8-bit clean thus "char" must be unsigned.
21 CFLAGS="$CFLAGS -funsigned-char"
22 [ -z "$OPTIMIZE" ] && OPTIMIZE="-Os -ffunction-sections -fdata-sections -fno-asynchronous-unwind-tables -fno-strict-aliasing"
24 # We accept LDFLAGS, but by default don't have anything in it
25 [ -z "$LDOPTIMIZE" ] && LDOPTIMIZE="-Wl,--gc-sections"
27 # The makefile provides defaults for these, so this only gets used if
28 # you call scripts/make.sh and friends directly.
32 # If HOSTCC needs CFLAGS or LDFLAGS, just add them to the variable
33 # ala HOSTCC="blah-cc --static"
34 [ -z "$HOSTCC" ] && HOSTCC=cc