From 714290979abf551d5116346e4fbd3d54eb24bd12 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Mon, 5 Aug 2013 20:16:40 +0100 Subject: configure: disable clang -Wstring-plus-int warning Some versions of clang will warn about adding integers to strings: disas/i386.c:4753:23: error: adding 'char' to a string does not append to the string [-Werror,-Wstring-plus-int] oappend ("%es:" + intel_syntax); ~~~~~~~^~~~~~~~~~~~~~ disas/i386.c:4753:23: note: use array indexing to silence this warning oappend ("%es:" + intel_syntax); ^ & [ ] disas/i386.c uses this idiom to to skip a "%" prefix if using intel rather than AT&T syntax. This seems like a reasonable thing to do, and I don't think anybody contributing to QEMU is likely to believe that '+' is a string concatenation operator in C, so just disable -Wstring-plus-int. Signed-off-by: Peter Maydell Signed-off-by: Michael Tokarev --- configure | 1 + 1 file changed, 1 insertion(+) (limited to 'configure') diff --git a/configure b/configure index 0a55c20252..03157c7378 100755 --- a/configure +++ b/configure @@ -1204,6 +1204,7 @@ gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_ gcc_flags="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags" gcc_flags="-Wendif-labels $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 # enable it for all configure tests. If a configure test failed due # to -Werror this would just silently disable some features, -- cgit v1.2.1 From 1d984a67a95d88f3e708b077dab8adeb47c38c93 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Tue, 27 Aug 2013 15:12:41 +0200 Subject: configure: Don't write .pyc files by default (python -B) When a Python script is run, Python normally writes bytecode into a .pyc file. QEMU's build process uses several Python scripts which are called from configure or make. The generated .pyc files take disk space without being of much use, because those scripts are short, not time critical and only called a few times. Python's option -B disables writing of .pyc files. QEMU now uses "python -B" as default, but it is still possible to choose a different call by passing --python=PYTHON to configure. Signed-off-by: Stefan Weil Signed-off-by: Michael Tokarev --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 03157c7378..391b204c95 100755 --- a/configure +++ b/configure @@ -568,7 +568,7 @@ fi : ${make=${MAKE-make}} : ${install=${INSTALL-install}} -: ${python=${PYTHON-python}} +: ${python=${PYTHON-python -B}} : ${smbd=${SMBD-/usr/sbin/smbd}} # Default objcc to clang if available, otherwise use CC @@ -1349,7 +1349,7 @@ fi # Note that if the Python conditional here evaluates True we will exit # with status 1 which is a shell 'false' value. -if ! "$python" -c 'import sys; sys.exit(sys.version_info < (2,4) or sys.version_info >= (3,))'; then +if ! $python -c 'import sys; sys.exit(sys.version_info < (2,4) or sys.version_info >= (3,))'; then error_exit "Cannot use '$python', Python 2.4 or later is required." \ "Note that Python 3 or later is not yet supported." \ "Use --python=/path/to/python to specify a supported Python." -- cgit v1.2.1 From ca871ec8612cc0e95a02de83a3bdd01514e5733b Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Tue, 27 Aug 2013 21:09:12 +0200 Subject: configure: Remove unneeded redirections of stderr (pkg-config --cflags, --libs) For existing libraries, pkg-config --cflags and pkg-config --libs won't print error messages to stderr, so redirecting stderr is not necessary. Signed-off-by: Stefan Weil Signed-off-by: Michael Tokarev --- configure | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 391b204c95..9748deef45 100755 --- a/configure +++ b/configure @@ -1704,10 +1704,10 @@ if test "$gtk" != "no"; then fi gtk="no" else - gtk_cflags=`$pkg_config --cflags $gtkpackage 2>/dev/null` - gtk_libs=`$pkg_config --libs $gtkpackage 2>/dev/null` - vte_cflags=`$pkg_config --cflags $vtepackage 2>/dev/null` - vte_libs=`$pkg_config --libs $vtepackage 2>/dev/null` + gtk_cflags=`$pkg_config --cflags $gtkpackage` + gtk_libs=`$pkg_config --libs $gtkpackage` + vte_cflags=`$pkg_config --cflags $vtepackage` + vte_libs=`$pkg_config --libs $vtepackage` libs_softmmu="$gtk_libs $vte_libs $libs_softmmu" gtk="yes" fi @@ -1909,8 +1909,8 @@ int main(void) { } EOF if $pkg_config libpng --modversion >/dev/null 2>&1; then - vnc_png_cflags=`$pkg_config libpng --cflags 2> /dev/null` - vnc_png_libs=`$pkg_config libpng --libs 2> /dev/null` + vnc_png_cflags=`$pkg_config libpng --cflags` + vnc_png_libs=`$pkg_config libpng --libs` else vnc_png_cflags="" vnc_png_libs="-lpng" @@ -2241,8 +2241,8 @@ else fi if $pkg_config --atleast-version=$glib_req_ver gthread-2.0 > /dev/null 2>&1 then - glib_cflags=`$pkg_config --cflags gthread-2.0 2>/dev/null` - glib_libs=`$pkg_config --libs gthread-2.0 2>/dev/null` + glib_cflags=`$pkg_config --cflags gthread-2.0` + glib_libs=`$pkg_config --libs gthread-2.0` LIBS="$glib_libs $LIBS" libs_qga="$glib_libs $libs_qga" else @@ -2271,8 +2271,8 @@ if test "$pixman" = "none"; then pixman_cflags= pixman_libs= elif test "$pixman" = "system"; then - pixman_cflags=`$pkg_config --cflags pixman-1 2>/dev/null` - pixman_libs=`$pkg_config --libs pixman-1 2>/dev/null` + pixman_cflags=`$pkg_config --cflags pixman-1` + pixman_libs=`$pkg_config --libs pixman-1` else if test ! -d ${source_path}/pixman/pixman; then error_exit "pixman not present. Your options:" \ @@ -2592,8 +2592,8 @@ fi if test "$glusterfs" != "no" ; then if $pkg_config --atleast-version=3 glusterfs-api >/dev/null 2>&1; then glusterfs="yes" - glusterfs_cflags=`$pkg_config --cflags glusterfs-api 2>/dev/null` - glusterfs_libs=`$pkg_config --libs glusterfs-api 2>/dev/null` + glusterfs_cflags=`$pkg_config --cflags glusterfs-api` + glusterfs_libs=`$pkg_config --libs glusterfs-api` CFLAGS="$CFLAGS $glusterfs_cflags" libs_tools="$glusterfs_libs $libs_tools" libs_softmmu="$glusterfs_libs $libs_softmmu" @@ -2962,8 +2962,8 @@ int main(void) { iscsi_unmap_sync(NULL,0,0,0,NULL,0); return 0; } EOF if $pkg_config --atleast-version=1.7.0 libiscsi --modversion >/dev/null 2>&1; then libiscsi="yes" - libiscsi_cflags=$($pkg_config --cflags libiscsi 2>/dev/null) - libiscsi_libs=$($pkg_config --libs libiscsi 2>/dev/null) + libiscsi_cflags=$($pkg_config --cflags libiscsi) + libiscsi_libs=$($pkg_config --libs libiscsi) CFLAGS="$CFLAGS $libiscsi_cflags" LIBS="$LIBS $libiscsi_libs" elif compile_prog "" "-liscsi" ; then @@ -3085,8 +3085,8 @@ if test "$libusb" != "no" ; then if $pkg_config --atleast-version=1.0.13 libusb-1.0 >/dev/null 2>&1 ; then libusb="yes" usb="libusb" - libusb_cflags=$($pkg_config --cflags libusb-1.0 2>/dev/null) - libusb_libs=$($pkg_config --libs libusb-1.0 2>/dev/null) + libusb_cflags=$($pkg_config --cflags libusb-1.0) + libusb_libs=$($pkg_config --libs libusb-1.0) QEMU_CFLAGS="$QEMU_CFLAGS $libusb_cflags" libs_softmmu="$libs_softmmu $libusb_libs" else @@ -3101,8 +3101,8 @@ fi if test "$usb_redir" != "no" ; then if $pkg_config --atleast-version=0.6 libusbredirparser-0.5 >/dev/null 2>&1 ; then usb_redir="yes" - usb_redir_cflags=$($pkg_config --cflags libusbredirparser-0.5 2>/dev/null) - usb_redir_libs=$($pkg_config --libs libusbredirparser-0.5 2>/dev/null) + usb_redir_cflags=$($pkg_config --cflags libusbredirparser-0.5) + usb_redir_libs=$($pkg_config --libs libusbredirparser-0.5) QEMU_CFLAGS="$QEMU_CFLAGS $usb_redir_cflags" libs_softmmu="$libs_softmmu $usb_redir_libs" else -- cgit v1.2.1 From 65d5d3f92246f056a45e4ddc6f13487de39cd47c Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Tue, 27 Aug 2013 21:09:13 +0200 Subject: configure: Remove unneeded redirections of stderr (pkg-config --exists) Predicate options (--exists, --atleast-version, ...) of pkg-config dont't print error messages to stderr, so redirecting stderr is not necessary. Combining a predicate option with --modversion is not necessary for tests. Instead of testing with --modversion, --exists can be used. Signed-off-by: Stefan Weil Signed-off-by: Michael Tokarev --- configure | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 9748deef45..43c0d21615 100755 --- a/configure +++ b/configure @@ -1470,7 +1470,7 @@ libs_softmmu="$libs_softmmu -lz" # libseccomp check if test "$seccomp" != "no" ; then - if $pkg_config --atleast-version=2.1.0 libseccomp --modversion >/dev/null 2>&1; then + if $pkg_config --atleast-version=2.1.0 libseccomp; then libs_softmmu="$libs_softmmu `$pkg_config --libs libseccomp`" QEMU_CFLAGS="$QEMU_CFLAGS `$pkg_config --cflags libseccomp`" seccomp="yes" @@ -1722,7 +1722,7 @@ if test "`basename $sdl_config`" != sdl-config && ! has ${sdl_config}; then sdl_config=sdl-config fi -if $pkg_config sdl --modversion >/dev/null 2>&1; then +if $pkg_config sdl --exists; then sdlconfig="$pkg_config sdl" _sdlversion=`$sdlconfig --modversion 2>/dev/null | sed 's/[^0-9]//g'` elif has ${sdl_config}; then @@ -1908,7 +1908,7 @@ int main(void) { return png_ptr != 0; } EOF - if $pkg_config libpng --modversion >/dev/null 2>&1; then + if $pkg_config libpng --exists; then vnc_png_cflags=`$pkg_config libpng --cflags` vnc_png_libs=`$pkg_config libpng --libs` else @@ -2187,7 +2187,7 @@ fi ########################################## # curl probe if test "$curl" != "no" ; then - if $pkg_config libcurl --modversion >/dev/null 2>&1; then + if $pkg_config libcurl --exists; then curlconfig="$pkg_config libcurl" else curlconfig=curl-config @@ -2239,8 +2239,7 @@ if test "$mingw32" = yes; then else glib_req_ver=2.12 fi -if $pkg_config --atleast-version=$glib_req_ver gthread-2.0 > /dev/null 2>&1 -then +if $pkg_config --atleast-version=$glib_req_ver gthread-2.0; then glib_cflags=`$pkg_config --cflags gthread-2.0` glib_libs=`$pkg_config --libs gthread-2.0` LIBS="$glib_libs $LIBS" @@ -2371,8 +2370,7 @@ fi # libssh2 probe min_libssh2_version=1.2.8 if test "$libssh2" != "no" ; then - if $pkg_config --atleast-version=$min_libssh2_version libssh2 >/dev/null 2>&1 - then + if $pkg_config --atleast-version=$min_libssh2_version libssh2; then libssh2_cflags=`$pkg_config libssh2 --cflags` libssh2_libs=`$pkg_config libssh2 --libs` libssh2=yes @@ -2590,14 +2588,14 @@ fi ########################################## # glusterfs probe if test "$glusterfs" != "no" ; then - if $pkg_config --atleast-version=3 glusterfs-api >/dev/null 2>&1; then + if $pkg_config --atleast-version=3 glusterfs-api; then glusterfs="yes" glusterfs_cflags=`$pkg_config --cflags glusterfs-api` glusterfs_libs=`$pkg_config --libs glusterfs-api` CFLAGS="$CFLAGS $glusterfs_cflags" libs_tools="$glusterfs_libs $libs_tools" libs_softmmu="$glusterfs_libs $libs_softmmu" - if $pkg_config --atleast-version=5 glusterfs-api >/dev/null 2>&1; then + if $pkg_config --atleast-version=5 glusterfs-api; then glusterfs_discard="yes" fi else @@ -2960,7 +2958,7 @@ if test "$libiscsi" != "no" ; then #include int main(void) { iscsi_unmap_sync(NULL,0,0,0,NULL,0); return 0; } EOF - if $pkg_config --atleast-version=1.7.0 libiscsi --modversion >/dev/null 2>&1; then + if $pkg_config --atleast-version=1.7.0 libiscsi; then libiscsi="yes" libiscsi_cflags=$($pkg_config --cflags libiscsi) libiscsi_libs=$($pkg_config --libs libiscsi) @@ -3030,8 +3028,8 @@ int main(void) { spice_server_new(); return 0; } EOF spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null) spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null) - if $pkg_config --atleast-version=0.12.0 spice-server >/dev/null 2>&1 && \ - $pkg_config --atleast-version=0.12.3 spice-protocol > /dev/null 2>&1 && \ + if $pkg_config --atleast-version=0.12.0 spice-server && \ + $pkg_config --atleast-version=0.12.3 spice-protocol && \ compile_prog "$spice_cflags" "$spice_libs" ; then spice="yes" libs_softmmu="$libs_softmmu $spice_libs" @@ -3066,7 +3064,7 @@ EOF test_cflags="-Werror $test_cflags" fi if test -n "$libtool" && - $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 && \ + $pkg_config --atleast-version=3.12.8 nss && \ compile_prog "$test_cflags" "$libcacard_libs"; then smartcard_nss="yes" QEMU_CFLAGS="$QEMU_CFLAGS $libcacard_cflags" @@ -3082,7 +3080,7 @@ fi # check for libusb if test "$libusb" != "no" ; then - if $pkg_config --atleast-version=1.0.13 libusb-1.0 >/dev/null 2>&1 ; then + if $pkg_config --atleast-version=1.0.13 libusb-1.0; then libusb="yes" usb="libusb" libusb_cflags=$($pkg_config --cflags libusb-1.0) @@ -3099,7 +3097,7 @@ fi # check for usbredirparser for usb network redirection support if test "$usb_redir" != "no" ; then - if $pkg_config --atleast-version=0.6 libusbredirparser-0.5 >/dev/null 2>&1 ; then + if $pkg_config --atleast-version=0.6 libusbredirparser-0.5; then usb_redir="yes" usb_redir_cflags=$($pkg_config --cflags libusbredirparser-0.5) usb_redir_libs=$($pkg_config --libs libusbredirparser-0.5) -- cgit v1.2.1