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 2011d9f695Sbellardprefix="" 211e43adfcSbellardinterp_prefix="/usr/gnemul/qemu-%M" 2243ce4dfeSbellardstatic="no" 237d13299dSbellardcross_prefix="" 247d13299dSbellardcc="gcc" 257d13299dSbellardhost_cc="gcc" 267d13299dSbellardar="ar" 277d13299dSbellardmake="make" 287d13299dSbellardstrip="strip" 297d13299dSbellardcpu=`uname -m` 305327cf48Sbellardtarget_list="" 317d13299dSbellardcase "$cpu" in 327d13299dSbellard i386|i486|i586|i686|i86pc|BePC) 3397a847bcSbellard cpu="i386" 347d13299dSbellard ;; 35ba68055eSbellard armv*b) 36808c4954Sbellard cpu="armv4b" 37808c4954Sbellard ;; 38ba68055eSbellard armv*l) 397d13299dSbellard cpu="armv4l" 407d13299dSbellard ;; 417d13299dSbellard alpha) 427d13299dSbellard cpu="alpha" 437d13299dSbellard ;; 44295defa5Sbellard "Power Macintosh"|ppc|ppc64) 457d13299dSbellard cpu="powerpc" 467d13299dSbellard ;; 477d13299dSbellard mips) 487d13299dSbellard cpu="mips" 497d13299dSbellard ;; 50fb3e5849Sbellard s390) 51fb3e5849Sbellard cpu="s390" 52fb3e5849Sbellard ;; 53ae228531Sbellard sparc) 54ae228531Sbellard cpu="sparc" 55ae228531Sbellard ;; 56ae228531Sbellard sparc64) 57ae228531Sbellard cpu="sparc64" 58ae228531Sbellard ;; 59a8baa8c5Sbellard ia64) 60a8baa8c5Sbellard cpu="ia64" 61a8baa8c5Sbellard ;; 6238e584a0Sbellard m68k) 6338e584a0Sbellard cpu="m68k" 6438e584a0Sbellard ;; 65bc51c5c9Sbellard x86_64|amd64) 660b0babc6Sbellard cpu="x86_64" 67bc51c5c9Sbellard ;; 687d13299dSbellard *) 697d13299dSbellard cpu="unknown" 707d13299dSbellard ;; 717d13299dSbellardesac 727d13299dSbellardgprof="no" 737d13299dSbellardbigendian="no" 7467b915a5Sbellardmingw32="no" 7567b915a5SbellardEXESUF="" 7667b915a5Sbellardgdbstub="yes" 77443f1376Sbellardslirp="yes" 78fb065187Sbellardadlib="no" 79fb065187Sbellardoss="no" 801d14ffa9Sbellarddsound="no" 811d14ffa9Sbellardcoreaudio="no" 821d14ffa9Sbellardalsa="no" 83102a52e4Sbellardfmod="no" 84102a52e4Sbellardfmod_lib="" 85102a52e4Sbellardfmod_inc="" 865327cf48Sbellardlinux="no" 87c9ec1fe4Sbellardkqemu="no" 88c9ec1fe4Sbellardkernel_path="" 895b0753e0Sbellardcocoa="no" 9097ccc689Sbellardcheck_gfx="yes" 911aff381fSbellardcheck_gcc="yes" 927d13299dSbellard 937d13299dSbellard# OS specific 947d13299dSbellardtargetos=`uname -s` 957d13299dSbellardcase $targetos in 96c326e0afSbellardCYGWIN*) 97c326e0afSbellardmingw32="yes" 98c326e0afSbellardCFLAGS="-O2 -mno-cygwin" 99c326e0afSbellard;; 10067b915a5SbellardMINGW32*) 10167b915a5Sbellardmingw32="yes" 10267b915a5Sbellard;; 1037d3505c5SbellardFreeBSD) 1047d3505c5Sbellardbsd="yes" 105fb065187Sbellardoss="yes" 106e99f9060Sbellardif [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then 10707f4ddbfSbellard kqemu="yes" 10807f4ddbfSbellardfi 1097d3505c5Sbellard;; 1107d3505c5SbellardNetBSD) 1117d3505c5Sbellardbsd="yes" 112fb065187Sbellardoss="yes" 1137d3505c5Sbellard;; 1147d3505c5SbellardOpenBSD) 1157d3505c5Sbellardbsd="yes" 116fb065187Sbellardoss="yes" 1177d3505c5Sbellard;; 11883fb7adfSbellardDarwin) 11983fb7adfSbellardbsd="yes" 12083fb7adfSbellarddarwin="yes" 12183fb7adfSbellard;; 122fb065187Sbellard*) 123fb065187Sbellardoss="yes" 1245327cf48Sbellardlinux="yes" 12507f4ddbfSbellardif [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then 126c9ec1fe4Sbellard kqemu="yes" 127c9ec1fe4Sbellardfi 128fb065187Sbellard;; 1297d13299dSbellardesac 1307d13299dSbellard 1317d3505c5Sbellardif [ "$bsd" = "yes" ] ; then 13283fb7adfSbellard if [ ! "$darwin" = "yes" ] ; then 1337d3505c5Sbellard make="gmake" 13483fb7adfSbellard fi 1357d3505c5Sbellardfi 1367d3505c5Sbellard 1377d13299dSbellard# find source path 1387d13299dSbellard# XXX: we assume an absolute path is given when launching configure, 1397d13299dSbellard# except in './configure' case. 1407d13299dSbellardsource_path=${0%configure} 1417d13299dSbellardsource_path=${source_path%/} 1427d13299dSbellardsource_path_used="yes" 1437d13299dSbellardif test -z "$source_path" -o "$source_path" = "." ; then 1447d13299dSbellard source_path=`pwd` 1457d13299dSbellard source_path_used="no" 1467d13299dSbellardfi 1477d13299dSbellard 1487d13299dSbellardfor opt do 1497d13299dSbellard case "$opt" in 1507d13299dSbellard --prefix=*) prefix=`echo $opt | cut -d '=' -f 2` 1517d13299dSbellard ;; 15232ce6337Sbellard --interp-prefix=*) interp_prefix=`echo $opt | cut -d '=' -f 2` 15332ce6337Sbellard ;; 1547d13299dSbellard --source-path=*) source_path=`echo $opt | cut -d '=' -f 2` 1557d13299dSbellard ;; 1567d13299dSbellard --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2` 1577d13299dSbellard ;; 1587d13299dSbellard --cc=*) cc=`echo $opt | cut -d '=' -f 2` 1597d13299dSbellard ;; 16083469015Sbellard --host-cc=*) host_cc=`echo $opt | cut -d '=' -f 2` 16183469015Sbellard ;; 1627d13299dSbellard --make=*) make=`echo $opt | cut -d '=' -f 2` 1637d13299dSbellard ;; 1647d13299dSbellard --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}" 1657d13299dSbellard ;; 1667d13299dSbellard --extra-ldflags=*) LDFLAGS="${opt#--extra-ldflags=}" 1677d13299dSbellard ;; 1687d13299dSbellard --cpu=*) cpu=`echo $opt | cut -d '=' -f 2` 1697d13299dSbellard ;; 17097a847bcSbellard --target-list=*) target_list=${opt#--target-list=} 171de83cd02Sbellard ;; 1727d13299dSbellard --enable-gprof) gprof="yes" 1737d13299dSbellard ;; 17443ce4dfeSbellard --static) static="yes" 17543ce4dfeSbellard ;; 17697a847bcSbellard --disable-sdl) sdl="no" 17797a847bcSbellard ;; 1781d14ffa9Sbellard --enable-coreaudio) coreaudio="yes" 1791d14ffa9Sbellard ;; 1801d14ffa9Sbellard --enable-alsa) alsa="yes" 1811d14ffa9Sbellard ;; 1821d14ffa9Sbellard --enable-dsound) dsound="yes" 1831d14ffa9Sbellard ;; 184102a52e4Sbellard --enable-fmod) fmod="yes" 185102a52e4Sbellard ;; 186102a52e4Sbellard --fmod-lib=*) fmod_lib=${opt#--fmod-lib=} 187102a52e4Sbellard ;; 188102a52e4Sbellard --fmod-inc=*) fmod_inc=${opt#--fmod-inc=} 189102a52e4Sbellard ;; 19067b915a5Sbellard --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-" 19167b915a5Sbellard ;; 192443f1376Sbellard --disable-slirp) slirp="no" 193c20709aaSbellard ;; 194fb065187Sbellard --enable-adlib) adlib="yes" 195fb065187Sbellard ;; 196c9ec1fe4Sbellard --disable-kqemu) kqemu="no" 197c9ec1fe4Sbellard ;; 198c9ec1fe4Sbellard --kernel-path=*) kernel_path=${opt#--kernel-path=} 199c9ec1fe4Sbellard ;; 2001d14ffa9Sbellard --enable-cocoa) cocoa="yes" ; coreaudio="yes" ; sdl="no" 2015b0753e0Sbellard ;; 20297ccc689Sbellard --disable-gfx-check) check_gfx="no" 20397ccc689Sbellard ;; 2041aff381fSbellard --disable-gcc-check) check_gcc="no" 2051aff381fSbellard ;; 2067d13299dSbellard esac 2077d13299dSbellarddone 2087d13299dSbellard 2097d13299dSbellard# Checking for CFLAGS 2107d13299dSbellardif test -z "$CFLAGS"; then 2117d13299dSbellard CFLAGS="-O2" 2127d13299dSbellardfi 2137d13299dSbellard 2147d13299dSbellardcc="${cross_prefix}${cc}" 2157d13299dSbellardar="${cross_prefix}${ar}" 2167d13299dSbellardstrip="${cross_prefix}${strip}" 2177d13299dSbellard 21867b915a5Sbellardif test "$mingw32" = "yes" ; then 2195327cf48Sbellard linux="no" 22067b915a5Sbellard EXESUF=".exe" 22167b915a5Sbellard gdbstub="no" 2229f059ecaSbellard oss="no" 22307f4ddbfSbellard if [ "$cpu" = "i386" ] ; then 22407f4ddbfSbellard kqemu="yes" 22507f4ddbfSbellard fi 22667b915a5Sbellardfi 22767b915a5Sbellard 2285327cf48Sbellardif test -z "$target_list" ; then 2295327cf48Sbellard# these targets are portable 230*b5ff1b31Sbellard target_list="i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu mips-softmmu arm-softmmu" 2315327cf48Sbellard# the following are Linux specific 2325327cf48Sbellard if [ "$linux" = "yes" ] ; then 233a20b5524Sbellard target_list="i386-user arm-user armeb-user sparc-user ppc-user $target_list" 2345327cf48Sbellard fi 2356e20a45fSbellardelse 2366e20a45fSbellard target_list=$(echo "$target_list" | sed -e 's/,/ /g') 2375327cf48Sbellardfi 2385327cf48Sbellard 2397d13299dSbellardif test -z "$cross_prefix" ; then 2407d13299dSbellard 2417d13299dSbellard# --- 2427d13299dSbellard# big/little endian test 2437d13299dSbellardcat > $TMPC << EOF 2447d13299dSbellard#include <inttypes.h> 2457d13299dSbellardint main(int argc, char ** argv){ 2467d13299dSbellard volatile uint32_t i=0x01234567; 2477d13299dSbellard return (*((uint8_t*)(&i))) == 0x67; 2487d13299dSbellard} 2497d13299dSbellardEOF 2507d13299dSbellard 2517d13299dSbellardif $cc -o $TMPE $TMPC 2>/dev/null ; then 2527d13299dSbellard$TMPE && bigendian="yes" 2537d13299dSbellardelse 2547d13299dSbellardecho big/little test failed 2557d13299dSbellardfi 2567d13299dSbellard 2577d13299dSbellardelse 2587d13299dSbellard 2597d13299dSbellard# if cross compiling, cannot launch a program, so make a static guess 260808c4954Sbellardif test "$cpu" = "powerpc" -o "$cpu" = "mips" -o "$cpu" = "s390" -o "$cpu" = "sparc" -o "$cpu" = "sparc64" -o "$cpu" = "m68k" -o "$cpu" = "armv4b"; then 2617d13299dSbellard bigendian="yes" 2627d13299dSbellardfi 2637d13299dSbellard 2647d13299dSbellardfi 2657d13299dSbellard 266b6853697Sbellard# host long bits test 267b6853697Sbellardhostlongbits="32" 268b6853697Sbellardif test "$cpu" = "sparc64" -o "$cpu" = "ia64" -o "$cpu" = "x86_64" -o "$cpu" = "alpha"; then 269b6853697Sbellard hostlongbits="64" 270b6853697Sbellardfi 271b6853697Sbellard 272e8cd23deSbellard# check gcc options support 27304369ff2Sbellardcat > $TMPC <<EOF 27404369ff2Sbellardint main(void) { 27504369ff2Sbellard} 27604369ff2SbellardEOF 27704369ff2Sbellard 278e8cd23deSbellardhave_gcc3_options="no" 279e8cd23deSbellardif $cc -fno-reorder-blocks -fno-optimize-sibling-calls -o $TMPO $TMPC 2> /dev/null ; then 280e8cd23deSbellard have_gcc3_options="yes" 28104369ff2Sbellardfi 282ca735206Sbellard 2831aff381fSbellard# Check for gcc4 2841aff381fSbellardif test "$check_gcc" = "yes" ; then 2851aff381fSbellard cat > $TMPC <<EOF 2861aff381fSbellard#if __GNUC__ >= 4 2871aff381fSbellard#error gcc4 2881aff381fSbellard#endif 2891aff381fSbellardint main(){return 0;} 2901aff381fSbellardEOF 2911aff381fSbellard if ! $cc -o $TMPO $TMPC 2>/dev/null ; then 2921aff381fSbellard echo "ERROR: \"$cc\" looks like gcc 4.x" 2931aff381fSbellard echo "QEMU is known to have problems when compiled with gcc 4.x" 2941aff381fSbellard echo "It is recommended that you use gcc 3.x to build QEMU" 2951aff381fSbellard echo "To use this compiler anyway, configure with --disable-gcc-check" 2961aff381fSbellard exit 1; 2971aff381fSbellard fi 2981aff381fSbellardfi 2991aff381fSbellard 30011d9f695Sbellard########################################## 30111d9f695Sbellard# SDL probe 30211d9f695Sbellard 30311d9f695Sbellardsdl_too_old=no 30411d9f695Sbellard 30511d9f695Sbellardif test -z "$sdl" ; then 30611d9f695Sbellard 307a6e022adSbellardsdl_config="sdl-config" 308a6e022adSbellardsdl=no 3097c1f25b4Sbellardsdl_static=no 310a6e022adSbellard 311a6e022adSbellardif test "$mingw32" = "yes" -a ! -z "$cross_prefix" ; then 312a6e022adSbellard# win32 cross compilation case 313a6e022adSbellard sdl_config="i386-mingw32msvc-sdl-config" 314a6e022adSbellard sdl=yes 315a6e022adSbellardelse 316a6e022adSbellard# normal SDL probe 31711d9f695Sbellardcat > $TMPC << EOF 31811d9f695Sbellard#include <SDL.h> 31911d9f695Sbellard#undef main /* We don't want SDL to override our main() */ 32011d9f695Sbellardint main( void ) { return SDL_Init (SDL_INIT_VIDEO); } 32111d9f695SbellardEOF 32211d9f695Sbellard 323a6e022adSbellardif $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /dev/null ; then 324a6e022adSbellard_sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'` 32511d9f695Sbellardif test "$_sdlversion" -lt 121 ; then 32611d9f695Sbellardsdl_too_old=yes 32711d9f695Sbellardelse 32811d9f695Sbellardsdl=yes 32911d9f695Sbellardfi 3307c1f25b4Sbellard 3317c1f25b4Sbellard# static link with sdl ? 3327c1f25b4Sbellardif test "$sdl" = "yes" ; then 3337c1f25b4Sbellardaa="no" 3347c1f25b4Sbellard`$sdl_config --static-libs | grep \\\-laa > /dev/null` && aa="yes" 3357c1f25b4Sbellardsdl_static_libs=`$sdl_config --static-libs` 3367c1f25b4Sbellardif [ "$aa" = "yes" ] ; then 337d8d8aa4eSbellard sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`" 33811d9f695Sbellardfi 33911d9f695Sbellard 3407c1f25b4Sbellardif $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev/null; then 3417c1f25b4Sbellard sdl_static=yes 3427c1f25b4Sbellardfi 3437c1f25b4Sbellard 3447c1f25b4Sbellardfi # static link 3457c1f25b4Sbellard 3467c1f25b4Sbellardfi # sdl compile test 3477c1f25b4Sbellard 348a6e022adSbellardfi # cross compilation 349a6e022adSbellardfi # -z $sdl 35011d9f695Sbellard 3517d13299dSbellardif test x"$1" = x"-h" -o x"$1" = x"--help" ; then 3527d13299dSbellardcat << EOF 3537d13299dSbellard 3547d13299dSbellardUsage: configure [options] 3557d13299dSbellardOptions: [defaults in brackets after descriptions] 3567d13299dSbellard 3577d13299dSbellardEOF 3587d13299dSbellardecho "Standard options:" 3597d13299dSbellardecho " --help print this message" 3607d13299dSbellardecho " --prefix=PREFIX install in PREFIX [$prefix]" 3611e43adfcSbellardecho " --interp-prefix=PREFIX where to find shared libraries, etc." 3621e43adfcSbellardecho " use %M for cpu name [$interp_prefix]" 36397a847bcSbellardecho " --target-list=LIST set target list [$target_list]" 3647d13299dSbellardecho "" 365c9ec1fe4Sbellardecho "kqemu kernel acceleration support:" 366c9ec1fe4Sbellardecho " --disable-kqemu disable kqemu build" 367c9ec1fe4Sbellardecho " --kernel-path=PATH set the kernel path (configure probes it)" 368c9ec1fe4Sbellardecho "" 3697d13299dSbellardecho "Advanced options (experts only):" 3707d13299dSbellardecho " --source-path=PATH path of source code [$source_path]" 3717d13299dSbellardecho " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" 3727d13299dSbellardecho " --cc=CC use C compiler CC [$cc]" 37383469015Sbellardecho " --host-cc=CC use C compiler CC [$cc] for dyngen etc." 3747d13299dSbellardecho " --make=MAKE use specified make [$make]" 37543ce4dfeSbellardecho " --static enable static build [$static]" 37667b915a5Sbellardecho " --enable-mingw32 enable Win32 cross compilation with mingw32" 377d37282adSbellardecho " --enable-adlib enable Adlib emulation" 3781d14ffa9Sbellardecho " --enable-coreaudio enable Coreaudio audio driver" 3791d14ffa9Sbellardecho " --enable-alsa enable ALSA audio driver" 3801d14ffa9Sbellardecho " --enable-fmod enable FMOD audio driver" 3811d14ffa9Sbellardecho " --enabled-dsound enable DirectSound audio driver" 382102a52e4Sbellardecho " --fmod-lib path to FMOD library" 383102a52e4Sbellardecho " --fmod-inc path to FMOD includes" 3847d13299dSbellardecho "" 3857d13299dSbellardecho "NOTE: The object files are build at the place where configure is launched" 3867d13299dSbellardexit 1 3877d13299dSbellardfi 3887d13299dSbellard 38911d9f695Sbellardif test "$mingw32" = "yes" ; then 39011d9f695Sbellardif test -z "$prefix" ; then 39111d9f695Sbellard prefix="/c/Program Files/Qemu" 39211d9f695Sbellardfi 39311d9f695Sbellardmandir="$prefix" 3947efa4387Sbellarddatadir="$prefix" 3951f50f8d1Sbellarddocdir="$prefix" 39611d9f695Sbellardbindir="$prefix" 39711d9f695Sbellardelse 39811d9f695Sbellardif test -z "$prefix" ; then 39911d9f695Sbellard prefix="/usr/local" 40011d9f695Sbellardfi 4015a67135aSbellardmandir="$prefix/share/man" 4027efa4387Sbellarddatadir="$prefix/share/qemu" 4031f50f8d1Sbellarddocdir="$prefix/share/doc/qemu" 40411d9f695Sbellardbindir="$prefix/bin" 40511d9f695Sbellardfi 4065a67135aSbellard 40707f4ddbfSbellard# kqemu support 408c9ec1fe4Sbellardif test $kqemu = "yes" ; then 409441c72baSbellard # test if the source code is installed 410441c72baSbellard if test '!' -f "kqemu/Makefile" ; then 411441c72baSbellard kqemu="no" 412441c72baSbellard fi 413441c72baSbellardfi 414441c72baSbellard 41507f4ddbfSbellard# Linux specific kqemu configuration 41607f4ddbfSbellardif test $kqemu = "yes" -a $linux = "yes" ; then 417c9ec1fe4Sbellard# find the kernel path 418c9ec1fe4Sbellardif test -z "$kernel_path" ; then 419c9ec1fe4Sbellardkernel_version=`uname -r` 420c9ec1fe4Sbellardkernel_path="/lib/modules/$kernel_version/build" 421c9ec1fe4Sbellardif test '!' -d "$kernel_path/include" ; then 422c9ec1fe4Sbellard kernel_path="/usr/src/linux" 423c9ec1fe4Sbellard if test '!' -d "$kernel_path/include" ; then 424c9ec1fe4Sbellard echo "Could not find kernel includes in /lib/modules or /usr/src/linux - cannot build the kqemu module" 425c9ec1fe4Sbellard kqemu="no" 426c9ec1fe4Sbellard fi 427c9ec1fe4Sbellardfi 428c9ec1fe4Sbellardfi 429c9ec1fe4Sbellard 430c9ec1fe4Sbellardif test $kqemu = "yes" ; then 431c9ec1fe4Sbellard 432c9ec1fe4Sbellard# test that the kernel config is present 433c9ec1fe4Sbellardif test '!' -f "$kernel_path/Makefile" ; then 434f94daeddSbellard echo "No Makefile file present in $kernel_path - kqemu cannot be built" 435c9ec1fe4Sbellard kqemu="no" 436c9ec1fe4Sbellardfi 437c9ec1fe4Sbellard 438c9ec1fe4Sbellard# find build system (2.6 or legacy) 439c9ec1fe4Sbellardkbuild26="yes" 440c9ec1fe4Sbellardif grep -q "PATCHLEVEL = 4" $kernel_path/Makefile ; then 441c9ec1fe4Sbellardkbuild26="no" 442c9ec1fe4Sbellardfi 443c9ec1fe4Sbellard 444c9ec1fe4Sbellardfi # kqemu 445c9ec1fe4Sbellard 44607f4ddbfSbellardfi # kqemu and linux 447c9ec1fe4Sbellard 448c9ec1fe4Sbellard 4497d13299dSbellardecho "Install prefix $prefix" 4507efa4387Sbellardecho "BIOS directory $datadir" 45111d9f695Sbellardecho "binary directory $bindir" 45211d9f695Sbellardif test "$mingw32" = "no" ; then 45311d9f695Sbellardecho "Manual directory $mandir" 45443ce4dfeSbellardecho "ELF interp prefix $interp_prefix" 45511d9f695Sbellardfi 4565a67135aSbellardecho "Source path $source_path" 4577d13299dSbellardecho "C compiler $cc" 45883469015Sbellardecho "Host C compiler $host_cc" 4597d13299dSbellardecho "make $make" 460a98fd896Sbellardecho "host CPU $cpu" 461de83cd02Sbellardecho "host big endian $bigendian" 46297a847bcSbellardecho "target list $target_list" 4637d13299dSbellardecho "gprof enabled $gprof" 46443ce4dfeSbellardecho "static build $static" 4655b0753e0Sbellardif test "$darwin" = "yes" ; then 4665b0753e0Sbellard echo "Cocoa support $cocoa" 4675b0753e0Sbellardfi 46897a847bcSbellardecho "SDL support $sdl" 469e4afee97Sbellardif test "$sdl" != "no" ; then 4707c1f25b4Sbellard echo "SDL static link $sdl_static" 471e4afee97Sbellardfi 47267b915a5Sbellardecho "mingw32 support $mingw32" 473fb065187Sbellardecho "Adlib support $adlib" 4741d14ffa9Sbellardecho "CoreAudio support $coreaudio" 4751d14ffa9Sbellardecho "ALSA support $alsa" 4761d14ffa9Sbellardecho "DSound support $dsound" 477102a52e4Sbellardecho -n "FMOD support $fmod" 4781d14ffa9Sbellardif test "$fmod" = "yes"; then 4791d14ffa9Sbellard if test -z $fmod_lib || test -z $fmod_inc; then 4801d14ffa9Sbellard echo 4811d14ffa9Sbellard echo "Error: You must specify path to FMOD library and headers" 4821d14ffa9Sbellard echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so" 4831d14ffa9Sbellard echo 4841d14ffa9Sbellard exit 1 4851d14ffa9Sbellard fi 486102a52e4Sbellard echo -n " (lib='$fmod_lib' include='$fmod_inc')" 487102a52e4Sbellardfi 488102a52e4Sbellardecho "" 48907f4ddbfSbellardecho "kqemu support $kqemu" 49007f4ddbfSbellardif test $kqemu = "yes" -a $linux = "yes" ; then 491c9ec1fe4Sbellardecho "" 49207f4ddbfSbellardecho "KQEMU Linux module configuration:" 493c9ec1fe4Sbellardecho "kernel sources $kernel_path" 494c9ec1fe4Sbellardecho -n "kbuild type " 495c9ec1fe4Sbellardif test $kbuild26 = "yes"; then 496c9ec1fe4Sbellardecho "2.6" 497c9ec1fe4Sbellardelse 498c9ec1fe4Sbellardecho "2.4" 499c9ec1fe4Sbellardfi 500c9ec1fe4Sbellardfi 50167b915a5Sbellard 50297a847bcSbellardif test $sdl_too_old = "yes"; then 50324b55b96Sbellardecho "-> Your SDL version is too old - please upgrade to have SDL support" 504e8cd23deSbellardfi 50524b55b96Sbellard#if test "$sdl_static" = "no"; then 50624b55b96Sbellard# echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output" 50724b55b96Sbellard#fi 50897a847bcSbellard 50997a847bcSbellardconfig_mak="config-host.mak" 51097a847bcSbellardconfig_h="config-host.h" 51197a847bcSbellard 5127c1f25b4Sbellard#echo "Creating $config_mak and $config_h" 51397a847bcSbellard 51497a847bcSbellardecho "# Automatically generated by configure - do not modify" > $config_mak 51597a847bcSbellardecho "/* Automatically generated by configure - do not modify */" > $config_h 51697a847bcSbellard 51797a847bcSbellardecho "prefix=$prefix" >> $config_mak 51811d9f695Sbellardecho "bindir=$bindir" >> $config_mak 5195a67135aSbellardecho "mandir=$mandir" >> $config_mak 5207efa4387Sbellardecho "datadir=$datadir" >> $config_mak 5211f50f8d1Sbellardecho "docdir=$docdir" >> $config_mak 5227efa4387Sbellardecho "#define CONFIG_QEMU_SHAREDIR \"$datadir\"" >> $config_h 52397a847bcSbellardecho "MAKE=$make" >> $config_mak 52497a847bcSbellardecho "CC=$cc" >> $config_mak 52597a847bcSbellardif test "$have_gcc3_options" = "yes" ; then 52697a847bcSbellard echo "HAVE_GCC3_OPTIONS=yes" >> $config_mak 52797a847bcSbellardfi 52897a847bcSbellardecho "HOST_CC=$host_cc" >> $config_mak 52997a847bcSbellardecho "AR=$ar" >> $config_mak 53097a847bcSbellardecho "STRIP=$strip -s -R .comment -R .note" >> $config_mak 53197a847bcSbellardecho "CFLAGS=$CFLAGS" >> $config_mak 53297a847bcSbellardecho "LDFLAGS=$LDFLAGS" >> $config_mak 53367b915a5Sbellardecho "EXESUF=$EXESUF" >> $config_mak 53497a847bcSbellardif test "$cpu" = "i386" ; then 53597a847bcSbellard echo "ARCH=i386" >> $config_mak 53697a847bcSbellard echo "#define HOST_I386 1" >> $config_h 5370b0babc6Sbellardelif test "$cpu" = "x86_64" ; then 5380b0babc6Sbellard echo "ARCH=x86_64" >> $config_mak 5390b0babc6Sbellard echo "#define HOST_X86_64 1" >> $config_h 540808c4954Sbellardelif test "$cpu" = "armv4b" ; then 541808c4954Sbellard echo "ARCH=arm" >> $config_mak 542808c4954Sbellard echo "#define HOST_ARM 1" >> $config_h 5437d13299dSbellardelif test "$cpu" = "armv4l" ; then 54497a847bcSbellard echo "ARCH=arm" >> $config_mak 54597a847bcSbellard echo "#define HOST_ARM 1" >> $config_h 5467d13299dSbellardelif test "$cpu" = "powerpc" ; then 54797a847bcSbellard echo "ARCH=ppc" >> $config_mak 54897a847bcSbellard echo "#define HOST_PPC 1" >> $config_h 5497d13299dSbellardelif test "$cpu" = "mips" ; then 55097a847bcSbellard echo "ARCH=mips" >> $config_mak 55197a847bcSbellard echo "#define HOST_MIPS 1" >> $config_h 552fb3e5849Sbellardelif test "$cpu" = "s390" ; then 55397a847bcSbellard echo "ARCH=s390" >> $config_mak 55497a847bcSbellard echo "#define HOST_S390 1" >> $config_h 555295defa5Sbellardelif test "$cpu" = "alpha" ; then 55697a847bcSbellard echo "ARCH=alpha" >> $config_mak 55797a847bcSbellard echo "#define HOST_ALPHA 1" >> $config_h 558ae228531Sbellardelif test "$cpu" = "sparc" ; then 55997a847bcSbellard echo "ARCH=sparc" >> $config_mak 56097a847bcSbellard echo "#define HOST_SPARC 1" >> $config_h 561ae228531Sbellardelif test "$cpu" = "sparc64" ; then 56297a847bcSbellard echo "ARCH=sparc64" >> $config_mak 56397a847bcSbellard echo "#define HOST_SPARC64 1" >> $config_h 564a8baa8c5Sbellardelif test "$cpu" = "ia64" ; then 56597a847bcSbellard echo "ARCH=ia64" >> $config_mak 56697a847bcSbellard echo "#define HOST_IA64 1" >> $config_h 56738e584a0Sbellardelif test "$cpu" = "m68k" ; then 56838ca2abcSbellard echo "ARCH=m68k" >> $config_mak 56938ca2abcSbellard echo "#define HOST_M68K 1" >> $config_h 5707d13299dSbellardelse 5717d13299dSbellard echo "Unsupported CPU" 5727d13299dSbellard exit 1 5737d13299dSbellardfi 5747d13299dSbellardif test "$bigendian" = "yes" ; then 57597a847bcSbellard echo "WORDS_BIGENDIAN=yes" >> $config_mak 57697a847bcSbellard echo "#define WORDS_BIGENDIAN 1" >> $config_h 57797a847bcSbellardfi 578b6853697Sbellardecho "#define HOST_LONG_BITS $hostlongbits" >> $config_h 57967b915a5Sbellardif test "$mingw32" = "yes" ; then 58067b915a5Sbellard echo "CONFIG_WIN32=yes" >> $config_mak 58111d9f695Sbellard echo "#define CONFIG_WIN32 1" >> $config_h 5827d3505c5Sbellardelif test -f "/usr/include/byteswap.h" ; then 58397a847bcSbellard echo "#define HAVE_BYTESWAP_H 1" >> $config_h 58467b915a5Sbellardfi 58583fb7adfSbellardif test "$darwin" = "yes" ; then 58683fb7adfSbellard echo "CONFIG_DARWIN=yes" >> $config_mak 58783fb7adfSbellard echo "#define CONFIG_DARWIN 1" >> $config_h 58883fb7adfSbellardfi 58967b915a5Sbellardif test "$gdbstub" = "yes" ; then 59067b915a5Sbellard echo "CONFIG_GDBSTUB=yes" >> $config_mak 59167b915a5Sbellard echo "#define CONFIG_GDBSTUB 1" >> $config_h 59267b915a5Sbellardfi 59397a847bcSbellardif test "$gprof" = "yes" ; then 59497a847bcSbellard echo "TARGET_GPROF=yes" >> $config_mak 59597a847bcSbellard echo "#define HAVE_GPROF 1" >> $config_h 59697a847bcSbellardfi 59797a847bcSbellardif test "$static" = "yes" ; then 59897a847bcSbellard echo "CONFIG_STATIC=yes" >> $config_mak 59950863472Sbellard echo "#define CONFIG_STATIC 1" >> $config_h 60097a847bcSbellardfi 601c20709aaSbellardif test "$slirp" = "yes" ; then 602c20709aaSbellard echo "CONFIG_SLIRP=yes" >> $config_mak 603c20709aaSbellard echo "#define CONFIG_SLIRP 1" >> $config_h 604c20709aaSbellardfi 605fb065187Sbellardif test "$adlib" = "yes" ; then 606fb065187Sbellard echo "CONFIG_ADLIB=yes" >> $config_mak 607fb065187Sbellard echo "#define CONFIG_ADLIB 1" >> $config_h 608fb065187Sbellardfi 609fb065187Sbellardif test "$oss" = "yes" ; then 610fb065187Sbellard echo "CONFIG_OSS=yes" >> $config_mak 611fb065187Sbellard echo "#define CONFIG_OSS 1" >> $config_h 612fb065187Sbellardfi 6131d14ffa9Sbellardif test "$coreaudio" = "yes" ; then 6141d14ffa9Sbellard echo "CONFIG_COREAUDIO=yes" >> $config_mak 6151d14ffa9Sbellard echo "#define CONFIG_COREAUDIO 1" >> $config_h 6161d14ffa9Sbellardfi 6171d14ffa9Sbellardif test "$alsa" = "yes" ; then 6181d14ffa9Sbellard echo "CONFIG_ALSA=yes" >> $config_mak 6191d14ffa9Sbellard echo "#define CONFIG_ALSA 1" >> $config_h 6201d14ffa9Sbellardfi 6211d14ffa9Sbellardif test "$dsound" = "yes" ; then 6221d14ffa9Sbellard echo "CONFIG_DSOUND=yes" >> $config_mak 6231d14ffa9Sbellard echo "#define CONFIG_DSOUND 1" >> $config_h 6241d14ffa9Sbellardfi 625102a52e4Sbellardif test "$fmod" = "yes" ; then 626102a52e4Sbellard echo "CONFIG_FMOD=yes" >> $config_mak 627102a52e4Sbellard echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak 628102a52e4Sbellard echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak 629102a52e4Sbellard echo "#define CONFIG_FMOD 1" >> $config_h 630102a52e4Sbellardfi 63197a847bcSbellardecho -n "VERSION=" >>$config_mak 63297a847bcSbellardhead $source_path/VERSION >>$config_mak 63397a847bcSbellardecho "" >>$config_mak 63497a847bcSbellardecho -n "#define QEMU_VERSION \"" >> $config_h 63597a847bcSbellardhead $source_path/VERSION >> $config_h 63697a847bcSbellardecho "\"" >> $config_h 63797a847bcSbellard 638c9ec1fe4Sbellardif test $kqemu = "yes" ; then 639c9ec1fe4Sbellard echo "CONFIG_KQEMU=yes" >> $config_mak 6401026f133Sbellard if test $linux = "yes" ; then 641c9ec1fe4Sbellard echo "KERNEL_PATH=$kernel_path" >> $config_mak 642c9ec1fe4Sbellard if test $kbuild26 = "yes" ; then 643c9ec1fe4Sbellard echo "CONFIG_KBUILD26=yes" >> $config_mak 644c9ec1fe4Sbellard fi 645c9ec1fe4Sbellard fi 6461026f133Sbellardfi 64797a847bcSbellardecho "SRC_PATH=$source_path" >> $config_mak 64897a847bcSbellardecho "TARGET_DIRS=$target_list" >> $config_mak 64997a847bcSbellard 65083fb7adfSbellard# XXX: suppress that 6517d3505c5Sbellardif [ "$bsd" = "yes" ] ; then 65243003046Sbellard echo "#define O_LARGEFILE 0" >> $config_h 65343003046Sbellard echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h 6547d3505c5Sbellard echo "#define _BSD 1" >> $config_h 6557d3505c5Sbellardfi 6567d3505c5Sbellard 65797a847bcSbellardfor target in $target_list; do 65897a847bcSbellard 65997a847bcSbellardtarget_dir="$target" 66097a847bcSbellardconfig_mak=$target_dir/config.mak 66197a847bcSbellardconfig_h=$target_dir/config.h 66297a847bcSbellardtarget_cpu=`echo $target | cut -d '-' -f 1` 66397a847bcSbellardtarget_bigendian="no" 664808c4954Sbellard[ "$target_cpu" = "armeb" ] && target_bigendian=yes 6651e43adfcSbellard[ "$target_cpu" = "sparc" ] && target_bigendian=yes 66664b3ab24Sbellard[ "$target_cpu" = "sparc64" ] && target_bigendian=yes 66767867308Sbellard[ "$target_cpu" = "ppc" ] && target_bigendian=yes 668a2458627Sbellard[ "$target_cpu" = "ppc64" ] && target_bigendian=yes 669d3258560Sbellard[ "$target_cpu" = "mips" ] && target_bigendian=yes 67097a847bcSbellardtarget_softmmu="no" 67197a847bcSbellardif expr $target : '.*-softmmu' > /dev/null ; then 67297a847bcSbellard target_softmmu="yes" 6737d13299dSbellardfi 674997344f3Sbellardtarget_user_only="no" 675997344f3Sbellardif expr $target : '.*-user' > /dev/null ; then 676997344f3Sbellard target_user_only="yes" 677997344f3Sbellardfi 678de83cd02Sbellard 67997ccc689Sbellardif test "$target_user_only" = "no" -a "$check_gfx" = "yes" \ 68097ccc689Sbellard -a "$sdl" = "no" -a "$cocoa" = "no" ; then 68197ccc689Sbellard echo "ERROR: QEMU requires SDL or Cocoa for graphical output" 68297ccc689Sbellard echo "To build QEMU with graphical output configure with --disable-gfx-check" 68397ccc689Sbellard echo "Note that this will disable all output from the virtual graphics card." 68497ccc689Sbellard exit 1; 68597ccc689Sbellardfi 68697ccc689Sbellard 6877c1f25b4Sbellard#echo "Creating $config_mak, $config_h and $target_dir/Makefile" 68897a847bcSbellard 68997a847bcSbellardmkdir -p $target_dir 690158142c2Sbellardmkdir -p $target_dir/fpu 691808c4954Sbellardif test "$target" = "arm-user" -o "$target" = "armeb-user" ; then 69269de927cSbellard mkdir -p $target_dir/nwfpe 69369de927cSbellardfi 694a7e61ed4Sbellardif test "$target_user_only" = "no" ; then 695a7e61ed4Sbellard mkdir -p $target_dir/slirp 696a7e61ed4Sbellardfi 69769de927cSbellard 69897a847bcSbellardln -sf $source_path/Makefile.target $target_dir/Makefile 69997a847bcSbellard 70097a847bcSbellardecho "# Automatically generated by configure - do not modify" > $config_mak 70197a847bcSbellardecho "/* Automatically generated by configure - do not modify */" > $config_h 70297a847bcSbellard 70397a847bcSbellard 70497a847bcSbellardecho "include ../config-host.mak" >> $config_mak 70597a847bcSbellardecho "#include \"../config-host.h\"" >> $config_h 7061e43adfcSbellard 7071e43adfcSbellardinterp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"` 7081e43adfcSbellardecho "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h 70997a847bcSbellard 71097a847bcSbellardif test "$target_cpu" = "i386" ; then 71197a847bcSbellard echo "TARGET_ARCH=i386" >> $config_mak 71297a847bcSbellard echo "#define TARGET_ARCH \"i386\"" >> $config_h 71397a847bcSbellard echo "#define TARGET_I386 1" >> $config_h 71407f4ddbfSbellard if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "i386" ; then 715824d560fSbellard echo "#define USE_KQEMU 1" >> $config_h 716824d560fSbellard fi 717808c4954Sbellardelif test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" ; then 71897a847bcSbellard echo "TARGET_ARCH=arm" >> $config_mak 71997a847bcSbellard echo "#define TARGET_ARCH \"arm\"" >> $config_h 72097a847bcSbellard echo "#define TARGET_ARM 1" >> $config_h 7211e43adfcSbellardelif test "$target_cpu" = "sparc" ; then 7221e43adfcSbellard echo "TARGET_ARCH=sparc" >> $config_mak 7231e43adfcSbellard echo "#define TARGET_ARCH \"sparc\"" >> $config_h 7241e43adfcSbellard echo "#define TARGET_SPARC 1" >> $config_h 72564b3ab24Sbellardelif test "$target_cpu" = "sparc64" ; then 72664b3ab24Sbellard echo "TARGET_ARCH=sparc64" >> $config_mak 72764b3ab24Sbellard echo "#define TARGET_ARCH \"sparc64\"" >> $config_h 72864b3ab24Sbellard echo "#define TARGET_SPARC 1" >> $config_h 72964b3ab24Sbellard echo "#define TARGET_SPARC64 1" >> $config_h 73067867308Sbellardelif test "$target_cpu" = "ppc" ; then 73167867308Sbellard echo "TARGET_ARCH=ppc" >> $config_mak 73267867308Sbellard echo "#define TARGET_ARCH \"ppc\"" >> $config_h 73367867308Sbellard echo "#define TARGET_PPC 1" >> $config_h 734a2458627Sbellardelif test "$target_cpu" = "ppc64" ; then 735a2458627Sbellard echo "TARGET_ARCH=ppc64" >> $config_mak 736a2458627Sbellard echo "#define TARGET_ARCH \"ppc64\"" >> $config_h 737a2458627Sbellard echo "#define TARGET_PPC 1" >> $config_h 738a2458627Sbellard echo "#define TARGET_PPC64 1" >> $config_h 7390b0babc6Sbellardelif test "$target_cpu" = "x86_64" ; then 7400b0babc6Sbellard echo "TARGET_ARCH=x86_64" >> $config_mak 7410b0babc6Sbellard echo "#define TARGET_ARCH \"x86_64\"" >> $config_h 7420b0babc6Sbellard echo "#define TARGET_I386 1" >> $config_h 7430b0babc6Sbellard echo "#define TARGET_X86_64 1" >> $config_h 74407f4ddbfSbellard if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64" ; then 74507f4ddbfSbellard echo "#define USE_KQEMU 1" >> $config_h 74607f4ddbfSbellard fi 747d3258560Sbellardelif test "$target_cpu" = "mips" ; then 748d3258560Sbellard echo "TARGET_ARCH=mips" >> $config_mak 749d3258560Sbellard echo "#define TARGET_ARCH \"mips\"" >> $config_h 750d3258560Sbellard echo "#define TARGET_MIPS 1" >> $config_h 751de83cd02Sbellardelse 752de83cd02Sbellard echo "Unsupported target CPU" 753de83cd02Sbellard exit 1 754de83cd02Sbellardfi 755de83cd02Sbellardif test "$target_bigendian" = "yes" ; then 75697a847bcSbellard echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak 75797a847bcSbellard echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h 75897a847bcSbellardfi 75997a847bcSbellardif test "$target_softmmu" = "yes" ; then 76097a847bcSbellard echo "CONFIG_SOFTMMU=yes" >> $config_mak 76197a847bcSbellard echo "#define CONFIG_SOFTMMU 1" >> $config_h 762de83cd02Sbellardfi 763997344f3Sbellardif test "$target_user_only" = "yes" ; then 764997344f3Sbellard echo "CONFIG_USER_ONLY=yes" >> $config_mak 765997344f3Sbellard echo "#define CONFIG_USER_ONLY 1" >> $config_h 766997344f3Sbellardfi 767de83cd02Sbellard 768158142c2Sbellardif test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" ; then 769158142c2Sbellard echo "CONFIG_SOFTFLOAT=yes" >> $config_mak 770158142c2Sbellard echo "#define CONFIG_SOFTFLOAT 1" >> $config_h 771158142c2Sbellardfi 7727c1f25b4Sbellard# sdl defines 7737c1f25b4Sbellard 7747c1f25b4Sbellardif test "$target_user_only" = "no"; then 7757c1f25b4Sbellard if test "$target_softmmu" = "no" -o "$static" = "yes"; then 776dbb2c921Sbellard sdl1=$sdl_static 7777c1f25b4Sbellard else 778dbb2c921Sbellard sdl1=$sdl 779dbb2c921Sbellard fi 780dbb2c921Sbellard if test "$sdl1" = "yes" ; then 7817c1f25b4Sbellard echo "#define CONFIG_SDL 1" >> $config_h 7827c1f25b4Sbellard echo "CONFIG_SDL=yes" >> $config_mak 783dbb2c921Sbellard if test "$target_softmmu" = "no" -o "$static" = "yes"; then 784dbb2c921Sbellard echo "SDL_LIBS=$sdl_static_libs" >> $config_mak 785dbb2c921Sbellard else 7867c1f25b4Sbellard echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak 7877c1f25b4Sbellard fi 7887c1f25b4Sbellard echo -n "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak 7897c1f25b4Sbellard if [ "${aa}" = "yes" ] ; then 7907c1f25b4Sbellard echo -n " `aalib-config --cflags`" >> $config_mak ; 7917c1f25b4Sbellard fi 7927c1f25b4Sbellard echo "" >> $config_mak 7937c1f25b4Sbellard fi 794dbb2c921Sbellardfi 7957c1f25b4Sbellard 7965b0753e0Sbellardif test "$cocoa" = "yes" ; then 7975b0753e0Sbellard echo "#define CONFIG_COCOA 1" >> $config_h 7985b0753e0Sbellard echo "CONFIG_COCOA=yes" >> $config_mak 7995b0753e0Sbellardfi 8005b0753e0Sbellard 80197a847bcSbellarddone # for target in $targets 8027d13299dSbellard 8037d13299dSbellard# build tree in object directory if source path is different from current one 8047d13299dSbellardif test "$source_path_used" = "yes" ; then 8057d13299dSbellard DIRS="tests" 8067d13299dSbellard FILES="Makefile tests/Makefile" 8077d13299dSbellard for dir in $DIRS ; do 8087d13299dSbellard mkdir -p $dir 8097d13299dSbellard done 8107d13299dSbellard for f in $FILES ; do 8117d13299dSbellard ln -sf $source_path/$f $f 8127d13299dSbellard done 8137d13299dSbellardfi 8147d13299dSbellard 81597a847bcSbellardrm -f $TMPO $TMPC $TMPE $TMPS 816