3 # Generate gcc's config.h, which is not your normal autoconf-generated
4 # config.h (that's auto-(host|build).h). $1 is the file to generate.
5 # HEADERS, DEFINES, and possibly TARGET_CPU_DEFAULT are expected to be
6 # set in the environment.
9 echo "Usage: HEADERS='list' DEFINES='list' mkconfig.sh FILE" >&2
17 # Define TARGET_CPU_DEFAULT if the system wants one.
18 # This substitutes for lots of *.h files.
19 if [ "$TARGET_CPU_DEFAULT" != "" ]; then
20 echo "#define TARGET_CPU_DEFAULT ($TARGET_CPU_DEFAULT)"
23 # The first entry in HEADERS may be auto-host.h or auto-build.h;
24 # it wants to be included even when not -DIN_GCC.
25 if [ -n "$HEADERS" ]; then
26 set $HEADERS; first
=$1
27 case $first in auto-
* )
28 echo "#include \"$first\""
35 if [ -n "$HEADERS" ]; then
37 for file in $HEADERS; do
38 echo "# include \"$file\""
43 for def
in $DEFINES; do
49 # Include insn-codes.h last, because it includes machmode.h,
50 # and we want EXTRA_CC_MODES to be taken into account.
51 echo "#ifndef GENERATOR_FILE"
52 echo "#include \"insn-codes.h\""
57 # Avoid changing the actual file if possible.
58 if [ -f $output ] && cmp $output.T
$output; then
59 echo $output is unchanged
>&2
62 mv -f $output.T
$output
65 # Touch a stamp file for Make's benefit.
67 echo timestamp
> cs-
$output