3 # qemu configure script (c) 2003 Fabrice Bellard
5 # set temporary file name
6 if test ! -z "$TMPDIR" ; then
8 elif test ! -z "$TEMPDIR" ; then
14 TMPC
="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.c"
15 TMPO
="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.o"
16 TMPE
="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}"
17 TMPS
="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.S"
21 interp_prefix
="/usr/gnemul/qemu-%M"
26 gcc3_list
="gcc-3.4.6 gcc-3.4 gcc34 gcc-3.3.6 gcc-3.3 gcc33 gcc-3.2 gcc32"
37 i386|i486|i586|i686|i86pc|BePC
)
70 "Power Macintosh"|ppc|ppc64
)
121 OS_CFLAGS
="-mno-cygwin"
122 if [ "$cpu" = "i386" ] ; then
125 audio_possible_drivers
="sdl"
129 if [ "$cpu" = "i386" ] ; then
132 audio_possible_drivers
="dsound sdl fmod"
136 audio_possible_drivers
="oss sdl esd pa"
137 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
144 audio_possible_drivers
="oss sdl esd pa"
145 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
152 audio_possible_drivers
="oss sdl esd"
158 audio_possible_drivers
="oss sdl esd"
166 audio_drv_list
="coreaudio"
167 audio_possible_drivers
="coreaudio sdl fmod"
168 OS_CFLAGS
="-mdynamic-no-pic"
169 OS_LDFLAGS
="-framework CoreFoundation -framework IOKit"
175 needs_libsunmath
="no"
176 solarisrev
=`uname -r | cut -f2 -d.`
177 # have to select again, because `uname -m` returns i86pc
178 # even on an x86_64 box.
179 solariscpu
=`isainfo -k`
180 if test "${solariscpu}" = "amd64" ; then
183 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
184 if test "$solarisrev" -le 9 ; then
185 if test -f /opt
/SUNWspro
/prod
/lib
/libsunmath.so
.1; then
186 needs_libsunmath
="yes"
188 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
189 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
190 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
191 echo "Studio 11 can be downloaded from www.sun.com."
195 if test "$solarisrev" -ge 9 ; then
199 if test -f /usr
/include
/sys
/soundcard.h
; then
202 audio_possible_drivers
="oss sdl"
206 audio_possible_drivers
="oss alsa sdl esd pa"
209 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
211 audio_possible_drivers
="$audio_possible_drivers fmod"
216 if [ "$bsd" = "yes" ] ; then
217 if [ "$darwin" != "yes" ] ; then
223 source_path
=`dirname "$0"`
224 source_path_used
="no"
226 if [ -z "$source_path" ]; then
229 source_path
=`cd "$source_path"; pwd`
231 [ -f "$workdir/vl.c" ] || source_path_used
="yes"
234 # generate compile errors on warnings for development builds
235 #if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then
240 optarg
=`expr "x$opt" : 'x[^=]*=\(.*\)'`
242 --help|
-h) show_help
=yes
244 --prefix=*) prefix
="$optarg"
246 --interp-prefix=*) interp_prefix
="$optarg"
248 --source-path=*) source_path
="$optarg"
249 source_path_used
="yes"
251 --cross-prefix=*) cross_prefix
="$optarg"
256 --host-cc=*) host_cc
="$optarg"
258 --make=*) make="$optarg"
260 --install=*) install="$optarg"
262 --extra-cflags=*) CFLAGS
="$optarg"
264 --extra-ldflags=*) LDFLAGS
="$optarg"
266 --cpu=*) cpu
="$optarg"
268 --target-list=*) target_list
="$optarg"
270 --enable-gprof) gprof
="yes"
272 --static) static
="yes"
274 --disable-sdl) sdl
="no"
276 --fmod-lib=*) fmod_lib
="$optarg"
278 --fmod-inc=*) fmod_inc
="$optarg"
280 --oss-lib=*) oss_lib
="$optarg"
282 --audio-card-list=*) audio_card_list
=`echo "$optarg" | sed -e 's/,/ /g'`
284 --audio-drv-list=*) audio_drv_list
="$optarg"
286 --disable-vnc-tls) vnc_tls
="no"
288 --disable-slirp) slirp
="no"
290 --disable-vde) vde
="no"
292 --disable-kqemu) kqemu
="no"
294 --disable-brlapi) brlapi
="no"
296 --enable-profiler) profiler
="yes"
301 audio_drv_list
="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
303 --disable-gfx-check) check_gfx
="no"
305 --disable-gcc-check) check_gcc
="no"
307 --disable-system) softmmu
="no"
309 --enable-system) softmmu
="yes"
311 --disable-linux-user) linux_user
="no"
313 --enable-linux-user) linux_user
="yes"
315 --disable-darwin-user) darwin_user
="no"
317 --enable-darwin-user) darwin_user
="yes"
319 --enable-uname-release=*) uname_release
="$optarg"
324 v7|v8
) SP_CFLAGS
="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m32"
325 target_cpu
="sparc"; cpu
="sparc" ;;
326 v8plus|v8plusa
) SP_CFLAGS
="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m32"
327 target_cpu
="sparc"; cpu
="sparc" ;;
328 v9
) SP_CFLAGS
="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m64"
329 target_cpu
="sparc64"; cpu
="sparc64" ;;
330 *) echo "undefined SPARC architecture. Exiting";exit 1;;
333 --enable-werror) werror
="yes"
335 --disable-werror) werror
="no"
337 --disable-curses) curses
="no"
339 --disable-nptl) nptl
="no"
341 --enable-mixemu) mixemu
="yes"
343 --disable-aio) aio
="no"
345 *) echo "ERROR: unknown option $opt"; show_help
="yes"
350 # default flags for all hosts
351 CFLAGS
="$CFLAGS -O2 -g -fno-strict-aliasing"
352 CFLAGS
="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings"
353 LDFLAGS
="$LDFLAGS -g"
354 if test "$werror" = "yes" ; then
355 CFLAGS
="$CFLAGS -Werror"
358 if ld
--version 2>/dev
/null |
grep -q "GNU ld" ; then
359 LDFLAGS
="$LDFLAGS -Wl,--warn-common"
363 # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
364 # ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
367 sparc
) if test -z "$sparc_cpu" ; then
368 ARCH_CFLAGS
="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
371 ARCH_CFLAGS
="${SP_CFLAGS}"
372 ARCH_LDFLAGS
="${SP_LDFLAGS}"
375 sparc64
) if test -z "$sparc_cpu" ; then
376 ARCH_CFLAGS
="-m64 -mcpu=ultrasparc -D__sparc_v9__"
379 ARCH_CFLAGS
="${SP_CFLAGS}"
380 ARCH_LDFLAGS
="${SP_LDFLAGS}"
384 ARCH_CFLAGS
="-march=z900"
396 if test x
"$show_help" = x
"yes" ; then
399 Usage: configure [options]
400 Options: [defaults in brackets after descriptions]
403 echo "Standard options:"
404 echo " --help print this message"
405 echo " --prefix=PREFIX install in PREFIX [$prefix]"
406 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
407 echo " use %M for cpu name [$interp_prefix]"
408 echo " --target-list=LIST set target list [$target_list]"
410 echo "kqemu kernel acceleration support:"
411 echo " --disable-kqemu disable kqemu support"
413 echo "Advanced options (experts only):"
414 echo " --source-path=PATH path of source code [$source_path]"
415 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
416 echo " --cc=CC use C compiler CC [$cc]"
417 echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
418 echo " --make=MAKE use specified make [$make]"
419 echo " --install=INSTALL use specified install [$install]"
420 echo " --static enable static build [$static]"
421 echo " --disable-werror disable compilation abort on warning"
422 echo " --disable-sdl disable SDL"
423 echo " --enable-cocoa enable COCOA (Mac OS X only)"
424 echo " --audio-drv-list=LIST set audio drivers list:"
425 echo " Available drivers: $audio_possible_drivers"
426 echo " --audio-card-list=LIST set list of additional emulated audio cards"
427 echo " Available cards: ac97 adlib cs4231a gus"
428 echo " --enable-mixemu enable mixer emulation"
429 echo " --disable-brlapi disable BrlAPI"
430 echo " --disable-vnc-tls disable TLS encryption for VNC server"
431 echo " --disable-curses disable curses output"
432 echo " --disable-nptl disable usermode NPTL support"
433 echo " --enable-system enable all system emulation targets"
434 echo " --disable-system disable all system emulation targets"
435 echo " --enable-linux-user enable all linux usermode emulation targets"
436 echo " --disable-linux-user disable all linux usermode emulation targets"
437 echo " --enable-darwin-user enable all darwin usermode emulation targets"
438 echo " --disable-darwin-user disable all darwin usermode emulation targets"
439 echo " --fmod-lib path to FMOD library"
440 echo " --fmod-inc path to FMOD includes"
441 echo " --oss-lib path to OSS library"
442 echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
443 echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
444 echo " --disable-vde disable support for vde network"
445 echo " --disable-aio disable AIO support"
447 echo "NOTE: The object files are built at the place where configure is launched"
451 cc
="${cross_prefix}${cc}"
452 ar="${cross_prefix}${ar}"
453 strip
="${cross_prefix}${strip}"
455 # check that the C compiler works.
460 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev
/null
; then
461 : C compiler works ok
463 echo "ERROR: \"$cc\" either does not exist or does not work"
467 # check compiler to see if we're on mingw32
476 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev
/null
; then
480 if test "$mingw32" = "yes" ; then
487 if [ "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then
489 elif [ "$bsd" = "yes" ]; then
492 # Some Linux architectures (e.g. s390) don't imply -lpthread automatically.
493 AIOLIBS
="-lrt -lpthread"
496 # Check for gcc4, error if pre-gcc4
497 if test "$check_gcc" = "yes" ; then
502 int main(){return 0;}
504 if "$cc" $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
505 echo "WARNING: \"$cc\" looks like gcc 4.x"
507 if test "$gcc3_search" = "yes" ; then
508 echo "Looking for gcc 3.x"
509 for compat_cc
in $gcc3_list ; do
510 if "$cross_prefix$compat_cc" --version 2> /dev
/null | fgrep
'(GCC) 3.' > /dev
/null
2>&1 ; then
511 echo "Found \"$compat_cc\""
512 cc
="$cross_prefix$compat_cc"
513 found_compat_cc
="yes"
517 if test "$found_compat_cc" = "no" ; then
518 echo "gcc 3.x not found!"
521 if test "$found_compat_cc" = "no" ; then
522 echo "QEMU is known to have problems when compiled with gcc 4.x"
523 echo "It is recommended that you use gcc 3.x to build QEMU"
524 echo "To use this compiler anyway, configure with --disable-gcc-check"
531 # Solaris specific configure tool chain decisions
533 if test "$solaris" = "yes" ; then
535 # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly
536 # override the check with --disable-gcc-check
538 if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then
540 if test "$solgcc" = "/usr/sfw/bin/gcc" ; then
541 echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly."
542 echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3"
543 echo "or get the latest patch from SunSolve for gcc"
547 solinst
=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
548 if test -z "$solinst" ; then
549 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
550 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
551 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
554 if test "$solinst" = "/usr/sbin/install" ; then
555 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
556 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
557 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
560 sol_ar
=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
561 if test -z "$sol_ar" ; then
562 echo "Error: No path includes ar"
563 if test -f /usr
/ccs
/bin
/ar ; then
564 echo "Add /usr/ccs/bin to your path and rerun configure"
571 if test -z "$target_list" ; then
572 # these targets are portable
573 if [ "$softmmu" = "yes" ] ; then
592 # the following are Linux specific
593 if [ "$linux_user" = "yes" ] ; then
594 target_list
="${target_list}\
606 ppc64abi32-linux-user \
611 sparc32plus-linux-user \
614 # the following are Darwin specific
615 if [ "$darwin_user" = "yes" ] ; then
616 target_list
="$target_list i386-darwin-user ppc-darwin-user"
619 target_list
=`echo "$target_list" | sed -e 's/,/ /g'`
621 if test -z "$target_list" ; then
622 echo "No targets enabled"
626 if test -z "$cross_prefix" ; then
629 # big/little endian test
631 #include <inttypes.h>
632 int main(int argc, char ** argv){
633 volatile uint32_t i=0x01234567;
634 return (*((uint8_t*)(&i))) == 0x67;
638 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
639 $TMPE && bigendian
="yes"
641 echo big
/little
test failed
646 # if cross compiling, cannot launch a program, so make a static guess
647 if test "$cpu" = "armv4b" \
651 -o "$cpu" = "mips64" \
652 -o "$cpu" = "powerpc" \
654 -o "$cpu" = "sparc" \
655 -o "$cpu" = "sparc64"; then
661 # host long bits test
663 if test "$cpu" = "x86_64" \
664 -o "$cpu" = "alpha" \
666 -o "$cpu" = "sparc64"; then
670 # ppc specific hostlongbits selection
671 if test "$cpu" = "powerpc" ; then
673 int main(void){return sizeof(long);}
676 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
679 4) hostlongbits
="32";;
680 8) hostlongbits
="64";;
681 *) echo "Couldn't determine bits per long value"; exit 1;;
684 echo hostlongbits
test failed
689 # check gcc options support
695 # Check host NPTL support
698 #include <linux/futex.h>
701 #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
707 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev
/null
; then
713 ##########################################
718 if test -z "$sdl" ; then
719 sdl_config
="sdl-config"
725 #undef main /* We don't want SDL to override our main() */
726 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
728 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /tmp
/qemu-$$
-sdl-config.log
; then
729 _sdlversion
=`$sdl_config --version | sed 's/[^0-9]//g'`
730 if test "$_sdlversion" -lt 121 ; then
733 if test "$cocoa" = "no" ; then
738 # static link with sdl ?
739 if test "$sdl" = "yes" ; then
741 `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa
="yes"
742 sdl_static_libs
=`$sdl_config --static-libs 2>/dev/null`
743 if [ "$aa" = "yes" ] ; then
744 sdl_static_libs
="$sdl_static_libs `aalib-config --static-libs`"
747 if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev
/null
; then
751 fi # sdl compile test
753 # Make sure to disable cocoa if sdl was set
754 if test "$sdl" = "yes" ; then
756 audio_drv_list
="`echo $audio_drv_list | sed s,coreaudio,,g`"
760 ##########################################
762 if test "$vnc_tls" = "yes" ; then
764 #include <gnutls/gnutls.h>
765 int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
767 vnc_tls_cflags
=`pkg-config --cflags gnutls 2> /dev/null`
768 vnc_tls_libs
=`pkg-config --libs gnutls 2> /dev/null`
769 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \
770 $vnc_tls_libs 2> /dev
/null
; then
777 ##########################################
778 # vde libraries probe
779 if test "$vde" = "yes" ; then
781 #include <libvdeplug.h>
784 struct vde_open_args a = {0, 0, 0};
785 vde_open("", "", &a);
789 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug 2> /dev
/null
; then
796 ##########################################
797 # Sound support libraries probe
808 int main(void) { $exp }
810 if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib 2> /dev
/null
; then
814 echo "Error: $drv check failed"
815 echo "Make sure to have the $drv libs and headers installed."
821 audio_drv_list
=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
822 for drv
in $audio_drv_list; do
825 audio_drv_probe
$drv alsa
/asoundlib.h
-lasound \
826 "snd_pcm_t **handle; return snd_pcm_close(*handle);"
830 if test -z $fmod_lib ||
test -z $fmod_inc; then
832 echo "Error: You must specify path to FMOD library and headers"
833 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
837 audio_drv_probe
$drv fmod.h
$fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
841 audio_drv_probe
$drv esd.h
-lesd 'return esd_play_stream(0, 0, "", 0);'
845 audio_drv_probe
$drv pulse
/simple.h
-lpulse-simple \
846 "pa_simple *s = NULL; pa_simple_free(s); return 0;"
849 oss|sdl|core|wav|dsound
)
850 # XXX: Probes for CoreAudio, DirectSound, SDL(?)
854 echo "$audio_possible_drivers" |
grep -q "\<$drv\>" ||
{
856 echo "Error: Unknown driver '$drv' selected"
857 echo "Possible drivers are: $audio_possible_drivers"
865 ##########################################
868 if test -z "$brlapi" ; then
872 int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
874 if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi 2> /dev
/null
; then
876 fi # brlapi compile test
879 ##########################################
882 if test "$curses" = "yes" ; then
886 int main(void) { return curses_version(); }
888 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses 2> /dev
/null
; then
893 ##########################################
895 if test "$aio" = "yes" ; then
899 int main(void) { return aio_write(NULL); }
901 if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev
/null
; then
906 ##########################################
911 #include <sys/syscall.h>
913 int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }
916 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
920 ##########################################
925 #include <sys/syscall.h>
926 int main(void) { return syscall(SYS_eventfd, 0); }
929 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
933 # Check if tools are available to build documentation.
934 if [ -x "`which texi2html 2>/dev/null`" ] && \
935 [ -x "`which pod2man 2>/dev/null`" ]; then
939 if test "$mingw32" = "yes" ; then
940 if test -z "$prefix" ; then
941 prefix
="/c/Program Files/Qemu"
948 if test -z "$prefix" ; then
951 mansuffix
="/share/man"
952 datasuffix
="/share/qemu"
953 docsuffix
="/share/doc/qemu"
957 echo "Install prefix $prefix"
958 echo "BIOS directory $prefix$datasuffix"
959 echo "binary directory $prefix$binsuffix"
960 if test "$mingw32" = "no" ; then
961 echo "Manual directory $prefix$mansuffix"
962 echo "ELF interp prefix $interp_prefix"
964 echo "Source path $source_path"
965 echo "C compiler $cc"
966 echo "Host C compiler $host_cc"
967 echo "ARCH_CFLAGS $ARCH_CFLAGS"
969 echo "install $install"
971 echo "host big endian $bigendian"
972 echo "target list $target_list"
973 echo "gprof enabled $gprof"
974 echo "profiler $profiler"
975 echo "static build $static"
976 echo "-Werror enabled $werror"
977 if test "$darwin" = "yes" ; then
978 echo "Cocoa support $cocoa"
980 echo "SDL support $sdl"
981 if test "$sdl" != "no" ; then
982 echo "SDL static link $sdl_static"
984 echo "curses support $curses"
985 echo "mingw32 support $mingw32"
986 echo "Audio drivers $audio_drv_list"
987 echo "Extra audio cards $audio_card_list"
988 echo "Mixer emulation $mixemu"
989 echo "VNC TLS support $vnc_tls"
990 if test "$vnc_tls" = "yes" ; then
991 echo " TLS CFLAGS $vnc_tls_cflags"
992 echo " TLS LIBS $vnc_tls_libs"
994 if test -n "$sparc_cpu"; then
995 echo "Target Sparc Arch $sparc_cpu"
997 echo "kqemu support $kqemu"
998 echo "brlapi support $brlapi"
999 echo "Documentation $build_docs"
1000 [ ! -z "$uname_release" ] && \
1001 echo "uname -r $uname_release"
1002 echo "NPTL support $nptl"
1003 echo "vde support $vde"
1004 echo "AIO support $aio"
1006 if test $sdl_too_old = "yes"; then
1007 echo "-> Your SDL version is too old - please upgrade to have SDL support"
1009 if [ -s /tmp
/qemu-$$
-sdl-config.log
]; then
1010 echo "The error log from compiling the libSDL test is: "
1011 cat /tmp
/qemu-$$
-sdl-config.log
1013 rm -f /tmp
/qemu-$$
-sdl-config.log
1014 #if test "$sdl_static" = "no"; then
1015 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
1017 config_mak
="config-host.mak"
1018 config_h
="config-host.h"
1020 #echo "Creating $config_mak and $config_h"
1022 test -f $config_h && mv $config_h ${config_h}~
1024 echo "# Automatically generated by configure - do not modify" > $config_mak
1025 echo "# Configured with: $0 $@" >> $config_mak
1026 echo "/* Automatically generated by configure - do not modify */" > $config_h
1028 echo "prefix=$prefix" >> $config_mak
1029 echo "bindir=\${prefix}$binsuffix" >> $config_mak
1030 echo "mandir=\${prefix}$mansuffix" >> $config_mak
1031 echo "datadir=\${prefix}$datasuffix" >> $config_mak
1032 echo "docdir=\${prefix}$docsuffix" >> $config_mak
1033 echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
1034 echo "MAKE=$make" >> $config_mak
1035 echo "INSTALL=$install" >> $config_mak
1036 echo "CC=$cc" >> $config_mak
1037 echo "HOST_CC=$host_cc" >> $config_mak
1038 echo "AR=$ar" >> $config_mak
1039 echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
1040 # XXX: only use CFLAGS and LDFLAGS ?
1041 # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
1042 # compilation of dyngen tool (useful for win32 build on Linux host)
1043 echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
1044 echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
1045 echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
1046 echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
1047 echo "CFLAGS=$CFLAGS" >> $config_mak
1048 echo "LDFLAGS=$LDFLAGS" >> $config_mak
1049 echo "EXESUF=$EXESUF" >> $config_mak
1050 echo "AIOLIBS=$AIOLIBS" >> $config_mak
1053 echo "ARCH=i386" >> $config_mak
1054 echo "#define HOST_I386 1" >> $config_h
1057 echo "ARCH=x86_64" >> $config_mak
1058 echo "#define HOST_X86_64 1" >> $config_h
1061 echo "ARCH=alpha" >> $config_mak
1062 echo "#define HOST_ALPHA 1" >> $config_h
1065 echo "ARCH=arm" >> $config_mak
1066 echo "#define HOST_ARM 1" >> $config_h
1069 echo "ARCH=arm" >> $config_mak
1070 echo "#define HOST_ARM 1" >> $config_h
1073 echo "ARCH=cris" >> $config_mak
1074 echo "#define HOST_CRIS 1" >> $config_h
1077 echo "ARCH=hppa" >> $config_mak
1078 echo "#define HOST_HPPA 1" >> $config_h
1081 echo "ARCH=ia64" >> $config_mak
1082 echo "#define HOST_IA64 1" >> $config_h
1085 echo "ARCH=m68k" >> $config_mak
1086 echo "#define HOST_M68K 1" >> $config_h
1089 echo "ARCH=mips" >> $config_mak
1090 echo "#define HOST_MIPS 1" >> $config_h
1093 echo "ARCH=mips64" >> $config_mak
1094 echo "#define HOST_MIPS64 1" >> $config_h
1097 if test "$hostlongbits" = "32"; then
1098 echo "ARCH=ppc" >> $config_mak
1099 echo "#define HOST_PPC 1" >> $config_h
1101 echo "ARCH=ppc64" >> $config_mak
1102 echo "#define HOST_PPC64 1" >> $config_h
1106 echo "ARCH=s390" >> $config_mak
1107 echo "#define HOST_S390 1" >> $config_h
1110 echo "ARCH=sparc" >> $config_mak
1111 echo "#define HOST_SPARC 1" >> $config_h
1114 echo "ARCH=sparc64" >> $config_mak
1115 echo "#define HOST_SPARC64 1" >> $config_h
1118 echo "Unsupported CPU = $cpu"
1122 if test "$bigendian" = "yes" ; then
1123 echo "WORDS_BIGENDIAN=yes" >> $config_mak
1124 echo "#define WORDS_BIGENDIAN 1" >> $config_h
1126 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
1127 if test "$mingw32" = "yes" ; then
1128 echo "CONFIG_WIN32=yes" >> $config_mak
1129 echo "#define CONFIG_WIN32 1" >> $config_h
1132 #include <byteswap.h>
1133 int main(void) { return bswap_32(0); }
1135 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
1136 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
1140 if [ "$openbsd" = "yes" ] ; then
1141 echo "#define ENOTSUP 4096" >> $config_h
1144 if test "$darwin" = "yes" ; then
1145 echo "CONFIG_DARWIN=yes" >> $config_mak
1146 echo "#define CONFIG_DARWIN 1" >> $config_h
1148 if test "$solaris" = "yes" ; then
1149 echo "CONFIG_SOLARIS=yes" >> $config_mak
1150 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
1151 if test "$needs_libsunmath" = "yes" ; then
1152 echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
1153 echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
1156 if test -n "$sparc_cpu"; then
1157 echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
1158 echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
1160 if test "$gdbstub" = "yes" ; then
1161 echo "CONFIG_GDBSTUB=yes" >> $config_mak
1162 echo "#define CONFIG_GDBSTUB 1" >> $config_h
1164 if test "$gprof" = "yes" ; then
1165 echo "TARGET_GPROF=yes" >> $config_mak
1166 echo "#define HAVE_GPROF 1" >> $config_h
1168 if test "$static" = "yes" ; then
1169 echo "CONFIG_STATIC=yes" >> $config_mak
1170 echo "#define CONFIG_STATIC 1" >> $config_h
1172 if test $profiler = "yes" ; then
1173 echo "#define CONFIG_PROFILER 1" >> $config_h
1175 if test "$slirp" = "yes" ; then
1176 echo "CONFIG_SLIRP=yes" >> $config_mak
1177 echo "#define CONFIG_SLIRP 1" >> $config_h
1179 if test "$vde" = "yes" ; then
1180 echo "CONFIG_VDE=yes" >> $config_mak
1181 echo "#define CONFIG_VDE 1" >> $config_h
1182 echo "VDE_LIBS=-lvdeplug" >> $config_mak
1184 for card
in $audio_card_list; do
1185 def
=CONFIG_
`echo $card | tr '[:lower:]' '[:upper:]'`
1186 echo "$def=yes" >> $config_mak
1187 echo "#define $def 1" >> $config_h
1189 echo "#define AUDIO_DRIVERS \\" >> $config_h
1190 for drv
in $audio_drv_list; do
1191 echo " &${drv}_audio_driver, \\" >>$config_h
1192 def
=CONFIG_
`echo $drv | tr '[:lower:]' '[:upper:]'`
1193 echo "$def=yes" >> $config_mak
1194 if test "$drv" = "fmod"; then
1195 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
1196 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
1197 elif test "$drv" = "oss"; then
1198 echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak
1202 if test "$mixemu" = "yes" ; then
1203 echo "CONFIG_MIXEMU=yes" >> $config_mak
1204 echo "#define CONFIG_MIXEMU 1" >> $config_h
1206 if test "$vnc_tls" = "yes" ; then
1207 echo "CONFIG_VNC_TLS=yes" >> $config_mak
1208 echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak
1209 echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
1210 echo "#define CONFIG_VNC_TLS 1" >> $config_h
1212 qemu_version
=`head $source_path/VERSION`
1213 echo "VERSION=$qemu_version" >>$config_mak
1214 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
1216 echo "SRC_PATH=$source_path" >> $config_mak
1217 if [ "$source_path_used" = "yes" ]; then
1218 echo "VPATH=$source_path" >> $config_mak
1220 echo "TARGET_DIRS=$target_list" >> $config_mak
1221 if [ "$build_docs" = "yes" ] ; then
1222 echo "BUILD_DOCS=yes" >> $config_mak
1224 if test "$static" = "yes"; then
1229 if test "$sdl1" = "yes" ; then
1230 echo "#define CONFIG_SDL 1" >> $config_h
1231 echo "CONFIG_SDL=yes" >> $config_mak
1232 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1233 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
1235 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1237 if [ "${aa}" = "yes" ] ; then
1238 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1240 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1243 if test "$cocoa" = "yes" ; then
1244 echo "#define CONFIG_COCOA 1" >> $config_h
1245 echo "CONFIG_COCOA=yes" >> $config_mak
1247 if test "$curses" = "yes" ; then
1248 echo "#define CONFIG_CURSES 1" >> $config_h
1249 echo "CONFIG_CURSES=yes" >> $config_mak
1250 echo "CURSES_LIBS=-lcurses" >> $config_mak
1252 if test "$brlapi" = "yes" ; then
1253 echo "CONFIG_BRLAPI=yes" >> $config_mak
1254 echo "#define CONFIG_BRLAPI 1" >> $config_h
1255 echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
1257 if test "$aio" = "yes" ; then
1258 echo "#define CONFIG_AIO 1" >> $config_h
1259 echo "CONFIG_AIO=yes" >> $config_mak
1261 if test "$signalfd" = "yes" ; then
1262 echo "#define CONFIG_signalfd 1" >> $config_h
1264 if test "$eventfd" = "yes" ; then
1265 echo "#define CONFIG_eventfd 1" >> $config_h
1268 # XXX: suppress that
1269 if [ "$bsd" = "yes" ] ; then
1270 echo "#define O_LARGEFILE 0" >> $config_h
1271 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
1272 echo "#define _BSD 1" >> $config_h
1275 echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
1278 if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
1279 tools
="qemu-img\$(EXESUF) $tools"
1280 if [ "$linux" = "yes" ] ; then
1281 tools
="qemu-nbd\$(EXESUF) $tools"
1284 echo "TOOLS=$tools" >> $config_mak
1286 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~
$config_h
1288 for target
in $target_list; do
1289 target_dir
="$target"
1290 config_mak
=$target_dir/config.mak
1291 config_h
=$target_dir/config.h
1292 target_cpu
=`echo $target | cut -d '-' -f 1`
1293 target_bigendian
="no"
1294 [ "$target_cpu" = "armeb" ] && target_bigendian
=yes
1295 [ "$target_cpu" = "m68k" ] && target_bigendian
=yes
1296 [ "$target_cpu" = "mips" ] && target_bigendian
=yes
1297 [ "$target_cpu" = "mipsn32" ] && target_bigendian
=yes
1298 [ "$target_cpu" = "mips64" ] && target_bigendian
=yes
1299 [ "$target_cpu" = "ppc" ] && target_bigendian
=yes
1300 [ "$target_cpu" = "ppcemb" ] && target_bigendian
=yes
1301 [ "$target_cpu" = "ppc64" ] && target_bigendian
=yes
1302 [ "$target_cpu" = "ppc64abi32" ] && target_bigendian
=yes
1303 [ "$target_cpu" = "sh4eb" ] && target_bigendian
=yes
1304 [ "$target_cpu" = "sparc" ] && target_bigendian
=yes
1305 [ "$target_cpu" = "sparc64" ] && target_bigendian
=yes
1306 [ "$target_cpu" = "sparc32plus" ] && target_bigendian
=yes
1308 target_user_only
="no"
1309 target_linux_user
="no"
1310 target_darwin_user
="no"
1312 ${target_cpu}-softmmu)
1313 target_softmmu
="yes"
1315 ${target_cpu}-linux-user)
1316 target_user_only
="yes"
1317 target_linux_user
="yes"
1319 ${target_cpu}-darwin-user)
1320 target_user_only
="yes"
1321 target_darwin_user
="yes"
1324 echo "ERROR: Target '$target' not recognised"
1329 if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
1330 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
1331 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
1332 echo "To build QEMU without graphical output configure with --disable-gfx-check"
1333 echo "Note that this will disable all output from the virtual graphics card"
1334 echo "except through VNC or curses."
1338 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
1340 test -f $config_h && mv $config_h ${config_h}~
1342 mkdir
-p $target_dir
1343 mkdir
-p $target_dir/fpu
1344 mkdir
-p $target_dir/tcg
1345 if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" ; then
1346 mkdir
-p $target_dir/nwfpe
1350 # don't use ln -sf as not all "ln -sf" over write the file/link
1352 rm -f $target_dir/Makefile
1353 ln -s $source_path/Makefile.target
$target_dir/Makefile
1356 echo "# Automatically generated by configure - do not modify" > $config_mak
1357 echo "/* Automatically generated by configure - do not modify */" > $config_h
1360 echo "include ../config-host.mak" >> $config_mak
1361 echo "#include \"../config-host.h\"" >> $config_h
1366 interp_prefix1
=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1367 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
1369 case "$target_cpu" in
1371 echo "TARGET_ARCH=i386" >> $config_mak
1372 echo "#define TARGET_ARCH \"i386\"" >> $config_h
1373 echo "#define TARGET_I386 1" >> $config_h
1374 if test $kqemu = "yes" -a "$target_softmmu" = "yes"
1376 echo "#define USE_KQEMU 1" >> $config_h
1378 gcc3minver
=`$cc --version 2> /dev/null| fgrep "(GCC) 3." | awk '{ print $3 }' | cut -f2 -d.`
1379 if test -n "$gcc3minver" && test $gcc3minver -gt 3
1381 echo "HAVE_GT_GCC_3_3=true" >> $config_mak
1383 echo "HAVE_GT_GCC_3_3=false" >> $config_mak
1387 echo "TARGET_ARCH=x86_64" >> $config_mak
1388 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1389 echo "#define TARGET_I386 1" >> $config_h
1390 echo "#define TARGET_X86_64 1" >> $config_h
1391 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
1393 echo "#define USE_KQEMU 1" >> $config_h
1397 echo "TARGET_ARCH=alpha" >> $config_mak
1398 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1399 echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1400 echo "#define TARGET_ALPHA 1" >> $config_h
1401 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1404 echo "TARGET_ARCH=arm" >> $config_mak
1405 echo "#define TARGET_ARCH \"arm\"" >> $config_h
1406 echo "#define TARGET_ARM 1" >> $config_h
1411 echo "TARGET_ARCH=cris" >> $config_mak
1412 echo "#define TARGET_ARCH \"cris\"" >> $config_h
1413 echo "#define TARGET_CRIS 1" >> $config_h
1416 echo "TARGET_ARCH=m68k" >> $config_mak
1417 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1418 echo "#define TARGET_M68K 1" >> $config_h
1422 echo "TARGET_ARCH=mips" >> $config_mak
1423 echo "#define TARGET_ARCH \"mips\"" >> $config_h
1424 echo "#define TARGET_MIPS 1" >> $config_h
1425 echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1428 echo "TARGET_ARCH=mipsn32" >> $config_mak
1429 echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1430 echo "#define TARGET_MIPS 1" >> $config_h
1431 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1434 echo "TARGET_ARCH=mips64" >> $config_mak
1435 echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1436 echo "#define TARGET_MIPS 1" >> $config_h
1437 echo "#define TARGET_MIPS64 1" >> $config_h
1438 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1441 echo "TARGET_ARCH=ppc" >> $config_mak
1442 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1443 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1444 echo "#define TARGET_PPC 1" >> $config_h
1445 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1448 echo "TARGET_ARCH=ppcemb" >> $config_mak
1449 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1450 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1451 echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1452 echo "#define TARGET_PPC 1" >> $config_h
1453 echo "#define TARGET_PPCEMB 1" >> $config_h
1454 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1457 echo "TARGET_ARCH=ppc64" >> $config_mak
1458 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1459 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1460 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1461 echo "#define TARGET_PPC 1" >> $config_h
1462 echo "#define TARGET_PPC64 1" >> $config_h
1463 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1466 echo "TARGET_ARCH=ppc64" >> $config_mak
1467 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1468 echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
1469 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1470 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1471 echo "#define TARGET_PPC 1" >> $config_h
1472 echo "#define TARGET_PPC64 1" >> $config_h
1473 echo "#define TARGET_ABI32 1" >> $config_h
1474 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1477 echo "TARGET_ARCH=sh4" >> $config_mak
1478 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1479 echo "#define TARGET_SH4 1" >> $config_h
1484 echo "TARGET_ARCH=sparc" >> $config_mak
1485 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1486 echo "#define TARGET_SPARC 1" >> $config_h
1489 echo "TARGET_ARCH=sparc64" >> $config_mak
1490 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1491 echo "#define TARGET_SPARC 1" >> $config_h
1492 echo "#define TARGET_SPARC64 1" >> $config_h
1496 echo "TARGET_ARCH=sparc64" >> $config_mak
1497 echo "TARGET_ABI_DIR=sparc" >> $config_mak
1498 echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1499 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1500 echo "#define TARGET_SPARC 1" >> $config_h
1501 echo "#define TARGET_SPARC64 1" >> $config_h
1502 echo "#define TARGET_ABI32 1" >> $config_h
1505 echo "Unsupported target CPU"
1509 if test "$target_bigendian" = "yes" ; then
1510 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1511 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1513 if test "$target_softmmu" = "yes" ; then
1514 echo "CONFIG_SOFTMMU=yes" >> $config_mak
1515 echo "#define CONFIG_SOFTMMU 1" >> $config_h
1517 if test "$target_user_only" = "yes" ; then
1518 echo "CONFIG_USER_ONLY=yes" >> $config_mak
1519 echo "#define CONFIG_USER_ONLY 1" >> $config_h
1521 if test "$target_linux_user" = "yes" ; then
1522 echo "CONFIG_LINUX_USER=yes" >> $config_mak
1523 echo "#define CONFIG_LINUX_USER 1" >> $config_h
1525 if test "$target_darwin_user" = "yes" ; then
1526 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1527 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1530 if test "$target_cpu" = "arm" \
1531 -o "$target_cpu" = "armeb" \
1532 -o "$target_cpu" = "m68k" \
1533 -o "$target_cpu" = "mips" \
1534 -o "$target_cpu" = "mipsel" \
1535 -o "$target_cpu" = "mipsn32" \
1536 -o "$target_cpu" = "mipsn32el" \
1537 -o "$target_cpu" = "mips64" \
1538 -o "$target_cpu" = "mips64el" \
1539 -o "$target_cpu" = "sparc" \
1540 -o "$target_cpu" = "sparc64" \
1541 -o "$target_cpu" = "sparc32plus"; then
1542 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1543 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1545 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
1546 echo "TARGET_HAS_BFLT=yes" >> $config_mak
1547 echo "#define TARGET_HAS_BFLT 1" >> $config_h
1549 if test "$target_user_only" = "yes" \
1550 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
1551 echo "#define USE_NPTL 1" >> $config_h
1553 # 32 bit ELF loader in addition to native 64 bit loader?
1554 if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
1555 echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak
1556 echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
1559 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~
$config_h
1561 done # for target in $targets
1563 # build tree in object directory if source path is different from current one
1564 if test "$source_path_used" = "yes" ; then
1565 DIRS
="tests tests/cris slirp audio"
1566 FILES
="Makefile tests/Makefile"
1567 FILES
="$FILES tests/cris/Makefile tests/cris/.gdbinit"
1568 FILES
="$FILES tests/test-mmap.c"
1569 for dir
in $DIRS ; do
1572 # remove the link and recreate it, as not all "ln -sf" overwrite the link
1573 for f
in $FILES ; do
1575 ln -s $source_path/$f $f
1579 rm -f $TMPO $TMPC $TMPE $TMPS