2003-07-09 Michael Snyder <msnyder@redhat.com>
[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 ;;
f1129fb8
NC
57 xscale-*-*)
58 sim_target=arm
59 extra_subdirs="${extra_subdirs} testsuite"
60 ;;
c906108c 61 d10v-*-*) sim_target=d10v ;;
3fbeef0b
AC
62# OBSOLETE d30v-*-*)
63# OBSOLETE sim_target=d30v
64# OBSOLETE only_if_gcc=yes
65# OBSOLETE extra_subdirs="${extra_subdirs} igen"
66# OBSOLETE ;;
7a3085c1 67# OBSOLETE fr30-*-*) sim_target=fr30 ;;
5fe8b0df
MS
68 h8300*-*-*)
69 sim_target=h8300
70 extra_subdirs="${extra_subdirs} testsuite"
71 ;;
c906108c
SS
72 h8500-*-*) sim_target=h8500 ;;
73 i960-*-*) sim_target=i960 ;;
74 m32r-*-*) sim_target=m32r ;;
5d031c16 75 m68hc11-*-*|m6811-*-*) sim_target=m68hc11 ;;
7a292a7a 76 mcore-*-*) sim_target=mcore ;;
c906108c
SS
77 mips*-*-*)
78 # The MIPS simulator can only be compiled by gcc.
79 sim_target=mips
80 only_if_gcc=yes
81 extra_subdirs="${extra_subdirs} igen"
82 ;;
83 mn10300*-*-*)
84 # The mn10300 simulator can only be compiled by gcc.
85 sim_target=mn10300
86 only_if_gcc=yes
87 extra_subdirs="${extra_subdirs} igen"
88 ;;
89 mn10200*-*-*)
90 sim_target=mn10200
91 ;;
ac78c4ba
MS
92 sh*-*-*)
93 sim_target=sh
94 extra_subdirs="${extra_subdirs} testsuite"
95 ;;
457174f6
AC
96 powerpc*-*-eabi* | powerpc*-*-solaris* | powerpc*-*-sysv4* | \
97 powerpc*-*-elf* | powerpc*-*-linux* | powerpc*-*-netbsd* )
c906108c
SS
98 # The PowerPC simulator uses the GCC extension long long as well as
99 # ANSI prototypes, so don't enable it for random host compilers
100 # unless asked to.
101 sim_target=ppc
102 only_if_gcc=yes
103 #extra_subdirs="${extra_subdirs}"
104 ;;
6c29acca
AC
105 tic80-*-*)
106 sim_target=tic80
107 only_if_gcc=yes
108 extra_subdirs="${extra_subdirs} igen"
109 ;;
c906108c
SS
110 v850-*-*)
111 # The V850 simulator can only be compiled by gcc.
112 sim_target=v850
113 extra_subdirs="${extra_subdirs} igen"
114 only_if_gcc=yes
115 ;;
116 v850e-*-*)
117 # The V850 simulator can only be compiled by gcc.
118 sim_target=v850
119 extra_subdirs="${extra_subdirs} igen"
120 only_if_gcc=yes
121 ;;
122 v850ea-*-*)
123 # The V850 simulator can only be compiled by gcc.
124 sim_target=v850
125 extra_subdirs="${extra_subdirs} igen"
126 only_if_gcc=yes
127 ;;
128 w65-*-*)
129 sim_target=w65
130 # The w65 is suffering from gradual decay.
131 only_if_enabled=yes
132 ;;
133 z8k*-*-*) sim_target=z8k ;;
134 sparc64-*-*)
135 only_if_gcc=yes
7a292a7a 136 sim_target=none # Don't build erc32 if sparc64.
c906108c
SS
137 ;;
138 sparclite*-*-* | sparc86x*-*-*)
139 # The SPARC simulator can only be compiled by gcc.
140 only_if_gcc=yes
7a292a7a 141 sim_target=erc32
c906108c
SS
142 ;;
143 sparc*-*-*)
144 # The SPARC simulator can only be compiled by gcc.
145 only_if_gcc=yes
7a292a7a
SS
146 # Unfortunately erc32 won't build on many hosts, so only enable
147 # it if the user really really wants it.
148 only_if_enabled=yes
149 sim_target=erc32
c906108c
SS
150 ;;
151 *) sim_target=none ;;
152esac
153
154
c906108c
SS
155# Is there a testsuite directory for the target?
156testdir=`echo ${target} | sed -e 's/-.*-/-/'`
157if test -r ${srcdir}/testsuite/${testdir}/configure ; then
158 extra_subdirs="${extra_subdirs} testsuite"
159fi
160
161
162case "${enable_sim}" in
163no) sim_target=none ;;
164yes)
165 if test ${only_if_gcc} = yes ; then
166 if test "${GCC}" != yes ; then
167 echo "Can't enable simulator since not compiling with GCC."
168 sim_target=none
169 fi
170 fi
171 ;;
172*)
173 if test ${only_if_enabled} = yes ; then
174 sim_target=none
175 else
176 if test ${only_if_gcc} = yes ; then
177 if test "${GCC}" != yes ; then
178 sim_target=none
179 fi
180 fi
181 fi
182 ;;
183esac
184
185if test x"${sim_target}" != xnone ; then
186 configdirs="${extra_subdirs} ${sim_target}"
187 AC_CONFIG_SUBDIRS($configdirs)
188fi
189
190AC_OUTPUT(Makefile)
191
192exit 0
This page took 0.189086 seconds and 4 git commands to generate.