--- qemu/configure 2018/04/24 19:17:17 1.1.1.17 +++ qemu/configure 2018/04/24 19:34:28 1.1.1.18 @@ -20,6 +20,13 @@ TMPE="${TMPDIR1}/qemu-conf-${RANDOM}-$$- trap "rm -f $TMPC $TMPO $TMPE" EXIT INT QUIT TERM rm -f config.log +# Print a helpful header at the top of config.log +echo "# QEMU configure log $(date)" >> config.log +printf "# Configured with:" >> config.log +printf " '%s'" "$0" "$@" >> config.log +echo >> config.log +echo "#" >> config.log + compile_object() { echo $cc $QEMU_CFLAGS -c -o $TMPO $TMPC >> config.log $cc $QEMU_CFLAGS -c -o $TMPO $TMPC >> config.log 2>&1 @@ -34,8 +41,8 @@ compile_prog() { # symbolically link $1 to $2. Portable version of "ln -sf". symlink() { - rm -f $2 - ln -s $1 $2 + rm -rf "$2" + ln -s "$1" "$2" } # check whether a command is available to this shell (may be either an @@ -93,6 +100,7 @@ audio_pt_int="" audio_win_int="" cc_i386=i386-pc-linux-gnu-gcc libs_qga="" +debug_info="yes" target_list="" @@ -116,6 +124,7 @@ docs="" fdt="" nptl="" sdl="" +virtfs="" vnc="yes" sparse="no" uuid="" @@ -128,6 +137,7 @@ vnc_thread="no" xen="" xen_ctrl_version="" linux_aio="" +cap_ng="" attr="" libattr="" xfs="" @@ -145,8 +155,8 @@ mingw32="no" EXESUF="" prefix="/usr/local" mandir="\${prefix}/share/man" -datadir="\${prefix}/share/qemu" -docdir="\${prefix}/share/doc/qemu" +datadir="\${prefix}/share" +qemu_docdir="\${prefix}/share/doc/qemu" bindir="\${prefix}/bin" libdir="\${prefix}/lib" includedir="\${prefix}/include" @@ -163,7 +173,6 @@ profiler="no" cocoa="no" softmmu="yes" linux_user="no" -darwin_user="no" bsd_user="no" guest_base="" uname_release="" @@ -171,7 +180,6 @@ mixemu="no" aix="no" blobs="yes" pkgversion="" -check_utests="" pie="" zero_malloc="" trace_backend="nop" @@ -185,6 +193,7 @@ opengl="" zlib="yes" guest_agent="yes" libiscsi="" +coroutine="" # parse CC options first for opt do @@ -202,6 +211,10 @@ for opt do ;; --extra-ldflags=*) LDFLAGS="$optarg $LDFLAGS" ;; + --enable-debug-info) debug_info="yes" + ;; + --disable-debug-info) debug_info="no" + ;; --sparc_cpu=*) sparc_cpu="$optarg" case $sparc_cpu in @@ -221,7 +234,7 @@ for opt do done # OS specific # Using uname is really, really broken. Once we have the right set of checks -# we can eliminate it's usage altogether +# we can eliminate its usage altogether. cc="${CC-${cross_prefix}gcc}" ar="${AR-${cross_prefix}ar}" @@ -230,18 +243,24 @@ ld="${LD-${cross_prefix}ld}" libtool="${LIBTOOL-${cross_prefix}libtool}" strip="${STRIP-${cross_prefix}strip}" windres="${WINDRES-${cross_prefix}windres}" -pkg_config="${PKG_CONFIG-${cross_prefix}pkg-config}" +pkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}" +query_pkg_config() { + "${pkg_config_exe}" ${QEMU_PKG_CONFIG_FLAGS} "$@" +} +pkg_config=query_pkg_config sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}" # default flags for all hosts QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS" -CFLAGS="-g $CFLAGS" QEMU_CFLAGS="-Wall -Wundef -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="-D_FORTIFY_SOURCE=2 $QEMU_CFLAGS" QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/fpu" -LDFLAGS="-g $LDFLAGS" +if test "$debug_info" = "yes"; then + CFLAGS="-g $CFLAGS" + LDFLAGS="-g $LDFLAGS" +fi # make source path absolute source_path=`cd "$source_path"; pwd` @@ -249,7 +268,7 @@ source_path=`cd "$source_path"; pwd` check_define() { cat > $TMPC < $TMPC << EOF +int main(void) { return 0; } +EOF + if compile_prog "" "-liberty" ; then + LIBS="-liberty $LIBS" + fi + prefix="c:/Program Files/QEMU" mandir="\${prefix}" datadir="\${prefix}" - docdir="\${prefix}" + qemu_docdir="\${prefix}" bindir="\${prefix}" sysconfdir="\${prefix}" confsuffix="" - guest_agent="no" + libs_qga="-lws2_32 -lwinmm -lpowrprof $libs_qga" fi werror="" @@ -541,6 +562,10 @@ for opt do ;; --extra-ldflags=*) ;; + --enable-debug-info) + ;; + --disable-debug-info) + ;; --cpu=*) ;; --target-list=*) target_list="$optarg" @@ -554,6 +579,7 @@ for opt do --static) static="yes" LDFLAGS="-static $LDFLAGS" + QEMU_PKG_CONFIG_FLAGS="--static $QEMU_PKG_CONFIG_FLAGS" ;; --mandir=*) mandir="$optarg" ;; @@ -565,7 +591,9 @@ for opt do ;; --datadir=*) datadir="$optarg" ;; - --docdir=*) docdir="$optarg" + --with-confsuffix=*) confsuffix="$optarg" + ;; + --docdir=*) qemu_docdir="$optarg" ;; --sysconfdir=*) sysconfdir="$optarg" ;; @@ -581,6 +609,10 @@ for opt do ;; --enable-sdl) sdl="yes" ;; + --disable-virtfs) virtfs="no" + ;; + --enable-virtfs) virtfs="yes" + ;; --disable-vnc) vnc="no" ;; --enable-vnc) vnc="yes" @@ -668,6 +700,10 @@ for opt do ;; --enable-tcg-interpreter) tcg_interpreter="yes" ;; + --disable-cap-ng) cap_ng="no" + ;; + --enable-cap-ng) cap_ng="yes" + ;; --disable-spice) spice="no" ;; --enable-spice) spice="yes" @@ -678,6 +714,8 @@ for opt do ;; --enable-profiler) profiler="yes" ;; + --disable-cocoa) cocoa="no" + ;; --enable-cocoa) cocoa="yes" ; sdl="no" ; @@ -690,17 +728,12 @@ for opt do --disable-user) linux_user="no" ; bsd_user="no" ; - darwin_user="no" ;; --enable-user) ;; --disable-linux-user) linux_user="no" ;; --enable-linux-user) linux_user="yes" ;; - --disable-darwin-user) darwin_user="no" - ;; - --enable-darwin-user) darwin_user="yes" - ;; --disable-bsd-user) bsd_user="no" ;; --enable-bsd-user) bsd_user="yes" @@ -733,10 +766,6 @@ for opt do ;; --enable-fdt) fdt="yes" ;; - --disable-check-utests) check_utests="no" - ;; - --enable-check-utests) check_utests="yes" - ;; --disable-nptl) nptl="no" ;; --enable-nptl) nptl="yes" @@ -755,6 +784,8 @@ for opt do ;; --with-pkgversion=*) pkgversion=" ($optarg)" ;; + --with-coroutine=*) coroutine="$optarg" + ;; --disable-docs) docs="no" ;; --enable-docs) docs="yes" @@ -771,6 +802,10 @@ for opt do ;; --enable-rbd) rbd="yes" ;; + --disable-xfsctl) xfs="no" + ;; + --enable-xfsctl) xfs="yes" + ;; --disable-smartcard) smartcard="no" ;; --enable-smartcard) smartcard="yes" @@ -927,10 +962,6 @@ unicore32-linux-user \ s390x-linux-user \ " fi -# the following are Darwin specific -if [ "$darwin_user" = "yes" ] ; then - default_target_list="$default_target_list i386-darwin-user ppc-darwin-user " -fi # the following are BSD specific if [ "$bsd_user" = "yes" ] ; then default_target_list="${default_target_list}\ @@ -971,10 +1002,11 @@ echo " --python=PYTHON use spe echo " --smbd=SMBD use specified smbd [$smbd]" echo " --static enable static build [$static]" echo " --mandir=PATH install man pages in PATH" -echo " --datadir=PATH install firmware in PATH" -echo " --docdir=PATH install documentation in PATH" +echo " --datadir=PATH install firmware in PATH$confsuffix" +echo " --docdir=PATH install documentation in PATH$confsuffix" echo " --bindir=PATH install binaries in PATH" -echo " --sysconfdir=PATH install config in PATH/qemu" +echo " --sysconfdir=PATH install config in PATH$confsuffix" +echo " --with-confsuffix=SUFFIX suffix for QEMU data inside datadir and sysconfdir [$confsuffix]" echo " --enable-debug-tcg enable TCG debugging" echo " --disable-debug-tcg disable TCG debugging (default)" echo " --enable-debug enable common debug build options" @@ -984,9 +1016,12 @@ echo " --disable-strip disable echo " --disable-werror disable compilation abort on warning" echo " --disable-sdl disable SDL" echo " --enable-sdl enable SDL" +echo " --disable-virtfs disable VirtFS" +echo " --enable-virtfs enable VirtFS" echo " --disable-vnc disable VNC" echo " --enable-vnc enable VNC" -echo " --enable-cocoa enable COCOA (Mac OS X only)" +echo " --disable-cocoa disable Cocoa (Mac OS X only)" +echo " --enable-cocoa enable Cocoa (default on Mac OS X)" echo " --audio-drv-list=LIST set audio drivers list:" echo " Available drivers: $audio_possible_drivers" echo " --audio-card-list=LIST set list of emulated audio cards [$audio_card_list]" @@ -1014,8 +1049,6 @@ echo " --disable-curl disable echo " --enable-curl enable curl connectivity" echo " --disable-fdt disable fdt device tree" echo " --enable-fdt enable fdt device tree" -echo " --disable-check-utests disable check unit-tests" -echo " --enable-check-utests enable check unit-tests" echo " --disable-bluez disable bluez stack connectivity" echo " --enable-bluez enable bluez stack connectivity" echo " --disable-slirp disable SLIRP userspace network connectivity" @@ -1030,8 +1063,6 @@ echo " --enable-user enable echo " --disable-user disable all user emulation targets" echo " --enable-linux-user enable all linux usermode emulation targets" echo " --disable-linux-user disable all linux usermode emulation targets" -echo " --enable-darwin-user enable all darwin usermode emulation targets" -echo " --disable-darwin-user disable all darwin usermode emulation targets" echo " --enable-bsd-user enable all BSD usermode emulation targets" echo " --disable-bsd-user disable all BSD usermode emulation targets" echo " --enable-guest-base enable GUEST_BASE support for usermode" @@ -1051,6 +1082,8 @@ echo " --disable-vde disable echo " --enable-vde enable support for vde network" echo " --disable-linux-aio disable Linux AIO support" echo " --enable-linux-aio enable Linux AIO support" +echo " --disable-cap-ng disable libcap-ng support" +echo " --enable-cap-ng enable libcap-ng support" echo " --disable-attr disables attr and xattr support" echo " --enable-attr enable attr and xattr support" echo " --disable-blobs disable installing provided firmware blobs" @@ -1059,7 +1092,7 @@ echo " --disable-docs disable echo " --disable-vhost-net disable vhost-net acceleration support" echo " --enable-vhost-net enable vhost-net acceleration support" echo " --enable-trace-backend=B Set trace backend" -echo " Available backends:" $("$source_path"/scripts/tracetool --list-backends) +echo " Available backends:" $($python "$source_path"/scripts/tracetool.py --list-backends) echo " --with-trace-file=NAME Full PATH,NAME of file to store traces" echo " Default:trace-" echo " --disable-spice disable spice" @@ -1075,14 +1108,28 @@ echo " --disable-usb-redir disable echo " --enable-usb-redir enable usb network redirection support" echo " --disable-guest-agent disable building of the QEMU Guest Agent" echo " --enable-guest-agent enable building of the QEMU Guest Agent" +echo " --with-coroutine=BACKEND coroutine backend. Supported options:" +echo " gthread, ucontext, sigaltstack, windows" echo "" echo "NOTE: The object files are built at the place where configure is launched" exit 1 fi +# Now we have handled --enable-tcg-interpreter and know we're not just +# printing the help message, bail out if the host CPU isn't supported. +if test "$ARCH" = "unknown"; then + if test "$tcg_interpreter" = "yes" ; then + echo "Unsupported CPU = $cpu, will use TCG with TCI (experimental)" + ARCH=tci + else + echo "Unsupported CPU = $cpu, try --enable-tcg-interpreter" + exit 1 + fi +fi + # check that the C compiler works. cat > $TMPC < $TMPC << EOF int main(void) { return 0; } EOF for flag in $gcc_flags; do - if compile_prog "$flag -Werror" "" ; then + if compile_prog "-Werror $flag" "" ; then QEMU_CFLAGS="$QEMU_CFLAGS $flag" fi done @@ -1185,13 +1232,18 @@ if test "$solaris" = "yes" ; then fi fi -if test "$guest_agent" != "no" ; then - if has $python; then - : - else - echo "Python not found. Use --python=/path/to/python" - exit 1 - fi +if ! has $python; then + echo "Python not found. Use --python=/path/to/python" + exit 1 +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 + echo "Cannot use '$python', Python 2.4 or later is required." + echo "Note that Python 3 or later is not yet supported." + echo "Use --python=/path/to/python to specify a supported Python." + exit 1 fi if test -z "$target_list" ; then @@ -1243,24 +1295,19 @@ else # if cross compiling, cannot launch a program, so make a static guess case "$cpu" in - armv4b|hppa|m68k|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64) + arm) + # ARM can be either way; ask the compiler which one we are + if check_define __ARMEB__; then + bigendian=yes + fi + ;; + hppa|m68k|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64) bigendian=yes ;; esac fi -# host long bits test, actually a pointer size test -cat > $TMPC << EOF -int sizeof_pointer_is_8[sizeof(void *) == 8 ? 1 : -1]; -EOF -if compile_object; then -hostlongbits=64 -else -hostlongbits=32 -fi - - ########################################## # NPTL probe @@ -1268,11 +1315,11 @@ if test "$nptl" != "no" ; then cat > $TMPC < #include -void foo() -{ +int main(void) { #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT) #error bork #endif + return 0; } EOF @@ -1311,10 +1358,55 @@ fi if test "$xen" != "no" ; then xen_libs="-lxenstore -lxenctrl -lxenguest" - # Xen unstable + # First we test whether Xen headers and libraries are available. + # If no, we are done and there is no Xen support. + # If yes, more tests are run to detect the Xen version. + + # Xen (any) cat > $TMPC < #include +int main(void) { + return 0; +} +EOF + if ! compile_prog "" "$xen_libs" ; then + # Xen not found + if test "$xen" = "yes" ; then + feature_not_found "xen" + fi + xen=no + + # Xen unstable + elif ( + cat > $TMPC < +#include +#include +#include +#if !defined(HVM_MAX_VCPUS) +# error HVM_MAX_VCPUS not defined +#endif +int main(void) { + xc_interface *xc; + xs_daemon_open(); + xc = xc_interface_open(0, 0, 0); + xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); + xc_gnttab_open(NULL, 0); + xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); + xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); + return 0; +} +EOF + compile_prog "" "$xen_libs" + ) ; then + xen_ctrl_version=420 + xen=yes + + elif ( + cat > $TMPC < +#include #include #include #if !defined(HVM_MAX_VCPUS) @@ -1330,7 +1422,8 @@ int main(void) { return 0; } EOF - if compile_prog "" "$xen_libs" ; then + compile_prog "" "$xen_libs" + ) ; then xen_ctrl_version=410 xen=yes @@ -1401,10 +1494,10 @@ EOF xen_ctrl_version=330 xen=yes - # Xen not found or unsupported + # Xen version unsupported else if test "$xen" = "yes" ; then - feature_not_found "xen" + feature_not_found "xen (unsupported version)" fi xen=no fi @@ -1417,8 +1510,8 @@ fi ########################################## # pkg-config probe -if ! has $pkg_config; then - echo "Error: pkg-config binary '$pkg_config' not found" +if ! has "$pkg_config_exe"; then + echo "Error: pkg-config binary '$pkg_config_exe' not found" exit 1 fi @@ -1522,9 +1615,6 @@ EOF if compile_prog "$sdl_cflags" "$sdl_libs" ; then sdl_libs="$sdl_libs -lX11" fi - if test "$mingw32" = "yes" ; then - sdl_libs="`echo $sdl_libs | sed s/-mwindows//g` -mconsole" - fi libs_softmmu="$sdl_libs $libs_softmmu" fi @@ -1667,6 +1757,7 @@ fi # xfsctl() probe, used for raw-posix if test "$xfs" != "no" ; then cat > $TMPC << EOF +#include /* NULL */ #include int main(void) { @@ -1710,6 +1801,29 @@ EOF fi ########################################## +# libcap-ng library probe +if test "$cap_ng" != "no" ; then + cap_libs="-lcap-ng" + cat > $TMPC << EOF +#include +int main(void) +{ + capng_capability_to_name(CAPNG_EFFECTIVE); + return 0; +} +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" + fi + cap_ng=no + fi +fi + +########################################## # Sound support libraries probe audio_drv_probe() @@ -1762,9 +1876,9 @@ for drv in $audio_drv_list; do ;; pa) - audio_drv_probe $drv pulse/simple.h "-lpulse-simple -lpulse" \ - "pa_simple *s = 0; pa_simple_free(s); return 0;" - libs_softmmu="-lpulse -lpulse-simple $libs_softmmu" + audio_drv_probe $drv pulse/mainloop.h "-lpulse" \ + "pa_mainloop *m = 0; pa_mainloop_free (m); return 0;" + libs_softmmu="-lpulse $libs_softmmu" audio_pt_int="yes" ;; @@ -1835,10 +1949,11 @@ if test "$curses" != "no" ; then curses_found=no cat > $TMPC << EOF #include -#ifdef __OpenBSD__ -#define resize_term resizeterm -#endif -int main(void) { resize_term(0, 0); return curses_version(); } +int main(void) { + const char *s = curses_version(); + resize_term(0, 0); + return s != 0; +} EOF for curses_lib in $curses_list; do if compile_prog "" "$curses_lib" ; then @@ -1886,26 +2001,6 @@ EOF fi # test "$curl" ########################################## -# check framework probe - -if test "$check_utests" != "no" ; then - cat > $TMPC << EOF -#include -int main(void) { suite_create("qemu test"); return 0; } -EOF - check_libs=`$pkg_config --libs check 2>/dev/null` - if compile_prog "" $check_libs ; then - check_utests=yes - libs_tools="$check_libs $libs_tools" - else - if test "$check_utests" = "yes" ; then - feature_not_found "check" - fi - check_utests=no - fi -fi # test "$check_utests" - -########################################## # bluez support probe if test "$bluez" != "no" ; then cat > $TMPC << EOF @@ -1927,24 +2022,53 @@ fi ########################################## # glib support probe -if $pkg_config --modversion gthread-2.0 > /dev/null 2>&1 ; then + +if test "$mingw32" = yes; then + # g_poll is required in order to integrate with the glib main loop. + glib_req_ver=2.20 +else + glib_req_ver=2.12 +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` LIBS="$glib_libs $LIBS" libs_qga="$glib_libs $libs_qga" else - echo "glib-2.0 required to compile QEMU" + echo "glib-$glib_req_ver required to compile QEMU" exit 1 fi ########################################## +# libcap probe + +if test "$cap" != "no" ; then + cat > $TMPC < +#include +int main(void) { cap_t caps; caps = cap_init(); } +EOF + if compile_prog "" "-lcap" ; then + cap=yes + else + cap=no + fi +fi + +########################################## # pthread probe PTHREADLIBS_LIST="-pthread -lpthread -lpthreadGC2" pthread=no cat > $TMPC << EOF #include -int main(void) { pthread_create(0,0,0,0); return 0; } +static void *f(void *p) { return NULL; } +int main(void) { + pthread_t thread; + pthread_create(&thread, 0, f, 0); + return 0; +} EOF if compile_prog "" "" ; then pthread=yes @@ -1952,7 +2076,16 @@ else for pthread_lib in $PTHREADLIBS_LIST; do if compile_prog "" "$pthread_lib" ; then pthread=yes - LIBS="$pthread_lib $LIBS" + found=no + for lib_entry in $LIBS; do + if test "$lib_entry" = "$pthread_lib"; then + found=yes + break + fi + done + if test "$found" = "no"; then + LIBS="$pthread_lib $LIBS" + fi break fi done @@ -2048,7 +2181,7 @@ cat > $TMPC < #include #include -int main(void) { struct iovec iov; return 0; } +int main(void) { return sizeof(struct iovec); } EOF iovec=no if compile_prog "" "" ; then @@ -2061,7 +2194,7 @@ cat > $TMPC < #include #include -int main(void) { preadv; } +int main(void) { return preadv == preadv; } EOF preadv=no if compile_prog "" "" ; then @@ -2094,7 +2227,7 @@ if test "$opengl" != "no" ; then #include #include #include -int main(void) { GL_VERSION; return 0; } +int main(void) { return GL_VERSION != 0; } EOF if compile_prog "" "-lGL" ; then opengl=yes @@ -2225,7 +2358,7 @@ cat > $TMPC << EOF int main(void) { - int len, fd; + int len, fd = 0; len = tee(STDIN_FILENO, STDOUT_FILENO, INT_MAX, SPLICE_F_NONBLOCK); splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE); return 0; @@ -2239,7 +2372,6 @@ fi # signalfd probe signalfd="no" cat > $TMPC << EOF -#define _GNU_SOURCE #include #include #include @@ -2257,8 +2389,7 @@ cat > $TMPC << EOF int main(void) { - int efd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); - return 0; + return eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); } EOF if compile_prog "" "" ; then @@ -2276,7 +2407,7 @@ int main(void) return 0; } EOF -if compile_prog "$ARCH_CFLAGS" "" ; then +if compile_prog "" "" ; then fallocate=yes fi @@ -2291,7 +2422,7 @@ int main(void) return 0; } EOF -if compile_prog "$ARCH_CFLAGS" "" ; then +if compile_prog "" "" ; then sync_file_range=yes fi @@ -2308,7 +2439,7 @@ int main(void) return 0; } EOF -if compile_prog "$ARCH_CFLAGS" "" ; then +if compile_prog "" "" ; then fiemap=yes fi @@ -2338,7 +2469,7 @@ int main(void) return 0; } EOF -if compile_prog "$ARCH_CFLAGS" "" ; then +if compile_prog "" "" ; then epoll=yes fi @@ -2358,11 +2489,10 @@ int main(void) * warning but not an error, and will proceed to fail the * qemu compile where we compile with -Werror.) */ - epoll_create1; - return 0; + return epoll_create1 == epoll_create1; } EOF -if compile_prog "$ARCH_CFLAGS" "" ; then +if compile_prog "" "" ; then epoll_create1=yes fi @@ -2376,7 +2506,7 @@ int main(void) return 0; } EOF -if compile_prog "$ARCH_CFLAGS" "" ; then +if compile_prog "" "" ; then epoll_pwait=yes fi @@ -2416,10 +2546,13 @@ fi ########################################## # Do we have libiscsi +# We check for iscsi_unmap_sync() to make sure we have a +# recent enough version of libiscsi. if test "$libiscsi" != "no" ; then cat > $TMPC << EOF +#include #include -int main(void) { iscsi_create_context(""); return 0; } +int main(void) { iscsi_unmap_sync(NULL,0,0,0,NULL,0); return 0; } EOF if compile_prog "-Werror" "-liscsi" ; then libiscsi="yes" @@ -2438,7 +2571,7 @@ fi cat > $TMPC < #include -int main(void) { clockid_t id; return clock_gettime(id, NULL); } +int main(void) { return clock_gettime(CLOCK_REALTIME, NULL); } EOF if compile_prog "" "" ; then @@ -2453,17 +2586,6 @@ if test "$darwin" != "yes" -a "$mingw32" fi ########################################## -# check if the compiler defines offsetof - -need_offsetof=yes -cat > $TMPC << EOF -#include -int main(void) { struct s { int f; }; return offsetof(struct s, f); } -EOF -if compile_prog "" "" ; then - need_offsetof=no -fi - # spice probe if test "$spice" != "no" ; then cat > $TMPC << EOF @@ -2472,7 +2594,8 @@ int main(void) { spice_server_new(); ret 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.6.0 spice-server >/dev/null 2>&1 && \ + if $pkg_config --atleast-version=0.8.2 spice-server >/dev/null 2>&1 && \ + $pkg_config --atleast-version=0.8.1 spice-protocol > /dev/null 2>&1 && \ compile_prog "$spice_cflags" "$spice_libs" ; then spice="yes" libs_softmmu="$libs_softmmu $spice_libs" @@ -2491,13 +2614,18 @@ if test "$smartcard" != "no" ; then smartcard_cflags="" # TODO - what's the minimal nss version we support? if test "$smartcard_nss" != "no"; then - if $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 ; then + cat > $TMPC << EOF +#include +int main(void) { PK11_FreeSlot(0); return 0; } +EOF + smartcard_cflags="-I\$(SRC_PATH)/libcacard" + libcacard_libs="$($pkg_config --libs nss 2>/dev/null) $glib_libs" + libcacard_cflags="$($pkg_config --cflags nss 2>/dev/null) $glib_cflags" + if $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 && \ + compile_prog "$smartcard_cflags $libcacard_cflags" "$libcacard_libs"; then smartcard_nss="yes" - smartcard_cflags="-I\$(SRC_PATH)/libcacard" - libcacard_libs=$($pkg_config --libs nss 2>/dev/null) - libcacard_cflags=$($pkg_config --cflags nss 2>/dev/null) QEMU_CFLAGS="$QEMU_CFLAGS $smartcard_cflags $libcacard_cflags" - LIBS="$libcacard_libs $LIBS" + libs_softmmu="$libcacard_libs $libs_softmmu" else if test "$smartcard_nss" = "yes"; then feature_not_found "nss" @@ -2512,7 +2640,7 @@ fi # check for usbredirparser for usb network redirection support if test "$usb_redir" != "no" ; then - if $pkg_config libusbredirparser >/dev/null 2>&1 ; then + if $pkg_config --atleast-version=0.3.4 libusbredirparser >/dev/null 2>&1 ; then usb_redir="yes" usb_redir_cflags=$($pkg_config --cflags libusbredirparser 2>/dev/null) usb_redir_libs=$($pkg_config --libs libusbredirparser 2>/dev/null) @@ -2538,7 +2666,7 @@ int main(void) { #if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0 return fdatasync(0); #else -#abort Not supported +#error Not supported #endif } EOF @@ -2576,7 +2704,7 @@ fi ########################################## # check if trace backend exists -sh "$source_path/scripts/tracetool" "--$trace_backend" --check-backend > /dev/null 2> /dev/null +$python "$source_path/scripts/tracetool.py" "--backend=$trace_backend" --check-backend > /dev/null 2> /dev/null if test "$?" -ne 0 ; then echo echo "Error: invalid trace backend" @@ -2594,7 +2722,8 @@ if test "$trace_backend" = "ust"; then int main(void) { return 0; } EOF if compile_prog "" "" ; then - LIBS="-lust $LIBS" + LIBS="-lust -lurcu-bp $LIBS" + libs_qga="-lust -lurcu-bp $libs_qga" else echo echo "Error: Trace backend 'ust' missing libust header files" @@ -2642,17 +2771,38 @@ EOF fi ########################################## -# check if we have makecontext +# check and set a backend for coroutine -ucontext_coroutine=no -if test "$darwin" != "yes"; then - cat > $TMPC << EOF +# default is ucontext, but always fallback to gthread +# windows autodetected by make +if test "$coroutine" = "" -o "$coroutine" = "ucontext"; then + if test "$darwin" != "yes"; then + cat > $TMPC << EOF #include -int main(void) { makecontext(0, 0, 0); } +#ifdef __stub_makecontext +#error Ignoring glibc stub makecontext which will always fail +#endif +int main(void) { makecontext(0, 0, 0); return 0; } EOF - if compile_prog "" "" ; then - ucontext_coroutine=yes + if compile_prog "" "" ; then + coroutine_backend=ucontext + else + coroutine_backend=gthread + fi + else + echo "Silently falling back into gthread backend under darwin" fi +elif test "$coroutine" = "gthread" ; then + coroutine_backend=gthread +elif test "$coroutine" = "windows" ; then + coroutine_backend=windows +elif test "$coroutine" = "sigaltstack" ; then + coroutine_backend=sigaltstack +else + echo + echo "Error: unknown coroutine backend $coroutine" + echo + exit 1 fi ########################################## @@ -2661,7 +2811,11 @@ fi open_by_hande_at=no cat > $TMPC << EOF #include -int main(void) { struct file_handle fh; open_by_handle_at(0, &fh, 0); } +#if !defined(AT_EMPTY_PATH) +# error missing definition +#else +int main(void) { struct file_handle fh; return open_by_handle_at(0, &fh, 0); } +#endif EOF if compile_prog "" "" ; then open_by_handle_at=yes @@ -2674,12 +2828,28 @@ linux_magic_h=no cat > $TMPC << EOF #include int main(void) { + return 0; } EOF if compile_prog "" "" ; then linux_magic_h=yes fi +######################################## +# check if environ is declared + +has_environ=no +cat > $TMPC << EOF +#include +int main(void) { + environ = environ; + return 0; +} +EOF +if compile_prog "" "" ; then + has_environ=yes +fi + ########################################## # End of CC checks # After here, no more $cc or $ld runs @@ -2721,6 +2891,13 @@ if test "$solaris" = "no" ; then fi fi +# test if pod2man has --utf8 option +if pod2man --help | grep -q utf8; then + POD2MAN="pod2man --utf8" +else + POD2MAN="pod2man" +fi + # Use ASLR, no-SEH and DEP if available if test "$mingw32" = "yes" ; then for flag in --dynamicbase --no-seh --nxcompat; do @@ -2730,20 +2907,29 @@ if test "$mingw32" = "yes" ; then done fi -confdir=$sysconfdir$confsuffix +qemu_confdir=$sysconfdir$confsuffix +qemu_datadir=$datadir$confsuffix tools= if test "$softmmu" = yes ; then tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools" + if test "$virtfs" != no ; then + if test "$cap" = yes && test "$linux" = yes && test "$attr" = yes ; then + virtfs=yes + tools="$tools fsdev/virtfs-proxy-helper\$(EXESUF)" + else + if test "$virtfs" = yes; then + echo "VirtFS is supported only on Linux and requires libcap-devel and libattr-devel" + exit 1 + fi + virtfs=no + fi + fi if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then tools="qemu-nbd\$(EXESUF) $tools" if [ "$guest_agent" = "yes" ]; then tools="qemu-ga\$(EXESUF) $tools" fi - if [ "$check_utests" = "yes" ]; then - checks="check-qint check-qstring check-qdict check-qlist" - checks="check-qfloat check-qjson test-coroutine $checks" - fi fi fi @@ -2759,7 +2945,7 @@ if test "$cpu" = "ppc64" -a "$targetos" fi echo "Install prefix $prefix" -echo "BIOS directory `eval echo $datadir`" +echo "BIOS directory `eval echo $qemu_datadir`" echo "binary directory `eval echo $bindir`" echo "library directory `eval echo $libdir`" echo "include directory `eval echo $includedir`" @@ -2797,12 +2983,12 @@ fi echo "SDL support $sdl" echo "curses support $curses" echo "curl support $curl" -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 "VirtFS support $virtfs" echo "VNC support $vnc" if test "$vnc" = "yes" ; then echo "VNC TLS support $vnc_tls" @@ -2835,6 +3021,7 @@ echo "fdatasync $fdatasync" echo "madvise $madvise" echo "posix_madvise $posix_madvise" echo "uuid support $uuid" +echo "libcap-ng support $cap_ng" echo "vhost-net support $vhost_net" echo "Trace backend $trace_backend" echo "Trace output file $trace_file-" @@ -2846,6 +3033,7 @@ echo "usb net redir $usb_redir" echo "OpenGL support $opengl" echo "libiscsi support $libiscsi" echo "build guest agent $guest_agent" +echo "coroutine backend $coroutine_backend" if test "$sdl_too_old" = "yes"; then echo "-> Your SDL version is too old - please upgrade to have SDL support" @@ -2865,28 +3053,13 @@ echo "bindir=$bindir" >> $config_host_ma echo "libdir=$libdir" >> $config_host_mak echo "includedir=$includedir" >> $config_host_mak echo "mandir=$mandir" >> $config_host_mak -echo "datadir=$datadir" >> $config_host_mak echo "sysconfdir=$sysconfdir" >> $config_host_mak -echo "docdir=$docdir" >> $config_host_mak -echo "confdir=$confdir" >> $config_host_mak +echo "qemu_confdir=$qemu_confdir" >> $config_host_mak +echo "qemu_datadir=$qemu_datadir" >> $config_host_mak +echo "qemu_docdir=$qemu_docdir" >> $config_host_mak +echo "libexecdir=\${prefix}/libexec" >> $config_host_mak +echo "CONFIG_QEMU_HELPERDIR=\"$prefix/libexec\"" >> $config_host_mak -case "$cpu" in - i386|x86_64|alpha|cris|hppa|ia64|lm32|m68k|microblaze|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64|unicore32) - ARCH=$cpu - ;; - armv4b|armv4l) - ARCH=arm - ;; - *) - if test "$tcg_interpreter" = "yes" ; then - echo "Unsupported CPU = $cpu, will use TCG with TCI (experimental)" - ARCH=tci - else - echo "Unsupported CPU = $cpu, try --enable-tcg-interpreter" - exit 1 - fi - ;; -esac echo "ARCH=$ARCH" >> $config_host_mak if test "$debug_tcg" = "yes" ; then echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak @@ -2903,7 +3076,6 @@ fi if test "$bigendian" = "yes" ; then echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak fi -echo "HOST_LONG_BITS=$hostlongbits" >> $config_host_mak if test "$mingw32" = "yes" ; then echo "CONFIG_WIN32=y" >> $config_host_mak rc_version=`cat $source_path/VERSION` @@ -2955,13 +3127,16 @@ fi if test "$vde" = "yes" ; then echo "CONFIG_VDE=y" >> $config_host_mak fi +if test "$cap_ng" = "yes" ; then + echo "CONFIG_LIBCAP=y" >> $config_host_mak +fi for card in $audio_card_list; do - def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'` + def=CONFIG_`echo $card | LC_ALL=C tr '[a-z]' '[A-Z]'` echo "$def=y" >> $config_host_mak done echo "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak for drv in $audio_drv_list; do - def=CONFIG_`echo $drv | tr '[:lower:]' '[:upper:]'` + def=CONFIG_`echo $drv | LC_ALL=C tr '[a-z]' '[A-Z]'` echo "$def=y" >> $config_host_mak if test "$drv" = "fmod"; then echo "FMOD_CFLAGS=-I$fmod_inc" >> $config_host_mak @@ -3102,10 +3277,8 @@ fi if test "$libattr" = "yes" ; then echo "CONFIG_LIBATTR=y" >> $config_host_mak fi -if test "$linux" = "yes" ; then - if test "$attr" = "yes" ; then - echo "CONFIG_VIRTFS=y" >> $config_host_mak - fi +if test "$virtfs" = "yes" ; then + echo "CONFIG_VIRTFS=y" >> $config_host_mak fi if test "$blobs" = "yes" ; then echo "INSTALL_BLOBS=yes" >> $config_host_mak @@ -3125,9 +3298,6 @@ fi if test "$tcg_interpreter" = "yes" ; then echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak fi -if test "$need_offsetof" = "yes" ; then - echo "CONFIG_NEED_OFFSETOF=y" >> $config_host_mak -fi if test "$fdatasync" = "yes" ; then echo "CONFIG_FDATASYNC=y" >> $config_host_mak fi @@ -3148,6 +3318,8 @@ fi if test "$smartcard_nss" = "yes" ; then echo "CONFIG_SMARTCARD_NSS=y" >> $config_host_mak + echo "libcacard_libs=$libcacard_libs" >> $config_host_mak + echo "libcacard_cflags=$libcacard_cflags" >> $config_host_mak fi if test "$usb_redir" = "yes" ; then @@ -3176,8 +3348,10 @@ if test "$rbd" = "yes" ; then echo "CONFIG_RBD=y" >> $config_host_mak fi -if test "$ucontext_coroutine" = "yes" ; then +if test "$coroutine_backend" = "ucontext" ; then echo "CONFIG_UCONTEXT_COROUTINE=y" >> $config_host_mak +elif test "$coroutine_backend" = "sigaltstack" ; then + echo "CONFIG_SIGALTSTACK_COROUTINE=y" >> $config_host_mak fi if test "$open_by_handle_at" = "yes" ; then @@ -3188,6 +3362,10 @@ if test "$linux_magic_h" = "yes" ; then echo "CONFIG_LINUX_MAGIC_H=y" >> $config_host_mak fi +if test "$has_environ" = "yes" ; then + echo "CONFIG_HAS_ENVIRON=y" >> $config_host_mak +fi + # USB host support case "$usb" in linux) @@ -3232,7 +3410,6 @@ if test "$trace_default" = "yes"; then fi echo "TOOLS=$tools" >> $config_host_mak -echo "CHECKS=$checks" >> $config_host_mak echo "ROMS=$roms" >> $config_host_mak echo "MAKE=$make" >> $config_host_mak echo "INSTALL=$install" >> $config_host_mak @@ -3264,6 +3441,7 @@ echo "LIBS+=$LIBS" >> $config_host_mak echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak echo "EXESUF=$EXESUF" >> $config_host_mak echo "LIBS_QGA+=$libs_qga" >> $config_host_mak +echo "POD2MAN=$POD2MAN" >> $config_host_mak # generate list of library paths for linker script @@ -3279,10 +3457,26 @@ fi for d in libdis libdis-user; do mkdir -p $d - symlink $source_path/Makefile.dis $d/Makefile + symlink "$source_path/Makefile.dis" "$d/Makefile" echo > $d/config.mak done +# use included Linux headers +if test "$linux" = "yes" ; then + mkdir -p linux-headers + case "$cpu" in + i386|x86_64) + symlink "$source_path/linux-headers/asm-x86" linux-headers/asm + ;; + ppcemb|ppc|ppc64) + symlink "$source_path/linux-headers/asm-powerpc" linux-headers/asm + ;; + s390x) + symlink "$source_path/linux-headers/asm-s390" linux-headers/asm + ;; + esac +fi + for target in $target_list; do target_dir="$target" config_target_mak=$target_dir/config-target.mak @@ -3297,7 +3491,6 @@ esac target_softmmu="no" target_user_only="no" target_linux_user="no" -target_darwin_user="no" target_bsd_user="no" case "$target" in ${target_arch2}-softmmu) @@ -3311,14 +3504,6 @@ case "$target" in 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" @@ -3337,11 +3522,13 @@ mkdir -p $target_dir mkdir -p $target_dir/fpu mkdir -p $target_dir/tcg mkdir -p $target_dir/ide +mkdir -p $target_dir/usb mkdir -p $target_dir/9pfs +mkdir -p $target_dir/kvm if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then mkdir -p $target_dir/nwfpe fi -symlink $source_path/Makefile.target $target_dir/Makefile +symlink "$source_path/Makefile.target" "$target_dir/Makefile" echo "# Automatically generated by configure - do not modify" > $config_target_mak @@ -3349,7 +3536,6 @@ echo "# Automatically generated by confi bflt="no" target_nptl="no" interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_arch2/g"` -echo "CONFIG_QEMU_INTERP_PREFIX=\"$interp_prefix1\"" >> $config_target_mak gdb_xml_files="" target_short_alignment=2 target_int_alignment=4 @@ -3382,6 +3568,7 @@ case "$target_arch2" in gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml" target_phys_bits=32 target_llong_alignment=4 + target_libs_softmmu="$fdt_libs" ;; cris) target_nptl="yes" @@ -3494,12 +3681,19 @@ case "$target_arch2" in exit 1 ;; esac + +case "$target_arch2" in + alpha | sparc*) + echo "CONFIG_TCG_PASS_AREG0=y" >> $config_target_mak + ;; +esac + echo "TARGET_SHORT_ALIGNMENT=$target_short_alignment" >> $config_target_mak echo "TARGET_INT_ALIGNMENT=$target_int_alignment" >> $config_target_mak echo "TARGET_LONG_ALIGNMENT=$target_long_alignment" >> $config_target_mak echo "TARGET_LLONG_ALIGNMENT=$target_llong_alignment" >> $config_target_mak echo "TARGET_ARCH=$TARGET_ARCH" >> $config_target_mak -target_arch_name="`echo $TARGET_ARCH | tr '[:lower:]' '[:upper:]'`" +target_arch_name="`echo $TARGET_ARCH | LC_ALL=C tr '[a-z]' '[A-Z]'`" echo "TARGET_$target_arch_name=y" >> $config_target_mak echo "TARGET_ARCH2=$target_arch2" >> $config_target_mak # TARGET_BASE_ARCH needs to be defined after TARGET_ARCH @@ -3552,21 +3746,17 @@ if test "$target_softmmu" = "yes" ; then echo "LIBS+=$libs_softmmu $target_libs_softmmu" >> $config_target_mak echo "HWDIR=../libhw$target_phys_bits" >> $config_target_mak echo "subdir-$target: subdir-libhw$target_phys_bits" >> $config_host_mak + if test "$smartcard_nss" = "yes" ; then + echo "subdir-$target: subdir-libcacard" >> $config_host_mak + fi fi 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 fi if test "$target_linux_user" = "yes" ; then echo "CONFIG_LINUX_USER=y" >> $config_target_mak fi -if test "$target_darwin_user" = "yes" ; then - echo "CONFIG_DARWIN_USER=y" >> $config_target_mak -fi -if test "$smartcard_nss" = "yes" ; then - echo "subdir-$target: subdir-libcacard" >> $config_host_mak - echo "libcacard_libs=$libcacard_libs" >> $config_host_mak - echo "libcacard_cflags=$libcacard_cflags" >> $config_host_mak -fi list="" if test ! -z "$gdb_xml_files" ; then for x in $gdb_xml_files; do @@ -3608,6 +3798,10 @@ else fi includes="-I\$(SRC_PATH)/tcg $includes" +if test "$linux" = "yes" ; then + includes="-I\$(SRC_PATH)/linux-headers $includes" +fi + if test "$target_user_only" = "yes" ; then libdis_config_mak=libdis-user/config.mak else @@ -3640,6 +3834,10 @@ for i in $ARCH $TARGET_BASE_ARCH ; do echo "CONFIG_IA64_DIS=y" >> $config_target_mak echo "CONFIG_IA64_DIS=y" >> $libdis_config_mak ;; + lm32) + echo "CONFIG_LM32_DIS=y" >> $config_target_mak + echo "CONFIG_LM32_DIS=y" >> $libdis_config_mak + ;; m68k) echo "CONFIG_M68K_DIS=y" >> $config_target_mak echo "CONFIG_M68K_DIS=y" >> $libdis_config_mak @@ -3739,23 +3937,6 @@ if test "$target_linux_user" = "yes" -o esac fi -# use included Linux headers -if test "$linux" = "yes" ; then - includes="-I\$(SRC_PATH)/linux-headers $includes" - mkdir -p linux-headers - case "$cpu" in - i386|x86_64) - symlink $source_path/linux-headers/asm-x86 linux-headers/asm - ;; - ppcemb|ppc|ppc64) - symlink $source_path/linux-headers/asm-powerpc linux-headers/asm - ;; - s390x) - symlink $source_path/linux-headers/asm-s390 linux-headers/asm - ;; - esac -fi - echo "LDFLAGS+=$ldflags" >> $config_target_mak echo "QEMU_CFLAGS+=$cflags" >> $config_target_mak echo "QEMU_INCLUDES+=$includes" >> $config_target_mak @@ -3763,14 +3944,16 @@ echo "QEMU_INCLUDES+=$includes" >> $conf done # for target in $targets # build tree in object directory in case the source is not in the current directory -DIRS="tests tests/cris slirp audio block net pc-bios/optionrom" +DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32" +DIRS="$DIRS slirp audio block net pc-bios/optionrom" DIRS="$DIRS pc-bios/spapr-rtas" DIRS="$DIRS roms/seabios roms/vgabios" -DIRS="$DIRS fsdev ui" +DIRS="$DIRS fsdev ui usb" DIRS="$DIRS qapi qapi-generated" -DIRS="$DIRS qga trace" -FILES="Makefile tests/Makefile qdict-test-data.txt" -FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit" +DIRS="$DIRS qga trace qom" +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" FILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps" FILES="$FILES pc-bios/spapr-rtas/Makefile" FILES="$FILES roms/seabios/Makefile roms/vgabios/Makefile" @@ -3785,7 +3968,7 @@ do done mkdir -p $DIRS for f in $FILES ; do - if [ -e "$source_path/$f" ] && ! [ -e "$f" ]; then + if [ -e "$source_path/$f" ] && [ "$source_path" != `pwd` ]; then symlink "$source_path/$f" "$f" fi done @@ -3807,7 +3990,8 @@ for hwlib in 32 64; do d=libhw$hwlib mkdir -p $d mkdir -p $d/ide - symlink $source_path/Makefile.hw $d/Makefile + mkdir -p $d/usb + symlink "$source_path/Makefile.hw" "$d/Makefile" mkdir -p $d/9pfs echo "QEMU_CFLAGS+=-DTARGET_PHYS_ADDR_BITS=$hwlib" > $d/config.mak done @@ -3815,14 +3999,14 @@ done if [ "$source_path" != `pwd` ]; then # out of tree build mkdir -p libcacard - rm -f libcacard/Makefile symlink "$source_path/libcacard/Makefile" libcacard/Makefile fi d=libuser mkdir -p $d mkdir -p $d/trace -symlink $source_path/Makefile.user $d/Makefile +mkdir -p $d/qom +symlink "$source_path/Makefile.user" "$d/Makefile" if test "$docs" = "yes" ; then mkdir -p QMP