* configure.in: Only build the V850 simulator if
[external/binutils.git] / sim / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.5)dnl
3 AC_INIT(Makefile.in)
4
5 AC_PROG_CC
6 AC_PROG_INSTALL
7 AC_CHECK_TOOL(AR, ar)
8 AC_CHECK_TOOL(RANLIB, ranlib, :)
9
10 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
11 AC_CANONICAL_SYSTEM
12 AC_ARG_PROGRAM
13 AC_PROG_CC
14 AC_SUBST(CFLAGS)
15 AC_SUBST(HDEFINES)
16 AR=${AR-ar}
17 AC_SUBST(AR)
18 AC_PROG_RANLIB
19
20 # Put a plausible default for CC_FOR_BUILD in Makefile.
21 AC_C_CROSS
22 if test "x$cross_compiling" = "xno"; then
23   CC_FOR_BUILD='$(CC)'
24 else
25   CC_FOR_BUILD=gcc
26 fi
27 AC_SUBST(CC_FOR_BUILD)
28
29 # The PowerPC simulator uses the GCC extension long long as well as
30 # ANSI prototypes, so don't enable it for random host compilers
31 # unless asked to.
32
33 AC_ARG_ENABLE(sim-powerpc,
34 [  --enable-sim-powerpc ],
35 [case "${enableval}" in
36 yes)    powerpc_sim=yes ;;
37 no)     powerpc_sim=no ;;
38 *)      AC_MSG_ERROR(bad value ${enableval} given for sim-powerpc option) ;;
39 esac],[if test x"$GCC" != x""; then powerpc_sim=yes; else powerpc_sim=no; fi])
40
41 # WHEN ADDING ENTRIES TO THIS MATRIX:
42 #  Make sure that the left side always has two dashes.  Otherwise you
43 #  can get spurious matches.  Even for unambiguous cases, do this as a
44 #  convention, else the table becomes a real mess to understand and maintain.
45
46 case "${target}" in
47   arm*-*-*)             sim_target=arm ;;
48 # start-sanitize-d10v
49   d10v-*-*)             sim_target=d10v ;;
50 # end-sanitize-d10v
51   h8300*-*-*)           sim_target=h8300 ;;
52   h8500-*-*)            sim_target=h8500 ;;
53   mips*-*-*)
54                                 # The MIPS simulator can only be compiled
55                                 # by gcc.
56                                 if test "${GCC}" = "yes"; then
57                                   sim_target=mips
58                                 else
59                                   sim_target=none
60                                 fi
61                                 ;;
62   sh*-*-*)              sim_target=sh ;; 
63   powerpc*-*-eabi* | powerpc*-*-solaris* | powerpc*-*-sysv4* | powerpc*-*-elf* )
64                         if test x"$powerpc_sim" = x"yes"; then sim_target=ppc; fi ;;
65 # start-sanitize-v850
66   v850-*-*)
67                                 # The V850 simulator can only be compiled
68                                 # by gcc.
69                                 if test "${GCC}" = "yes"; then
70                                   sim_target=v850
71                                 else
72                                   sim_target=none
73                                 fi
74                                 ;;
75 # end-sanitize-v850
76   w65-*-*)              sim_target=w65 ;;
77   z8k*-*-*)             sim_target=z8k ;;
78   sparc*-*-*)                   # The SPARC simulator can only be compiled
79                                 # by gcc.
80                                 if test "${GCC}" = "yes"; then
81                                   sim_target=erc32
82                                 else
83                                   sim_target=none
84                                 fi
85                                 ;;
86   *)                    sim_target=none ;;
87 esac
88
89 configdirs=${sim_target}
90 AC_CONFIG_SUBDIRS($configdirs)
91
92 AC_OUTPUT(Makefile)
93
94 exit 0