build-gcc.sh: Allow CC, OBJCOPY, STRIP, and RC to be overridden.

These affect cross-compilation with TARGET as well.
This commit is contained in:
David Korth 2017-07-07 22:38:39 -04:00
parent d1e30aa3fa
commit f802a69e80

View File

@ -15,17 +15,24 @@ if [ -z "${ISWIN}" ]; then
;;
esac
fi
if [ ! -z "${TARGET}" ]; then
CC=${TARGET}-gcc
OBJCOPY=${TARGET}-objcopy
STRIP=${TARGET}-strip
RC=${TARGET}-windres
else
if [ -z "${CC}" ]; then
CC=gcc
fi
if [ -z "${OBJCOPY}" ]; then
OBJCOPY=objcopy
fi
if [ -z "${STRIP}" ]; then
STRIP=strip
fi
if [ -z "${RC}" ]; then
RC=windres
fi
if [ ! -z "${TARGET}" ]; then
CC=${TARGET}-${CC}
OBJCOPY=${TARGET}-${OBJCOPY}
STRIP=${TARGET}-${STRIP}
RC=${TARGET}-${RC}
fi
CFLAGS="-O2 -Wall -Wextra -std=c99"
LDFLAGS="-lm"