blob: c718e83b64f01d4e2059653ab63784dc5d4b97b6 [file] [log] [blame]
Rob Landley29fb6382018-02-04 20:07:12 -06001#!/bin/bash
Rob Landley28964802008-01-19 17:08:39 -06002
Rob Landley7a5cb952022-03-04 04:11:01 -06003# set environment variables used by scripts/make.sh
Rob Landley28964802008-01-19 17:08:39 -06004
Rob Landley29fb6382018-02-04 20:07:12 -06005# People run ./configure out of habit, so do "defconfig" for them.
6
7if [ "$(basename "$0")" == configure ]
8then
9 echo "Assuming you want 'make defconfig', but you should probably check the README."
10 make defconfig
11 exit $?
12fi
13
Rob Landley7a5cb952022-03-04 04:11:01 -060014# Warn about stuff, disable stupid warnings, be 8-bit clean for utf8.
15CFLAGS="$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 Landleybbe709f2022-03-22 14:21:08 -050018: ${CC:=cc} ${HOSTCC:=cc} ${GENDIR:=generated} ${KCONFIG_CONFIG:=.config}
Rob Landleycecd1692022-04-12 17:22:18 -050019: ${UNSTRIPPED:=$GENDIR/unstripped} ${OUTNAME:=toybox${TARGET:+-$TARGET}}
Rob Landley7a5cb952022-03-04 04:11:01 -060020: ${OPTIMIZE:=-Os -ffunction-sections -fdata-sections -fno-asynchronous-unwind-tables -fno-strict-aliasing}
21
Rob Landley57f93c82015-02-28 12:39:16 -060022# We accept LDFLAGS, but by default don't have anything in it