diff options
author | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-03-09 20:53:56 +0000 |
---|---|---|
committer | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-03-09 20:53:56 +0000 |
commit | 83b8e55bcaa1fed08c87617aca312ad5a4e578e4 (patch) | |
tree | 761de789b427cf9d459daddeacf06dc57b99319c /gcc/mkconfig.sh | |
parent | d14d1623b3fec9b97a9c02342996087263af2c01 (diff) | |
download | gcc-83b8e55bcaa1fed08c87617aca312ad5a4e578e4.tar.gz |
* configure.in: Prune nonexistent files from build_xm_file,
xm_file, and host_xm_file lists. Warn unless they're
$cpu/xm-$cpu.h.
Don't generate *config.h here.
AC_SUBST all variables needed to generate *config.h.
* configure: Regenerate.
* mkconfig.sh: New helper script, from code removed from
configure.in.
* Makefile.in: Zap all MALLOC variables - no longer used
anywhere, and malloc.c doesn't exist.
Substitute in variables needed to generate *config.h.
Stop lying about the dependencies contained in CONFIG_H and
GCONFIG_H.
(HCONFIG_H, TCONFIG_H, TM_P_H): New variables.
(config.h, hconfig.h, tconfig.h, tm_p.h, cs-config.h,
cs-hconfig.h, cs-tconfig.h, cs-tm_p.h): New rules.
(all .o): Add dependencies on $(HCONFIG_H), $(TCONFIG_H),
$(TM_P_H), etc. as appropriate.
* config.gcc: Zap references to deleted files.
* ggc-none.c: Don't include rtl.h or tm_p.h.
* config/i386/xm-beos.h, config/i386/xm-dgux.h,
config/i386/xm-djgpp.h, config/i386/xm-dos.h,
config/i386/xm-gnu.h, config/i386/xm-i386-interix.h,
config/i386/xm-linux.h, config/i386/xm-linux.h,
config/i386/xm-next.h, config/i386/xm-openbsd.h,
config/i386/xm-sun.h, config/i386/xm-sysv3.h:
Don't include i386/xm-i386.h.
* config/elxsi/xm-elxsi.h, config/i386/xm-bsd386.h,
config/i386/xm-i386.h, config/i860/xm-i860.h,
config/i960/xm-i960.h, config/mcore/xm-mcore.h,
config/mn10300/xm-mn10300.h, config/ns32k/xm-ns32k.h,
config/pj/xm-pj.h, config/sh/xm-sh.h, config/v850/xm-v850.h:
Delete (empty except comments, #includes of other deleted
files, and macros used nowhere).
cp:
* Make-lang.in: Add dependencies on $(TM_P_H) as appropriate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40350 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/mkconfig.sh')
-rw-r--r-- | gcc/mkconfig.sh | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh new file mode 100644 index 00000000000..53151d00d29 --- /dev/null +++ b/gcc/mkconfig.sh @@ -0,0 +1,67 @@ +#! /bin/sh + +# 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. + +if [ -z "$1" ]; then + echo "Usage: HEADERS='list' DEFINES='list' mkconfig.sh FILE" >&2 + exit 1 +fi + +output=$1 +rm -f $output.T +exec > $output.T + +# Define TARGET_CPU_DEFAULT if the system wants one. +# This substitutes for lots of *.h files. +if [ "$TARGET_CPU_DEFAULT" != "" ]; then + echo "#define TARGET_CPU_DEFAULT ($TARGET_CPU_DEFAULT)" +fi + +# 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 + set $HEADERS; first=$1 + case $first in auto-* ) + echo "#include \"$first\"" + shift + HEADERS=$* + ;; + esac +fi + +if [ -n "$HEADERS" ]; then + echo '#ifdef IN_GCC' + for file in $HEADERS; do + echo "# include \"$file\"" + done + echo '#endif' +fi + +for def in $DEFINES; do + echo "#ifndef $def" + echo "# define $def" + echo "#endif" +done + +# Include insn-codes.h last, because it includes machmode.h, +# and we want EXTRA_CC_MODES to be taken into account. +echo "#ifndef GENERATOR_FILE" +echo "#include \"insn-codes.h\"" +echo "#endif" + +exec >&- + +# Avoid changing the actual file if possible. +if [ -f $output ] && cmp $output.T $output; then + echo $output is unchanged >&2 + rm -f $output.T +else + mv -f $output.T $output +fi + +# Touch a stamp file for Make's benefit. +rm -f cs-$output +echo timestamp > cs-$output |