blob: 7b10f6e595f4e54ea5e9a03d97f980dfa6d648ad [file] [log] [blame]
Rob Landley28964802008-01-19 17:08:39 -06001# Toybox configuration file.
2
3# This sets environment variables used by scripts/make.sh
4
5# A synonym.
6[ -z "$CROSS_COMPILE" ] && CROSS_COMPILE="$CROSS"
Rob Landley57f93c82015-02-28 12:39:16 -06007
8# CFLAGS and OPTIMIZE are different so you can add extra CFLAGS without
9# disabling default optimizations
Rob Landleya913d922015-05-09 17:07:22 -050010[ -z "$CFLAGS" ] && CFLAGS="-Wall -Wundef -Wno-char-subscripts"
Rob Landley97abd4a2012-06-18 23:23:24 -050011# Required for our expected ABI. we're 8-bit clean thus "char" must be unsigned.
Rob Landley28964802008-01-19 17:08:39 -060012CFLAGS="$CFLAGS -funsigned-char"
Rob Landley35c92f12015-09-17 01:49:48 -050013[ -z "$OPTIMIZE" ] && OPTIMIZE="-Os -ffunction-sections -fdata-sections -fno-asynchronous-unwind-tables -fno-strict-aliasing"
Rob Landley97abd4a2012-06-18 23:23:24 -050014
Rob Landley57f93c82015-02-28 12:39:16 -060015# We accept LDFLAGS, but by default don't have anything in it
16[ -z "$LDOPTIMIZE" ] && LDOPTIMIZE="-Wl,--gc-sections"
17
Rob Landley12235782015-10-05 20:47:49 -050018# The makefile provides defaults for these, so this only gets used if
19# you call scripts/make.sh and friends directly.
20
Rob Landley57f93c82015-02-28 12:39:16 -060021[ -z "$CC" ] && CC=cc
Rob Landley57f93c82015-02-28 12:39:16 -060022
23# If HOSTCC needs CFLAGS or LDFLAGS, just add them to the variable
24# ala HOSTCC="blah-cc --static"
Rob Landley12235782015-10-05 20:47:49 -050025[ -z "$HOSTCC" ] && HOSTCC=cc