xref: /openbmc/qemu/configure (revision 67b915a5dd52a05f8030cd9edc005effd9c8eea5)
17d13299dSbellard#!/bin/sh
27d13299dSbellard#
33ef693a0Sbellard# qemu configure script (c) 2003 Fabrice Bellard
47d13299dSbellard#
57d13299dSbellard# set temporary file name
67d13299dSbellardif test ! -z "$TMPDIR" ; then
77d13299dSbellard    TMPDIR1="${TMPDIR}"
87d13299dSbellardelif test ! -z "$TEMPDIR" ; then
97d13299dSbellard    TMPDIR1="${TEMPDIR}"
107d13299dSbellardelse
117d13299dSbellard    TMPDIR1="/tmp"
127d13299dSbellardfi
137d13299dSbellard
143ef693a0SbellardTMPC="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.c"
153ef693a0SbellardTMPO="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.o"
163ef693a0SbellardTMPE="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}"
173ef693a0SbellardTMPS="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.S"
187d13299dSbellard
197d13299dSbellard# default parameters
207d13299dSbellardprefix="/usr/local"
211e43adfcSbellardinterp_prefix="/usr/gnemul/qemu-%M"
2243ce4dfeSbellardstatic="no"
237d13299dSbellardcross_prefix=""
247d13299dSbellardcc="gcc"
257d13299dSbellardhost_cc="gcc"
267d13299dSbellardar="ar"
277d13299dSbellardmake="make"
287d13299dSbellardstrip="strip"
297d13299dSbellardcpu=`uname -m`
3067867308Sbellardtarget_list="i386-user i386 i386-softmmu arm-user sparc-user ppc-user"
317d13299dSbellardcase "$cpu" in
327d13299dSbellard  i386|i486|i586|i686|i86pc|BePC)
3397a847bcSbellard    cpu="i386"
347d13299dSbellard  ;;
357d13299dSbellard  armv4l)
367d13299dSbellard    cpu="armv4l"
377d13299dSbellard  ;;
387d13299dSbellard  alpha)
397d13299dSbellard    cpu="alpha"
407d13299dSbellard  ;;
41295defa5Sbellard  "Power Macintosh"|ppc|ppc64)
427d13299dSbellard    cpu="powerpc"
437d13299dSbellard  ;;
447d13299dSbellard  mips)
457d13299dSbellard    cpu="mips"
467d13299dSbellard  ;;
47fb3e5849Sbellard  s390)
48fb3e5849Sbellard    cpu="s390"
49fb3e5849Sbellard  ;;
50ae228531Sbellard  sparc)
51ae228531Sbellard    cpu="sparc"
52ae228531Sbellard  ;;
53ae228531Sbellard  sparc64)
54ae228531Sbellard    cpu="sparc64"
55ae228531Sbellard  ;;
56a8baa8c5Sbellard  ia64)
57a8baa8c5Sbellard    cpu="ia64"
58a8baa8c5Sbellard  ;;
5938e584a0Sbellard  m68k)
6038e584a0Sbellard    cpu="m68k"
6138e584a0Sbellard  ;;
62bc51c5c9Sbellard  x86_64|amd64)
63bc51c5c9Sbellard    cpu="amd64"
64bc51c5c9Sbellard  ;;
657d13299dSbellard  *)
667d13299dSbellard    cpu="unknown"
677d13299dSbellard  ;;
687d13299dSbellardesac
697d13299dSbellardgprof="no"
707d13299dSbellardbigendian="no"
71*67b915a5Sbellardmingw32="no"
72*67b915a5SbellardEXESUF=""
73*67b915a5Sbellardgdbstub="yes"
747d13299dSbellard
757d13299dSbellard# OS specific
767d13299dSbellardtargetos=`uname -s`
777d13299dSbellardcase $targetos in
78*67b915a5SbellardMINGW32*)
79*67b915a5Sbellardmingw32="yes"
80*67b915a5Sbellard;;
817d13299dSbellard*) ;;
827d13299dSbellardesac
837d13299dSbellard
8497a847bcSbellard##########################################
8597a847bcSbellard# SDL probe
8697a847bcSbellard
8797a847bcSbellardcat > $TMPC << EOF
8897a847bcSbellard#include <SDL.h>
8997a847bcSbellard#undef main /* We don't want SDL to override our main() */
9097a847bcSbellardint main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
9197a847bcSbellardEOF
9297a847bcSbellard
9397a847bcSbellardsdl_too_old=no
9497a847bcSbellardsdl=no
9597a847bcSbellardif $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs`  2> /dev/null  ; then
9697a847bcSbellard_sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
9797a847bcSbellardif test "$_sdlversion" -lt 121 ; then
9897a847bcSbellardsdl_too_old=yes
9997a847bcSbellardelse
10097a847bcSbellardsdl=yes
10197a847bcSbellardfi
10297a847bcSbellardfi
10397a847bcSbellard
1047d13299dSbellard# find source path
1057d13299dSbellard# XXX: we assume an absolute path is given when launching configure,
1067d13299dSbellard# except in './configure' case.
1077d13299dSbellardsource_path=${0%configure}
1087d13299dSbellardsource_path=${source_path%/}
1097d13299dSbellardsource_path_used="yes"
1107d13299dSbellardif test -z "$source_path" -o "$source_path" = "." ; then
1117d13299dSbellard    source_path=`pwd`
1127d13299dSbellard    source_path_used="no"
1137d13299dSbellardfi
1147d13299dSbellard
1157d13299dSbellardfor opt do
1167d13299dSbellard  case "$opt" in
1177d13299dSbellard  --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
1187d13299dSbellard  ;;
11932ce6337Sbellard  --interp-prefix=*) interp_prefix=`echo $opt | cut -d '=' -f 2`
12032ce6337Sbellard  ;;
1217d13299dSbellard  --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
1227d13299dSbellard  ;;
1237d13299dSbellard  --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
1247d13299dSbellard  ;;
1257d13299dSbellard  --cc=*) cc=`echo $opt | cut -d '=' -f 2`
1267d13299dSbellard  ;;
1277d13299dSbellard  --make=*) make=`echo $opt | cut -d '=' -f 2`
1287d13299dSbellard  ;;
1297d13299dSbellard  --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}"
1307d13299dSbellard  ;;
1317d13299dSbellard  --extra-ldflags=*) LDFLAGS="${opt#--extra-ldflags=}"
1327d13299dSbellard  ;;
1337d13299dSbellard  --extra-libs=*) extralibs=${opt#--extra-libs=}
1347d13299dSbellard  ;;
1357d13299dSbellard  --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
1367d13299dSbellard  ;;
13797a847bcSbellard  --target-list=*) target_list=${opt#--target-list=}
138de83cd02Sbellard  ;;
1397d13299dSbellard  --enable-gprof) gprof="yes"
1407d13299dSbellard  ;;
14143ce4dfeSbellard  --static) static="yes"
14243ce4dfeSbellard  ;;
14397a847bcSbellard  --disable-sdl) sdl="no"
14497a847bcSbellard  ;;
145*67b915a5Sbellard  --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-"
146*67b915a5Sbellard  ;;
1477d13299dSbellard  esac
1487d13299dSbellarddone
1497d13299dSbellard
1507d13299dSbellard# Checking for CFLAGS
1517d13299dSbellardif test -z "$CFLAGS"; then
1527d13299dSbellard    CFLAGS="-O2"
1537d13299dSbellardfi
1547d13299dSbellard
1557d13299dSbellardcc="${cross_prefix}${cc}"
1567d13299dSbellardar="${cross_prefix}${ar}"
1577d13299dSbellardstrip="${cross_prefix}${strip}"
1587d13299dSbellard
159*67b915a5Sbellardif test "$mingw32" = "yes" ; then
160*67b915a5Sbellard    host_cc="$cc"
161*67b915a5Sbellard    target_list="i386-softmmu"
162*67b915a5Sbellard    prefix="/c/Program Files/Qemu"
163*67b915a5Sbellard    EXESUF=".exe"
164*67b915a5Sbellard    gdbstub="no"
165*67b915a5Sbellardfi
166*67b915a5Sbellard
1677d13299dSbellardif test -z "$cross_prefix" ; then
1687d13299dSbellard
1697d13299dSbellard# ---
1707d13299dSbellard# big/little endian test
1717d13299dSbellardcat > $TMPC << EOF
1727d13299dSbellard#include <inttypes.h>
1737d13299dSbellardint main(int argc, char ** argv){
1747d13299dSbellard	volatile uint32_t i=0x01234567;
1757d13299dSbellard	return (*((uint8_t*)(&i))) == 0x67;
1767d13299dSbellard}
1777d13299dSbellardEOF
1787d13299dSbellard
1797d13299dSbellardif $cc -o $TMPE $TMPC 2>/dev/null ; then
1807d13299dSbellard$TMPE && bigendian="yes"
1817d13299dSbellardelse
1827d13299dSbellardecho big/little test failed
1837d13299dSbellardfi
1847d13299dSbellard
1857d13299dSbellardelse
1867d13299dSbellard
1877d13299dSbellard# if cross compiling, cannot launch a program, so make a static guess
18838e584a0Sbellardif test "$cpu" = "powerpc" -o "$cpu" = "mips" -o "$cpu" = "s390" -o "$cpu" = "sparc" -o "$cpu" = "sparc64" -o "$cpu" = "m68k"; then
1897d13299dSbellard    bigendian="yes"
1907d13299dSbellardfi
1917d13299dSbellard
1927d13299dSbellardfi
1937d13299dSbellard
194e8cd23deSbellard# check gcc options support
19504369ff2Sbellardcat > $TMPC <<EOF
19604369ff2Sbellardint main(void) {
19704369ff2Sbellard}
19804369ff2SbellardEOF
19904369ff2Sbellard
200e8cd23deSbellardhave_gcc3_options="no"
201e8cd23deSbellardif $cc -fno-reorder-blocks -fno-optimize-sibling-calls -o $TMPO $TMPC 2> /dev/null ; then
202e8cd23deSbellard   have_gcc3_options="yes"
20304369ff2Sbellardfi
204ca735206Sbellard
2057d13299dSbellardif test x"$1" = x"-h" -o x"$1" = x"--help" ; then
2067d13299dSbellardcat << EOF
2077d13299dSbellard
2087d13299dSbellardUsage: configure [options]
2097d13299dSbellardOptions: [defaults in brackets after descriptions]
2107d13299dSbellard
2117d13299dSbellardEOF
2127d13299dSbellardecho "Standard options:"
2137d13299dSbellardecho "  --help                   print this message"
2147d13299dSbellardecho "  --prefix=PREFIX          install in PREFIX [$prefix]"
2151e43adfcSbellardecho "  --interp-prefix=PREFIX   where to find shared libraries, etc."
2161e43adfcSbellardecho "                           use %M for cpu name [$interp_prefix]"
21797a847bcSbellardecho "  --target-list=LIST       set target list [$target_list]"
2187d13299dSbellardecho ""
2197d13299dSbellardecho "Advanced options (experts only):"
2207d13299dSbellardecho "  --source-path=PATH       path of source code [$source_path]"
2217d13299dSbellardecho "  --cross-prefix=PREFIX    use PREFIX for compile tools [$cross_prefix]"
2227d13299dSbellardecho "  --cc=CC                  use C compiler CC [$cc]"
2237d13299dSbellardecho "  --make=MAKE              use specified make [$make]"
22443ce4dfeSbellardecho "  --static                 enable static build [$static]"
225*67b915a5Sbellardecho "  --enable-mingw32         enable Win32 cross compilation with mingw32"
2267d13299dSbellardecho ""
2277d13299dSbellardecho "NOTE: The object files are build at the place where configure is launched"
2287d13299dSbellardexit 1
2297d13299dSbellardfi
2307d13299dSbellard
2315a67135aSbellardmandir="$prefix/share/man"
2325a67135aSbellardsharedir="$prefix/share/qemu"
2335a67135aSbellard
2347d13299dSbellardecho "Install prefix    $prefix"
2355a67135aSbellardecho "Manual directory  $mandir"
2365a67135aSbellardecho "BIOS directory    $sharedir"
23743ce4dfeSbellardecho "ELF interp prefix $interp_prefix"
2385a67135aSbellardecho "Source path       $source_path"
2397d13299dSbellardecho "C compiler        $cc"
2407d13299dSbellardecho "make              $make"
241a98fd896Sbellardecho "host CPU          $cpu"
242de83cd02Sbellardecho "host big endian   $bigendian"
24397a847bcSbellardecho "target list       $target_list"
2447d13299dSbellardecho "gprof enabled     $gprof"
24543ce4dfeSbellardecho "static build      $static"
24697a847bcSbellardecho "SDL support       $sdl"
247*67b915a5Sbellardecho "mingw32 support   $mingw32"
248*67b915a5Sbellard
24997a847bcSbellardif test $sdl_too_old = "yes"; then
25097a847bcSbellardecho "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
251e8cd23deSbellardfi
25297a847bcSbellard
25397a847bcSbellardconfig_mak="config-host.mak"
25497a847bcSbellardconfig_h="config-host.h"
25597a847bcSbellard
25697a847bcSbellardecho "Creating $config_mak and $config_h"
25797a847bcSbellard
25897a847bcSbellardecho "# Automatically generated by configure - do not modify" > $config_mak
25997a847bcSbellardecho "/* Automatically generated by configure - do not modify */" > $config_h
26097a847bcSbellard
26197a847bcSbellardecho "prefix=$prefix" >> $config_mak
2625a67135aSbellardecho "mandir=$mandir" >> $config_mak
2635a67135aSbellardecho "sharedir=$sharedir" >> $config_mak
2645a67135aSbellardecho "#define CONFIG_QEMU_SHAREDIR \"$sharedir\"" >> $config_h
26597a847bcSbellardecho "MAKE=$make" >> $config_mak
26697a847bcSbellardecho "CC=$cc" >> $config_mak
26797a847bcSbellardif test "$have_gcc3_options" = "yes" ; then
26897a847bcSbellard  echo "HAVE_GCC3_OPTIONS=yes" >> $config_mak
26997a847bcSbellardfi
27097a847bcSbellardecho "HOST_CC=$host_cc" >> $config_mak
27197a847bcSbellardecho "AR=$ar" >> $config_mak
27297a847bcSbellardecho "STRIP=$strip -s -R .comment -R .note" >> $config_mak
27397a847bcSbellardecho "CFLAGS=$CFLAGS" >> $config_mak
27497a847bcSbellardecho "LDFLAGS=$LDFLAGS" >> $config_mak
275*67b915a5Sbellardecho "EXESUF=$EXESUF" >> $config_mak
27697a847bcSbellardif test "$cpu" = "i386" ; then
27797a847bcSbellard  echo "ARCH=i386" >> $config_mak
27897a847bcSbellard  echo "#define HOST_I386 1" >> $config_h
279bc51c5c9Sbellardelif test "$cpu" = "amd64" ; then
280bc51c5c9Sbellard  echo "ARCH=amd64" >> $config_mak
281bc51c5c9Sbellard  echo "#define HOST_AMD64 1" >> $config_h
2827d13299dSbellardelif test "$cpu" = "armv4l" ; then
28397a847bcSbellard  echo "ARCH=arm" >> $config_mak
28497a847bcSbellard  echo "#define HOST_ARM 1" >> $config_h
2857d13299dSbellardelif test "$cpu" = "powerpc" ; then
28697a847bcSbellard  echo "ARCH=ppc" >> $config_mak
28797a847bcSbellard  echo "#define HOST_PPC 1" >> $config_h
2887d13299dSbellardelif test "$cpu" = "mips" ; then
28997a847bcSbellard  echo "ARCH=mips" >> $config_mak
29097a847bcSbellard  echo "#define HOST_MIPS 1" >> $config_h
291fb3e5849Sbellardelif test "$cpu" = "s390" ; then
29297a847bcSbellard  echo "ARCH=s390" >> $config_mak
29397a847bcSbellard  echo "#define HOST_S390 1" >> $config_h
294295defa5Sbellardelif test "$cpu" = "alpha" ; then
29597a847bcSbellard  echo "ARCH=alpha" >> $config_mak
29697a847bcSbellard  echo "#define HOST_ALPHA 1" >> $config_h
297ae228531Sbellardelif test "$cpu" = "sparc" ; then
29897a847bcSbellard  echo "ARCH=sparc" >> $config_mak
29997a847bcSbellard  echo "#define HOST_SPARC 1" >> $config_h
300ae228531Sbellardelif test "$cpu" = "sparc64" ; then
30197a847bcSbellard  echo "ARCH=sparc64" >> $config_mak
30297a847bcSbellard  echo "#define HOST_SPARC64 1" >> $config_h
303a8baa8c5Sbellardelif test "$cpu" = "ia64" ; then
30497a847bcSbellard  echo "ARCH=ia64" >> $config_mak
30597a847bcSbellard  echo "#define HOST_IA64 1" >> $config_h
30638e584a0Sbellardelif test "$cpu" = "m68k" ; then
30738ca2abcSbellard  echo "ARCH=m68k" >> $config_mak
30838ca2abcSbellard  echo "#define HOST_M68K 1" >> $config_h
3097d13299dSbellardelse
3107d13299dSbellard  echo "Unsupported CPU"
3117d13299dSbellard  exit 1
3127d13299dSbellardfi
3137d13299dSbellardif test "$bigendian" = "yes" ; then
31497a847bcSbellard  echo "WORDS_BIGENDIAN=yes" >> $config_mak
31597a847bcSbellard  echo "#define WORDS_BIGENDIAN 1" >> $config_h
31697a847bcSbellardfi
317*67b915a5Sbellardif test "$mingw32" = "yes" ; then
318*67b915a5Sbellard  echo "CONFIG_WIN32=yes" >> $config_mak
319*67b915a5Sbellardelse
32097a847bcSbellard  echo "#define HAVE_BYTESWAP_H 1" >> $config_h
321*67b915a5Sbellardfi
322*67b915a5Sbellardif test "$gdbstub" = "yes" ; then
323*67b915a5Sbellard  echo "CONFIG_GDBSTUB=yes" >> $config_mak
324*67b915a5Sbellard  echo "#define CONFIG_GDBSTUB 1" >> $config_h
325*67b915a5Sbellardfi
32697a847bcSbellardif test "$gprof" = "yes" ; then
32797a847bcSbellard  echo "TARGET_GPROF=yes" >> $config_mak
32897a847bcSbellard  echo "#define HAVE_GPROF 1" >> $config_h
32997a847bcSbellardfi
33097a847bcSbellardif test "$static" = "yes" ; then
33197a847bcSbellard  echo "CONFIG_STATIC=yes" >> $config_mak
33250863472Sbellard  echo "#define CONFIG_STATIC 1" >> $config_h
33397a847bcSbellardfi
33497a847bcSbellardif test "$sdl" = "yes" ; then
33597a847bcSbellard  echo "CONFIG_SDL=yes" >> $config_mak
33697a847bcSbellard  echo "#define CONFIG_SDL 1" >> $config_h
33797a847bcSbellard  echo "SDL_LIBS=`sdl-config --libs`" >> $config_mak
338590b7eedSbellard  aa="no"
339590b7eedSbellard  `sdl-config --static-libs | grep \\\-laa > /dev/null` && aa="yes"
340590b7eedSbellard  echo -n "SDL_STATIC_LIBS=`sdl-config --static-libs`" >> $config_mak
341590b7eedSbellard  if [ "${aa}" = "yes" ] ; then
342590b7eedSbellard      echo -n " `aalib-config --libs`" >> $config_mak ;
343590b7eedSbellard  fi
344590b7eedSbellard  echo "" >> $config_mak
345590b7eedSbellard  echo -n "SDL_CFLAGS=`sdl-config --cflags`" >> $config_mak
346590b7eedSbellard  if [ "${aa}" = "yes" ] ; then
347590b7eedSbellard      echo -n " `aalib-config --cflags`" >> $config_mak ;
348590b7eedSbellard  fi
349590b7eedSbellard  echo "" >> $config_mak
35097a847bcSbellardfi
35197a847bcSbellardecho -n "VERSION=" >>$config_mak
35297a847bcSbellardhead $source_path/VERSION >>$config_mak
35397a847bcSbellardecho "" >>$config_mak
35497a847bcSbellardecho -n "#define QEMU_VERSION \"" >> $config_h
35597a847bcSbellardhead $source_path/VERSION >> $config_h
35697a847bcSbellardecho "\"" >> $config_h
35797a847bcSbellard
35897a847bcSbellardecho "SRC_PATH=$source_path" >> $config_mak
35997a847bcSbellardecho "TARGET_DIRS=$target_list" >> $config_mak
36097a847bcSbellard
36197a847bcSbellardfor target in $target_list; do
36297a847bcSbellard
36397a847bcSbellardtarget_dir="$target"
36497a847bcSbellardconfig_mak=$target_dir/config.mak
36597a847bcSbellardconfig_h=$target_dir/config.h
36697a847bcSbellardtarget_cpu=`echo $target | cut -d '-' -f 1`
36797a847bcSbellardtarget_bigendian="no"
3681e43adfcSbellard[ "$target_cpu" = "sparc" ] && target_bigendian=yes
36967867308Sbellard[ "$target_cpu" = "ppc" ] && target_bigendian=yes
37097a847bcSbellardtarget_softmmu="no"
37197a847bcSbellardif expr $target : '.*-softmmu' > /dev/null ; then
37297a847bcSbellard  target_softmmu="yes"
3737d13299dSbellardfi
374997344f3Sbellardtarget_user_only="no"
375997344f3Sbellardif expr $target : '.*-user' > /dev/null ; then
376997344f3Sbellard  target_user_only="yes"
377997344f3Sbellardfi
378de83cd02Sbellard
37997a847bcSbellardecho "Creating $config_mak, $config_h and $target_dir/Makefile"
38097a847bcSbellard
38197a847bcSbellardmkdir -p $target_dir
38269de927cSbellardif test "$target" = "arm-user" ; then
38369de927cSbellard  mkdir -p $target_dir/nwfpe
38469de927cSbellardfi
38569de927cSbellard
38697a847bcSbellardln -sf $source_path/Makefile.target $target_dir/Makefile
38797a847bcSbellard
38897a847bcSbellardecho "# Automatically generated by configure - do not modify" > $config_mak
38997a847bcSbellardecho "/* Automatically generated by configure - do not modify */" > $config_h
39097a847bcSbellard
39197a847bcSbellard
39297a847bcSbellardecho "include ../config-host.mak" >> $config_mak
39397a847bcSbellardecho "#include \"../config-host.h\"" >> $config_h
3941e43adfcSbellard
3951e43adfcSbellardinterp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
3961e43adfcSbellardecho "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
39797a847bcSbellard
39897a847bcSbellardif test "$target_cpu" = "i386" ; then
39997a847bcSbellard  echo "TARGET_ARCH=i386" >> $config_mak
40097a847bcSbellard  echo "#define TARGET_ARCH \"i386\"" >> $config_h
40197a847bcSbellard  echo "#define TARGET_I386 1" >> $config_h
402de83cd02Sbellardelif test "$target_cpu" = "arm" ; then
40397a847bcSbellard  echo "TARGET_ARCH=arm" >> $config_mak
40497a847bcSbellard  echo "#define TARGET_ARCH \"arm\"" >> $config_h
40597a847bcSbellard  echo "#define TARGET_ARM 1" >> $config_h
4061e43adfcSbellardelif test "$target_cpu" = "sparc" ; then
4071e43adfcSbellard  echo "TARGET_ARCH=sparc" >> $config_mak
4081e43adfcSbellard  echo "#define TARGET_ARCH \"sparc\"" >> $config_h
4091e43adfcSbellard  echo "#define TARGET_SPARC 1" >> $config_h
41067867308Sbellardelif test "$target_cpu" = "ppc" ; then
41167867308Sbellard  echo "TARGET_ARCH=ppc" >> $config_mak
41267867308Sbellard  echo "#define TARGET_ARCH \"ppc\"" >> $config_h
41367867308Sbellard  echo "#define TARGET_PPC 1" >> $config_h
414de83cd02Sbellardelse
415de83cd02Sbellard  echo "Unsupported target CPU"
416de83cd02Sbellard  exit 1
417de83cd02Sbellardfi
418de83cd02Sbellardif test "$target_bigendian" = "yes" ; then
41997a847bcSbellard  echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
42097a847bcSbellard  echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
42197a847bcSbellardfi
42297a847bcSbellardif test "$target_softmmu" = "yes" ; then
42397a847bcSbellard  echo "CONFIG_SOFTMMU=yes" >> $config_mak
42497a847bcSbellard  echo "#define CONFIG_SOFTMMU 1" >> $config_h
425de83cd02Sbellardfi
426997344f3Sbellardif test "$target_user_only" = "yes" ; then
427997344f3Sbellard  echo "CONFIG_USER_ONLY=yes" >> $config_mak
428997344f3Sbellard  echo "#define CONFIG_USER_ONLY 1" >> $config_h
429997344f3Sbellardfi
430de83cd02Sbellard
43197a847bcSbellarddone # for target in $targets
4327d13299dSbellard
4337d13299dSbellard# build tree in object directory if source path is different from current one
4347d13299dSbellardif test "$source_path_used" = "yes" ; then
4357d13299dSbellard    DIRS="tests"
4367d13299dSbellard    FILES="Makefile tests/Makefile"
4377d13299dSbellard    for dir in $DIRS ; do
4387d13299dSbellard            mkdir -p $dir
4397d13299dSbellard    done
4407d13299dSbellard    for f in $FILES ; do
4417d13299dSbellard        ln -sf $source_path/$f $f
4427d13299dSbellard    done
4437d13299dSbellardfi
4447d13299dSbellard
44597a847bcSbellardrm -f $TMPO $TMPC $TMPE $TMPS
446