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 gcc34 gcc-3.3 gcc33 gcc-3.2 gcc32"
35 i386|i486|i586|i686|i86pc|BePC
)
47 "Power Macintosh"|ppc|ppc64
)
107 OS_CFLAGS
="-mno-cygwin"
115 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
133 OS_CFLAGS
="-mdynamic-no-pic"
142 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
148 if [ "$bsd" = "yes" ] ; then
149 if [ "$darwin" != "yes" ] ; then
154 if [ "$solaris" = "yes" ] ; then
157 solarisrev
=`uname -r | cut -f2 -d.`
158 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
159 if test "$solarisrev" -gt 10 ; then
166 source_path
=`dirname "$0"`
167 if [ -z "$source_path" ]; then
170 source_path
=`cd "$source_path"; pwd`
172 if test "$source_path" = `pwd` ; then
173 source_path_used
="no"
175 source_path_used
="yes"
179 optarg
=`expr "x$opt" : 'x[^=]*=\(.*\)'`
181 --help|
-h) show_help
=yes
183 --prefix=*) prefix
="$optarg"
185 --interp-prefix=*) interp_prefix
="$optarg"
187 --source-path=*) source_path
="$optarg"
188 source_path_used
="yes"
190 --cross-prefix=*) cross_prefix
="$optarg"
195 --host-cc=*) host_cc
="$optarg"
197 --make=*) make="$optarg"
199 --install=*) install="$optarg"
201 --extra-cflags=*) CFLAGS
="$optarg"
203 --extra-ldflags=*) LDFLAGS
="$optarg"
205 --cpu=*) cpu
="$optarg"
207 --target-list=*) target_list
="$optarg"
209 --enable-gprof) gprof
="yes"
211 --static) static
="yes"
213 --disable-sdl) sdl
="no"
215 --enable-coreaudio) coreaudio
="yes"
217 --enable-alsa) alsa
="yes"
219 --enable-dsound) dsound
="yes"
221 --enable-fmod) fmod
="yes"
223 --fmod-lib=*) fmod_lib
="$optarg"
225 --fmod-inc=*) fmod_inc
="$optarg"
227 --enable-mingw32) mingw32
="yes" ; cross_prefix
="i386-mingw32-" ; user
="no"
229 --disable-slirp) slirp
="no"
231 --enable-adlib) adlib
="yes"
233 --disable-kqemu) kqemu
="no"
235 --enable-profiler) profiler
="yes"
237 --enable-cocoa) cocoa
="yes" ; coreaudio
="yes" ; sdl
="no"
239 --disable-gfx-check) check_gfx
="no"
241 --disable-gcc-check) check_gcc
="no"
243 --disable-system) softmmu
="no"
245 --enable-system) softmmu
="yes"
247 --disable-linux-user) linux_user
="no"
249 --enable-linux-user) linux_user
="yes"
251 --disable-darwin-user) darwin_user
="no"
253 --enable-darwin-user) darwin_user
="yes"
255 --enable-uname-release=*) uname_release
="$optarg"
260 # default flags for all hosts
261 CFLAGS
="$CFLAGS -Wall -O2 -g -fno-strict-aliasing"
262 LDFLAGS
="$LDFLAGS -g"
264 if test x
"$show_help" = x
"yes" ; then
267 Usage: configure [options]
268 Options: [defaults in brackets after descriptions]
271 echo "Standard options:"
272 echo " --help print this message"
273 echo " --prefix=PREFIX install in PREFIX [$prefix]"
274 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
275 echo " use %M for cpu name [$interp_prefix]"
276 echo " --target-list=LIST set target list [$target_list]"
278 echo "kqemu kernel acceleration support:"
279 echo " --disable-kqemu disable kqemu support"
281 echo "Advanced options (experts only):"
282 echo " --source-path=PATH path of source code [$source_path]"
283 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
284 echo " --cc=CC use C compiler CC [$cc]"
285 echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
286 echo " --make=MAKE use specified make [$make]"
287 echo " --install=INSTALL use specified install [$install]"
288 echo " --static enable static build [$static]"
289 echo " --enable-cocoa enable COCOA (Mac OS X only)"
290 echo " --enable-mingw32 enable Win32 cross compilation with mingw32"
291 echo " --enable-adlib enable Adlib emulation"
292 echo " --enable-coreaudio enable Coreaudio audio driver"
293 echo " --enable-alsa enable ALSA audio driver"
294 echo " --enable-fmod enable FMOD audio driver"
295 echo " --enabled-dsound enable DirectSound audio driver"
296 echo " --enable-system enable all system emulation targets"
297 echo " --disable-system disable all system emulation targets"
298 echo " --enable-linux-user enable all linux usermode emulation targets"
299 echo " --disable-linux-user disable all linux usermode emulation targets"
300 echo " --enable-darwin-user enable all darwin usermode emulation targets"
301 echo " --disable-darwin-user disable all darwin usermode emulation targets"
302 echo " --fmod-lib path to FMOD library"
303 echo " --fmod-inc path to FMOD includes"
304 echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
306 echo "NOTE: The object files are built at the place where configure is launched"
310 cc
="${cross_prefix}${cc}"
311 ar="${cross_prefix}${ar}"
312 strip
="${cross_prefix}${strip}"
314 # check that the C compiler works.
319 if $cc -c -o $TMPO $TMPC 2>/dev
/null
; then
320 : C compiler works ok
322 echo "ERROR: \"$cc\" either does not exist or does not work"
326 if test "$mingw32" = "yes" ; then
330 if [ "$cpu" = "i386" ] ; then
335 # Check for gcc4, error if pre-gcc4
336 if test "$check_gcc" = "yes" ; then
341 int main(){return 0;}
344 which "$1" >&/dev
/null
348 if "$cc" -o $TMPE $TMPC 2>/dev
/null
; then
349 echo "WARNING: \"$cc\" looks like gcc 4.x"
351 if test "$gcc3_search" = "yes" ; then
352 echo "Looking for gcc 3.x"
353 for compat_cc
in $gcc3_list ; do
354 if check_cc
"$compat_cc" ; then
355 echo "Found \"$compat_cc\""
357 found_compat_cc
="yes"
361 if test "$found_compat_cc" = "no" ; then
362 echo "gcc 3.x not found!"
365 if test "$found_compat_cc" = "no" ; then
366 echo "QEMU is known to have problems when compiled with gcc 4.x"
367 echo "It is recommended that you use gcc 3.x to build QEMU"
368 echo "To use this compiler anyway, configure with --disable-gcc-check"
375 # Solaris specific configure tool chain decisions
377 if test "$solaris" = "yes" ; then
379 # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly
380 # override the check with --disable-gcc-check
382 if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then
384 if test "$solgcc" = "/usr/sfw/bin/gcc" ; then
385 echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly."
386 echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3"
387 echo "or get the latest patch from SunSolve for gcc"
391 solinst
=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
392 if test -z "$solinst" ; then
393 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
394 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
395 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
398 if test "$solinst" = "/usr/sbin/install" ; then
399 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
400 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
401 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
404 sol_ar
=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
405 if test -z "$sol_ar" ; then
406 echo "Error: No path includes ar"
407 if test -f /usr
/ccs
/bin
/ar ; then
408 echo "Add /usr/ccs/bin to your path and rerun configure"
415 if test -z "$target_list" ; then
416 # these targets are portable
417 if [ "$softmmu" = "yes" ] ; then
418 target_list
="i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu arm-softmmu"
420 # the following are Linux specific
421 if [ "$linux_user" = "yes" ] ; then
422 target_list
="i386-linux-user arm-linux-user armeb-linux-user sparc-linux-user ppc-linux-user mips-linux-user mipsel-linux-user m68k-linux-user $target_list"
424 # the following are Darwin specific
425 if [ "$darwin_user" = "yes" ] ; then
426 target_list
="i386-darwin-user ppc-darwin-user $target_list"
429 target_list
=`echo "$target_list" | sed -e 's/,/ /g'`
431 if test -z "$target_list" ; then
432 echo "No targets enabled"
436 if test -z "$cross_prefix" ; then
439 # big/little endian test
441 #include <inttypes.h>
442 int main(int argc, char ** argv){
443 volatile uint32_t i=0x01234567;
444 return (*((uint8_t*)(&i))) == 0x67;
448 if $cc -o $TMPE $TMPC 2>/dev
/null
; then
449 $TMPE && bigendian
="yes"
451 echo big
/little
test failed
456 # if cross compiling, cannot launch a program, so make a static guess
457 if test "$cpu" = "powerpc" -o "$cpu" = "mips" -o "$cpu" = "s390" -o "$cpu" = "sparc" -o "$cpu" = "sparc64" -o "$cpu" = "m68k" -o "$cpu" = "armv4b"; then
463 # host long bits test
465 if test "$cpu" = "sparc64" -o "$cpu" = "ia64" -o "$cpu" = "x86_64" -o "$cpu" = "alpha"; then
469 # check gcc options support
475 have_gcc3_options
="no"
476 if $cc -fno-reorder-blocks -fno-optimize-sibling-calls -o $TMPO $TMPC 2> /dev
/null
; then
477 have_gcc3_options
="yes"
480 ##########################################
485 if test -z "$sdl" ; then
487 sdl_config
="sdl-config"
491 if test "$mingw32" = "yes" -a ! -z "$cross_prefix" ; then
492 # win32 cross compilation case
493 sdl_config
="i386-mingw32msvc-sdl-config"
499 #undef main /* We don't want SDL to override our main() */
500 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
503 if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /dev
/null
; then
504 _sdlversion
=`$sdl_config --version | sed 's/[^0-9]//g'`
505 if test "$_sdlversion" -lt 121 ; then
508 if test "$cocoa" = "no" ; then
513 # static link with sdl ?
514 if test "$sdl" = "yes" ; then
516 `$sdl_config --static-libs | grep \\\-laa > /dev/null` && aa
="yes"
517 sdl_static_libs
=`$sdl_config --static-libs`
518 if [ "$aa" = "yes" ] ; then
519 sdl_static_libs
="$sdl_static_libs `aalib-config --static-libs`"
522 if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev
/null
; then
528 fi # sdl compile test
530 fi # cross compilation
533 # Make sure to disable cocoa if sdl was set
534 if test "$sdl" = "yes" ; then
540 ##########################################
541 # alsa sound support libraries
543 if test "$alsa" = "yes" ; then
545 #include <alsa/asoundlib.h>
546 int main(void) { snd_pcm_t **handle; return snd_pcm_close(*handle); }
548 if $cc -o $TMPE $TMPC -lasound 2> /dev
/null
; then
552 echo "Error: Could not find alsa"
553 echo "Make sure to have the alsa libs and headers installed."
559 # Check if tools are available to build documentation.
560 if [ -x "`which texi2html`" ] && [ -x "`which pod2man`" ]; then
564 if test "$mingw32" = "yes" ; then
565 if test -z "$prefix" ; then
566 prefix
="/c/Program Files/Qemu"
573 if test -z "$prefix" ; then
576 mandir
="$prefix/share/man"
577 datadir
="$prefix/share/qemu"
578 docdir
="$prefix/share/doc/qemu"
582 echo "Install prefix $prefix"
583 echo "BIOS directory $datadir"
584 echo "binary directory $bindir"
585 if test "$mingw32" = "no" ; then
586 echo "Manual directory $mandir"
587 echo "ELF interp prefix $interp_prefix"
589 echo "Source path $source_path"
590 echo "C compiler $cc"
591 echo "Host C compiler $host_cc"
593 echo "install $install"
595 echo "host big endian $bigendian"
596 echo "target list $target_list"
597 echo "gprof enabled $gprof"
598 echo "profiler $profiler"
599 echo "static build $static"
600 if test "$darwin" = "yes" ; then
601 echo "Cocoa support $cocoa"
603 echo "SDL support $sdl"
604 if test "$sdl" != "no" ; then
605 echo "SDL static link $sdl_static"
607 echo "mingw32 support $mingw32"
608 echo "Adlib support $adlib"
609 echo "CoreAudio support $coreaudio"
610 echo "ALSA support $alsa"
611 echo "DSound support $dsound"
612 if test "$fmod" = "yes"; then
613 if test -z $fmod_lib ||
test -z $fmod_inc; then
615 echo "Error: You must specify path to FMOD library and headers"
616 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
620 fmod_support
=" (lib='$fmod_lib' include='$fmod_inc')"
624 echo "FMOD support $fmod $fmod_support"
625 echo "kqemu support $kqemu"
626 echo "Documentation $build_docs"
627 [ ! -z "$uname_release" ] && \
628 echo "uname -r $uname_release"
630 if test $sdl_too_old = "yes"; then
631 echo "-> Your SDL version is too old - please upgrade to have SDL support"
633 #if test "$sdl_static" = "no"; then
634 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
636 config_mak
="config-host.mak"
637 config_h
="config-host.h"
639 #echo "Creating $config_mak and $config_h"
641 echo "# Automatically generated by configure - do not modify" > $config_mak
642 echo "# Configured with: $0 $@" >> $config_mak
643 echo "/* Automatically generated by configure - do not modify */" > $config_h
645 echo "prefix=$prefix" >> $config_mak
646 echo "bindir=$bindir" >> $config_mak
647 echo "mandir=$mandir" >> $config_mak
648 echo "datadir=$datadir" >> $config_mak
649 echo "docdir=$docdir" >> $config_mak
650 echo "#define CONFIG_QEMU_SHAREDIR \"$datadir\"" >> $config_h
651 echo "MAKE=$make" >> $config_mak
652 echo "INSTALL=$install" >> $config_mak
653 echo "CC=$cc" >> $config_mak
654 if test "$have_gcc3_options" = "yes" ; then
655 echo "HAVE_GCC3_OPTIONS=yes" >> $config_mak
657 echo "HOST_CC=$host_cc" >> $config_mak
658 echo "AR=$ar" >> $config_mak
659 echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
660 echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
661 echo "CFLAGS=$CFLAGS" >> $config_mak
662 echo "LDFLAGS=$LDFLAGS" >> $config_mak
663 echo "EXESUF=$EXESUF" >> $config_mak
664 if test "$cpu" = "i386" ; then
665 echo "ARCH=i386" >> $config_mak
666 echo "#define HOST_I386 1" >> $config_h
667 elif test "$cpu" = "x86_64" ; then
668 echo "ARCH=x86_64" >> $config_mak
669 echo "#define HOST_X86_64 1" >> $config_h
670 elif test "$cpu" = "armv4b" ; then
671 echo "ARCH=arm" >> $config_mak
672 echo "#define HOST_ARM 1" >> $config_h
673 elif test "$cpu" = "armv4l" ; then
674 echo "ARCH=arm" >> $config_mak
675 echo "#define HOST_ARM 1" >> $config_h
676 elif test "$cpu" = "powerpc" ; then
677 echo "ARCH=ppc" >> $config_mak
678 echo "#define HOST_PPC 1" >> $config_h
679 elif test "$cpu" = "mips" ; then
680 echo "ARCH=mips" >> $config_mak
681 echo "#define HOST_MIPS 1" >> $config_h
682 elif test "$cpu" = "s390" ; then
683 echo "ARCH=s390" >> $config_mak
684 echo "#define HOST_S390 1" >> $config_h
685 elif test "$cpu" = "alpha" ; then
686 echo "ARCH=alpha" >> $config_mak
687 echo "#define HOST_ALPHA 1" >> $config_h
688 elif test "$cpu" = "sparc" ; then
689 echo "ARCH=sparc" >> $config_mak
690 echo "#define HOST_SPARC 1" >> $config_h
691 elif test "$cpu" = "sparc64" ; then
692 echo "ARCH=sparc64" >> $config_mak
693 echo "#define HOST_SPARC64 1" >> $config_h
694 elif test "$cpu" = "ia64" ; then
695 echo "ARCH=ia64" >> $config_mak
696 echo "#define HOST_IA64 1" >> $config_h
697 elif test "$cpu" = "m68k" ; then
698 echo "ARCH=m68k" >> $config_mak
699 echo "#define HOST_M68K 1" >> $config_h
701 echo "Unsupported CPU"
704 if test "$bigendian" = "yes" ; then
705 echo "WORDS_BIGENDIAN=yes" >> $config_mak
706 echo "#define WORDS_BIGENDIAN 1" >> $config_h
708 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
709 if test "$mingw32" = "yes" ; then
710 echo "CONFIG_WIN32=yes" >> $config_mak
711 echo "#define CONFIG_WIN32 1" >> $config_h
712 elif test -f "/usr/include/byteswap.h" ; then
713 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
715 if test "$darwin" = "yes" ; then
716 echo "CONFIG_DARWIN=yes" >> $config_mak
717 echo "#define CONFIG_DARWIN 1" >> $config_h
719 if test "$solaris" = "yes" ; then
720 echo "CONFIG_SOLARIS=yes" >> $config_mak
721 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
723 if test "$gdbstub" = "yes" ; then
724 echo "CONFIG_GDBSTUB=yes" >> $config_mak
725 echo "#define CONFIG_GDBSTUB 1" >> $config_h
727 if test "$gprof" = "yes" ; then
728 echo "TARGET_GPROF=yes" >> $config_mak
729 echo "#define HAVE_GPROF 1" >> $config_h
731 if test "$static" = "yes" ; then
732 echo "CONFIG_STATIC=yes" >> $config_mak
733 echo "#define CONFIG_STATIC 1" >> $config_h
735 if test $profiler = "yes" ; then
736 echo "#define CONFIG_PROFILER 1" >> $config_h
738 if test "$slirp" = "yes" ; then
739 echo "CONFIG_SLIRP=yes" >> $config_mak
740 echo "#define CONFIG_SLIRP 1" >> $config_h
742 if test "$adlib" = "yes" ; then
743 echo "CONFIG_ADLIB=yes" >> $config_mak
744 echo "#define CONFIG_ADLIB 1" >> $config_h
746 if test "$oss" = "yes" ; then
747 echo "CONFIG_OSS=yes" >> $config_mak
748 echo "#define CONFIG_OSS 1" >> $config_h
750 if test "$coreaudio" = "yes" ; then
751 echo "CONFIG_COREAUDIO=yes" >> $config_mak
752 echo "#define CONFIG_COREAUDIO 1" >> $config_h
754 if test "$alsa" = "yes" ; then
755 echo "CONFIG_ALSA=yes" >> $config_mak
756 echo "#define CONFIG_ALSA 1" >> $config_h
758 if test "$dsound" = "yes" ; then
759 echo "CONFIG_DSOUND=yes" >> $config_mak
760 echo "#define CONFIG_DSOUND 1" >> $config_h
762 if test "$fmod" = "yes" ; then
763 echo "CONFIG_FMOD=yes" >> $config_mak
764 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
765 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
766 echo "#define CONFIG_FMOD 1" >> $config_h
768 qemu_version
=`head $source_path/VERSION`
769 echo "VERSION=$qemu_version" >>$config_mak
770 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
772 echo "SRC_PATH=$source_path" >> $config_mak
773 if [ "$source_path_used" = "yes" ]; then
774 echo "VPATH=$source_path" >> $config_mak
776 echo "TARGET_DIRS=$target_list" >> $config_mak
777 if [ "$build_docs" = "yes" ] ; then
778 echo "BUILD_DOCS=yes" >> $config_mak
782 if [ "$bsd" = "yes" ] ; then
783 echo "#define O_LARGEFILE 0" >> $config_h
784 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
785 echo "#define _BSD 1" >> $config_h
788 echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
790 for target
in $target_list; do
792 config_mak
=$target_dir/config.mak
793 config_h
=$target_dir/config.h
794 target_cpu
=`echo $target | cut -d '-' -f 1`
795 target_bigendian
="no"
796 [ "$target_cpu" = "armeb" ] && target_bigendian
=yes
797 [ "$target_cpu" = "sparc" ] && target_bigendian
=yes
798 [ "$target_cpu" = "sparc64" ] && target_bigendian
=yes
799 [ "$target_cpu" = "ppc" ] && target_bigendian
=yes
800 [ "$target_cpu" = "ppc64" ] && target_bigendian
=yes
801 [ "$target_cpu" = "mips" ] && target_bigendian
=yes
802 [ "$target_cpu" = "sh4eb" ] && target_bigendian
=yes
803 [ "$target_cpu" = "m68k" ] && target_bigendian
=yes
805 if expr $target : '.*-softmmu' > /dev
/null
; then
808 target_user_only
="no"
809 if expr $target : '.*-user' > /dev
/null
; then
810 target_user_only
="yes"
813 target_linux_user
="no"
814 if expr $target : '.*-linux-user' > /dev
/null
; then
815 target_linux_user
="yes"
818 target_darwin_user
="no"
819 if expr $target : '.*-darwin-user' > /dev
/null
; then
820 target_darwin_user
="yes"
823 if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
824 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
825 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
826 echo "To build QEMU without graphical output configure with --disable-gfx-check"
827 echo "Note that this will disable all output from the virtual graphics card."
831 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
834 mkdir
-p $target_dir/fpu
835 if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" ; then
836 mkdir
-p $target_dir/nwfpe
838 if test "$target_user_only" = "no" ; then
839 mkdir
-p $target_dir/slirp
843 # don't use ln -sf as not all "ln -sf" over write the file/link
845 rm -f $target_dir/Makefile
846 ln -s $source_path/Makefile.target
$target_dir/Makefile
849 echo "# Automatically generated by configure - do not modify" > $config_mak
850 echo "/* Automatically generated by configure - do not modify */" > $config_h
853 echo "include ../config-host.mak" >> $config_mak
854 echo "#include \"../config-host.h\"" >> $config_h
857 interp_prefix1
=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
858 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
860 if test "$target_cpu" = "i386" ; then
861 echo "TARGET_ARCH=i386" >> $config_mak
862 echo "#define TARGET_ARCH \"i386\"" >> $config_h
863 echo "#define TARGET_I386 1" >> $config_h
864 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "i386" ; then
865 echo "#define USE_KQEMU 1" >> $config_h
867 elif test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" ; then
868 echo "TARGET_ARCH=arm" >> $config_mak
869 echo "#define TARGET_ARCH \"arm\"" >> $config_h
870 echo "#define TARGET_ARM 1" >> $config_h
872 elif test "$target_cpu" = "sparc" ; then
873 echo "TARGET_ARCH=sparc" >> $config_mak
874 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
875 echo "#define TARGET_SPARC 1" >> $config_h
876 elif test "$target_cpu" = "sparc64" ; then
877 echo "TARGET_ARCH=sparc64" >> $config_mak
878 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
879 echo "#define TARGET_SPARC 1" >> $config_h
880 echo "#define TARGET_SPARC64 1" >> $config_h
881 elif test "$target_cpu" = "ppc" ; then
882 echo "TARGET_ARCH=ppc" >> $config_mak
883 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
884 echo "#define TARGET_PPC 1" >> $config_h
885 elif test "$target_cpu" = "ppc64" ; then
886 echo "TARGET_ARCH=ppc64" >> $config_mak
887 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
888 echo "#define TARGET_PPC 1" >> $config_h
889 echo "#define TARGET_PPC64 1" >> $config_h
890 elif test "$target_cpu" = "x86_64" ; then
891 echo "TARGET_ARCH=x86_64" >> $config_mak
892 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
893 echo "#define TARGET_I386 1" >> $config_h
894 echo "#define TARGET_X86_64 1" >> $config_h
895 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64" ; then
896 echo "#define USE_KQEMU 1" >> $config_h
898 elif test "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" ; then
899 echo "TARGET_ARCH=mips" >> $config_mak
900 echo "#define TARGET_ARCH \"mips\"" >> $config_h
901 echo "#define TARGET_MIPS 1" >> $config_h
902 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
903 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
904 elif test "$target_cpu" = "sh4" -o "$target_cpu" = "sh4eb" ; then
905 echo "TARGET_ARCH=sh4" >> $config_mak
906 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
907 echo "#define TARGET_SH4 1" >> $config_h
909 elif test "$target_cpu" = "m68k" ; then
910 echo "TARGET_ARCH=m68k" >> $config_mak
911 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
912 echo "#define TARGET_M68K 1" >> $config_h
915 echo "Unsupported target CPU"
918 if test "$target_bigendian" = "yes" ; then
919 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
920 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
922 if test "$target_softmmu" = "yes" ; then
923 echo "CONFIG_SOFTMMU=yes" >> $config_mak
924 echo "#define CONFIG_SOFTMMU 1" >> $config_h
926 if test "$target_user_only" = "yes" ; then
927 echo "CONFIG_USER_ONLY=yes" >> $config_mak
928 echo "#define CONFIG_USER_ONLY 1" >> $config_h
930 if test "$target_linux_user" = "yes" ; then
931 echo "CONFIG_LINUX_USER=yes" >> $config_mak
932 echo "#define CONFIG_LINUX_USER 1" >> $config_h
934 if test "$target_darwin_user" = "yes" ; then
935 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
936 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
939 if test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" -o "$target_cpu" = "sparc" -o "$target_cpu" = "sparc64" -o "$target_cpu" = "m68k"; then
940 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
941 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
943 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
944 echo "TARGET_HAS_BFLT=yes" >> $config_mak
945 echo "#define TARGET_HAS_BFLT 1" >> $config_h
949 if test "$target_user_only" = "no"; then
950 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
955 if test "$sdl1" = "yes" ; then
956 echo "#define CONFIG_SDL 1" >> $config_h
957 echo "CONFIG_SDL=yes" >> $config_mak
958 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
959 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
961 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
963 if [ "${aa}" = "yes" ] ; then
964 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
966 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
971 if test "$cocoa" = "yes" ; then
972 echo "#define CONFIG_COCOA 1" >> $config_h
973 echo "CONFIG_COCOA=yes" >> $config_mak
976 done # for target in $targets
978 # build tree in object directory if source path is different from current one
979 if test "$source_path_used" = "yes" ; then
981 FILES
="Makefile tests/Makefile"
982 for dir
in $DIRS ; do
985 # remove the link and recreate it, as not all "ln -sf" overwrite the link
988 ln -s $source_path/$f $f
992 rm -f $TMPO $TMPC $TMPE $TMPS