Docker related updates

- configure/probe for docker
   - TARGET_DIRS -> TARGET_LIST cleanup
   - new fedora-i386-cross and debian/tricore images
   - test-mingw use SDL2/GTK3
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEZoWumedRZ7yvyN81+9DbCVqeKkQFAlsWrSUACgkQ+9DbCVqe
 KkQxRgf/XbNaRfMtZx2FX847NLp+AyCqUOmtQyU58pkI6g6Ld7RsRTcTI9S0bsdk
 GJhDIbP+B6hqou998BUIifNT4Ofd1KcTJ/8IodDXGMkO00DgW/igq5KWc/ZDW2EI
 nfAVd1lqZiH4a0iOWKpRmfGqlKK5yTStVOtU82SEOnDjMQMD8ESLtPD/oSghLrGA
 AWPmrE1lBoTQq6Ly2NXQrFcM9SkvEwFAkXQSuuoYA3DELoIkX6rSqKHzzJL1wdqK
 /38nlC+oELRTjJBSVQ9TDfRduwd5JqW0h1gnlUDoFrsSVN45OibLlK2TAlNxRQ26
 xiyeFB4tBG7jp8xtYIOIWuAW/DJgsw==
 =NdC0
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/stsquad/tags/pull-docker-updates-050618-1' into staging

Docker related updates

  - configure/probe for docker
  - TARGET_DIRS -> TARGET_LIST cleanup
  - new fedora-i386-cross and debian/tricore images
  - test-mingw use SDL2/GTK3

# gpg: Signature made Tue 05 Jun 2018 16:32:53 BST
# gpg:                using RSA key FBD0DB095A9E2A44
# gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>"
# Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44

* remotes/stsquad/tags/pull-docker-updates-050618-1:
  docker: add debian/tricore image
  docker: test-mingw: use SDL2 and GTK+3
  docker: Add fedora-i386-cross image
  Makefile: Rename TARGET_DIRS to TARGET_LIST
  configure: add test for docker availability
  docker: add "probe" command for configure

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2018-06-05 17:06:23 +01:00
commit c1c2a43590
10 changed files with 94 additions and 19 deletions

View File

