Rob Landley | 2896480 | 2008-01-19 17:08:39 -0600 | [diff] [blame] | 1 | # 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 Landley | 57f93c8 | 2015-02-28 12:39:16 -0600 | [diff] [blame] | 7 | |
| 8 | # CFLAGS and OPTIMIZE are different so you can add extra CFLAGS without |
| 9 | # disabling default optimizations |
Rob Landley | a913d92 | 2015-05-09 17:07:22 -0500 | [diff] [blame] | 10 | [ -z "$CFLAGS" ] && CFLAGS="-Wall -Wundef -Wno-char-subscripts" |
Rob Landley | 97abd4a | 2012-06-18 23:23:24 -0500 | [diff] [blame] | 11 | # Required for our expected ABI. we're 8-bit clean thus "char" must be unsigned. |
Rob Landley | 2896480 | 2008-01-19 17:08:39 -0600 | [diff] [blame] | 12 | CFLAGS="$CFLAGS -funsigned-char" |
Rob Landley | 9614620 | 2014-08-30 17:44:07 -0500 | [diff] [blame] | 13 | [ -z "$OPTIMIZE" ] && OPTIMIZE="-Os -ffunction-sections -fdata-sections -fno-asynchronous-unwind-tables" |
Rob Landley | 97abd4a | 2012-06-18 23:23:24 -0500 | [diff] [blame] | 14 | |
Rob Landley | 57f93c8 | 2015-02-28 12:39:16 -0600 | [diff] [blame] | 15 | # We accept LDFLAGS, but by default don't have anything in it |
| 16 | [ -z "$LDOPTIMIZE" ] && LDOPTIMIZE="-Wl,--gc-sections" |
| 17 | |
| 18 | [ -z "$CC" ] && CC=cc |
Rob Landley | 57f93c8 | 2015-02-28 12:39:16 -0600 | [diff] [blame] | 19 | |
| 20 | # If HOSTCC needs CFLAGS or LDFLAGS, just add them to the variable |
| 21 | # ala HOSTCC="blah-cc --static" |
Rob Landley | 2896480 | 2008-01-19 17:08:39 -0600 | [diff] [blame] | 22 | [ -z "$HOSTCC" ] && HOSTCC=gcc |