8sa1-gcc/gcc/mkconfig.sh
Zack Weinberg 11642c3a7c configure.in: Prune nonexistent files from build_xm_file, xm_file, and host_xm_file lists.
* 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.

From-SVN: r40350
2001-03-09 20:53:56 +00:00

68 lines
1.5 KiB
Bash

#! /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