@ -62,8 +62,8 @@ seems to have been used for an in-tree build. You can fix this by running \
endif
endif
CONFIG_SOFTMMU := $(if $(filter %-softmmu,$(TARGET_DIRS)),y)
CONFIG_USER_ONLY := $(if $(filter %-user,$(TARGET_DIRS)),y)
CONFIG_SOFTMMU := $(if $(filter %-softmmu,$(TARGET_LIST)),y)
CONFIG_USER_ONLY := $(if $(filter %-user,$(TARGET_LIST)),y)
CONFIG_XEN := $(CONFIG_XEN_BACKEND)
CONFIG_ALL=y
-include config-all-devices.mak
@ -366,8 +366,8 @@ DOCS=
endif
SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory --quiet) BUILD_DIR=$(BUILD_DIR)
SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %-config-devices.mak.d, $(TARGET_DIRS))
SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_LIST))
SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %-config-devices.mak.d, $(TARGET_LIST))
ifeq ($(SUBDIR_DEVICES_MAK),)
config-all-devices.mak:
@ -470,7 +470,7 @@ config-host.h-timestamp: config-host.mak
qemu-options.def: $(SRC_PATH)/qemu-options.hx $(SRC_PATH)/scripts/hxtool
$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$@")
SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_LIST))
SOFTMMU_SUBDIR_RULES=$(filter %-softmmu,$(SUBDIR_RULES))
$(SOFTMMU_SUBDIR_RULES): $(block-obj-y)
@ -514,7 +514,7 @@ ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
romsubdir-%:
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/" CFLAGS="$(filter -O% -g%,$(CFLAGS))",)
ALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
ALL_SUBDIRS=$(TARGET_LIST) $(patsubst %,pc-bios/%, $(ROMS))
recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
@ -772,7 +772,7 @@ distclean: clean
rm -f docs/interop/qemu-qmp-ref.pdf docs/interop/qemu-ga-ref.pdf
rm -f docs/interop/qemu-qmp-ref.html docs/interop/qemu-ga-ref.html
rm -f docs/qemu-block-drivers.7
for d in $(TARGET_DIRS); do \
for d in $(TARGET_LIST); do \
rm -rf $$d || exit 1 ; \
done
rm -Rf .sdk
@ -873,7 +873,7 @@ endif
$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \
done
$(INSTALL_DATA) $(BUILD_DIR)/trace-events-all "$(DESTDIR)$(qemu_datadir)/trace-events-all"
for d in $(TARGET_DIRS); do \
for d in $(TARGET_LIST); do \
$(MAKE) $(SUBDIR_MAKEFLAGS) TARGET_DIR=$$d/ -C $$d $@ || exit 1 ; \
done
@ -1071,9 +1071,9 @@ endif
@echo ' ctags/TAGS - Generate tags file for editors'
@echo ' cscope - Generate cscope index'
@echo ''
@$(if $(TARGET_DIRS), \
@$(if $(TARGET_LIST), \
echo 'Architecture specific targets:'; \
$(foreach t, $(TARGET_DIRS), \
$(foreach t, $(TARGET_LIST), \
printf " %-30s - Build for %s\\n" $(patsubst %,subdir-%,$(t)) $(t);) \
echo '')
@echo 'Cleaning targets:'

19
configure vendored
View File

@ -456,6 +456,7 @@ jemalloc="no"
replication="yes"
vxhs=""
libxml2=""
docker="no"
supported_cpu="no"
supported_os="no"
@ -5450,6 +5451,17 @@ EOF
fi
fi
##########################################
# Docker and cross-compiler support
#
# This is specifically for building test
# cases for foreign architectures, not
# cross-compiling QEMU itself.
if has "docker"; then
docker=$($python $source_path/tests/docker/docker.py probe)
fi
##########################################
# End of CC checks
# After here, no more $cc or $ld runs
@ -5913,6 +5925,7 @@ echo "avx2 optimization $avx2_opt"
echo "replication support $replication"
echo "VxHS block device $vxhs"
echo "capstone $capstone"
echo "docker $docker"
if test "$sdl_too_old" = "yes"; then
echo "-> Your SDL version is too old - please upgrade to have SDL support"
@ -6115,7 +6128,7 @@ 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 "TARGET_LIST=$target_list" >> $config_host_mak
if [ "$docs" = "yes" ] ; then
echo "BUILD_DOCS=yes" >> $config_host_mak
fi
@ -6740,6 +6753,10 @@ if test "$gcov" = "yes" ; then
echo "GCOV=$gcov_tool" >> $config_host_mak
fi
if test "$docker" != "no"; then
echo "HAVE_USER_DOCKER=y" >> $config_host_mak
fi
# use included Linux headers
if test "$linux" = "yes" ; then
mkdir -p linux-headers

View File

@ -107,7 +107,7 @@ case $line in
target_name=${line#*=}
echo "#define TARGET_NAME \"$target_name\""
;;
TARGET_DIRS=*)
TARGET_LIST=*)
# do nothing
;;
TARGET_*=y) # configuration

View File

@ -858,7 +858,7 @@ endif
# QTest rules
TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS)))
TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_LIST)))
ifeq ($(CONFIG_POSIX),y)
QTEST_TARGETS = $(TARGETS)
check-qtest-y=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y))

View File

