Revision d9840e25

b/.gitignore
82 82
*.la
83 83
*.pc
84 84
.libs
85
.sdk
85 86
*.swp
86 87
*.orig
87 88
.pc
b/Makefile
272 272
	for d in $(TARGET_DIRS); do \
273 273
	rm -rf $$d || exit 1 ; \
274 274
        done
275
	rm -Rf .sdk
275 276
	if test -f pixman/config.log; then make -C pixman distclean; fi
276 277
	if test -f dtc/version_gen.h; then make $(DTC_MAKE_ARGS) clean; fi
277 278

  
b/configure
232 232
glx=""
233 233
zlib="yes"
234 234
guest_agent=""
235
guest_agent_with_vss="no"
236
vss_win32_sdk=""
237
win_sdk="no"
235 238
want_tools="yes"
236 239
libiscsi=""
237 240
coroutine=""
......
927 930
  ;;
928 931
  --disable-guest-agent) guest_agent="no"
929 932
  ;;
933
  --with-vss-sdk) vss_win32_sdk=""
934
  ;;
935
  --with-vss-sdk=*) vss_win32_sdk="$optarg"
936
  ;;
937
  --without-vss-sdk) vss_win32_sdk="no"
938
  ;;
939
  --with-win-sdk) win_sdk=""
940
  ;;
941
  --with-win-sdk=*) win_sdk="$optarg"
942
  ;;
943
  --without-win-sdk) win_sdk="no"
944
  ;;
930 945
  --enable-tools) want_tools="yes"
931 946
  ;;
932 947
  --disable-tools) want_tools="no"
......
1168 1183
echo "  --enable-usb-redir       enable usb network redirection support"
1169 1184
echo "  --disable-guest-agent    disable building of the QEMU Guest Agent"
1170 1185
echo "  --enable-guest-agent     enable building of the QEMU Guest Agent"
1186
echo "  --with-vss-sdk=SDK-path  enable Windows VSS support in QEMU Guest Agent"
1187
echo "  --with-win-sdk=SDK-path  path to Windows Platform SDK (to build VSS .tlb)"
1171 1188
echo "  --disable-seccomp        disable seccomp support"
1172 1189
echo "  --enable-seccomp         enables seccomp support"
1173 1190
echo "  --with-coroutine=BACKEND coroutine backend. Supported options:"
......
3132 3149
fi
3133 3150

  
3134 3151
##########################################
3152
# check if we have VSS SDK headers for win
3153

  
3154
if test "$mingw32" = "yes" -a "$guest_agent" != "no" -a "$vss_win32_sdk" != "no" ; then
3155
  case "$vss_win32_sdk" in
3156
    "")   vss_win32_include="-I$source_path" ;;
3157
    *\ *) # The SDK is installed in "Program Files" by default, but we cannot
3158
          # handle path with spaces. So we symlink the headers into ".sdk/vss".
3159
          vss_win32_include="-I$source_path/.sdk/vss"
3160
	  symlink "$vss_win32_sdk/inc" "$source_path/.sdk/vss/inc"
3161
	  ;;
3162
    *)    vss_win32_include="-I$vss_win32_sdk"
3163
  esac
3164
  cat > $TMPC << EOF
3165
#define __MIDL_user_allocate_free_DEFINED__
3166
#include <inc/win2003/vss.h>
3167
int main(void) { return VSS_CTX_BACKUP; }
3168
EOF
3169
  if compile_prog "$vss_win32_include" "" ; then
3170
    guest_agent_with_vss="yes"
3171
    QEMU_CFLAGS="$QEMU_CFLAGS $vss_win32_include"
3172
    libs_qga="-lole32 -loleaut32 -lshlwapi -luuid -lstdc++ -Wl,--enable-stdcall-fixup $libs_qga"
3173
  else
3174
    if test "$vss_win32_sdk" != "" ; then
3175
      echo "ERROR: Please download and install Microsoft VSS SDK:"
3176
      echo "ERROR:   http://www.microsoft.com/en-us/download/details.aspx?id=23490"
3177
      echo "ERROR: On POSIX-systems, you can extract the SDK headers by:"
3178
      echo "ERROR:   scripts/extract-vsssdk-headers setup.exe"
3179
      echo "ERROR: The headers are extracted in the directory \`inc'."
3180
      feature_not_found "VSS support"
3181
    fi
3182
    guest_agent_with_vss="no"
3183
  fi
3184
fi
3185

  
3186
##########################################
3187
# lookup Windows platform SDK (if not specified)
3188
# The SDK is needed only to build .tlb (type library) file of guest agent
3189
# VSS provider from the source. It is usually unnecessary because the
3190
# pre-compiled .tlb file is included.
3191

  
3192
if test "$mingw32" = "yes" -a "$guest_agent" != "no" -a "$guest_agent_with_vss" = "yes" ; then
3193
  if test -z "$win_sdk"; then
3194
    programfiles="$PROGRAMFILES"
3195
    test -n "$PROGRAMW6432" && programfiles="$PROGRAMW6432"
3196
    if test -n "$programfiles"; then
3197
      win_sdk=$(ls -d "$programfiles/Microsoft SDKs/Windows/v"* | tail -1) 2>/dev/null
3198
    else
3199
      feature_not_found "Windows SDK"
3200
    fi
3201
  elif test "$win_sdk" = "no"; then
3202
    win_sdk=""
3203
  fi
3204
fi
3205

  
3206
##########################################
3135 3207

  
3136 3208
##########################################
3137 3209
# check if we have fdatasync
......
3568 3640
echo "ELF interp prefix $interp_prefix"
3569 3641
else
3570 3642
echo "local state directory   queried at runtime"
3643
echo "Windows SDK       $win_sdk"
3571 3644
fi
3572 3645
echo "Source path       $source_path"
3573 3646
echo "C compiler        $cc"
......
3654 3727
echo "GLX support       $glx"
3655 3728
echo "libiscsi support  $libiscsi"
3656 3729
echo "build guest agent $guest_agent"
3730
echo "QGA VSS support   $guest_agent_with_vss"
3657 3731
echo "seccomp support   $seccomp"
3658 3732
echo "coroutine backend $coroutine"
3659 3733
echo "GlusterFS support $glusterfs"
......
3728 3802
  version_micro=0
3729 3803
  echo "CONFIG_FILEVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak
3730 3804
  echo "CONFIG_PRODUCTVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak
3805
  if test "$guest_agent_with_vss" = "yes" ; then
3806
    echo "CONFIG_QGA_VSS=y" >> $config_host_mak
3807
    echo "WIN_SDK=\"$win_sdk\"" >> $config_host_mak
3808
  fi
3731 3809
else
3732 3810
  echo "CONFIG_POSIX=y" >> $config_host_mak
3733 3811
fi

Also available in: Unified diff