i386:i386 | i386:x86_64 | i386:x32 | \
x86_64:i386 | x86_64:x86_64 | x86_64:x32 | \
mips:mips | mipsel:mips | \
- ppc:ppc | ppcemb:ppc | ppc64:ppc | \
- ppc:ppc64 | ppcemb:ppc64 | ppc64:ppc64 | \
+ ppc:ppc | ppc64:ppc | ppc:ppc64 | ppc64:ppc64 | \
s390x:s390x)
return 0
;;
libs_tools=""
audio_pt_int=""
audio_win_int=""
-cc_i386=i386-pc-linux-gnu-gcc
libs_qga=""
debug_info="yes"
stack_protector=""
then
git_update=yes
git_submodules="ui/keycodemapdb"
+ git_submodules="$git_submodules tests/fp/berkeley-testfloat-3"
+ git_submodules="$git_submodules tests/fp/berkeley-softfloat-3"
else
git_update=no
git_submodules=""
+
+ if ! test -f "$source_path/ui/keycodemapdb/README"
+ then
+ echo
+ echo "ERROR: missing file $source_path/ui/keycodemapdb/README"
+ echo
+ echo "This is not a GIT checkout but module content appears to"
+ echo "be missing. Do not use 'git archive' or GitHub download links"
+ echo "to acquire QEMU source archives. Non-GIT builds are only"
+ echo "supported with source archives linked from:"
+ echo
+ echo " https://www.qemu.org/download/"
+ echo
+ echo "Developers working with GIT can use scripts/archive-source.sh"
+ echo "if they need to create valid source archives."
+ echo
+ exit 1
+ fi
fi
git="git"
hvf="no"
whpx="no"
rdma=""
+pvrdma=""
gprof="no"
debug_tcg="no"
debug="no"
glusterfs_fallocate="no"
glusterfs_zerofill="no"
gtk=""
-gtkabi=""
gtk_gl="no"
tls_priority="NORMAL"
gnutls=""
vxhs=""
libxml2=""
docker="no"
+debug_mutex="no"
+libpmem=""
+
+# cross compilers defaults, can be overridden with --cross-cc-ARCH
+cross_cc_aarch64="aarch64-linux-gnu-gcc"
+cross_cc_aarch64_be="$cross_cc_aarch64"
+cross_cc_cflags_aarch64_be="-mbig-endian"
+cross_cc_arm="arm-linux-gnueabihf-gcc"
+cross_cc_cflags_armeb="-mbig-endian"
+cross_cc_i386="i386-pc-linux-gnu-gcc"
+cross_cc_cflags_i386=""
+cross_cc_powerpc="powerpc-linux-gnu-gcc"
+cross_cc_powerpc="powerpc-linux-gnu-gcc"
+
+enabled_cross_compilers=""
supported_cpu="no"
supported_os="no"
;;
--disable-debug-info) debug_info="no"
;;
+ --cross-cc-*[!a-zA-Z0-9_-]*=*) error_exit "Passed bad --cross-cc-FOO option"
+ ;;
+ --cross-cc-cflags-*) cc_arch=${opt#--cross-cc-flags-}; cc_arch=${cc_arch%%=*}
+ eval "cross_cc_cflags_${cc_arch}=\$optarg"
+ ;;
+ --cross-cc-*) cc_arch=${opt#--cross-cc-}; cc_arch=${cc_arch%%=*}
+ eval "cross_cc_${cc_arch}=\$optarg"
+ ;;
esac
done
# OS specific
ppc|ppc64|s390|s390x|sparc64|x32)
cpu="$cpu"
supported_cpu="yes"
+ eval "cross_cc_${cpu}=\$host_cc"
;;
i386|i486|i586|i686|i86pc|BePC)
cpu="i386"
supported_cpu="yes"
+ cross_cc_i386=$host_cc
;;
x86_64|amd64)
cpu="x86_64"
supported_cpu="yes"
+ cross_cc_x86_64=$host_cc
;;
armv*b|armv*l|arm)
cpu="arm"
supported_cpu="yes"
+ cross_cc_arm=$host_cc
;;
aarch64)
cpu="aarch64"
supported_cpu="yes"
+ cross_cc_aarch64=$host_cc
;;
mips*)
cpu="mips"
supported_cpu="yes"
+ cross_cc_mips=$host_cc
;;
sparc|sun4[cdmuv])
cpu="sparc"
supported_cpu="yes"
+ cross_cc_sparc=$host_cc
;;
*)
# This will result in either an error or falling back to TCI later
;;
--disable-debug-info)
;;
+ --cross-cc-*)
+ ;;
--enable-modules)
modules="yes"
;;
--enable-debug)
# Enable debugging options that aren't excessively noisy
debug_tcg="yes"
+ debug_mutex="yes"
debug="yes"
strip_opt="no"
fortify_source="no"
;;
--disable-rdma) rdma="no"
;;
- --with-gtkabi=*) gtkabi="$optarg"
+ --enable-pvrdma) pvrdma="yes"
+ ;;
+ --disable-pvrdma) pvrdma="no"
;;
--disable-vte) vte="no"
;;
;;
--disable-git-update) git_update=no
;;
+ --enable-debug-mutex) debug_mutex=yes
+ ;;
+ --disable-debug-mutex) debug_mutex=no
+ ;;
+ --enable-libpmem) libpmem=yes
+ ;;
+ --disable-libpmem) libpmem=no
+ ;;
*)
echo "ERROR: unknown option $opt"
echo "Try '$0 --help' for more information"
ppc)
CPU_CFLAGS="-m32"
LDFLAGS="-m32 $LDFLAGS"
+ cross_cc_powerpc=$cc
+ cross_cc_cflags_powerpc=$CPU_CFLAGS
;;
ppc64)
CPU_CFLAGS="-m64"
LDFLAGS="-m64 $LDFLAGS"
+ cross_cc_ppc64=$cc
+ cross_cc_cflags_ppc64=$CPU_CFLAGS
;;
sparc)
CPU_CFLAGS="-m32 -mv8plus -mcpu=ultrasparc"
LDFLAGS="-m32 -mv8plus $LDFLAGS"
+ cross_cc_sparc=$cc
+ cross_cc_cflags_sparc=$CPU_CFLAGS
;;
sparc64)
CPU_CFLAGS="-m64 -mcpu=ultrasparc"
LDFLAGS="-m64 $LDFLAGS"
+ cross_cc_sparc64=$cc
+ cross_cc_cflags_sparc64=$CPU_CFLAGS
;;
s390)
CPU_CFLAGS="-m31"
LDFLAGS="-m31 $LDFLAGS"
+ cross_cc_s390=$cc
+ cross_cc_cflags_s390=$CPU_CFLAGS
;;
s390x)
CPU_CFLAGS="-m64"
LDFLAGS="-m64 $LDFLAGS"
+ cross_cc_s390x=$cc
+ cross_cc_cflags_s390x=$CPU_CFLAGS
;;
i386)
CPU_CFLAGS="-m32"
LDFLAGS="-m32 $LDFLAGS"
- cc_i386='$(CC) -m32'
+ cross_cc_i386=$cc
+ cross_cc_cflags_i386=$CPU_CFLAGS
;;
x86_64)
# ??? Only extremely old AMD cpus do not have cmpxchg16b.
# runtime and generate the fallback to serial emulation.
CPU_CFLAGS="-m64 -mcx16"
LDFLAGS="-m64 $LDFLAGS"
- cc_i386='$(CC) -m32'
+ cross_cc_x86_64=$cc
+ cross_cc_cflags_x86_64=$CPU_CFLAGS
;;
x32)
CPU_CFLAGS="-mx32"
LDFLAGS="-mx32 $LDFLAGS"
- cc_i386='$(CC) -m32'
+ cross_cc_i386=$cc
+ cross_cc_cflags_i386=$CPU_CFLAGS
;;
# No special flags required for other host CPUs
esac
--extra-cflags=CFLAGS append extra C compiler flags QEMU_CFLAGS
--extra-cxxflags=CXXFLAGS append extra C++ compiler flags QEMU_CXXFLAGS
--extra-ldflags=LDFLAGS append extra linker flags LDFLAGS
+ --cross-cc-ARCH=CC use compiler when building ARCH guest test cases
+ --cross-cc-flags-ARCH= use compiler flags when building ARCH guest tests
--make=MAKE use specified make [$make]
--install=INSTALL use specified install [$install]
--python=PYTHON use specified python [$python]
sdl SDL UI
--with-sdlabi select preferred SDL ABI 1.2 or 2.0
gtk gtk UI
- --with-gtkabi select preferred GTK ABI 2.0 or 3.0
vte vte support for the gtk UI
curses curses UI
vnc VNC UI support
hax HAX acceleration support
hvf Hypervisor.framework acceleration support
whpx Windows Hypervisor Platform acceleration support
- rdma Enable RDMA-based migration and PVRDMA support
+ rdma Enable RDMA-based migration
+ pvrdma Enable PVRDMA support
vde support for vde network
netmap support for netmap network
linux-aio Linux AIO support
crypto-afalg Linux AF_ALG crypto backend driver
vhost-user vhost-user support
capstone capstone disassembler support
+ debug-mutex mutex debugging support
+ libpmem libpmem support
NOTE: The object files are built at the place where configure is launched
EOF
##########################################
# libseccomp check
+libseccomp_minver="2.2.0"
if test "$seccomp" != "no" ; then
case "$cpu" in
- i386|x86_64)
- libseccomp_minver="2.1.0"
- ;;
- mips)
- libseccomp_minver="2.2.0"
+ i386|x86_64|mips)
;;
arm|aarch64)
libseccomp_minver="2.2.3"
# GTK probe
if test "$gtk" != "no"; then
- if test "$gtkabi" = ""; then
- # The GTK ABI was not specified explicitly, so try whether 3.0 is available.
- # Use 2.0 as a fallback if that is available.
- if $pkg_config --exists "gtk+-3.0 >= 3.0.0"; then
- gtkabi=3.0
- elif $pkg_config --exists "gtk+-2.0 >= 2.18.0"; then
- gtkabi=2.0
- else
- gtkabi=3.0
- fi
- fi
- gtkpackage="gtk+-$gtkabi"
- gtkx11package="gtk+-x11-$gtkabi"
- if test "$gtkabi" = "3.0" ; then
- gtkversion="3.0.0"
- else
- gtkversion="2.18.0"
- fi
+ gtkpackage="gtk+-3.0"
+ gtkx11package="gtk+-x11-3.0"
+ gtkversion="3.14.0"
if $pkg_config --exists "$gtkpackage >= $gtkversion"; then
gtk_cflags=$($pkg_config --cflags $gtkpackage)
gtk_libs=$($pkg_config --libs $gtkpackage)
# VTE probe
if test "$vte" != "no"; then
- if test "$gtkabi" = "3.0"; then
- vteminversion="0.32.0"
- if $pkg_config --exists "vte-2.91"; then
- vtepackage="vte-2.91"
- else
- vtepackage="vte-2.90"
- fi
+ vteminversion="0.32.0"
+ if $pkg_config --exists "vte-2.91"; then
+ vtepackage="vte-2.91"
else
- vtepackage="vte"
- vteminversion="0.24.0"
+ vtepackage="vte-2.90"
fi
if $pkg_config --exists "$vtepackage >= $vteminversion"; then
vte_cflags=$($pkg_config --cflags $vtepackage)
vteversion=$($pkg_config --modversion $vtepackage)
vte="yes"
elif test "$vte" = "yes"; then
- if test "$gtkabi" = "3.0"; then
- feature_not_found "vte" "Install libvte-2.90/2.91 devel"
- else
- feature_not_found "vte" "Install libvte devel"
- fi
+ feature_not_found "vte" "Install libvte-2.90/2.91 devel"
else
vte="no"
fi
fi
fi
+##########################################
+# PVRDMA detection
+
+cat > $TMPC <<EOF &&
+#include <sys/mman.h>
+
+int
+main(void)
+{
+ char buf = 0;
+ void *addr = &buf;
+ addr = mremap(addr, 0, 1, MREMAP_MAYMOVE | MREMAP_FIXED);
+
+ return 0;
+}
+EOF
+
+if test "$rdma" = "yes" ; then
+ case "$pvrdma" in
+ "")
+ if compile_prog "" ""; then
+ pvrdma="yes"
+ else
+ pvrdma="no"
+ fi
+ ;;
+ "yes")
+ if ! compile_prog "" ""; then
+ error_exit "PVRDMA is not supported since mremap is not implemented"
+ fi
+ pvrdma="yes"
+ ;;
+ "no")
+ pvrdma="no"
+ ;;
+ esac
+else
+ if test "$pvrdma" = "yes" ; then
+ error_exit "PVRDMA requires rdma suppport"
+ fi
+ pvrdma="no"
+fi
##########################################
# VNC SASL detection
##########################################
# glib support probe
-if test "$mingw32" = yes; then
- glib_req_ver=2.30
-else
- glib_req_ver=2.22
-fi
+glib_req_ver=2.40
glib_modules=gthread-2.0
if test "$modules" = yes; then
glib_modules="$glib_modules gmodule-export-2.0"
"build target"
fi
-# g_test_trap_subprocess added in 2.38. Used by some tests.
-glib_subprocess=yes
-if ! $pkg_config --atleast-version=2.38 glib-2.0; then
- glib_subprocess=no
-fi
-
# Silence clang 3.5.0 warnings about glib attribute __alloc_size__ usage
cat > $TMPC << EOF
#include <glib.h>
# libmpathpersist probe
if test "$mpath" != "no" ; then
+ # probe for the new API
cat > $TMPC <<EOF
#include <libudev.h>
#include <mpath_persist.h>
EOF
if compile_prog "" "-ludev -lmultipath -lmpathpersist" ; then
mpathpersist=yes
+ mpathpersist_new_api=yes
else
- mpathpersist=no
+ # probe for the old API
+ cat > $TMPC <<EOF
+#include <libudev.h>
+#include <mpath_persist.h>
+unsigned mpath_mx_alloc_len = 1024;
+int logsink;
+int main(void) {
+ struct udev *udev = udev_new();
+ mpath_lib_init(udev);
+ return 0;
+}
+EOF
+ if compile_prog "" "-ludev -lmultipath -lmpathpersist" ; then
+ mpathpersist=yes
+ mpathpersist_new_api=no
+ else
+ mpathpersist=no
+ fi
fi
else
mpathpersist=no
# opengl probe (for sdl2, gtk, milkymist-tmu2)
if test "$opengl" != "no" ; then
- opengl_pkgs="epoxy libdrm gbm"
+ opengl_pkgs="epoxy gbm"
if $pkg_config $opengl_pkgs; then
opengl_cflags="$($pkg_config --cflags $opengl_pkgs)"
opengl_libs="$($pkg_config --libs $opengl_pkgs)"
sem_timedwait=yes
fi
+##########################################
+# check if we have strchrnul
+
+strchrnul=no
+cat > $TMPC << EOF
+#include <string.h>
+int main(void);
+// Use a haystack that the compiler shouldn't be able to constant fold
+char *haystack = (char*)&main;
+int main(void) { return strchrnul(haystack, 'x') != &haystack[6]; }
+EOF
+if compile_prog "" "" ; then
+ strchrnul=yes
+fi
+
##########################################
# check if trace backend exists
docker=$($python $source_path/tests/docker/docker.py probe)
fi
+##########################################
+# check for libpmem
+
+if test "$libpmem" != "no"; then
+ if $pkg_config --exists "libpmem"; then
+ 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
+ feature_not_found "libpmem" "Install nvml or pmdk"
+ fi
+ libpmem="no"
+ fi
+fi
+
##########################################
# End of CC checks
# After here, no more $cc or $ld runs
tools=""
if test "$want_tools" = "yes" ; then
- tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools"
+ tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) qemu-edid\$(EXESUF) $tools"
if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then
tools="qemu-nbd\$(EXESUF) $tools"
fi
if [ "$ivshmem" = "yes" ]; then
tools="ivshmem-client\$(EXESUF) ivshmem-server\$(EXESUF) $tools"
fi
+ if [ "$posix" = "yes" ] && [ "$curl" = "yes" ]; then
+ tools="elf2dmp $tools"
+ fi
fi
if test "$softmmu" = yes ; then
if test "$linux" = yes; then
fi
echo "malloc trim support $malloc_trim"
echo "RDMA support $rdma"
+echo "PVRDMA support $pvrdma"
echo "fdt support $fdt"
echo "membarrier $membarrier"
echo "preadv support $preadv"
echo "coroutine backend $coroutine"
echo "coroutine pool $coroutine_pool"
echo "debug stack usage $debug_stack_usage"
+echo "mutex debugging $debug_mutex"
echo "crypto afalg $crypto_afalg"
echo "GlusterFS support $glusterfs"
echo "gcov $gcov_tool"
echo "VxHS block device $vxhs"
echo "capstone $capstone"
echo "docker $docker"
+echo "libpmem support $libpmem"
if test "$sdl_too_old" = "yes"; then
echo "-> Your SDL version is too old - please upgrade to have SDL support"
fi
-if test "$gtkabi" = "2.0"; then
- echo
- echo "WARNING: Use of GTK 2.0 is deprecated and will be removed in"
- echo "WARNING: future releases. Please switch to using GTK 3.0"
-fi
-
if test "$sdlabi" = "1.2"; then
echo
echo "WARNING: Use of SDL 1.2 is deprecated and will be removed in"
echo "VERSION=$qemu_version" >>$config_host_mak
echo "PKGVERSION=$pkgversion" >>$config_host_mak
echo "SRC_PATH=$source_path" >> $config_host_mak
-echo "TARGET_LIST=$target_list" >> $config_host_mak
+echo "TARGET_DIRS=$target_list" >> $config_host_mak
if [ "$docs" = "yes" ] ; then
echo "BUILD_DOCS=yes" >> $config_host_mak
fi
if test "$sem_timedwait" = "yes" ; then
echo "CONFIG_SEM_TIMEDWAIT=y" >> $config_host_mak
fi
+if test "$strchrnul" = "yes" ; then
+ echo "HAVE_STRCHRNUL=y" >> $config_host_mak
+fi
if test "$byteswap_h" = "yes" ; then
echo "CONFIG_BYTESWAP_H=y" >> $config_host_mak
fi
echo "CONFIG_BLUEZ=y" >> $config_host_mak
echo "BLUEZ_CFLAGS=$bluez_cflags" >> $config_host_mak
fi
-if test "$glib_subprocess" = "yes" ; then
- echo "CONFIG_HAS_GLIB_SUBPROCESS_TESTS=y" >> $config_host_mak
-fi
if test "$gtk" = "yes" ; then
echo "CONFIG_GTK=m" >> $config_host_mak
- echo "CONFIG_GTKABI=$gtkabi" >> $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
fi
if test "$mpath" = "yes" ; then
echo "CONFIG_MPATH=y" >> $config_host_mak
+ if test "$mpathpersist_new_api" = "yes"; then
+ echo "CONFIG_MPATH_NEW_API=y" >> $config_host_mak
+ fi
fi
if test "$vhost_scsi" = "yes" ; then
echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak
echo "RDMA_LIBS=$rdma_libs" >> $config_host_mak
fi
+if test "$pvrdma" = "yes" ; then
+ echo "CONFIG_PVRDMA=y" >> $config_host_mak
+fi
+
if test "$have_rtnetlink" = "yes" ; then
echo "CONFIG_RTNETLINK=y" >> $config_host_mak
fi
if test "$capstone" != "no" ; then
echo "CONFIG_CAPSTONE=y" >> $config_host_mak
fi
+if test "$debug_mutex" = "yes" ; then
+ echo "CONFIG_DEBUG_MUTEX=y" >> $config_host_mak
+fi
# Hold two types of flag:
# CONFIG_THREAD_SETNAME_BYTHREAD - we've got a way of setting the name on
echo "VXHS_LIBS=$vxhs_libs" >> $config_host_mak
fi
+if test "$libpmem" = "yes" ; then
+ echo "CONFIG_LIBPMEM=y" >> $config_host_mak
+fi
+
if test "$tcg_interpreter" = "yes"; then
QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/tci $QEMU_INCLUDES"
elif test "$ARCH" = "sparc64" ; then
if $iasl -h > /dev/null 2>&1; then
echo "IASL=$iasl" >> $config_host_mak
fi
-echo "CC_I386=$cc_i386" >> $config_host_mak
echo "HOST_CC=$host_cc" >> $config_host_mak
echo "CXX=$cxx" >> $config_host_mak
echo "OBJCC=$objcc" >> $config_host_mak
i386|x86_64|x32)
linux_arch=x86
;;
- ppcemb|ppc|ppc64)
+ ppc|ppc64)
linux_arch=powerpc
;;
s390x)
target_bigendian="no"
case "$target_name" in
- armeb|aarch64_be|hppa|lm32|m68k|microblaze|mips|mipsn32|mips64|moxie|or1k|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb)
+ armeb|aarch64_be|hppa|lm32|m68k|microblaze|mips|mipsn32|mips64|moxie|or1k|ppc|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb)
target_bigendian=yes
;;
esac
;;
esac
+target_compiler=""
+target_compiler_static=""
+target_compiler_cflags=""
+
mkdir -p $target_dir
echo "# Automatically generated by configure - do not modify" > $config_target_mak
case "$target_name" in
i386)
+ mttcg="yes"
gdb_xml_files="i386-32bit.xml i386-32bit-core.xml i386-32bit-sse.xml"
+ target_compiler=$cross_cc_i386
+ target_compiler_cflags=$cross_cc_ccflags_i386
;;
x86_64)
TARGET_BASE_ARCH=i386
+ mttcg="yes"
gdb_xml_files="i386-64bit.xml i386-64bit-core.xml i386-64bit-sse.xml"
+ target_compiler=$cross_cc_x86_64
;;
alpha)
mttcg="yes"
+ target_compiler=$cross_cc_alpha
;;
arm|armeb)
TARGET_ARCH=arm
bflt="yes"
mttcg="yes"
gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
+ target_compiler=$cross_cc_arm
+ eval "target_compiler_cflags=\$cross_cc_cflags_${target_name}"
;;
aarch64|aarch64_be)
TARGET_ARCH=aarch64
bflt="yes"
mttcg="yes"
gdb_xml_files="aarch64-core.xml aarch64-fpu.xml arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
+ target_compiler=$cross_cc_aarch64
+ eval "target_compiler_cflags=\$cross_cc_cflags_${target_name}"
;;
cris)
+ target_compiler=$cross_cc_cris
;;
hppa)
mttcg="yes"
+ target_compiler=$cross_cc_hppa
;;
lm32)
+ target_compiler=$cross_cc_lm32
;;
m68k)
bflt="yes"
gdb_xml_files="cf-core.xml cf-fp.xml m68k-fp.xml"
+ target_compiler=$cross_cc_m68k
;;
microblaze|microblazeel)
TARGET_ARCH=microblaze
bflt="yes"
echo "TARGET_ABI32=y" >> $config_target_mak
+ target_compiler=$cross_cc_microblaze
;;
mips|mipsel)
TARGET_ARCH=mips
+ target_compiler=$cross_cc_mips
echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak
;;
mipsn32|mipsn32el)
TARGET_ARCH=mips64
TARGET_BASE_ARCH=mips
+ target_compiler=$cross_cc_mipsn32
echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak
echo "TARGET_ABI32=y" >> $config_target_mak
;;
mips64|mips64el)
TARGET_ARCH=mips64
TARGET_BASE_ARCH=mips
+ target_compiler=$cross_cc_mips64
echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak
;;
moxie)
+ target_compiler=$cross_cc_moxie
;;
nios2)
+ target_compiler=$cross_cc_nios2
;;
or1k)
+ target_compiler=$cross_cc_or1k
TARGET_ARCH=openrisc
TARGET_BASE_ARCH=openrisc
;;
ppc)
gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
- ;;
- ppcemb)
- TARGET_BASE_ARCH=ppc
- TARGET_ABI_DIR=ppc
- gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
+ target_compiler=$cross_cc_powerpc
;;
ppc64)
TARGET_BASE_ARCH=ppc
TARGET_ABI_DIR=ppc
mttcg=yes
gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml"
+ target_compiler=$cross_cc_ppc64
;;
ppc64le)
TARGET_ARCH=ppc64
TARGET_ABI_DIR=ppc
mttcg=yes
gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml"
+ target_compiler=$cross_cc_ppc64le
;;
ppc64abi32)
TARGET_ARCH=ppc64
TARGET_ABI_DIR=ppc
echo "TARGET_ABI32=y" >> $config_target_mak
gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml"
+ target_compiler=$cross_cc_ppc64abi32
;;
riscv32)
TARGET_BASE_ARCH=riscv
TARGET_ABI_DIR=riscv
mttcg=yes
+ target_compiler=$cross_cc_riscv32
;;
riscv64)
TARGET_BASE_ARCH=riscv
TARGET_ABI_DIR=riscv
mttcg=yes
+ target_compiler=$cross_cc_riscv64
;;
sh4|sh4eb)
TARGET_ARCH=sh4
bflt="yes"
+ target_compiler=$cross_cc_sh4
;;
sparc)
+ target_compiler=$cross_cc_sparc
;;
sparc64)
TARGET_BASE_ARCH=sparc
+ target_compiler=$cross_cc_sparc64
;;
sparc32plus)
TARGET_ARCH=sparc64
TARGET_BASE_ARCH=sparc
TARGET_ABI_DIR=sparc
+ target_compiler=$cross_cc_sparc32plus
echo "TARGET_ABI32=y" >> $config_target_mak
;;
s390x)
mttcg=yes
gdb_xml_files="s390x-core64.xml s390-acr.xml s390-fpr.xml s390-vx.xml s390-cr.xml s390-virt.xml s390-gs.xml"
+ target_compiler=$cross_cc_s390x
;;
tilegx)
+ target_compiler=$cross_cc_tilegx
;;
tricore)
+ target_compiler=$cross_cc_tricore
;;
unicore32)
+ target_compiler=$cross_cc_unicore32
;;
xtensa|xtensaeb)
TARGET_ARCH=xtensa
mttcg="yes"
+ target_compiler=$cross_cc_xtensa
;;
*)
error_exit "Unsupported target CPU"
TARGET_BASE_ARCH=$TARGET_ARCH
fi
+# Do we have a cross compiler for this target?
+if has $target_compiler; then
+
+ write_c_skeleton
+
+ if ! do_compiler "$target_compiler" $target_compiler_cflags -o $TMPE $TMPC -static ; then
+ # For host systems we might get away with building without -static
+ if ! do_compiler "$target_compiler" $target_compiler_cflags -o $TMPE $TMPC ; then
+ target_compiler=""
+ else
+ enabled_cross_compilers="${enabled_cross_compilers} '${target_compiler}'"
+ target_compiler_static="n"
+ fi
+ else
+ enabled_cross_compilers="${enabled_cross_compilers} '${target_compiler}'"
+ target_compiler_static="y"
+ fi
+else
+ target_compiler=""
+fi
+
symlink "$source_path/Makefile.target" "$target_dir/Makefile"
upper() {
echo "CONFIG_BSD_USER=y" >> $config_target_mak
fi
+if test -n "$target_compiler"; then
+ echo "CROSS_CC_GUEST=\"$target_compiler\"" >> $config_target_mak
+
+ if test -n "$target_compiler_static"; then
+ echo "CROSS_CC_GUEST_STATIC=$target_compiler_static" >> $config_target_mak
+ fi
+
+ if test -n "$target_compiler_cflags"; then
+ echo "CROSS_CC_GUEST_CFLAGS=$target_compiler_cflags" >> $config_target_mak
+ fi
+fi
+
+
# generate QEMU_CFLAGS/LDFLAGS for targets
cflags=""
done # for target in $targets
+if test -n "$enabled_cross_compilers"; then
+ echo
+ echo "NOTE: cross-compilers enabled: $enabled_cross_compilers"
+fi
+
if [ "$fdt" = "git" ]; then
echo "config-host.h: subdir-dtc" >> $config_host_mak
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 tests/vm"
+DIRS="$DIRS tests/fp"
DIRS="$DIRS docs docs/interop fsdev scsi"
DIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas pc-bios/s390-ccw"
DIRS="$DIRS roms/seabios roms/vgabios"
FILES="Makefile tests/tcg/Makefile qdict-test-data.txt"
FILES="$FILES tests/tcg/cris/Makefile tests/tcg/cris/.gdbinit"
FILES="$FILES tests/tcg/lm32/Makefile tests/tcg/xtensa/Makefile po/Makefile"
+FILES="$FILES tests/fp/Makefile"
FILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps"
FILES="$FILES pc-bios/spapr-rtas/Makefile"
FILES="$FILES pc-bios/s390-ccw/Makefile"
do
FILES="$FILES tests/acpi-test-data$(echo $test_file | sed -e 's/.*acpi-test-data//')"
done
+for test_file in $(find $source_path/tests/hex-loader-check-data -type f)
+do
+ FILES="$FILES tests/hex-loader-check-data$(echo $test_file | sed -e 's/.*hex-loader-check-data//')"
+done
mkdir -p $DIRS
for f in $FILES ; do
if [ -e "$source_path/$f" ] && [ "$pwd_is_source_path" != "y" ]; then
# Compiler output produced by configure, useful for debugging
# configure, is in config.log if it exists.
EOD
+
+preserve_env() {
+ envname=$1
+
+ eval envval=\$$envname
+
+ if test -n "$envval"
+ then
+ echo "$envname='$envval'" >> config.status
+ echo "export $envname" >> config.status
+ else
+ echo "unset $envname" >> config.status
+ fi
+}
+
+# Preserve various env variables that influence what
+# features/build target configure will detect
+preserve_env AR
+preserve_env AS
+preserve_env CC
+preserve_env CPP
+preserve_env CXX
+preserve_env INSTALL
+preserve_env LD
+preserve_env LD_LIBRARY_PATH
+preserve_env LIBTOOL
+preserve_env MAKE
+preserve_env NM
+preserve_env OBJCOPY
+preserve_env PATH
+preserve_env PKG_CONFIG
+preserve_env PKG_CONFIG_LIBDIR
+preserve_env PKG_CONFIG_PATH
+preserve_env PYTHON
+preserve_env SDL_CONFIG
+preserve_env SDL2_CONFIG
+preserve_env SMBD
+preserve_env STRIP
+preserve_env WINDRES
+
printf "exec" >>config.status
printf " '%s'" "$0" "$@" >>config.status
echo ' "$@"' >>config.status