@ -63,6 +63,9 @@ docker-image-debian-win32-cross: docker-image-debian8-mxe
docker-image-debian-win64-cross: docker-image-debian8-mxe
docker-image-travis: NOUSER=1
# Specialist build images, sometimes very limited tools
docker-image-tricore-cross: docker-image-debian9
# Expand all the pre-requistes for each docker image and test combination
$(foreach i,$(DOCKER_IMAGES) $(DOCKER_DEPRECATED_IMAGES), \
$(foreach t,$(DOCKER_TESTS) $(DOCKER_TOOLS), \

View File

@ -390,6 +390,24 @@ class ImagesCommand(SubCommand):
def run(self, args, argv):
return Docker().command("images", argv, args.quiet)
class ProbeCommand(SubCommand):
"""Probe if we can run docker automatically"""
name = "probe"
def run(self, args, argv):
try:
docker = Docker()
if docker._command[0] == "docker":
print "yes"
elif docker._command[0] == "sudo":
print "sudo"
except Exception:
print "no"
return
def main():
parser = argparse.ArgumentParser(description="A Docker helper",
usage="%s <subcommand> ..." % os.path.basename(sys.argv[0]))

View File

@ -0,0 +1,23 @@
#
# Docker TriCore cross-compiler target
#
# This docker target builds on the debian Stretch base image.
#
# Copyright (c) 2018 Philippe Mathieu-Daudé
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
FROM debian:9
MAINTAINER Philippe Mathieu-Daudé <f4bug@amsat.org>
RUN git clone --single-branch \
https://github.com/bkoppelmann/tricore-binutils.git \
/usr/src/binutils && \
cd /usr/src/binutils && chmod +x missing && \
CFLAGS=-w ./configure --prefix=/usr --disable-nls --target=tricore && \
make && make install && \
rm -rf /usr/src/binutils
# Specify the cross prefix for this image (see tests/docker/common.rc)
ENV QEMU_CONFIGURE_OPTS --cross-prefix=tricore-

View File

@ -0,0 +1,14 @@
FROM fedora:latest
ENV PACKAGES \
gcc \
glibc-static.i686 \
glibc-devel.i686 \
glib2-devel.i686 \
zlib-devel.i686 \
glib2-devel.i686 \
nettle-devel.i686 \
pixman-devel.i686 \
gnutls-devel.i686
RUN dnf install -y $PACKAGES
RUN rpm -q $PACKAGES | sort > /packages.txt

View File

@ -11,12 +11,12 @@ ENV PACKAGES \
numactl-devel SDL2-devel snappy-devel spice-server-devel \
systemtap-sdt-devel usbredir-devel virglrenderer-devel vte3-devel \
xen-devel \
mingw32-pixman mingw32-glib2 mingw32-gmp mingw32-SDL mingw32-pkg-config \
mingw32-gtk2 mingw32-gtk3 mingw32-gnutls mingw32-nettle mingw32-libtasn1 \
mingw32-pixman mingw32-glib2 mingw32-gmp mingw32-SDL2 mingw32-pkg-config \
mingw32-gtk3 mingw32-gnutls mingw32-nettle mingw32-libtasn1 \
mingw32-libjpeg-turbo mingw32-libpng mingw32-curl mingw32-libssh2 \
mingw32-bzip2 \
mingw64-pixman mingw64-glib2 mingw64-gmp mingw64-SDL mingw64-pkg-config \
mingw64-gtk2 mingw64-gtk3 mingw64-gnutls mingw64-nettle mingw64-libtasn1 \
mingw64-pixman mingw64-glib2 mingw64-gmp mingw64-SDL2 mingw64-pkg-config \
mingw64-gtk3 mingw64-gnutls mingw64-nettle mingw64-libtasn1 \
mingw64-libjpeg-turbo mingw64-libpng mingw64-curl mingw64-libssh2 \
mingw64-bzip2
ENV QEMU_CONFIGURE_OPTS --python=/usr/bin/python3

View File

@ -28,8 +28,8 @@ for prefix in x86_64-w64-mingw32- i686-w64-mingw32-; do
--enable-vnc \
--enable-bzip2 \
--enable-guest-agent \
--with-sdlabi=1.2 \
--with-gtkabi=2.0
--with-sdlabi=2.0 \
--with-gtkabi=3.0
install_qemu
make clean