TMPO="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.o"
TMPE="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.exe"
-trap "rm -f $TMPC $TMPO $TMPE ; exit" 0 2 3 15
+trap "rm -f $TMPC $TMPO $TMPE ; exit" EXIT INT QUIT TERM
compile_object() {
$cc $QEMU_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null
# default parameters
cpu=""
-prefix=""
interp_prefix="/usr/gnemul/qemu-%M"
static="no"
-sysconfdir=""
sparc_cpu=""
cross_prefix=""
cc="gcc"
fi
elif check_define __mips__ ; then
cpu="mips"
+elif check_define __ia64__ ; then
+ cpu="ia64"
else
cpu=`uname -m`
fi
cpu="sparc"
;;
*)
- cpu="unknown"
+ echo "Unsupported CPU = $cpu"
+ exit 1
;;
esac
vnc_sasl=""
xen=""
linux_aio=""
+vhost_net=""
gprof="no"
debug_tcg="no"
bigendian="no"
mingw32="no"
EXESUF=""
+prefix="/usr/local"
+mandir="\${prefix}/share/man"
+datadir="\${prefix}/share/qemu"
+docdir="\${prefix}/share/doc/qemu"
+bindir="\${prefix}/bin"
+sysconfdir="\${prefix}/etc"
+confsuffix="/qemu"
slirp="yes"
fmod_lib=""
fmod_inc=""
make="gmake"
audio_drv_list="oss"
audio_possible_drivers="oss sdl esd pa"
+ # needed for kinfo_getvmmap(3) in libutil.h
+ LIBS="-lutil $LIBS"
;;
DragonFly)
bsd="yes"
# enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later)
QEMU_CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $QEMU_CFLAGS"
LIBS="-lwinmm -lws2_32 -liphlpapi $LIBS"
+ prefix="c:/Program Files/Qemu"
+ mandir="\${prefix}"
+ datadir="\${prefix}"
+ docdir="\${prefix}"
+ bindir="\${prefix}"
+ sysconfdir="\${prefix}"
+ confsuffix=""
fi
# find source path
static="yes"
LDFLAGS="-static $LDFLAGS"
;;
+ --mandir=*) mandir="$optarg"
+ ;;
+ --bindir=*) bindir="$optarg"
+ ;;
+ --datadir=*) datadir="$optarg"
+ ;;
+ --docdir=*) docdir="$optarg"
+ ;;
--sysconfdir=*) sysconfdir="$optarg"
;;
--disable-sdl) sdl="no"
;;
--enable-docs) docs="yes"
;;
+ --disable-vhost-net) vhost_net="no"
+ ;;
+ --enable-vhost-net) vhost_net="yes"
+ ;;
+ --*dir)
+ ;;
*) echo "ERROR: unknown option $opt"; show_help="yes"
;;
esac
mips*)
host_guest_base="yes"
;;
+ ia64*)
+ host_guest_base="yes"
+ ;;
+ hppa*)
+ host_guest_base="yes"
+ ;;
esac
[ -z "$guest_base" ] && guest_base="$host_guest_base"
echo " --source-path=PATH path of source code [$source_path]"
echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
echo " --cc=CC use C compiler CC [$cc]"
-echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
+echo " --host-cc=CC use C compiler CC [$host_cc] for code run at"
+echo " build time"
echo " --extra-cflags=CFLAGS append extra C compiler flags QEMU_CFLAGS"
echo " --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS"
echo " --make=MAKE use specified make [$make]"
echo " --install=INSTALL use specified install [$install]"
echo " --static enable static build [$static]"
-echo " --sysconfdir=PATH install config in PATH"
+echo " --mandir=PATH install man pages in PATH"
+echo " --datadir=PATH install firmware in PATH"
+echo " --docdir=PATH install documentation in PATH"
+echo " --bindir=PATH install binaries in PATH"
+echo " --sysconfdir=PATH install config in PATH/qemu"
echo " --enable-debug-tcg enable TCG debugging"
echo " --disable-debug-tcg disable TCG debugging (default)"
echo " --enable-debug enable common debug build options"
echo " --kerneldir=PATH look for kernel includes in PATH"
echo " --enable-docs enable documentation build"
echo " --disable-docs disable documentation build"
+echo " --disable-vhost-net disable vhost-net acceleration support"
+echo " --enable-vhost-net enable vhost-net acceleration support"
echo ""
echo "NOTE: The object files are built at the place where configure is launched"
exit 1
echo "No targets enabled"
exit 1
fi
+# see if system emulation was really requested
+case " $target_list " in
+ *"-softmmu "*) softmmu=yes
+ ;;
+ *) softmmu=no
+ ;;
+esac
feature_not_found() {
feature=$1
##########################################
# SDL probe
-if $pkgconfig sdl --modversion >/dev/null 2>&1; then
+# Look for sdl configuration program (pkg-config or sdl-config).
+# Prefer variant with cross prefix if cross compiling,
+# and favour pkg-config with sdl over sdl-config.
+if test -n "$cross_prefix" -a $pkgconfig != pkg-config && \
+ $pkgconfig sdl --modversion >/dev/null 2>&1; then
+ sdlconfig="$pkgconfig sdl"
+ _sdlversion=`$sdlconfig --modversion 2>/dev/null | sed 's/[^0-9]//g'`
+elif test -n "$cross_prefix" && has ${cross_prefix}sdl-config; then
+ sdlconfig="${cross_prefix}sdl-config"
+ _sdlversion=`$sdlconfig --version | sed 's/[^0-9]//g'`
+elif $pkgconfig sdl --modversion >/dev/null 2>&1; then
sdlconfig="$pkgconfig sdl"
_sdlversion=`$sdlconfig --modversion 2>/dev/null | sed 's/[^0-9]//g'`
elif has sdl-config; then
kvm_cflags="$kvm_cflags -I$kerneldir/arch/$cpu/include"
fi
else
- kvm_cflags=`pkg-config --cflags kvm-kmod 2> /dev/null`
+ kvm_cflags=`$pkgconfig --cflags kvm-kmod 2>/dev/null`
fi
if compile_prog "$kvm_cflags" "" ; then
kvm=yes
fi
fi
+##########################################
+# test for vhost net
+
+if test "$vhost_net" != "no"; then
+ if test "$kvm" != "no"; then
+ cat > $TMPC <<EOF
+ #include <linux/vhost.h>
+ int main(void) { return 0; }
+EOF
+ if compile_prog "$kvm_cflags" "" ; then
+ vhost_net=yes
+ else
+ if test "$vhost_net" = "yes" ; then
+ feature_not_found "vhost-net"
+ fi
+ vhost_net=no
+ fi
+ else
+ if test "$vhost_net" = "yes" ; then
+ echo "NOTE: vhost-net feature requires KVM (--enable-kvm)."
+ feature_not_found "vhost-net"
+ fi
+ vhost_net=no
+ fi
+fi
+
##########################################
# pthread probe
PTHREADLIBS_LIST="-lpthread -lpthreadGC2"
EOF
if compile_prog "" "-laio" ; then
linux_aio=yes
- LIBS="$LIBS -laio"
+ libs_softmmu="$libs_softmmu -laio"
+ libs_tools="$libs_tools -laio"
else
if test "$linux_aio" = "yes" ; then
feature_not_found "linux AIO"
fi
fi
-if test "$mingw32" = "yes" ; then
- if test -z "$prefix" ; then
- prefix="c:/Program Files/Qemu"
- fi
- mansuffix=""
- datasuffix=""
- confsuffix=""
- docsuffix=""
- binsuffix=""
- if test -z "$sysconfdir" ; then
- sysconfdir="${prefix}"
- fi
-else
- if test -z "$prefix" ; then
- prefix="/usr/local"
- fi
- mansuffix="/share/man"
- datasuffix="/share/qemu"
- docsuffix="/share/doc/qemu"
- binsuffix="/bin"
- if test -z "$sysconfdir" ; then
- sysconfdir="${prefix}/etc"
+confdir=$sysconfdir$confsuffix
+
+tools=
+if test "$softmmu" = yes ; then
+ tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools"
+ if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then
+ tools="qemu-nbd\$(EXESUF) $tools"
+ if [ "$check_utests" = "yes" ]; then
+ tools="check-qint check-qstring check-qdict check-qlist $tools"
+ tools="check-qfloat check-qjson $tools"
+ fi
fi
fi
+# Mac OS X ships with a broken assembler
+roms=
+if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \
+ "$targetos" != "Darwin" -a "$targetos" != "SunOS" -a \
+ "$softmmu" = yes ; then
+ roms="optionrom"
+fi
+
+
echo "Install prefix $prefix"
-echo "BIOS directory $prefix$datasuffix"
-echo "binary directory $prefix$binsuffix"
+echo "BIOS directory `eval echo $datadir`"
+echo "binary directory `eval echo $bindir`"
if test "$mingw32" = "no" ; then
-echo "Manual directory $prefix$mansuffix"
+echo "Manual directory `eval echo $mandir`"
echo "ELF interp prefix $interp_prefix"
fi
echo "Source path $source_path"
echo "preadv support $preadv"
echo "fdatasync $fdatasync"
echo "uuid support $uuid"
+echo "vhost-net support $vhost_net"
if test $sdl_too_old = "yes"; then
echo "-> Your SDL version is too old - please upgrade to have SDL support"
printf " '%s'" "$0" "$@" >> $config_host_mak
echo >> $config_host_mak
-echo "CONFIG_QEMU_SHAREDIR=\"$prefix$datasuffix\"" >> $config_host_mak
-if test "$mingw32" = "yes" ; then
- echo "CONFIG_QEMU_CONFDIR=\"$sysconfdir\"" >> $config_host_mak
-else
- echo "CONFIG_QEMU_CONFDIR=\"${sysconfdir}/qemu\"" >> $config_host_mak
-fi
+echo "prefix=$prefix" >> $config_host_mak
+echo "bindir=$bindir" >> $config_host_mak
+echo "mandir=$mandir" >> $config_host_mak
+echo "datadir=$datadir" >> $config_host_mak
+echo "sysconfdir=$sysconfdir" >> $config_host_mak
+echo "docdir=$docdir" >> $config_host_mak
+echo "confdir=$confdir" >> $config_host_mak
case "$cpu" in
i386|x86_64|alpha|cris|hppa|ia64|m68k|microblaze|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64)
armv4b|armv4l)
ARCH=arm
;;
- *)
- echo "Unsupported CPU = $cpu"
- exit 1
- ;;
esac
echo "ARCH=$ARCH" >> $config_host_mak
if test "$debug_tcg" = "yes" ; then
;;
esac
-tools=
-if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
- tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools"
- if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then
- tools="qemu-nbd\$(EXESUF) $tools"
- if [ "$check_utests" = "yes" ]; then
- tools="check-qint check-qstring check-qdict check-qlist $tools"
- tools="check-qfloat check-qjson $tools"
- fi
- fi
-fi
echo "TOOLS=$tools" >> $config_host_mak
-
-# Mac OS X ships with a broken assembler
-roms=
-if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \
- "$targetos" != "Darwin" -a "$targetos" != "SunOS" -a \
- `expr "$target_list" : ".*softmmu.*"` != 0 ; then
- roms="optionrom"
-fi
echo "ROMS=$roms" >> $config_host_mak
-
-echo "prefix=$prefix" >> $config_host_mak
-echo "bindir=\${prefix}$binsuffix" >> $config_host_mak
-echo "mandir=\${prefix}$mansuffix" >> $config_host_mak
-echo "datadir=\${prefix}$datasuffix" >> $config_host_mak
-echo "sysconfdir=$sysconfdir" >> $config_host_mak
-echo "docdir=\${prefix}$docsuffix" >> $config_host_mak
echo "MAKE=$make" >> $config_host_mak
echo "INSTALL=$install" >> $config_host_mak
echo "INSTALL_DIR=$install -d -m0755 -p" >> $config_host_mak
ln -s $source_path/Makefile.dis $d/Makefile
echo > $d/config.mak
done
+if test "$static" = "no" -a "$user_pie" = "yes" ; then
+ echo "QEMU_CFLAGS+=-fpie" > libdis-user/config.mak
+fi
for target in $target_list; do
target_dir="$target"
echo "# Automatically generated by configure - do not modify" > $config_target_mak
bflt="no"
-elfload32="no"
target_nptl="no"
interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_arch2/g"`
-echo "CONFIG_QEMU_PREFIX=\"$interp_prefix1\"" >> $config_target_mak
+echo "CONFIG_QEMU_INTERP_PREFIX=\"$interp_prefix1\"" >> $config_target_mak
gdb_xml_files=""
TARGET_ARCH="$target_arch2"
;;
alpha)
target_phys_bits=64
+ target_nptl="yes"
;;
arm|armeb)
TARGET_ARCH=arm
;;
sparc64)
TARGET_BASE_ARCH=sparc
- elfload32="yes"
target_phys_bits=64
;;
sparc32plus)
TARGET_ABI_DIR=$TARGET_ARCH
fi
echo "TARGET_ABI_DIR=$TARGET_ABI_DIR" >> $config_target_mak
-if [ $target_phys_bits -lt $hostlongbits ] ; then
- target_phys_bits=$hostlongbits
-fi
case "$target_arch2" in
i386|x86_64)
if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then
if test "$kvm_para" = "yes"; then
echo "CONFIG_KVM_PARA=y" >> $config_target_mak
fi
+ if test $vhost_net = "yes" ; then
+ echo "CONFIG_VHOST_NET=y" >> $config_target_mak
+ fi
fi
esac
if test "$target_bigendian" = "yes" ; then
-a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
echo "CONFIG_USE_NPTL=y" >> $config_target_mak
fi
-# 32 bit ELF loader in addition to native 64 bit loader?
-if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
- echo "TARGET_HAS_ELFLOAD32=y" >> $config_target_mak
-fi
if test "$target_user_only" = "yes" -a "$guest_base" = "yes"; then
echo "CONFIG_USE_GUEST_BASE=y" >> $config_target_mak
fi
echo "CONFIG_I386_DIS=y" >> $config_target_mak
echo "CONFIG_I386_DIS=y" >> $libdis_config_mak
;;
+ ia64*)
+ echo "CONFIG_IA64_DIS=y" >> $config_target_mak
+ echo "CONFIG_IA64_DIS=y" >> $libdis_config_mak
+ ;;
m68k)
echo "CONFIG_M68K_DIS=y" >> $config_target_mak
echo "CONFIG_M68K_DIS=y" >> $libdis_config_mak
# Ensure there's only a single GP
cflags="-msmall-data $cflags"
;;
-ia64)
- cflags="-mno-sdata $cflags"
-;;
esac
if test "$target_softmmu" = "yes" ; then
# -static is used to avoid g1/g3 usage by the dynamic linker
ldflags="$linker_script -static $ldflags"
;;
- ia64)
- ldflags="-Wl,-G0 $linker_script -static $ldflags"
- ;;
- i386|x86_64|ppc|ppc64|s390|sparc64|alpha|arm|m68k|mips|mips64)
+ *)
ldflags="$linker_script $ldflags"
;;
esac
fi
-if test "$target_softmmu" = "yes" ; then
- case "$ARCH" in
- ia64)
- ldflags="-Wl,-G0 $linker_script -static $ldflags"
- ;;
- esac
-fi
echo "LDFLAGS+=$ldflags" >> $config_target_mak
echo "QEMU_CFLAGS+=$cflags" >> $config_target_mak
if test "$source_path_used" = "yes" ; then
DIRS="tests tests/cris slirp audio block net pc-bios/optionrom"
DIRS="$DIRS roms/seabios roms/vgabios"
+ DIRS="$DIRS fsdev"
FILES="Makefile tests/Makefile"
FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit"
FILES="$FILES tests/test-mmap.c"
if test "$static" = "no" -a "$user_pie" = "yes" ; then
echo "QEMU_CFLAGS+=-fpie" > $d/config.mak
fi
+
+if test "$docs" = "yes" ; then
+ mkdir -p QMP
+fi