]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - sim/m4/sim_ac_output.m4
sim: drop configure scripts for simple ports
[thirdparty/binutils-gdb.git] / sim / m4 / sim_ac_output.m4
CommitLineData
760b3e8b
MF
1dnl Copyright (C) 1997-2021 Free Software Foundation, Inc.
2dnl
3dnl This program is free software; you can redistribute it and/or modify
4dnl it under the terms of the GNU General Public License as published by
5dnl the Free Software Foundation; either version 3 of the License, or
6dnl (at your option) any later version.
7dnl
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11dnl GNU General Public License for more details.
12dnl
13dnl You should have received a copy of the GNU General Public License
14dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
15dnl
16dnl Generate the Makefile in a target specific directory.
17dnl Substitutions aren't performed on the file in AC_SUBST_FILE,
18dnl so this is a cover macro to tuck the details away of how we cope.
19dnl We cope by having autoconf generate two files and then merge them into
20dnl one afterwards. The two pieces of the common fragment are inserted into
21dnl the target's fragment at the appropriate points.
22AC_DEFUN([SIM_AC_OUTPUT],
23[dnl
760b3e8b
MF
24dnl Make @cgen_breaks@ non-null only if the sim uses CGEN.
25cgen_breaks=""
26if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
27cgen_breaks="break cgen_rtx_error";
28fi
29AC_SUBST(cgen_breaks)
30AC_CONFIG_FILES(Makefile.sim:Makefile.in)
31AC_CONFIG_FILES(Make-common.sim:../common/Make-common.in)
32AC_CONFIG_FILES(.gdbinit:../common/gdbinit.in)
33AC_CONFIG_COMMANDS([Makefile],
34[echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
35 rm -f Makesim1.tmp Makesim2.tmp Makefile
36 sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
37 sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
38 sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
39 -e '/^## COMMON_POST_/ r Makesim2.tmp' \
40 <Makefile.sim >Makefile
41 rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
42])
43AC_CONFIG_COMMANDS([stamp-h], [echo > stamp-h])
44
45dnl These are unfortunate. They are conditionally called by other sim macros
46dnl but always used by common/Make-common.in. So we have to subst here even
47dnl when the rest of the code is in the respective macros.
760b3e8b 48AC_SUBST(sim_bitsize)
760b3e8b
MF
49AC_SUBST(sim_float)
50AC_SUBST(sim_scache)
51AC_SUBST(sim_default_model)
760b3e8b
MF
52AC_SUBST(sim_reserved_bits)
53
36bb57e4
MF
54dnl Used by common/Make-common.in to see which configure script created it.
55SIM_COMMON_BUILD_TRUE='#'
56SIM_COMMON_BUILD_FALSE=
57AC_SUBST(SIM_COMMON_BUILD_TRUE)
58AC_SUBST(SIM_COMMON_BUILD_FALSE)
59
760b3e8b
MF
60AC_OUTPUT
61])