vhost_net="no"
vhost_scsi="no"
kvm="no"
+hax="no"
rdma=""
gprof="no"
debug_tcg="no"
tcmalloc="no"
jemalloc="no"
+yagl="no"
+yagl_stats="no"
+glx=""
+vigs="no"
+libtizenusb="no"
+
+# for TIZEN-maru
+maru="no"
+winver="0x501"
+libav=""
+libpng="no"
+dxva2=""
+vaapi=""
+qt="no"
+qtabi="5.0"
+extension_path=""
+#
+
# parse CC options first
for opt do
optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)')
else
audio_drv_list=""
fi
+ LIBS="-lole32 $LIBS"
+ libs_qga="-lole32 $libs_qga"
;;
GNU/kFreeBSD)
bsd="yes"
if test "$mingw32" = "yes" ; then
EXESUF=".exe"
DSOSUF=".dll"
- QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS"
+ QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN $QEMU_CFLAGS"
# enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later)
QEMU_CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $QEMU_CFLAGS"
# MinGW needs -mthreads for TLS and macro _MT.
;;
--enable-kvm) kvm="yes"
;;
+ --disable-hax) hax="no"
+ ;;
+ --enable-hax) hax="yes"
+ ;;
--disable-tcg-interpreter) tcg_interpreter="no"
;;
--enable-tcg-interpreter) tcg_interpreter="yes"
;;
--disable-pie) pie="no"
;;
- --enable-werror) werror="yes"
+ --enable-werror)
+ werror="yes" ;
+ force_werror="yes" ;
;;
--disable-werror) werror="no"
;;
;;
--enable-vhost-net) vhost_net="yes"
;;
+ --enable-efence) efence="yes"
+ ;;
+ --disable-efence) efence="no"
+ ;;
+ --enable-yagl) yagl="yes"
+ ;;
+ --disable-yagl) yagl="no"
+ ;;
+ --enable-yagl-stats) yagl_stats="yes"
+ ;;
+ --disable-yagl-stats) yagl_stats="no"
+ ;;
+ --enable-vigs) vigs="yes"
+ ;;
+ --disable-vigs) vigs="no"
+ ;;
--disable-vhost-scsi) vhost_scsi="no"
;;
--enable-vhost-scsi) vhost_scsi="yes"
;;
--enable-libusb) libusb="yes"
;;
+ --disable-libtizenusb) libtizenusb="no"
+ ;;
+ --enable-libtizenusb) libtizenusb="yes"
+ ;;
--disable-usb-redir) usb_redir="no"
;;
--enable-usb-redir) usb_redir="yes"
;;
--enable-jemalloc) jemalloc="yes"
;;
+# for TIZEN-maru
+ --enable-maru) maru="yes"
+ ;;
+ --winver=*) winver="$optarg"
+ ;;
+ --enable-libav) libav="yes"
+ ;;
+ --disable-libav) libav="no"
+ ;;
+ --enable-libpng) libpng="yes"
+ ;;
+ --enable-dxva2) dxva2="yes"
+ ;;
+ --disable-dxva2) dxva2="no"
+ ;;
+ --enable-vaapi) vaapi="yes"
+ ;;
+ --disable-vaapi) vaapi="no"
+ ;;
+ --disable-qt) qt="no"
+ ;;
+ --enable-qt) qt="yes"
+ ;;
+ --extension-path=*) extension_path="$optarg"
+ ;;
+#
*)
echo "ERROR: unknown option $opt"
echo "Try '$0 --help' for more information"
numa libnuma support
tcmalloc tcmalloc support
jemalloc jemalloc support
+ qt Qt5 UI
+ hax HAX acceleration support
+ yagl YaGL device
+ yagl-stats YaGL stats
+ vigs VIGS device
+
+TIZEN-maru options:
+ --enable-maru enable maru board
+ --winver=WINVER set WINVER
+ --enable-libav enable libav library
+ --disable-libav disable libav library
+ --enable-libpng enable png library
+ --enable-dxva2 enable dxva2 support
+ --disable-dxva2 disable dxva2 support
+ --ensable-vaapi enable vaapi support
+ --disable-vaapi disable vaapi support
+ --extension-path=PATH set extension path
NOTE: The object files are built at the place where configure is launched
EOF
gcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits"
gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags"
gcc_flags="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
-gcc_flags="-Wendif-labels $gcc_flags"
+gcc_flags="-Wendif-labels -Wno-shift-negative-value $gcc_flags"
gcc_flags="-Wno-initializer-overrides $gcc_flags"
gcc_flags="-Wno-string-plus-int $gcc_flags"
# Note that we do not add -Werror to gcc_flags here, because that would
EOF
if ! compile_prog "-Werror" "" ; then
+ echo $cc
error_exit "Your compiler does not support the __thread specifier for " \
"Thread-Local Storage (TLS). Please upgrade to a version that does."
fi
##########################################
# avx2 optimization requirement check
-cat > $TMPC << EOF
+
+if test "$static" = "no" ; then
+ cat > $TMPC << EOF
#pragma GCC push_options
#pragma GCC target("avx2")
#include <cpuid.h>
int foo(void *a) __attribute__((ifunc("bar_ifunc")));
int main(int argc, char *argv[]) { return foo(argv[0]);}
EOF
-if compile_object "" ; then
- if has readelf; then
- if readelf --syms $TMPO 2>/dev/null |grep -q "IFUNC.*foo"; then
- avx2_opt="yes"
- fi
- fi
+ if compile_object "" ; then
+ if has readelf; then
+ if readelf --syms $TMPO 2>/dev/null |grep -q "IFUNC.*foo"; then
+ avx2_opt="yes"
+ fi
+ fi
+ fi
fi
#########################################
##########################################
# X11 probe
x11_cflags=
-x11_libs=-lX11
+x11_libs=
if $pkg_config --exists "x11"; then
x11_cflags=$($pkg_config --cflags x11)
x11_libs=$($pkg_config --libs x11)
fi
##########################################
+# Qt probe
+
+qtversion=""
+if test "$qt" != "no"; then
+ if test "$qtabi" = "5.0" ; then
+ qtpackage="Qt5Widgets Qt5OpenGL Qt5Gui"
+ qtversion="5.0.0"
+
+ if $pkg_config --exists "$qtpackage >= $qtversion"; then
+ qt_cflags=`$pkg_config --cflags $qtpackage`
+ qt_libs=`$pkg_config --libs $qtpackage`
+ qt_libs="$qt_libs"
+ if test "$mingw32" = "yes" ; then
+ libs_softmmu="$qt_libs -mwindows $libs_softmmu"
+ elif test "$darwin" = "yes" ; then
+ libs_softmmu="$qt_libs $libs_softmmu"
+ else
+ libs_softmmu="$qt_libs $x11_libs $libs_softmmu"
+ fi
+
+ qt_cflags_private=`pkg-config --modversion Qt5Gui`
+ if test "$darwin" = "yes" ; then
+ qt_cflags_private=`pkg-config --cflags Qt5Gui | sed "s,QtGui.framework/Headers,&/$qt_cflags_private/QtGui,g"`
+ else
+ qt_cflags_private=`pkg-config --cflags Qt5Gui | sed "s,QtGui,&/$qt_cflags_private/QtGui,g"`
+ fi
+
+ qt_cflags="$qt_cflags $qt_cflags_private"
+ if test "$mingw32" = "no" ; then
+ qt_cflags="$qt_cflags -fPIC"
+ fi
+ qt="yes"
+ elif test "$qt" = "yes"; then
+ feature_not_found "qt" "Install qt devel"
+ else
+ qt="no"
+ fi
+ else
+ qt="no"
+ fi
+fi
+
+##########################################
# SDL probe
# Look for sdl configuration program (pkg-config or sdl-config). Try
fi
fi
+# check for libtizenusb
+if test "$libtizenusb" != "no" ; then
+ libtizenusb="yes"
+ libusb="no"
+ usb="libtizenusb"
+ echo $PKG_CONFIG_PATH
+ if $pkg_config --modversion libtizenusb >/dev/null 2>&1 ; then
+ libtizenusb_cflags=$($pkg_config --cflags libtizenusb 2>/dev/null)
+ libtizenusb_libs=$($pkg_config --libs libtizenusb 2>/dev/null)
+
+ echo "libtizenusb found"
+ echo "cflags = $libtizenusb_cflags"
+ echo "libs = $libtizenusb_libs"
+ else
+ error_exit "libtizenusb not found (you might not be set PKG_CONFIG_PATH"
+ fi
+ QEMU_CFLAGS="$QEMU_CFLAGS $libtizenusb_cflags"
+ libs_softmmu="$libs_softmmu $libtizenusb_libs"
+fi
+
# check for libusb
if test "$libusb" != "no" ; then
if $pkg_config --atleast-version=1.0.13 libusb-1.0; then
}
EOF
if compile_prog "-Werror" "" ; then
- pragma_diagnostic_available=yes
+ pragma_diagnostic_available=yes
else
+ if test "$force_werror" != "yes"; then
werror=no
+ fi
fi
########################################
fi
fi
+########################################
+# check if dxva2 is available.
+
+check_dxva2() {
+
+cat > $TMPC << EOF
+#include <d3d9.h>
+#include <dxva2api.h>
+int main(void) {
+#if !defined(IDirect3D9_CreateDevice) || \
+ !defined(IDirect3DDeviceManager9_ResetDevice)
+#error No DXVA2 support
+#endif
+ return 0;
+}
+EOF
+if compile_prog "" "" ; then
+ dxva2="yes"
+else
+ dxva2="no"
+fi
+
+}
+
+if test "$dxva2" = "yes" ; then
+ if test "$mingw32" = "yes" ; then
+ check_dxva2
+ if test "$dxva2" != "yes" ; then
+ feature_not_found "dxva2"
+ fi
+ else
+ error_exit "DXVA2 is supported only on Windows"
+ fi
+else
+ if test "$dxva2" != "no" ; then
+ check_dxva2
+ fi
+fi
+
+########################################
+# check if vaapi is available.
+
+check_vaapi() {
+
+if $pkg_config libva --exists; then
+ libva_cflags=`$pkg_config --cflags libva`
+ libva_libs=`$pkg_config --libs libva`
+ vaapi="yes"
+else
+ vaapi="no"
+fi
+
+if $pkg_config libva-x11 --exists; then
+ libva_x11_cflags=`$pkg_config --cflags libva-x11`
+ libva_x11_libs=`$pkg_config --libs libva-x11`
+ libs_softmmu="$libva_libs $libva_x11_libs $libs_softmmu"
+ vaapi="yes"
+else
+ vaapi="no"
+fi
+
+}
+
+if test "$vaapi" = "yes" ; then
+ if test "$linux" = "yes" ; then
+ check_vaapi
+ if test "$vaapi" != "yes" ; then
+ feature_not_found "vaapi"
+ fi
+ else
+ error_exit "VAAPI is supported only on Linux"
+ fi
+else
+ if test "$vaapi" != "no" ; then
+ check_vaapi
+ fi
+fi
+
+########################################
+# set WINVER
+
+if test "$mingw32" = "yes" ; then
+ QEMU_CFLAGS="-DWINVER=$winver -D_WIN32_WINNT=$winver $QEMU_CFLAGS"
+fi
+
+########################################
+# check extension path
+
+if [ ! -d "$source_path/tizen/src/$extension_path" ] ; then
+ error_exit "Extension path is not valid $source_path/tizen/src/$extension_path"
+fi
+
+##########################################
+# libav probe
+
+libavcodec_package="libavcodec"
+libavcodec_version="54.35.0"
+libavutil_package="libavutil"
+libavutil_version="52.3.0"
+libavformat_package="libavformat"
+libavformat_version="54.20.3"
+libavresample_package="libavresample"
+libavresample_version="1.0.1"
+libx264_package="x264"
+libav_package="libav"
+exists_libav="no"
+exists_x264="no"
+
+check_libav() {
+
+ if ! $pkg_config --exists "$libavcodec_package >= $libavcodec_version" ; then
+ return
+ fi
+ if ! $pkg_config --exists "$libavformat_package >= $libavformat_version" ; then
+ return
+ fi
+ if ! $pkg_config --exists "$libavutil_package >= $libavutil_version" ; then
+ return
+ fi
+ if ! $pkg_config --exists "$libavresample_package >= $libavresample_version" ; then
+ return
+ fi
+ exists_libav="yes"
+
+ if $pkg_config --exists "$libx264_package" ; then
+ exists_x264="yes"
+ fi
+}
+
+set_libav_config() {
+ if [ "$libav" = "yes" ]; then
+ if [ "$exists_libav" = "no" ]; then
+ feature_not_found "$libav_package"
+ elif [ "$exists_x264" = "no" ]; then
+ feature_not_found "$libx264_package"
+ fi
+ fi
+
+ if [ "$exists_libav" = "yes" ] && [ "$exists_x264" = "yes" ]; then
+ libav="yes"
+ libav_cflags=`$pkg_config --cflags $libavcodec_package` #Header files are in same place.
+ libav_libs=`$pkg_config --libs $libavcodec_package $libavformat_package $libavutil_package $libavresample_package $libx264_package`
+ else
+ libav="no"
+ fi
+}
+
+if [ "$libav" != "no" ]; then
+ check_libav
+ set_libav_config
+fi
+
+##########################################
+# libpng probe
+
+if test "$libpng" != "no"; then
+ libpng_package="libpng"
+
+ if $pkg_config --exists "$libpng_package" ; then
+ libpng_cflags=`$pkg_config --cflags $libpng_package`
+ libpng_libs=`$pkg_config --libs $libpng_package`
+ libs_softmmu="$libpng_libs $libs_softmmu"
+ libpng="yes"
+ else
+ if test "$libpng" = "yes" ; then
+ feature_not_found "libpng"
+ fi
+ libpng="no"
+ fi
+fi
+
+
# Now we've finished running tests it's OK to add -Werror to the compiler flags
if test "$werror" = "yes"; then
QEMU_CFLAGS="-Werror $QEMU_CFLAGS"
if test "$cap" = yes && test "$linux" = yes && test "$attr" = yes ; then
virtfs=yes
tools="$tools fsdev/virtfs-proxy-helper\$(EXESUF)"
+ elif test "$maru" = yes && test "$darwin" = yes ; then
+ echo "Enable VirtFS on Darwin"
+ virtfs=yes
+ elif test "$maru" = yes && test "$mingw32" = yes ; then
+ echo "Enable VirtFS on Windows"
+ virtfs=yes
else
if test "$virtfs" = yes; then
error_exit "VirtFS is supported only on Linux and requires libcap devel and libattr devel"
if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \
"$targetos" != "Darwin" -a "$targetos" != "SunOS" -a \
"$softmmu" = yes ; then
- roms="optionrom"
+ # Different host OS linkers have different ideas about the name of the ELF
+ # emulation. Linux and OpenBSD use 'elf_i386'; FreeBSD uses the _fbsd
+ # variant; and Windows uses i386pe.
+ for emu in elf_i386 elf_i386_fbsd i386pe; do
+ if "$ld" -verbose 2>&1 | grep -q "^[[:space:]]*$emu[[:space:]]*$"; then
+ ld_i386_emulation="$emu"
+ roms="optionrom"
+ break
+ fi
+ done
fi
if test "$cpu" = "ppc64" -a "$targetos" != "Darwin" ; then
roms="$roms spapr-rtas"
echo "jemalloc support $jemalloc"
echo "avx2 optimization $avx2_opt"
+echo "Qt support $qt"
+echo "HAX support $hax"
+echo "YaGL support $yagl"
+echo "YaGL stats $yagl_stats"
+echo "VIGS support $vigs"
+
+# for TIZEN-maru
+if test "$maru" = "yes"; then
+echo "TIZEN-maru options:"
+echo "maru enabled $maru"
+ if test "$mingw32" = "yes"; then
+echo "WINVER $winver"
+ fi
+echo "libav support $libav"
+echo "libpng support $libpng"
+echo "DXVA2 support $dxva2"
+echo "vaapi support $vaapi"
+echo "libtizenusb support $libtizenusb"
+echo "extension path $extension_path"
+fi
+#
+
if test "$sdl_too_old" = "yes"; then
echo "-> Your SDL version is too old - please upgrade to have SDL support"
fi
echo "VIRGL_CFLAGS=$virgl_cflags" >> $config_host_mak
echo "VIRGL_LIBS=$virgl_libs" >> $config_host_mak
fi
+if test "$qt" = "yes" ; then
+ echo "CONFIG_QT=y" >> $config_host_mak
+ echo "QT_CFLAGS=$qt_cflags" >> $config_host_mak
+fi
if test "$xen" = "yes" ; then
echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak
echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak
echo "CONFIG_SPICE=y" >> $config_host_mak
fi
+if test "$yagl" = "yes" ; then
+ echo "CONFIG_YAGL=y" >> $config_host_mak
+ if test "$linux" = "yes" ; then
+ LIBS="-lGLU -ldl $LIBS"
+ elif test "$mingw32" = "yes" ; then
+ LIBS="-lopengl32 -lglu32 $LIBS"
+ elif test "$darwin" = "yes" ; then
+ LIBS="-framework OpenGL -framework AGL -framework GLUT $LIBS"
+ else
+ echo "ERROR: YaGL is not available on $targetos"
+ exit 1
+ fi
+fi
+
+if test "$yagl_stats" = "yes" ; then
+ echo "CONFIG_YAGL_STATS=y" >> $config_host_mak
+fi
+
+if test "$vigs" = "yes" ; then
+ echo "CONFIG_VIGS=y" >> $config_host_mak
+fi
+
if test "$smartcard" = "yes" ; then
echo "CONFIG_SMARTCARD=y" >> $config_host_mak
fi
# USB host support
if test "$libusb" = "yes"; then
echo "HOST_USB=libusb legacy" >> $config_host_mak
+elif test "$libtizenusb" = "yes"; then
+ echo "HOST_USB=tizenusb legacy" >> $config_host_mak
else
echo "HOST_USB=stub" >> $config_host_mak
fi
echo "LDFLAGS=$LDFLAGS" >> $config_host_mak
echo "LDFLAGS_NOPIE=$LDFLAGS_NOPIE" >> $config_host_mak
echo "LD_REL_FLAGS=$LD_REL_FLAGS" >> $config_host_mak
+echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak
echo "LIBS+=$LIBS" >> $config_host_mak
echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak
echo "PTHREAD_LIB=$PTHREAD_LIB" >> $config_host_mak
fi
fi
esac
+case "$target_name" in
+ i386|x86_64)
+ echo "CONFIG_HAVE_GET_MEMORY_MAPPING=y" >> $config_target_mak
+esac
+if test "$hax" = "yes" ; then
+ if test "$target_softmmu" = "yes" ; then
+ case "$target_name" in
+ i386|x86_64)
+ echo "CONFIG_HAX=y" >> $config_target_mak
+ ;;
+ *)
+ echo "CONFIG_NO_HAX=y" >> $config_target_mak
+ ;;
+ esac
+ else
+ echo "CONFIG_NO_HAX=y" >> $config_target_mak
+ fi
+fi
if test "$target_bigendian" = "yes" ; then
echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak
fi
echo "CONFIG_BSD_USER=y" >> $config_target_mak
fi
+if test "$yagl" = "yes" ; then
+ echo "CONFIG_BUILD_YAGL=y" >> $config_target_mak
+fi
+
+if test "$vigs" = "yes" ; then
+ echo "CONFIG_BUILD_VIGS=y" >> $config_target_mak
+fi
+
# generate QEMU_CFLAGS/LDFLAGS for targets
cflags=""
;;
esac
+if test "$target_softmmu" = "yes" ; then
+ case "$TARGET_BASE_ARCH" in
+ arm)
+ cflags="-DHAS_AUDIO -DHAS_AUDIO_CHOICE $cflags"
+ ;;
+ lm32)
+ cflags="-DHAS_AUDIO $cflags"
+ ;;
+ i386|mips|ppc)
+ cflags="-DHAS_AUDIO -DHAS_AUDIO_CHOICE $cflags"
+ ;;
+ esac
+fi
+
if test "$gprof" = "yes" ; then
echo "TARGET_GPROF=yes" >> $config_target_mak
if test "$target_linux_user" = "yes" ; then
echo "export CCACHE_CPP2=y" >> $config_host_mak
fi
+# for TIZEN-maru
+if test "$maru" = "yes" ; then
+ echo "CONFIG_MARU=y" >> $config_host_mak
+
+ if test "$libav" = "yes" ; then
+ echo "CONFIG_LIBAV=y" >> $config_host_mak
+ echo "LIBAV_CFLAGS=$libav_cflags" >> $config_host_mak
+ echo "LIBAV_LIBS=$libav_libs" >> $config_host_mak
+ fi
+ if test "$libpng" = "yes" ; then
+ echo "CONFIG_PNG=y" >> $config_host_mak
+ echo "LIBPNG_CFLAGS=$libpng_cflags" >> $config_host_mak
+ fi
+ if test "$dxva2" = "yes" ; then
+ echo "CONFIG_DXVA2=y" >> $config_host_mak
+ fi
+ if test "$vaapi" = "yes" ; then
+ echo "CONFIG_VAAPI=y" >> $config_host_mak
+ echo "LIBVA_CFLAGS=$libva_cflags $libva_x11_cflags" >> $config_host_mak
+ fi
+ if test "$libtizenusb" = "yes" ; then
+ echo "CONFIG_TIZENUSB=y" >> $config_host_mak
+ fi
+ if [ ! -z "$extension_path" ] ; then
+ echo "CONFIG_EXTENSION_PATH=$extension_path" >> $config_host_mak
+ fi
+fi
+
# build tree in object directory in case the source is not in the current directory
DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32 tests/libqos tests/qapi-schema tests/tcg/xtensa tests/qemu-iotests"
DIRS="$DIRS fsdev"