aboutsummaryrefslogtreecommitdiff
path: root/sim/ppc/configure.in
blob: 59bc4b2b2be8b11f189de4e8ebeed3993e342134 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.3)dnl
AC_INIT(Makefile.in)

AC_CONFIG_HEADER(config.h:config.in)

AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../..)
AC_CANONICAL_SYSTEM
AC_ARG_PROGRAM

. ${srcdir}/../../bfd/configure.host

AC_PROG_CC
AC_SUBST(CFLAGS)
AC_SUBST(HDEFINES)
AR=${AR-ar}
AC_SUBST(AR)
AC_PROG_RANLIB

# Put a plausible default for CC_FOR_BUILD in Makefile.
AC_C_CROSS
if test "x$cross_compiling" = "xno"; then
  CC_FOR_BUILD='$(CC)'
else
  CC_FOR_BUILD=gcc
fi
AC_SUBST(CC_FOR_BUILD)

AC_CHECK_HEADERS(string.h strings.h stdlib.h time.h sys/times.h)

AC_OUTPUT(Makefile,
[case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])

if test x"$enable_sim_inline" != x""; then
  flags=""
  case "$enable_sim_inline" in
    no)		flags="";;
    0)		flags="-DDEFAULT_INLINE=0";;
    yes | 2)	flags="-DDEFAULT_INLINE=2";;
    1)		flags="-DDEFAULT_INLINE=1";;
    *) for x in `echo "$enable_sim_inline" | sed -e "s/,/ /g"`; do
	 case "$x" in
	   *_INLINE=*)	flags="$flags -D$x";;
	   *_INLINE)	flags="$flags -D$x=2";;
	   *=*)		x=`sed -e "s/=/_INLINE=/"`; flags="$flags -D$x";;
	   *)		flags="$flags -D$x""_INLINE=2";;
	 esac
       done;;
  esac
  if test x"$flags" != x""; then
    mv Makefile Makefile.tem
    echo "Setting INLINE_CFLAGS=$flags" 1>&6
    sed -e "s/^INLINE_CFLAGS.*=.*\$/INLINE_CFLAGS =$flags/" \
      < Makefile.tem > Makefile
    rm -f Makefile.tem
  fi
fi

if test x"$enable_sim_bswap" != x"" -a x"$enable_sim_bswap" != x"no"; then
  mv Makefile Makefile.tem
  echo "Setting BSWAP_CFLAGS=-DWITH_BSWAP=1" 1>&6
  sed -e "s/^BSWAP_CFLAGS.*=.*\$/BSWAP_CFLAGS = -DWITH_BSWAP=1/" \
    < Makefile.tem > Makefile
  rm -f Makefile.tem
fi

if test x"$enable_sim_cflags" != x"" -a x"$enable_sim_cflags" != x"no"; then
  if test "$enable_sim_cflags" = "yes"; then
    enable_sim_cflags="-fomit-frame-pointer,-O2"
  fi
  mv Makefile Makefile.tem
  echo "Setting SIM_CFLAGS=$enable_sim_cflags"
  sed -e "s/^SIM_CFLAGS.*=.*\$/SIM_CFLAGS = $enable_sim_cflags/" -e "s/,/ /g"\
    < Makefile.tem > Makefile
  rm -f Makefile.tem
fi

if test x"$enable_sim_complex" != x"" -a x"$enable_sim_complex" != x"no"; then
  mv Makefile Makefile.tem
  echo "Setting IGEN_OPCODE_RULES=ppc-opcode-complex" 1>&6
  sed -e "s/^IGEN_OPCODE_RULES.*=.*\$/IGEN_OPCODE_RULES = ppc-opcode-complex/" \
    < Makefile.tem > Makefile
  rm -f Makefile.tem
fi

if test x"$enable_sim_switch" != x"" -a x"$enable_sim_switch" != x"no"; then
  mv Makefile Makefile.tem
  echo "Setting DGEN_FLAGS=-s" 1>&6
  sed -e "s/^DGEN_FLAGS.*=.*\$/DGEN_FLAGS = -s/" < Makefile.tem > Makefile
  rm -f Makefile.tem
fi

if test x"$enable_sim_duplicate" != x"" -a x"$enable_sim_duplicate" != x"no"; then
  mv Makefile Makefile.tem
  echo "Setting IGEN_DUPLICATE=-e" 1>&6
  sed -e "s/^IGEN_DUPLICATE.*=.*\$/IGEN_DUPLICATE = -e/" < Makefile.tem > Makefile
  rm -f Makefile.tem
fi

if test x"$enable_sim_filter" = x"no"; then
  mv Makefile Makefile.tem
  echo "Setting IGEN_FILTER=" 1>&6
  sed -e "s/^IGEN_FILTER.*=.*\$/IGEN_FILTER =/" < Makefile.tem > Makefile
  rm -f Makefile.tem

else
  if test x"$enable_sim_filter" != x"yes" -a x"$enable_sim_filter" != x""; then
    mv Makefile Makefile.tem
    echo "Setting IGEN_FILTER= -f $enable_sim_filter" 1>&6
    sed -e "s/^IGEN_FILTER.*=.*\$/IGEN_FILTER = -f $enable_sim_filter/" \
      < Makefile.tem > Makefile
    rm -f Makefile.tem
  fi
fi

endian=""
case x"$enable_sim_endian" in
  xb* | xB*) endian="BIG_ENDIAN";;
  xl* | xL*) endian="LITTLE_ENDIAN";;
  xyes) case "$target" in
	  *powerpc-*) endian="BIG_ENDIAN";;
	  *powerpcle-*) endian="LITTLE_ENDIAN";;
	  *) echo "Unknown $target" 1>&6;;
        esac;;
esac
if test x"$endian" != x""; then
  mv Makefile Makefile.tem
  echo "Setting SIM_ENDIAN=-DWITH_TARGET_BYTE_ORDER=$endian"
  sed -e "s/^SIM_ENDIAN.*=.*\$/SIM_ENDIAN = -DWITH_TARGET_BYTE_ORDER=$endian/" \
    < Makefile.tem > Makefile
  rm -f Makefile.tem
fi