diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-06-19 21:33:30 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-06-22 19:26:13 -0400 |
commit | 36bb57e40c5062ff6c5cb16463e1c7233baf46bb (patch) | |
tree | df77ebccb379772d96211f3b5d74e260b184cdfe /sim/configure.ac | |
parent | 224506e95d2d44aa6583cbcda9f4b7305f834ab3 (diff) | |
download | gdb-36bb57e40c5062ff6c5cb16463e1c7233baf46bb.zip gdb-36bb57e40c5062ff6c5cb16463e1c7233baf46bb.tar.gz gdb-36bb57e40c5062ff6c5cb16463e1c7233baf46bb.tar.bz2 |
sim: drop configure scripts for simple ports
These ports only use the pieces that have been unified, so we can
merge them into the common configure script and get rid of their
unique one entirely.
We still compile & link separate run programs, and have dedicated
subdir Makefiles, but the configure script portion is merged.
Diffstat (limited to 'sim/configure.ac')
-rw-r--r-- | sim/configure.ac | 84 |
1 files changed, 65 insertions, 19 deletions
diff --git a/sim/configure.ac b/sim/configure.ac index 042bfbf..62dcdee 100644 --- a/sim/configure.ac +++ b/sim/configure.ac @@ -48,21 +48,57 @@ dnl used when installing files to see if they need to be suffixed. SIM_PRIMARY_TARGET= AC_SUBST(SIM_PRIMARY_TARGET) +SIM_SUBDIRS= +AC_SUBST(SIM_SUBDIRS) + +dnl Used by common/Make-common.in to see which configure script created it. +SIM_COMMON_BUILD_TRUE= +SIM_COMMON_BUILD_FALSE='#' +AC_SUBST(SIM_COMMON_BUILD_TRUE) +AC_SUBST(SIM_COMMON_BUILD_FALSE) + +AC_CONFIG_FILES(Make-common.sim:common/Make-common.in) +dnl Build a particular arch subdir. +dnl arg[1] is the arch subdir name. +dnl arg[2] is whether the arch has a dedicated configure script. m4_define([SIM_BUILD_TARGET], [dnl - AC_CONFIG_SUBDIRS($1) + m4_if($2, [true], [dnl + AC_CONFIG_SUBDIRS($1) + ], [dnl + AC_CONFIG_FILES($1/Makefile.sim:$1/Makefile.in) + AC_CONFIG_COMMANDS([$1/Makefile], +[sed -n \ + -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ { + /^srcdir / { s:= := ../:; s:$:/$1:; } + p + }' \ + <Make-common.sim >$1/Makesim1.tmp + sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >$1/Makesim2.tmp + sed -e '/^## COMMON_PRE_/ r $1/Makesim1.tmp' \ + -e '/^## COMMON_POST_/ r $1/Makesim2.tmp' \ + <$1/Makefile.sim >$1/Makefile + rm -f $1/Makesim1.tmp $1/Makesim2.tmp +]) + AS_VAR_APPEND([SIM_SUBDIRS], [" $1"]) + ]) dnl Create the depdirs for ports until we can convert them to automake. AC_CONFIG_COMMANDS([depdir-$1], [$SHELL $ac_aux_dir/mkinstalldirs $1/$DEPDIR], [ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR]) ]) +dnl Enable a particular arch subdir. +dnl arg[1] is the matching target triple. +dnl arg[2] is the arch subdir name. +dnl arg[3] is whether the arch has a dedicated configure script. +dnl arg[4] is any additional shell code to run for this arch. m4_define([SIM_TARGET], [dnl case "${targ}" in all|$1) if test "${targ}" = "${target}"; then SIM_PRIMARY_TARGET=$2 fi - SIM_BUILD_TARGET($2) - $3 + SIM_BUILD_TARGET($2, $3) + $4 ;; esac ]) @@ -78,34 +114,34 @@ if test "${enable_sim}" != no; then SIM_TARGET([aarch64*-*-*], [aarch64]) SIM_TARGET([arm*-*-*], [arm]) SIM_TARGET([avr*-*-*], [avr]) - SIM_TARGET([bfin-*-*], [bfin]) - SIM_TARGET([bpf-*-*], [bpf]) + SIM_TARGET([bfin-*-*], [bfin], [true]) + SIM_TARGET([bpf-*-*], [bpf], [true]) SIM_TARGET([cr16*-*-*], [cr16]) - SIM_TARGET([cris-*-* | crisv32-*-*], [cris]) + SIM_TARGET([cris-*-* | crisv32-*-*], [cris], [true]) SIM_TARGET([d10v-*-*], [d10v]) - SIM_TARGET([frv-*-*], [frv]) + SIM_TARGET([frv-*-*], [frv], [true]) + SIM_TARGET([ft32-*-*], [ft32]) SIM_TARGET([h8300*-*-*], [h8300]) - SIM_TARGET([iq2000-*-*], [iq2000]) - SIM_TARGET([lm32-*-*], [lm32]) + SIM_TARGET([iq2000-*-*], [iq2000], [true]) + SIM_TARGET([lm32-*-*], [lm32], [true]) SIM_TARGET([m32c-*-*], [m32c]) - SIM_TARGET([m32r-*-*], [m32r]) + SIM_TARGET([m32r-*-*], [m32r], [true]) SIM_TARGET([m68hc11-*-*|m6811-*-*], [m68hc11]) SIM_TARGET([mcore-*-*], [mcore]) SIM_TARGET([microblaze-*-*], [microblaze]) - SIM_TARGET([mips*-*-*], [mips], [sim_igen=yes]) - SIM_TARGET([mn10300*-*-*], [mn10300], [sim_igen=yes]) + SIM_TARGET([mips*-*-*], [mips], [true], [sim_igen=yes]) + SIM_TARGET([mn10300*-*-*], [mn10300], [true], [sim_igen=yes]) SIM_TARGET([moxie-*-*], [moxie]) SIM_TARGET([msp430*-*-*], [msp430]) - SIM_TARGET([or1k-*-* | or1knd-*-*], [or1k]) + SIM_TARGET([or1k-*-* | or1knd-*-*], [or1k], [true]) SIM_TARGET([pru*-*-*], [pru]) - SIM_TARGET([riscv*-*-*], [riscv]) + SIM_TARGET([riscv*-*-*], [riscv], [true]) SIM_TARGET([rl78-*-*], [rl78]) - SIM_TARGET([rx-*-*], [rx]) + SIM_TARGET([rx-*-*], [rx], [true]) SIM_TARGET([sh*-*-*], [sh]) - SIM_TARGET([sparc-*-rtems*|sparc-*-elf*], [erc32]) - SIM_TARGET([powerpc*-*-*], [ppc]) - SIM_TARGET([ft32-*-*], [ft32]) - SIM_TARGET([v850*-*-*], [v850], [sim_igen=yes]) + SIM_TARGET([sparc-*-rtems*|sparc-*-elf*], [erc32], [true]) + SIM_TARGET([powerpc*-*-*], [ppc], [true]) + SIM_TARGET([v850*-*-*], [v850], [true], [sim_igen=yes]) done if test "x${enable_example_sims}" = xyes; then @@ -129,5 +165,15 @@ SIM_AC_OPTION_STDIO SIM_AC_OPTION_TRACE SIM_AC_OPTION_WARNINGS +dnl These are unfortunate. They are conditionally called by other sim macros +dnl but always used by common/Make-common.in. So we have to subst here even +dnl when the rest of the code is in the respective macros. Once we merge the +dnl respective SIM_AC_OPTION_xxx call above, we can drop these. +AC_SUBST(sim_bitsize) +AC_SUBST(sim_float) +AC_SUBST(sim_scache) +AC_SUBST(sim_default_model) +AC_SUBST(sim_reserved_bits) + AC_CONFIG_FILES([arch-subdir.mk Makefile]) AC_OUTPUT |