# symbolically link $1 to $2. Portable version of "ln -sf".
symlink() {
- rm -f $2
- ln -s $1 $2
+ rm -rf "$2"
+ ln -s "$1" "$2"
}
# check whether a command is available to this shell (may be either an
EXESUF=""
prefix="/usr/local"
mandir="\${prefix}/share/man"
-qemu_datadir="\${prefix}/share/qemu"
+datadir="\${prefix}/share"
qemu_docdir="\${prefix}/share/doc/qemu"
bindir="\${prefix}/bin"
libdir="\${prefix}/lib"
cocoa="no"
softmmu="yes"
linux_user="no"
-darwin_user="no"
bsd_user="no"
guest_base=""
uname_release=""
else
QEMU_CFLAGS="-mdynamic-no-pic $QEMU_CFLAGS"
fi
- darwin_user="yes"
cocoa="yes"
audio_drv_list="coreaudio"
audio_possible_drivers="coreaudio sdl fmod"
# needed for TIOCWIN* defines in termios.h
QEMU_CFLAGS="-D__EXTENSIONS__ $QEMU_CFLAGS"
QEMU_CFLAGS="-std=gnu99 $QEMU_CFLAGS"
- LIBS="-lsocket -lnsl -lresolv $LIBS"
+ solarisnetlibs="-lsocket -lnsl -lresolv"
+ LIBS="$solarisnetlibs $LIBS"
+ libs_qga="$solarisnetlibs $libs_qga"
;;
AIX)
aix="yes"
if [ "$bsd" = "yes" ] ; then
if [ "$darwin" != "yes" ] ; then
usb="bsd"
+ bsd_user="yes"
fi
- bsd_user="yes"
fi
: ${make=${MAKE-make}}
fi
prefix="c:/Program Files/QEMU"
mandir="\${prefix}"
- qemu_datadir="\${prefix}"
+ datadir="\${prefix}"
qemu_docdir="\${prefix}"
bindir="\${prefix}"
sysconfdir="\${prefix}"
;;
--includedir=*) includedir="$optarg"
;;
- --datadir=*) qemu_datadir="$optarg"
+ --datadir=*) datadir="$optarg"
+ ;;
+ --with-confsuffix=*) confsuffix="$optarg"
;;
--docdir=*) qemu_docdir="$optarg"
;;
;;
--enable-profiler) profiler="yes"
;;
+ --disable-cocoa) cocoa="no"
+ ;;
--enable-cocoa)
cocoa="yes" ;
sdl="no" ;
--disable-user)
linux_user="no" ;
bsd_user="no" ;
- darwin_user="no"
;;
--enable-user) ;;
--disable-linux-user) linux_user="no"
;;
--enable-linux-user) linux_user="yes"
;;
- --disable-darwin-user) darwin_user="no"
- ;;
- --enable-darwin-user) darwin_user="yes"
- ;;
--disable-bsd-user) bsd_user="no"
;;
--enable-bsd-user) bsd_user="yes"
s390x-linux-user \
"
fi
-# the following are Darwin specific
-if [ "$darwin_user" = "yes" ] ; then
- default_target_list="$default_target_list i386-darwin-user ppc-darwin-user "
-fi
# the following are BSD specific
if [ "$bsd_user" = "yes" ] ; then
default_target_list="${default_target_list}\
echo " --smbd=SMBD use specified smbd [$smbd]"
echo " --static enable static build [$static]"
echo " --mandir=PATH install man pages in PATH"
-echo " --datadir=PATH install firmware in PATH"
-echo " --docdir=PATH install documentation in PATH"
+echo " --datadir=PATH install firmware in PATH$confsuffix"
+echo " --docdir=PATH install documentation in PATH$confsuffix"
echo " --bindir=PATH install binaries in PATH"
-echo " --sysconfdir=PATH install config in PATH/qemu"
+echo " --sysconfdir=PATH install config in PATH$confsuffix"
+echo " --with-confsuffix=SUFFIX suffix for Qemu data inside datadir and sysconfdir [$confsuffix]"
echo " --enable-debug-tcg enable TCG debugging"
echo " --disable-debug-tcg disable TCG debugging (default)"
echo " --enable-debug enable common debug build options"
echo " --enable-virtfs enable VirtFS"
echo " --disable-vnc disable VNC"
echo " --enable-vnc enable VNC"
-echo " --enable-cocoa enable COCOA (Mac OS X only)"
+echo " --disable-cocoa disable Cocoa (Mac OS X only)"
+echo " --enable-cocoa enable Cocoa (default on Mac OS X)"
echo " --audio-drv-list=LIST set audio drivers list:"
echo " Available drivers: $audio_possible_drivers"
echo " --audio-card-list=LIST set list of emulated audio cards [$audio_card_list]"
echo " --disable-user disable all user emulation targets"
echo " --enable-linux-user enable all linux usermode emulation targets"
echo " --disable-linux-user disable all linux usermode emulation targets"
-echo " --enable-darwin-user enable all darwin usermode emulation targets"
-echo " --disable-darwin-user disable all darwin usermode emulation targets"
echo " --enable-bsd-user enable all BSD usermode emulation targets"
echo " --disable-bsd-user disable all BSD usermode emulation targets"
echo " --enable-guest-base enable GUEST_BASE support for usermode"
# Note that if the Python conditional here evaluates True we will exit
# with status 1 which is a shell 'false' value.
-if ! "$python" -c 'import sys; sys.exit(sys.version_info[0] >= 3)'; then
- echo "Python 2 required but '$python' is version 3 or better."
- echo "Use --python=/path/to/python to specify a Python 2."
+if ! "$python" -c 'import sys; sys.exit(sys.version_info < (2,4) or sys.version_info >= (3,))'; then
+ echo "Cannot use '$python', Python 2.4 or later is required."
+ echo "Note that Python 3 or later is not yet supported."
+ echo "Use --python=/path/to/python to specify a supported Python."
exit 1
fi
for pthread_lib in $PTHREADLIBS_LIST; do
if compile_prog "" "$pthread_lib" ; then
pthread=yes
- LIBS="$pthread_lib $LIBS"
+ found=no
+ for lib_entry in $LIBS; do
+ if test "$lib_entry" = "$pthread_lib"; then
+ found=yes
+ break
+ fi
+ done
+ if test "$found" = "no"; then
+ LIBS="$pthread_lib $LIBS"
+ fi
break
fi
done
fi
qemu_confdir=$sysconfdir$confsuffix
+qemu_datadir=$datadir$confsuffix
tools=
if test "$softmmu" = yes ; then
for d in libdis libdis-user; do
mkdir -p $d
- symlink $source_path/Makefile.dis $d/Makefile
+ symlink "$source_path/Makefile.dis" "$d/Makefile"
echo > $d/config.mak
done
mkdir -p linux-headers
case "$cpu" in
i386|x86_64)
- symlink $source_path/linux-headers/asm-x86 linux-headers/asm
+ symlink "$source_path/linux-headers/asm-x86" linux-headers/asm
;;
ppcemb|ppc|ppc64)
- symlink $source_path/linux-headers/asm-powerpc linux-headers/asm
+ symlink "$source_path/linux-headers/asm-powerpc" linux-headers/asm
;;
s390x)
- symlink $source_path/linux-headers/asm-s390 linux-headers/asm
+ symlink "$source_path/linux-headers/asm-s390" linux-headers/asm
;;
esac
fi
target_softmmu="no"
target_user_only="no"
target_linux_user="no"
-target_darwin_user="no"
target_bsd_user="no"
case "$target" in
${target_arch2}-softmmu)
target_user_only="yes"
target_linux_user="yes"
;;
- ${target_arch2}-darwin-user)
- if test "$darwin" != "yes" ; then
- echo "ERROR: Target '$target' is only available on a Darwin host"
- exit 1
- fi
- target_user_only="yes"
- target_darwin_user="yes"
- ;;
${target_arch2}-bsd-user)
if test "$bsd" != "yes" ; then
echo "ERROR: Target '$target' is only available on a BSD host"
if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
mkdir -p $target_dir/nwfpe
fi
-symlink $source_path/Makefile.target $target_dir/Makefile
+symlink "$source_path/Makefile.target" "$target_dir/Makefile"
echo "# Automatically generated by configure - do not modify" > $config_target_mak
if test "$target_linux_user" = "yes" ; then
echo "CONFIG_LINUX_USER=y" >> $config_target_mak
fi
-if test "$target_darwin_user" = "yes" ; then
- echo "CONFIG_DARWIN_USER=y" >> $config_target_mak
-fi
list=""
if test ! -z "$gdb_xml_files" ; then
for x in $gdb_xml_files; do
done
mkdir -p $DIRS
for f in $FILES ; do
- if [ -e "$source_path/$f" ] && ! [ -e "$f" ]; then
+ if [ -e "$source_path/$f" ] && [ "$source_path" != `pwd` ]; then
symlink "$source_path/$f" "$f"
fi
done
mkdir -p $d
mkdir -p $d/ide
mkdir -p $d/usb
- symlink $source_path/Makefile.hw $d/Makefile
+ symlink "$source_path/Makefile.hw" "$d/Makefile"
mkdir -p $d/9pfs
echo "QEMU_CFLAGS+=-DTARGET_PHYS_ADDR_BITS=$hwlib" > $d/config.mak
done
if [ "$source_path" != `pwd` ]; then
# out of tree build
mkdir -p libcacard
- rm -f libcacard/Makefile
symlink "$source_path/libcacard/Makefile" libcacard/Makefile
fi
mkdir -p $d
mkdir -p $d/trace
mkdir -p $d/qom
-symlink $source_path/Makefile.user $d/Makefile
+symlink "$source_path/Makefile.user" "$d/Makefile"
if test "$docs" = "yes" ; then
mkdir -p QMP