diff options
Diffstat (limited to 'gcc/mkconfig.sh')
-rw-r--r-- | gcc/mkconfig.sh | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh index 5b86b79f8b9..cc87ccb37e8 100644 --- a/gcc/mkconfig.sh +++ b/gcc/mkconfig.sh @@ -2,11 +2,11 @@ # Generate gcc's config.h, which is not your normal autoconf-generated # config.h (that's auto-(host|build).h). $1 is the file to generate. -# HEADERS, DEFINES, and possibly TARGET_CPU_DEFAULT are expected to be -# set in the environment. +# TM_DEFINES, HEADERS, XM_DEFINES, and possibly TARGET_CPU_DEFAULT are +# expected to be set in the environment. if [ -z "$1" ]; then - echo "Usage: HEADERS='list' DEFINES='list' mkconfig.sh FILE" >&2 + echo "Usage: TM_DEFINES='list' HEADERS='list' XM_DEFINES='list' mkconfig.sh FILE" >&2 exit 1 fi @@ -19,6 +19,13 @@ if [ "$TARGET_CPU_DEFAULT" != "" ]; then echo "#define TARGET_CPU_DEFAULT ($TARGET_CPU_DEFAULT)" >> ${output}T fi +# Provide defines for other target machine macros to be used everywhere. +for def in $TM_DEFINES; do + echo "#ifndef $def" | sed 's/=.*//' >> ${output}T + echo "# define $def" | sed 's/=/ /' >> ${output}T + echo "#endif" >> ${output}T +done + # The first entry in HEADERS may be auto-host.h or auto-build.h; # it wants to be included even when not -DIN_GCC. if [ -n "$HEADERS" ]; then @@ -63,7 +70,7 @@ if [ -n "$HEADERS" ]; then echo '#endif' >> ${output}T fi -for def in $DEFINES; do +for def in $XM_DEFINES; do echo "#ifndef $def" | sed 's/=.*//' >> ${output}T echo "# define $def" | sed 's/=/ /' >> ${output}T echo "#endif" >> ${output}T |