TMPO="${TMPDIR1}/${TMPB}.o"
TMPCXX="${TMPDIR1}/${TMPB}.cxx"
TMPE="${TMPDIR1}/${TMPB}.exe"
-TMPMO="${TMPDIR1}/${TMPB}.mo"
TMPTXT="${TMPDIR1}/${TMPB}.txt"
rm -f config.log
while true; do
set x $local_ver1
local_first=${2-0}
- # shift 2 does nothing if there are less than 2 arguments
- shift; shift
+ # 'shift 2' if $2 is set, or 'shift' if $2 is not set
+ shift ${2:+2}
local_ver1=$*
set x $local_ver2
# the second argument finished, the first must be greater or equal
test $# = 1 && return 0
test $local_first -lt $2 && return 1
test $local_first -gt $2 && return 0
- shift; shift
+ shift ${2:+2}
local_ver2=$*
done
}
block_drv_rw_whitelist=""
block_drv_ro_whitelist=""
host_cc="cc"
-libs_cpu=""
-libs_softmmu=""
libs_tools=""
audio_win_int=""
libs_qga=""
docs=""
fdt=""
netmap="no"
-sdl=""
-sdl_image=""
+sdl="auto"
+sdl_image="auto"
virtfs=""
mpath=""
-vnc="yes"
+vnc="enabled"
sparse="no"
vde=""
-vnc_sasl=""
-vnc_jpeg=""
-vnc_png=""
-xkbcommon=""
+vnc_sasl="auto"
+vnc_jpeg="auto"
+vnc_png="auto"
+xkbcommon="auto"
xen=""
xen_ctrl_version=""
xen_pci_passthrough=""
mingw32="no"
gcov="no"
EXESUF=""
-DSOSUF=".so"
+HOST_DSOSUF=".so"
LDFLAGS_SHARED="-shared"
modules="no"
module_upgrades="no"
libdaxctl=""
meson=""
skip_meson=no
+gettext=""
bogus_os="no"
malloc_trim=""
audio_drv_list=""
fi
supported_os="yes"
+ pie="no"
;;
GNU/kFreeBSD)
bsd="yes"
audio_drv_list="coreaudio try-sdl"
audio_possible_drivers="coreaudio sdl"
QEMU_LDFLAGS="-framework CoreFoundation -framework IOKit $QEMU_LDFLAGS"
- libs_softmmu="-F/System/Library/Frameworks -framework Cocoa -framework IOKit $libs_softmmu"
# Disable attempts to use ObjectiveC features in os/object.h since they
# won't work when we're compiling with gcc as a C compiler.
QEMU_CFLAGS="-DOS_OBJECT_USE_OBJC=0 $QEMU_CFLAGS"
if test "$mingw32" = "yes" ; then
EXESUF=".exe"
- DSOSUF=".dll"
+ HOST_DSOSUF=".dll"
# MinGW needs -mthreads for TLS and macro _MT.
CFLAGS="-mthreads $CFLAGS"
LIBS="-lwinmm -lws2_32 $LIBS"
# configure to be used by RPM and similar macros that set
# lots of directory switches by default.
;;
- --disable-sdl) sdl="no"
+ --disable-sdl) sdl="disabled"
;;
- --enable-sdl) sdl="yes"
+ --enable-sdl) sdl="enabled"
;;
- --disable-sdl-image) sdl_image="no"
+ --disable-sdl-image) sdl_image="disabled"
;;
- --enable-sdl-image) sdl_image="yes"
+ --enable-sdl-image) sdl_image="enabled"
;;
--disable-qom-cast-debug) qom_cast_debug="no"
;;
;;
--enable-mpath) mpath="yes"
;;
- --disable-vnc) vnc="no"
+ --disable-vnc) vnc="disabled"
+ ;;
+ --enable-vnc) vnc="enabled"
+ ;;
+ --disable-gettext) gettext="false"
;;
- --enable-vnc) vnc="yes"
+ --enable-gettext) gettext="true"
;;
--oss-lib=*) oss_lib="$optarg"
;;
;;
--disable-strip) strip_opt="no"
;;
- --disable-vnc-sasl) vnc_sasl="no"
+ --disable-vnc-sasl) vnc_sasl="disabled"
;;
- --enable-vnc-sasl) vnc_sasl="yes"
+ --enable-vnc-sasl) vnc_sasl="enabled"
;;
- --disable-vnc-jpeg) vnc_jpeg="no"
+ --disable-vnc-jpeg) vnc_jpeg="disabled"
;;
- --enable-vnc-jpeg) vnc_jpeg="yes"
+ --enable-vnc-jpeg) vnc_jpeg="enabled"
;;
- --disable-vnc-png) vnc_png="no"
+ --disable-vnc-png) vnc_png="disabled"
;;
- --enable-vnc-png) vnc_png="yes"
+ --enable-vnc-png) vnc_png="enabled"
;;
--disable-slirp) slirp="no"
;;
;;
--disable-libpmem) libpmem=no
;;
- --enable-xkbcommon) xkbcommon=yes
+ --enable-xkbcommon) xkbcommon="enabled"
;;
- --disable-xkbcommon) xkbcommon=no
+ --disable-xkbcommon) xkbcommon="disabled"
;;
--enable-plugins) plugins="yes"
;;
# Remove old dependency files to make sure that they get properly regenerated
rm -f */config-devices.mak.d
-# Remove syscall_nr.h to be sure they will be regenerated in the build
-# directory, not in the source directory
-for arch in alpha hppa m68k xtensa sh4 microblaze arm ppc s390x sparc sparc64 \
- i386 x86_64 mips mips64 ; do
- # remove the file if it has been generated in the source directory
- rm -f "${source_path}/linux-user/${arch}/syscall_nr.h"
- # remove the dependency files
- for target in ${arch}*-linux-user ; do
- test -d "${target}" && find "${target}" -type f -name "*.d" \
- -exec grep -q "${source_path}/linux-user/${arch}/syscall_nr.h" {} \; \
- -print | while read file ; do rm "${file}" "${file%.d}.o" ; done
- done
-done
-
if test -z "$python"
then
error_exit "Python not found. Use --python=/path/to/python"
error_exit "Cocoa and GTK UIs cannot both be enabled at once"
fi
gtk=no
- sdl=no
+ sdl=disabled
fi
# Some versions of Mac OS X incorrectly define SIZE_MAX
int main(void) { lzo_version(); return 0; }
EOF
if compile_prog "" "-llzo2" ; then
- libs_softmmu="$libs_softmmu -llzo2"
+ lzo_libs="-llzo2"
lzo="yes"
else
if test "$lzo" = "yes"; then
int main(void) { snappy_max_compressed_length(4096); return 0; }
EOF
if compile_prog "" "-lsnappy" ; then
- libs_softmmu="$libs_softmmu -lsnappy"
+ snappy_libs='-lsnappy'
snappy="yes"
else
if test "$snappy" = "yes"; then
xen_pc="$xen_pc xentoolcore"
fi
QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)"
- libs_softmmu="$($pkg_config --libs $xen_pc) $libs_softmmu"
+ xen_cflags="$($pkg_config --cflags $xen_pc)"
+ xen_libs="$($pkg_config --libs $xen_pc)"
else
xen_libs="-lxenstore -lxenctrl -lxenguest"
if test "$xen" = yes; then
if test $xen_ctrl_version -ge 40701 ; then
- libs_softmmu="$xen_stable_libs $libs_softmmu"
+ xen_libs="$xen_libs $xen_stable_libs "
fi
- libs_softmmu="$xen_libs $libs_softmmu"
fi
fi
fi
fi
fi
+##########################################
+# gettext probe
+if test "$gettext" != "false" ; then
+ if has xgettext; then
+ gettext=true
+ else
+ if test "$gettext" = "true" ; then
+ feature_not_found "gettext" "Install xgettext binary"
+ fi
+ gettext=false
+ fi
+fi
+
##########################################
# Sparse probe
if test "$sparse" != "no" ; then
fi
fi
-##########################################
-# SDL probe
-
-# Look for sdl configuration program (pkg-config or sdl2-config). Try
-# sdl2-config even without cross prefix, and favour pkg-config over sdl2-config.
-
-sdl_probe ()
-{
- if $pkg_config sdl2 --exists; then
- sdlconfig="$pkg_config sdl2"
- sdlversion=$($sdlconfig --modversion 2>/dev/null)
- elif has "$sdl2_config"; then
- sdlconfig="$sdl2_config"
- sdlversion=$($sdlconfig --version)
- else
- if test "$sdl" = "yes" ; then
- feature_not_found "sdl" "Install SDL2-devel"
- fi
- sdl=no
- # no need to do the rest
- return
- fi
- if test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl2-config; then
- echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2
- fi
-
- cat > $TMPC << EOF
-#include <SDL.h>
-#undef main /* We don't want SDL to override our main() */
-int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
-EOF
- sdl_cflags=$($sdlconfig --cflags 2>/dev/null)
- sdl_cflags="$sdl_cflags -Wno-undef" # workaround 2.0.8 bug
- if test "$static" = "yes" ; then
- if $pkg_config sdl2 --exists; then
- sdl_libs=$($pkg_config sdl2 --static --libs 2>/dev/null)
- else
- sdl_libs=$($sdlconfig --static-libs 2>/dev/null)
- fi
- else
- sdl_libs=$($sdlconfig --libs 2>/dev/null)
- fi
- if compile_prog "$sdl_cflags" "$sdl_libs" ; then
- sdl=yes
-
- # static link with sdl ? (note: sdl.pc's --static --libs is broken)
- if test "$sdl" = "yes" && test "$static" = "yes" ; then
- if test $? = 0 && echo $sdl_libs | grep -- -laa > /dev/null; then
- sdl_libs="$sdl_libs $(aalib-config --static-libs 2>/dev/null)"
- sdl_cflags="$sdl_cflags $(aalib-config --cflags 2>/dev/null)"
- fi
- if compile_prog "$sdl_cflags" "$sdl_libs" ; then
- :
- else
- sdl=no
- fi
- fi # static link
- else # sdl not found
- if test "$sdl" = "yes" ; then
- feature_not_found "sdl" "Install SDL2 devel"
- fi
- sdl=no
- fi # sdl compile test
-}
-
-sdl_image_probe ()
-{
- if test "$sdl_image" != "no" ; then
- if $pkg_config SDL2_image --exists; then
- if test "$static" = "yes"; then
- sdl_image_libs=$($pkg_config SDL2_image --libs --static 2>/dev/null)
- else
- sdl_image_libs=$($pkg_config SDL2_image --libs 2>/dev/null)
- fi
- sdl_image_cflags=$($pkg_config SDL2_image --cflags 2>/dev/null)
- sdl_image=yes
-
- sdl_cflags="$sdl_cflags $sdl_image_cflags"
- sdl_libs="$sdl_libs $sdl_image_libs"
- else
- if test "$sdl_image" = "yes" ; then
- feature_not_found "sdl_image" "Install SDL Image devel"
- else
- sdl_image=no
- fi
- fi
- fi
-}
-
-if test "$sdl" != "no" ; then
- sdl_probe
-fi
-
-if test "$sdl" = "yes" ; then
- sdl_image_probe
-else
- if test "$sdl_image" = "yes"; then
- echo "warning: SDL Image requested, but SDL is not available, disabling"
- fi
- sdl_image=no
-fi
-
-if test "$sdl" = "yes" ; then
- cat > $TMPC <<EOF
-#include <SDL.h>
-#if defined(SDL_VIDEO_DRIVER_X11)
-#include <X11/XKBlib.h>
-#else
-#error No x11 support
-#endif
-int main(void) { return 0; }
-EOF
- if compile_prog "$sdl_cflags $x11_cflags" "$sdl_libs $x11_libs" ; then
- need_x11=yes
- sdl_cflags="$sdl_cflags $x11_cflags"
- sdl_libs="$sdl_libs $x11_libs"
- fi
-fi
-
##########################################
# RDMA needs OpenFabrics libraries
if test "$rdma" != "no" ; then
rdma_libs="-lrdmacm -libverbs -libumad"
if compile_prog "" "$rdma_libs" ; then
rdma="yes"
- libs_softmmu="$libs_softmmu $rdma_libs"
else
if test "$rdma" = "yes" ; then
error_exit \
fi
fi
-##########################################
-# VNC SASL detection
-if test "$vnc" = "yes" && test "$vnc_sasl" != "no" ; then
- cat > $TMPC <<EOF
-#include <sasl/sasl.h>
-#include <stdio.h>
-int main(void) { sasl_server_init(NULL, "qemu"); return 0; }
-EOF
- # Assuming Cyrus-SASL installed in /usr prefix
- # QEMU defines struct iovec in "qemu/osdep.h",
- # we don't want libsasl to redefine it in <sasl/sasl.h>.
- vnc_sasl_cflags="-DSTRUCT_IOVEC_DEFINED"
- vnc_sasl_libs="-lsasl2"
- if compile_prog "$vnc_sasl_cflags" "$vnc_sasl_libs" ; then
- vnc_sasl=yes
- libs_softmmu="$vnc_sasl_libs $libs_softmmu"
- QEMU_CFLAGS="$QEMU_CFLAGS $vnc_sasl_cflags"
- else
- if test "$vnc_sasl" = "yes" ; then
- feature_not_found "vnc-sasl" "Install Cyrus SASL devel"
- fi
- vnc_sasl=no
- fi
-fi
-
-##########################################
-# VNC JPEG detection
-if test "$vnc" = "yes" && test "$vnc_jpeg" != "no" ; then
-cat > $TMPC <<EOF
-#include <stdio.h>
-#include <jpeglib.h>
-int main(void) { struct jpeg_compress_struct s; jpeg_create_compress(&s); return 0; }
-EOF
- vnc_jpeg_cflags=""
- vnc_jpeg_libs="-ljpeg"
- if compile_prog "$vnc_jpeg_cflags" "$vnc_jpeg_libs" ; then
- vnc_jpeg=yes
- libs_softmmu="$vnc_jpeg_libs $libs_softmmu"
- QEMU_CFLAGS="$QEMU_CFLAGS $vnc_jpeg_cflags"
- else
- if test "$vnc_jpeg" = "yes" ; then
- feature_not_found "vnc-jpeg" "Install libjpeg-turbo devel"
- fi
- vnc_jpeg=no
- fi
-fi
-
-##########################################
-# VNC PNG detection
-if test "$vnc" = "yes" && test "$vnc_png" != "no" ; then
-cat > $TMPC <<EOF
-//#include <stdio.h>
-#include <png.h>
-#include <stddef.h>
-int main(void) {
- png_structp png_ptr;
- png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
- return png_ptr != 0;
-}
-EOF
- if $pkg_config libpng --exists; then
- vnc_png_cflags=$($pkg_config libpng --cflags)
- vnc_png_libs=$($pkg_config libpng --libs)
- else
- vnc_png_cflags=""
- vnc_png_libs="-lpng"
- fi
- if compile_prog "$vnc_png_cflags" "$vnc_png_libs" ; then
- vnc_png=yes
- libs_softmmu="$vnc_png_libs $libs_softmmu"
- QEMU_CFLAGS="$QEMU_CFLAGS $vnc_png_cflags"
- else
- if test "$vnc_png" = "yes" ; then
- feature_not_found "vnc-png" "Install libpng devel"
- fi
- vnc_png=no
- fi
-fi
-
-##########################################
-# xkbcommon probe
-if test "$xkbcommon" != "no" ; then
- if $pkg_config xkbcommon --exists; then
- xkbcommon_cflags=$($pkg_config xkbcommon --cflags)
- xkbcommon_libs=$($pkg_config xkbcommon --libs)
- xkbcommon=yes
- else
- if test "$xkbcommon" = "yes" ; then
- feature_not_found "xkbcommon" "Install libxkbcommon-devel"
- fi
- xkbcommon=no
- fi
-fi
-
-
##########################################
# xfsctl() probe, used for file-posix.c
if test "$xfs" != "no" ; then
EOF
if compile_prog "" "$cap_libs" ; then
cap_ng=yes
- libs_tools="$cap_libs $libs_tools"
else
if test "$cap_ng" = "yes" ; then
feature_not_found "cap_ng" "Install libcap-ng devel"
alsa | try-alsa)
if $pkg_config alsa --exists; then
alsa_libs=$($pkg_config alsa --libs)
+ alsa_cflags=$($pkg_config alsa --cflags)
+ alsa=yes
if test "$drv" = "try-alsa"; then
audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-alsa/alsa/')
fi
pa | try-pa)
if $pkg_config libpulse --exists; then
+ libpulse=yes
pulse_libs=$($pkg_config libpulse --libs)
+ pulse_cflags=$($pkg_config libpulse --cflags)
if test "$drv" = "try-pa"; then
audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-pa/pa/')
fi
jack | try-jack)
if $pkg_config jack --exists; then
+ libjack=yes
jack_libs=$($pkg_config jack --libs)
if test "$drv" = "try-jack"; then
audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-jack/jack/')
fi
fi
-##########################################
-# pixman support probe
-
-if test "$softmmu" = "no"; then
- pixman_cflags=
- pixman_libs=
-elif $pkg_config --atleast-version=0.21.8 pixman-1 > /dev/null 2>&1; then
- pixman_cflags=$($pkg_config --cflags pixman-1)
- pixman_libs=$($pkg_config --libs pixman-1)
-else
- error_exit "pixman >= 0.21.8 not present." \
- "Please install the pixman devel package."
-fi
-
##########################################
# libmpathpersist probe
fi
fi
-libs_softmmu="$libs_softmmu $fdt_libs"
-
##########################################
# opengl probe (for sdl2, gtk, milkymist-tmu2)
if compile_prog "" "-lnuma" ; then
numa=yes
- libs_softmmu="-lnuma $libs_softmmu"
+ numa_libs="-lnuma"
else
if test "$numa" = "yes" ; then
feature_not_found "numa" "install numactl devel"
have_openpty="yes"
else
if compile_prog "" "-lutil" ; then
- libs_softmmu="-lutil $libs_softmmu"
libs_tools="-lutil $libs_tools"
have_openpty="yes"
fi
$pkg_config --atleast-version=0.12.3 spice-protocol && \
compile_prog "$spice_cflags" "$spice_libs" ; then
spice="yes"
- libs_softmmu="$libs_softmmu $spice_libs"
QEMU_CFLAGS="$QEMU_CFLAGS $spice_cflags"
else
if test "$spice" = "yes" ; then
else
LIBCAPSTONE=libcapstone.a
fi
- libs_cpu="-L$PWD/capstone -lcapstone $libs_cpu"
+ capstone_libs="-L$PWD/capstone -lcapstone"
+ capstone_cflags="-I${source_path}/capstone/include"
;;
system)
+ capstone_libs="$($pkg_config --libs capstone)"
+ capstone_cflags="$($pkg_config --cflags capstone)"
QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags capstone)"
- libs_cpu="$($pkg_config --libs capstone) $libs_cpu"
;;
no)
fi
fi
-#################################################
-# Sparc implicitly links with --relax, which is
-# incompatible with -r, so --no-relax should be
-# given. It does no harm to give it on other
-# platforms too.
-
-# Note: the prototype is needed since QEMU_CFLAGS
-# contains -Wmissing-prototypes
-cat > $TMPC << EOF
-extern int foo(void);
-int foo(void) { return 0; }
-EOF
-if ! compile_object ""; then
- error_exit "Failed to compile object file for LD_REL_FLAGS test"
-fi
-for i in '-Wl,-r -Wl,--no-relax' -Wl,-r -r; do
- if do_cc -nostdlib $i -o $TMPMO $TMPO; then
- LD_REL_FLAGS=$i
- break
- fi
-done
-if test "$modules" = "yes" && test "$LD_REL_FLAGS" = ""; then
- feature_not_found "modules" "Cannot find how to build relocatable objects"
-fi
-
##########################################
# check for sysmacros.h
if test "$fuzzing" = "yes" ; then
write_c_fuzzer_skeleton
if compile_prog "$CPU_CFLAGS -Werror -fsanitize=fuzzer" ""; then
- have_fuzzer=yes
+ have_fuzzer=yes
+ else
+ error_exit "Your compiler doesn't support -fsanitize=fuzzer"
+ exit 1
fi
fi
libpmem="yes"
libpmem_libs=$($pkg_config --libs libpmem)
libpmem_cflags=$($pkg_config --cflags libpmem)
- libs_softmmu="$libs_softmmu $libpmem_libs"
QEMU_CFLAGS="$QEMU_CFLAGS $libpmem_cflags"
else
if test "$libpmem" = "yes" ; then
libdaxctl="yes"
libdaxctl_libs=$($pkg_config --libs libdaxctl)
libdaxctl_cflags=$($pkg_config --cflags libdaxctl)
- libs_softmmu="$libs_softmmu $libdaxctl_libs"
QEMU_CFLAGS="$QEMU_CFLAGS $libdaxctl_cflags"
else
if test "$libdaxctl" = "yes" ; then
ivshmem=yes
fi
-tools=""
-if test "$want_tools" = "yes" ; then
- if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then
- tools="qemu-storage-daemon\$(EXESUF) $tools"
- fi
-fi
if test "$softmmu" = yes ; then
if test "$linux" = yes; then
if test "$virtfs" != no && test "$cap_ng" = yes && test "$attr" = yes ; then
fi
}
-# prepend pixman and ftd flags after all config tests are done
-QEMU_CFLAGS="$pixman_cflags $fdt_cflags $QEMU_CFLAGS"
+# prepend ftd flags after all config tests are done
+QEMU_CFLAGS="$fdt_cflags $QEMU_CFLAGS"
QEMU_LDFLAGS="$fdt_ldflags $QEMU_LDFLAGS"
-libs_softmmu="$pixman_libs $libs_softmmu"
config_host_mak="config-host.mak"
echo "qemu_localedir=$qemu_localedir" >> $config_host_mak
echo "qemu_icondir=$qemu_icondir" >> $config_host_mak
echo "qemu_desktopdir=$qemu_desktopdir" >> $config_host_mak
-echo "libs_cpu=$libs_cpu" >> $config_host_mak
-echo "libs_softmmu=$libs_softmmu" >> $config_host_mak
echo "GIT=$git" >> $config_host_mak
echo "GIT_SUBMODULES=$git_submodules" >> $config_host_mak
echo "GIT_UPDATE=$git_update" >> $config_host_mak
echo "ARCH=$ARCH" >> $config_host_mak
-echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak
-echo "GLIB_LDFLAGS=$glib_ldflags" >> $config_host_mak
-
if test "$default_devices" = "yes" ; then
echo "CONFIG_MINIKCONF_MODE=--defconfig" >> $config_host_mak
else
echo "SLIRP_CFLAGS=$slirp_cflags" >> $config_host_mak
echo "SLIRP_LIBS=$slirp_libs" >> $config_host_mak
fi
+subdirs=
if [ "$slirp" = "git" -o "$slirp" = "internal" ]; then
- echo "config-host.h: slirp/all" >> $config_host_mak
+ subdirs="$subdirs slirp"
fi
if test "$vde" = "yes" ; then
echo "CONFIG_VDE=y" >> $config_host_mak
echo "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak
for drv in $audio_drv_list; do
def=CONFIG_AUDIO_$(echo $drv | LC_ALL=C tr '[a-z]' '[A-Z]')
- case "$drv" in
- alsa | oss | pa | sdl)
- echo "$def=m" >> $config_host_mak ;;
- *)
- echo "$def=y" >> $config_host_mak ;;
- esac
+ echo "$def=y" >> $config_host_mak
done
+if test "$alsa" = "yes" ; then
+ echo "CONFIG_ALSA=y" >> $config_host_mak
+fi
echo "ALSA_LIBS=$alsa_libs" >> $config_host_mak
+echo "ALSA_CFLAGS=$alsa_cflags" >> $config_host_mak
+if test "$libpulse" = "yes" ; then
+ echo "CONFIG_LIBPULSE=y" >> $config_host_mak
+fi
echo "PULSE_LIBS=$pulse_libs" >> $config_host_mak
+echo "PULSE_CFLAGS=$pulse_cflags" >> $config_host_mak
echo "COREAUDIO_LIBS=$coreaudio_libs" >> $config_host_mak
echo "DSOUND_LIBS=$dsound_libs" >> $config_host_mak
echo "OSS_LIBS=$oss_libs" >> $config_host_mak
+if test "$libjack" = "yes" ; then
+ echo "CONFIG_LIBJACK=y" >> $config_host_mak
+fi
echo "JACK_LIBS=$jack_libs" >> $config_host_mak
if test "$audio_win_int" = "yes" ; then
echo "CONFIG_AUDIO_WIN_INT=y" >> $config_host_mak
fi
echo "CONFIG_BDRV_RW_WHITELIST=$block_drv_rw_whitelist" >> $config_host_mak
echo "CONFIG_BDRV_RO_WHITELIST=$block_drv_ro_whitelist" >> $config_host_mak
-if test "$vnc" = "yes" ; then
- echo "CONFIG_VNC=y" >> $config_host_mak
-fi
-if test "$vnc_sasl" = "yes" ; then
- echo "CONFIG_VNC_SASL=y" >> $config_host_mak
-fi
-if test "$vnc_jpeg" = "yes" ; then
- echo "CONFIG_VNC_JPEG=y" >> $config_host_mak
-fi
-if test "$vnc_png" = "yes" ; then
- echo "CONFIG_VNC_PNG=y" >> $config_host_mak
-fi
-if test "$xkbcommon" = "yes" ; then
- echo "CONFIG_XKBCOMMON=y" >> $config_host_mak
- echo "XKBCOMMON_CFLAGS=$xkbcommon_cflags" >> $config_host_mak
- echo "XKBCOMMON_LIBS=$xkbcommon_libs" >> $config_host_mak
-fi
if test "$xfs" = "yes" ; then
echo "CONFIG_XFS=y" >> $config_host_mak
fi
qemu_version=$(head $source_path/VERSION)
-echo "VERSION=$qemu_version" >>$config_host_mak
echo "PKGVERSION=$pkgversion" >>$config_host_mak
echo "SRC_PATH=$source_path" >> $config_host_mak
echo "TARGET_DIRS=$target_list" >> $config_host_mak
echo "X11_CFLAGS=$x11_cflags" >> $config_host_mak
echo "X11_LIBS=$x11_libs" >> $config_host_mak
fi
-if test "$sdl" = "yes" ; then
- echo "CONFIG_SDL=m" >> $config_host_mak
- echo "SDL_CFLAGS=$sdl_cflags" >> $config_host_mak
- echo "SDL_LIBS=$sdl_libs" >> $config_host_mak
- if test "$sdl_image" = "yes" ; then
- echo "CONFIG_SDL_IMAGE=y" >> $config_host_mak
- fi
-fi
if test "$cocoa" = "yes" ; then
echo "CONFIG_COCOA=y" >> $config_host_mak
fi
echo "ICONV_LIBS=$iconv_lib" >> $config_host_mak
fi
if test "$curses" = "yes" ; then
- echo "CONFIG_CURSES=m" >> $config_host_mak
+ echo "CONFIG_CURSES=y" >> $config_host_mak
echo "CURSES_CFLAGS=$curses_inc" >> $config_host_mak
echo "CURSES_LIBS=$curses_lib" >> $config_host_mak
fi
echo "CONFIG_MACHINE_BSWAP_H=y" >> $config_host_mak
fi
if test "$curl" = "yes" ; then
- echo "CONFIG_CURL=m" >> $config_host_mak
+ echo "CONFIG_CURL=y" >> $config_host_mak
echo "CURL_CFLAGS=$curl_cflags" >> $config_host_mak
echo "CURL_LIBS=$curl_libs" >> $config_host_mak
fi
echo "BRLAPI_LIBS=$brlapi_libs" >> $config_host_mak
fi
if test "$gtk" = "yes" ; then
- echo "CONFIG_GTK=m" >> $config_host_mak
+ echo "CONFIG_GTK=y" >> $config_host_mak
echo "GTK_CFLAGS=$gtk_cflags" >> $config_host_mak
echo "GTK_LIBS=$gtk_libs" >> $config_host_mak
if test "$gtk_gl" = "yes" ; then
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 "XEN_CFLAGS=$xen_cflags" >> $config_host_mak
+ echo "XEN_LIBS=$xen_libs" >> $config_host_mak
fi
if test "$linux_aio" = "yes" ; then
echo "CONFIG_LINUX_AIO=y" >> $config_host_mak
fi
if test "$fdt" != "no" ; then
echo "CONFIG_FDT=y" >> $config_host_mak
+ echo "FDT_CFLAGS=$fdt_cflags" >> $config_host_mak
+ echo "FDT_LIBS=$fdt_ldflags $fdt_libs" >> $config_host_mak
fi
if test "$membarrier" = "yes" ; then
echo "CONFIG_MEMBARRIER=y" >> $config_host_mak
fi
if test "$spice" = "yes" ; then
echo "CONFIG_SPICE=y" >> $config_host_mak
+ echo "SPICE_CFLAGS=$spice_cflags" >> $config_host_mak
+ echo "SPICE_LIBS=$spice_libs" >> $config_host_mak
fi
if test "$smartcard" = "yes" ; then
if test "$lzo" = "yes" ; then
echo "CONFIG_LZO=y" >> $config_host_mak
+ echo "LZO_LIBS=$lzo_libs" >> $config_host_mak
fi
if test "$snappy" = "yes" ; then
echo "CONFIG_SNAPPY=y" >> $config_host_mak
+ echo "SNAPPY_LIBS=$snappy_libs" >> $config_host_mak
fi
if test "$bzip2" = "yes" ; then
fi
if test "$libiscsi" = "yes" ; then
- echo "CONFIG_LIBISCSI=m" >> $config_host_mak
+ echo "CONFIG_LIBISCSI=y" >> $config_host_mak
echo "LIBISCSI_CFLAGS=$libiscsi_cflags" >> $config_host_mak
echo "LIBISCSI_LIBS=$libiscsi_libs" >> $config_host_mak
fi
if test "$libnfs" = "yes" ; then
- echo "CONFIG_LIBNFS=m" >> $config_host_mak
+ echo "CONFIG_LIBNFS=y" >> $config_host_mak
echo "LIBNFS_LIBS=$libnfs_libs" >> $config_host_mak
fi
echo "CONFIG_QOM_CAST_DEBUG=y" >> $config_host_mak
fi
if test "$rbd" = "yes" ; then
- echo "CONFIG_RBD=m" >> $config_host_mak
+ echo "CONFIG_RBD=y" >> $config_host_mak
echo "RBD_LIBS=$rbd_libs" >> $config_host_mak
fi
fi
if test "$glusterfs" = "yes" ; then
- echo "CONFIG_GLUSTERFS=m" >> $config_host_mak
+ echo "CONFIG_GLUSTERFS=y" >> $config_host_mak
echo "GLUSTERFS_CFLAGS=$glusterfs_cflags" >> $config_host_mak
echo "GLUSTERFS_LIBS=$glusterfs_libs" >> $config_host_mak
fi
fi
if test "$libssh" = "yes" ; then
- echo "CONFIG_LIBSSH=m" >> $config_host_mak
+ echo "CONFIG_LIBSSH=y" >> $config_host_mak
echo "LIBSSH_CFLAGS=$libssh_cflags" >> $config_host_mak
echo "LIBSSH_LIBS=$libssh_libs" >> $config_host_mak
fi
fi
if test "$capstone" != "no" ; then
echo "CONFIG_CAPSTONE=y" >> $config_host_mak
+ echo "CAPSTONE_CFLAGS=$capstone_cflags" >> $config_host_mak
+ echo "CAPSTONE_LIBS=$capstone_libs" >> $config_host_mak
fi
if test "$debug_mutex" = "yes" ; then
echo "CONFIG_DEBUG_MUTEX=y" >> $config_host_mak
if test "$libpmem" = "yes" ; then
echo "CONFIG_LIBPMEM=y" >> $config_host_mak
+ echo "LIBPMEM_LIBS=$libpmem_libs" >> $config_host_mak
+ echo "LIBPMEM_CFLAGS=$libpmem_cflags" >> $config_host_mak
fi
if test "$libdaxctl" = "yes" ; then
echo "CONFIG_LIBDAXCTL=y" >> $config_host_mak
+ echo "LIBDAXCTL_LIBS=$libdaxctl_libs" >> $config_host_mak
fi
if test "$bochs" = "yes" ; then
echo "HAVE_MLOCKALL=y" >> $config_host_mak
fi
if test "$fuzzing" = "yes" ; then
- if test "$have_fuzzer" = "yes"; then
- FUZZ_LDFLAGS=" -fsanitize=fuzzer"
- FUZZ_CFLAGS=" -fsanitize=fuzzer"
- QEMU_CFLAGS="$QEMU_CFLAGS -fsanitize=fuzzer-no-link"
- else
- error_exit "Your compiler doesn't support -fsanitize=fuzzer"
- exit 1
- fi
+ QEMU_CFLAGS="$QEMU_CFLAGS -fsanitize=fuzzer-no-link"
fi
if test "$plugins" = "yes" ; then
QEMU_INCLUDES="-iquote ${source_path}/tcg/${ARCH} $QEMU_INCLUDES"
fi
-echo "TOOLS=$tools" >> $config_host_mak
echo "ROMS=$roms" >> $config_host_mak
echo "MAKE=$make" >> $config_host_mak
echo "INSTALL=$install" >> $config_host_mak
echo "INSTALL_LIB=$install -c -m 0644" >> $config_host_mak
echo "PYTHON=$python" >> $config_host_mak
echo "SPHINX_BUILD=$sphinx_build" >> $config_host_mak
-echo "SPHINX_WERROR=$sphinx_werror" >> $config_host_mak
echo "GENISOIMAGE=$genisoimage" >> $config_host_mak
echo "MESON=$meson" >> $config_host_mak
echo "CC=$cc" >> $config_host_mak
if $iasl -h > /dev/null 2>&1; then
- echo "IASL=$iasl" >> $config_host_mak
+ echo "CONFIG_IASL=$iasl" >> $config_host_mak
fi
echo "CXX=$cxx" >> $config_host_mak
echo "OBJCC=$objcc" >> $config_host_mak
echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak
echo "PTHREAD_LIB=$PTHREAD_LIB" >> $config_host_mak
echo "EXESUF=$EXESUF" >> $config_host_mak
-echo "DSOSUF=$DSOSUF" >> $config_host_mak
+echo "HOST_DSOSUF=$HOST_DSOSUF" >> $config_host_mak
echo "LDFLAGS_SHARED=$LDFLAGS_SHARED" >> $config_host_mak
echo "LIBS_QGA=$libs_qga" >> $config_host_mak
echo "TASN1_LIBS=$tasn1_libs" >> $config_host_mak
fi
if test "$fuzzing" != "no"; then
echo "CONFIG_FUZZ=y" >> $config_host_mak
- echo "FUZZ_CFLAGS=$FUZZ_CFLAGS" >> $config_host_mak
- echo "FUZZ_LDFLAGS=$FUZZ_LDFLAGS" >> $config_host_mak
fi
if test "$edk2_blobs" = "yes" ; then
TARGET_ARCH="$target_name"
TARGET_BASE_ARCH=""
TARGET_ABI_DIR=""
+TARGET_SYSTBL_ABI=""
+TARGET_SYSTBL=""
case "$target_name" in
i386)
mttcg="yes"
gdb_xml_files="i386-32bit.xml"
TARGET_SYSTBL_ABI=i386
+ TARGET_SYSTBL=syscall_32.tbl
;;
x86_64)
TARGET_BASE_ARCH=i386
TARGET_SYSTBL_ABI=common,64
+ TARGET_SYSTBL=syscall_64.tbl
mttcg="yes"
- gdb_xml_files="i386-64bit.xml"
+ gdb_xml_files="i386-64bit.xml"
;;
alpha)
mttcg="yes"
microblaze|microblazeel)
TARGET_ARCH=microblaze
TARGET_SYSTBL_ABI=common
+ mttcg="yes"
bflt="yes"
echo "TARGET_ABI32=y" >> $config_target_mak
;;
TARGET_ARCH=mips
echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak
TARGET_SYSTBL_ABI=o32
+ TARGET_SYSTBL=syscall_o32.tbl
;;
mipsn32|mipsn32el)
mttcg="yes"
echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak
echo "TARGET_ABI32=y" >> $config_target_mak
TARGET_SYSTBL_ABI=n32
+ TARGET_SYSTBL=syscall_n32.tbl
;;
mips64|mips64el)
mttcg="no"
TARGET_BASE_ARCH=mips
echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak
TARGET_SYSTBL_ABI=n64
+ TARGET_SYSTBL=syscall_n64.tbl
;;
moxie)
;;
if [ "$TARGET_BASE_ARCH" = "" ]; then
TARGET_BASE_ARCH=$TARGET_ARCH
fi
-
-symlink "$source_path/Makefile.target" "$target_dir/Makefile"
+if [ "$TARGET_SYSTBL_ABI" != "" ] && [ "$TARGET_SYSTBL" = "" ]; then
+ TARGET_SYSTBL=syscall.tbl
+fi
upper() {
echo "$@"| LC_ALL=C tr '[a-z]' '[A-Z]'
fi
if [ "$TARGET_SYSTBL_ABI" != "" ]; then
echo "TARGET_SYSTBL_ABI=$TARGET_SYSTBL_ABI" >> $config_target_mak
+ echo "TARGET_SYSTBL=$TARGET_SYSTBL" >> $config_target_mak
fi
if supported_xen_target $target; then
if test "$target_user_only" = "yes" ; then
echo "CONFIG_USER_ONLY=y" >> $config_target_mak
echo "CONFIG_QEMU_INTERP_PREFIX=\"$interp_prefix1\"" >> $config_target_mak
+ symlink "../qemu-$target_name" "$target_dir/qemu-$target_name"
+else
+ symlink "../qemu-system-$target_name" "$target_dir/qemu-system-$target_name"
fi
if test "$target_linux_user" = "yes" ; then
echo "CONFIG_LINUX_USER=y" >> $config_target_mak
list=""
if test ! -z "$gdb_xml_files" ; then
for x in $gdb_xml_files; do
- list="$list $source_path/gdb-xml/$x"
+ list="$list gdb-xml/$x"
done
echo "TARGET_XML_FILES=$list" >> $config_target_mak
fi
# generate QEMU_CFLAGS/QEMU_LDFLAGS for targets
-cflags=""
-ldflags=""
-
disas_config() {
echo "CONFIG_${1}_DIS=y" >> $config_target_mak
echo "CONFIG_${1}_DIS=y" >> config-all-disas.mak
disas_config "TCI"
fi
-# Newer kernels on s390 check for an S390_PGSTE program header and
-# enable the pgste page table extensions in that case. This makes
-# the vm.allocate_pgste sysctl unnecessary. We enable this program
-# header if
-# - we build on s390x
-# - we build the system emulation for s390x (qemu-system-s390x)
-# - KVM is enabled
-# - the linker supports --s390-pgste
-if test "$TARGET_ARCH" = "s390x" && test "$target_softmmu" = "yes" && \
- test "$ARCH" = "s390x" && test "$kvm" = "yes"; then
- if ld_has --s390-pgste ; then
- ldflags="-Wl,--s390-pgste $ldflags"
- fi
-fi
-
-echo "QEMU_LDFLAGS+=$ldflags" >> $config_target_mak
-echo "QEMU_CFLAGS+=$cflags" >> $config_target_mak
-
done # for target in $targets
-echo "PIXMAN_CFLAGS=$pixman_cflags" >> $config_host_mak
-echo "PIXMAN_LIBS=$pixman_libs" >> $config_host_mak
-
if [ "$fdt" = "git" ]; then
- echo "config-host.h: dtc/all" >> $config_host_mak
+ subdirs="$subdirs dtc"
fi
if [ "$capstone" = "git" -o "$capstone" = "internal" ]; then
- echo "config-host.h: capstone/all" >> $config_host_mak
+ subdirs="$subdirs capstone"
fi
+echo "SUBDIRS=$subdirs" >> $config_host_mak
if test -n "$LIBCAPSTONE"; then
echo "LIBCAPSTONE=$LIBCAPSTONE" >> $config_host_mak
fi
if test "$numa" = "yes"; then
echo "CONFIG_NUMA=y" >> $config_host_mak
+ echo "NUMA_LIBS=$numa_libs" >> $config_host_mak
fi
if test "$ccache_cpp2" = "yes"; then
DIRS="$DIRS pc-bios/optionrom pc-bios/s390-ccw"
DIRS="$DIRS roms/seabios"
LINKS="Makefile"
-LINKS="$LINKS tests/tcg/lm32/Makefile po/Makefile"
+LINKS="$LINKS tests/tcg/lm32/Makefile"
LINKS="$LINKS tests/tcg/Makefile.target"
-LINKS="$LINKS tests/plugin/Makefile"
-LINKS="$LINKS pc-bios/optionrom/Makefile pc-bios/keymaps"
+LINKS="$LINKS pc-bios/optionrom/Makefile"
LINKS="$LINKS pc-bios/s390-ccw/Makefile"
LINKS="$LINKS roms/seabios/Makefile"
LINKS="$LINKS pc-bios/qemu-icon.bmp"
LINKS="$LINKS python"
for bios_file in \
$source_path/pc-bios/*.bin \
+ $source_path/pc-bios/*.elf \
$source_path/pc-bios/*.lid \
$source_path/pc-bios/*.rom \
$source_path/pc-bios/*.dtb \
-Dstrip=$(if test "$strip_opt" = yes; then echo true; else echo false; fi) \
-Db_pie=$(if test "$pie" = yes; then echo true; else echo false; fi) \
-Db_coverage=$(if test "$gcov" = yes; then echo true; else echo false; fi) \
+ -Dsdl=$sdl -Dsdl_image=$sdl_image \
+ -Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \
+ -Dgettext=$gettext -Dxkbcommon=$xkbcommon \
$cross_arg \
"$PWD" "$source_path"