X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=configure;h=5f463b05b5c11db3bc490e411951f32ed68ed662;hb=b04c3db504f35b57a2ce519313f3d49fcecf6cb3;hp=aa2cc4322718b9eb0c4bb55c24c866b386867dde;hpb=2d9f27d2fd385bd4b06b2d140433388d8404b526;p=qemu.git diff --git a/configure b/configure index aa2cc4322..5f463b05b 100755 --- a/configure +++ b/configure @@ -38,6 +38,7 @@ cc="gcc" audio_drv_list="" audio_card_list="ac97 es1370 sb16" audio_possible_cards="ac97 es1370 sb16 cs4231a adlib gus" +block_drv_whitelist="" host_cc="gcc" ar="ar" make="make" @@ -90,6 +91,26 @@ ar="${cross_prefix}${ar}" objcopy="${cross_prefix}${objcopy}" ld="${cross_prefix}${ld}" +# default flags for all hosts +QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS" +CFLAGS="-g $CFLAGS" +QEMU_CFLAGS="-Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" +QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" +QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS" +QEMU_CFLAGS="-U_FORTIFY_SOURCE $QEMU_CFLAGS" +QEMU_CFLAGS="-I. -I\$(SRC_PATH) $QEMU_CFLAGS" +LDFLAGS="-g $LDFLAGS" + +gcc_flags="-Wold-style-declaration -Wold-style-definition" +cat > $TMPC << EOF +int main(void) { } +EOF +for flag in $gcc_flags; do + if compile_prog "$QEMU_CFLAGS" "$flag" ; then + QEMU_CFLAGS="$flag $QEMU_CFLAGS" + fi +done + # check that the C compiler works. cat > $TMPC < $TMPC << EOF +#define _GNU_SOURCE +#include +#include + +int main(void) +{ + accept4(0, NULL, NULL, SOCK_CLOEXEC); + return 0; +} +EOF +if compile_prog "" "" ; then + accept4=yes +fi + # check if tee/splice is there. vmsplice was added same time. splice=no cat > $TMPC << EOF @@ -1580,7 +1639,7 @@ int main(void) return 0; } EOF -if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then +if compile_prog "$ARCH_CFLAGS" "" ; then fallocate=yes fi @@ -1595,7 +1654,7 @@ int main(void) return 0; } EOF -if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then +if compile_prog "" "" ; then dup3=yes fi @@ -1728,33 +1787,15 @@ fi # End of CC checks # After here, no more $cc or $ld runs -# default flags for all hosts -QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS" -CFLAGS="-g $CFLAGS" if test "$debug" = "no" ; then CFLAGS="-O2 $CFLAGS" fi -QEMU_CFLAGS="-Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" -QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" -QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS" -QEMU_CFLAGS="-U_FORTIFY_SOURCE $QEMU_CFLAGS" -QEMU_CFLAGS="-I. -I\$(SRC_PATH) $QEMU_CFLAGS" -LDFLAGS="-g $LDFLAGS" - -gcc_flags="-Wold-style-declaration -Wold-style-definition" -cat > $TMPC << EOF -int main(void) { } -EOF -for flag in $gcc_flags; do - if compile_prog "$QEMU_CFLAGS" "$flag" ; then - QEMU_CFLAGS="$flag $QEMU_CFLAGS" - fi -done # Consult white-list to determine whether to enable werror # by default. Only enable by default for git builds +z_version=`cut -f3 -d. $source_path/VERSION` + if test -z "$werror" ; then - z_version=`cut -f3 -d. $source_path/VERSION` if test "$z_version" = "50" -a \ "$linux" = "yes" ; then werror="yes" @@ -1763,6 +1804,16 @@ if test -z "$werror" ; then fi fi +# Disable zero malloc errors for official releases unless explicitly told to +# enable/disable +if test -z "$zero_malloc" ; then + if test "$z_version" = "50" ; then + zero_malloc="no" + else + zero_malloc="yes" + fi +fi + if test "$werror" = "yes" ; then QEMU_CFLAGS="-Werror $QEMU_CFLAGS" fi @@ -1826,6 +1877,7 @@ echo "check support $check_utests" echo "mingw32 support $mingw32" echo "Audio drivers $audio_drv_list" echo "Extra audio cards $audio_card_list" +echo "Block whitelist $block_drv_whitelist" echo "Mixer emulation $mixemu" echo "VNC TLS support $vnc_tls" echo "VNC SASL support $vnc_sasl" @@ -1866,7 +1918,7 @@ echo >> $config_host_mak echo "CONFIG_QEMU_SHAREDIR=\"$prefix$datasuffix\"" >> $config_host_mak case "$cpu" in - i386|x86_64|alpha|cris|hppa|ia64|m68k|microblaze|mips|mips64|ppc|ppc64|s390|sparc|sparc64) + i386|x86_64|alpha|cris|hppa|ia64|m68k|microblaze|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64) ARCH=$cpu ;; armv4b|armv4l) @@ -1948,6 +2000,7 @@ fi if test "$audio_win_int" = "yes" ; then echo "CONFIG_AUDIO_WIN_INT=y" >> $config_host_mak fi +echo "CONFIG_BDRV_WHITELIST=$block_drv_whitelist" >> $config_host_mak if test "$mixemu" = "yes" ; then echo "CONFIG_MIXEMU=y" >> $config_host_mak fi @@ -1995,6 +2048,9 @@ fi if test "$pipe2" = "yes" ; then echo "CONFIG_PIPE2=y" >> $config_host_mak fi +if test "$accept4" = "yes" ; then + echo "CONFIG_ACCEPT4=y" >> $config_host_mak +fi if test "$splice" = "yes" ; then echo "CONFIG_SPLICE=y" >> $config_host_mak fi @@ -2065,6 +2121,10 @@ fi echo "CONFIG_UNAME_RELEASE=\"$uname_release\"" >> $config_host_mak +if test "$zero_malloc" = "yes" ; then + echo "CONFIG_ZERO_MALLOC=y" >> $config_host_mak +fi + # USB host support case "$usb" in linux) @@ -2080,14 +2140,13 @@ esac tools= if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then - tools="qemu-img\$(EXESUF) $tools" + tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools" if [ "$linux" = "yes" ] ; then - tools="qemu-nbd\$(EXESUF) qemu-io\$(EXESUF) $tools" + 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 - elif test "$mingw32" = "yes" ; then - tools="qemu-io\$(EXESUF) $tools" fi fi echo "TOOLS=$tools" >> $config_host_mak @@ -2095,7 +2154,7 @@ 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" != "Darwin" -a "$targetos" != "SunOS" -a \ `expr "$target_list" : ".*softmmu.*"` != 0 ; then roms="optionrom" fi @@ -2150,7 +2209,7 @@ target_arch2=`echo $target | cut -d '-' -f 1` target_bigendian="no" case "$target_arch2" in - armeb|m68k|microblaze|mips|mipsn32|mips64|ppc|ppcemb|ppc64|ppc64abi32|sh4eb|sparc|sparc64|sparc32plus) + armeb|m68k|microblaze|mips|mipsn32|mips64|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus) target_bigendian=yes ;; esac @@ -2164,14 +2223,26 @@ case "$target" in target_softmmu="yes" ;; ${target_arch2}-linux-user) + if test "$linux" != "yes" ; then + echo "ERROR: Target '$target' is only available on a Linux host" + exit 1 + fi target_user_only="yes" target_linux_user="yes" ;; ${target_arch2}-darwin-user) + if test "$darwin" != "yes" ; then + echo "ERROR: Target '$target' is only available on a Darwin host" + exit 1 + fi target_user_only="yes" target_darwin_user="yes" ;; ${target_arch2}-bsd-user) + if test "$bsd" != "yes" ; then + echo "ERROR: Target '$target' is only available on a BSD host" + exit 1 + fi target_user_only="yes" target_bsd_user="yes" ;; @@ -2189,10 +2260,6 @@ if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$targ mkdir -p $target_dir/nwfpe fi -if test ! -f $target_dir/config-devices.mak ; then - cp $source_path/default-configs/${target}.mak $target_dir/config-devices.mak -fi - # # don't use ln -sf as not all "ln -sf" over write the file/link # @@ -2310,6 +2377,9 @@ case "$target_arch2" in echo "TARGET_ABI32=y" >> $config_target_mak target_phys_bits=64 ;; + s390x) + target_phys_bits=64 + ;; *) echo "Unsupported target CPU" exit 1 @@ -2338,7 +2408,7 @@ case "$target_arch2" in fi esac case "$target_arch2" in - i386|x86_64|ppcemb|ppc|ppc64) + i386|x86_64|ppcemb|ppc|ppc64|s390x) # Make sure the target and host cpus are compatible if test "$kvm" = "yes" -a "$target_softmmu" = "yes" -a \ \( "$target_arch2" = "$cpu" -o \ @@ -2378,7 +2448,7 @@ if test ! -z "$gdb_xml_files" ; then fi case "$target_arch2" in - arm|armeb|m68k|microblaze|mips|mipsel|mipsn32|mipsn32el|mips64|mips64el|ppc|ppc64|ppc64abi32|ppcemb|sparc|sparc64|sparc32plus) + arm|armeb|m68k|microblaze|mips|mipsel|mipsn32|mipsn32el|mips64|mips64el|ppc|ppc64|ppc64abi32|ppcemb|s390x|sparc|sparc64|sparc32plus) echo "CONFIG_SOFTFLOAT=y" >> $config_target_mak ;; *) @@ -2411,6 +2481,8 @@ ldflags="" if test "$ARCH" = "sparc64" ; then cflags="-I\$(SRC_PATH)/tcg/sparc $cflags" +elif test "$ARCH" = "s390x" ; then + cflags="-I\$(SRC_PATH)/tcg/s390 $cflags" else cflags="-I\$(SRC_PATH)/tcg/\$(ARCH) $cflags" fi @@ -2446,7 +2518,7 @@ for i in $ARCH $TARGET_BASE_ARCH ; do ppc*) echo "CONFIG_PPC_DIS=y" >> $config_target_mak ;; - s390) + s390*) echo "CONFIG_S390_DIS=y" >> $config_target_mak ;; sh4) @@ -2580,3 +2652,6 @@ d=libuser mkdir -p $d rm -f $d/Makefile ln -s $source_path/Makefile.user $d/Makefile +if test "$static" = "no" -a "$user_pie" = "yes" ; then + echo "QEMU_CFLAGS+=-fpie" > $d/config.mak +fi