Copy comments from gdbarch.sh to gdbarch.h. Fix a number of K&R params.
[deliverable/binutils-gdb.git] / sim / configure.in
CommitLineData
c906108c 1dnl Process this file with autoconf to produce a configure script.
c2d11a7d 2AC_PREREQ(2.13)dnl
c906108c
SS
3AC_INIT(Makefile.in)
4
5AC_PROG_CC
6AC_PROG_INSTALL
7AC_CHECK_TOOL(AR, ar)
8AC_CHECK_TOOL(RANLIB, ranlib, :)
9
10AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
11AC_CANONICAL_SYSTEM
12AC_ARG_PROGRAM
13AC_PROG_CC
14AC_SUBST(CFLAGS)
15AC_SUBST(HDEFINES)
16AR=${AR-ar}
17AC_SUBST(AR)
18AC_PROG_RANLIB
19
20# Put a plausible default for CC_FOR_BUILD in Makefile.
c906108c
SS
21if test "x$cross_compiling" = "xno"; then
22 CC_FOR_BUILD='$(CC)'
23else
24 CC_FOR_BUILD=gcc
25fi
26AC_SUBST(CC_FOR_BUILD)
27
28# If a cpu ever has more than one simulator to choose from, use
29# --enable-sim=... to choose.
30AC_ARG_ENABLE(sim,
31[ --enable-sim ],
32[case "${enableval}" in
33yes | no) ;;
34*) AC_MSG_ERROR(bad value ${enableval} given for --enable-sim option) ;;
35esac])
36
37# Assume simulator can be built with cc.
38# If the user passes --enable-sim built it regardless of $(CC).
39only_if_gcc=no
40only_if_enabled=no
41extra_subdirs=common
42
43# WHEN ADDING ENTRIES TO THIS MATRIX:
44# Make sure that the left side always has two dashes. Otherwise you
45# can get spurious matches. Even for unambiguous cases, do this as a
46# convention, else the table becomes a real mess to understand and maintain.
47
48case "${target}" in
2acceee2 49 arm*-*-* | thumb*-*-*)
6426a772
JM
50 sim_target=arm
51 extra_subdirs="${extra_subdirs} testsuite"
52 ;;
bcd65766
NC
53 strongarm*-*-*)
54 sim_target=arm
55 extra_subdirs="${extra_subdirs} testsuite"
56 ;;
c906108c
SS
57 d10v-*-*) sim_target=d10v ;;
58 d30v-*-*)
59 sim_target=d30v
60 only_if_gcc=yes
61 extra_subdirs="${extra_subdirs} igen"
62 ;;
63 fr30-*-*) sim_target=fr30 ;;
64 h8300*-*-*) sim_target=h8300 ;;
65 h8500-*-*) sim_target=h8500 ;;
66 i960-*-*) sim_target=i960 ;;
67 m32r-*-*) sim_target=m32r ;;
5d031c16 68 m68hc11-*-*|m6811-*-*) sim_target=m68hc11 ;;
7a292a7a 69 mcore-*-*) sim_target=mcore ;;
c906108c
SS
70 mips*-*-*)
71 # The MIPS simulator can only be compiled by gcc.
72 sim_target=mips
73 only_if_gcc=yes
74 extra_subdirs="${extra_subdirs} igen"
75 ;;
76 mn10300*-*-*)
77 # The mn10300 simulator can only be compiled by gcc.
78 sim_target=mn10300
79 only_if_gcc=yes
80 extra_subdirs="${extra_subdirs} igen"
81 ;;
82 mn10200*-*-*)
83 sim_target=mn10200
84 ;;
85 sh*-*-*) sim_target=sh ;;
86 powerpc*-*-eabi* | powerpc*-*-solaris* | powerpc*-*-sysv4* | powerpc*-*-elf* | powerpc*-*-linux* )
87 # The PowerPC simulator uses the GCC extension long long as well as
88 # ANSI prototypes, so don't enable it for random host compilers
89 # unless asked to.
90 sim_target=ppc
91 only_if_gcc=yes
92 #extra_subdirs="${extra_subdirs}"
93 ;;
6c29acca
AC
94 tic80-*-*)
95 sim_target=tic80
96 only_if_gcc=yes
97 extra_subdirs="${extra_subdirs} igen"
98 ;;
c906108c
SS
99 v850-*-*)
100 # The V850 simulator can only be compiled by gcc.
101 sim_target=v850
102 extra_subdirs="${extra_subdirs} igen"
103 only_if_gcc=yes
104 ;;
105 v850e-*-*)
106 # The V850 simulator can only be compiled by gcc.
107 sim_target=v850
108 extra_subdirs="${extra_subdirs} igen"
109 only_if_gcc=yes
110 ;;
111 v850ea-*-*)
112 # The V850 simulator can only be compiled by gcc.
113 sim_target=v850
114 extra_subdirs="${extra_subdirs} igen"
115 only_if_gcc=yes
116 ;;
117 w65-*-*)
118 sim_target=w65
119 # The w65 is suffering from gradual decay.
120 only_if_enabled=yes
121 ;;
122 z8k*-*-*) sim_target=z8k ;;
123 sparc64-*-*)
124 only_if_gcc=yes
7a292a7a 125 sim_target=none # Don't build erc32 if sparc64.
c906108c
SS
126 ;;
127 sparclite*-*-* | sparc86x*-*-*)
128 # The SPARC simulator can only be compiled by gcc.
129 only_if_gcc=yes
7a292a7a 130 sim_target=erc32
c906108c
SS
131 ;;
132 sparc*-*-*)
133 # The SPARC simulator can only be compiled by gcc.
134 only_if_gcc=yes
7a292a7a
SS
135 # Unfortunately erc32 won't build on many hosts, so only enable
136 # it if the user really really wants it.
137 only_if_enabled=yes
138 sim_target=erc32
c906108c
SS
139 ;;
140 *) sim_target=none ;;
141esac
142
143
c906108c
SS
144# Is there a testsuite directory for the target?
145testdir=`echo ${target} | sed -e 's/-.*-/-/'`
146if test -r ${srcdir}/testsuite/${testdir}/configure ; then
147 extra_subdirs="${extra_subdirs} testsuite"
148fi
149
150
151case "${enable_sim}" in
152no) sim_target=none ;;
153yes)
154 if test ${only_if_gcc} = yes ; then
155 if test "${GCC}" != yes ; then
156 echo "Can't enable simulator since not compiling with GCC."
157 sim_target=none
158 fi
159 fi
160 ;;
161*)
162 if test ${only_if_enabled} = yes ; then
163 sim_target=none
164 else
165 if test ${only_if_gcc} = yes ; then
166 if test "${GCC}" != yes ; then
167 sim_target=none
168 fi
169 fi
170 fi
171 ;;
172esac
173
174if test x"${sim_target}" != xnone ; then
175 configdirs="${extra_subdirs} ${sim_target}"
176 AC_CONFIG_SUBDIRS($configdirs)
177fi
178
179AC_OUTPUT(Makefile)
180
181exit 0
This page took 0.057899 seconds and 4 git commands to generate.