From patchwork Tue Feb 6 21:29:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shashank Ram X-Patchwork-Id: 870126 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zbd225SL5z9s7M for ; Wed, 7 Feb 2018 08:31:37 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 4EE50BAA; Tue, 6 Feb 2018 21:31:19 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 430D8BAA for ; Tue, 6 Feb 2018 21:31:18 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from EX13-EDG-OU-001.vmware.com (ex13-edg-ou-001.vmware.com [208.91.0.189]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 741632F6 for ; Tue, 6 Feb 2018 21:31:17 +0000 (UTC) Received: from sc9-mailhost3.vmware.com (10.113.161.73) by EX13-EDG-OU-001.vmware.com (10.113.208.155) with Microsoft SMTP Server id 15.0.1156.6; Tue, 6 Feb 2018 13:31:04 -0800 Received: from localhost.localdomain (desktop-gtu4ktv.prom.eng.vmware.com [10.33.78.79]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id B526540B00; Tue, 6 Feb 2018 13:31:16 -0800 (PST) From: Shashank Ram To: Date: Tue, 6 Feb 2018 13:29:39 -0800 Message-ID: <20180206212939.13188-1-rams@vmware.com> X-Mailer: git-send-email 2.9.3.windows.2 MIME-Version: 1.0 Received-SPF: None (EX13-EDG-OU-001.vmware.com: rams@vmware.com does not designate permitted sender hosts) X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH] datapath-windows: Support to selectively compile targets X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Adds support to selectively compile kernel driver for target versions. This is useful when environments to compile for all targets might not be available on the user's machine, or if the user wants to only compile some targets selectively. Also once appveyor has support to build Win10 targets, we will not pass the "--with-vstudiotargetver" to the configure script. Signed-off-by: Shashank Ram Signed-off-by: Shashank Ram Acked-by: Anand Kumar --- Makefile.am | 15 +++++++++++++++ appveyor.yml | 4 ++-- m4/openvswitch.m4 | 28 +++++++++++++++++++++++++++- 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index d397f65..e035a98 100644 --- a/Makefile.am +++ b/Makefile.am @@ -411,14 +411,29 @@ if VSTUDIO_DDK ALL_LOCAL += ovsext ARCH = x64 ovsext: datapath-windows/ovsext.sln $(srcdir)/datapath-windows/include/OvsDpInterface.h +if VSTUDIO_WIN8 MSBuild.exe //nologo //maxcpucount datapath-windows/ovsext.sln /target:Build /property:Configuration="Win8$(VSTUDIO_CONFIG)" /property:Version="$(PACKAGE_VERSION)" //p:Platform=$(ARCH) +endif +if VSTUDIO_WIN8_1 MSBuild.exe //nologo //maxcpucount datapath-windows/ovsext.sln /target:Build /property:Configuration="Win8.1$(VSTUDIO_CONFIG)" /property:Version="$(PACKAGE_VERSION)" //p:Platform=$(ARCH) +endif +if VSTUDIO_WIN10 + MSBuild.exe //nologo //maxcpucount datapath-windows/ovsext.sln /target:Build /property:Configuration="Win10$(VSTUDIO_CONFIG)" /property:Version="$(PACKAGE_VERSION)" //p:Platform=$(ARCH) +endif + CLEAN_LOCAL += ovsext_clean ovsext_clean: datapath-windows/ovsext.sln +if VSTUDIO_WIN8 MSBuild.exe //nologo //maxcpucount datapath-windows/ovsext.sln /target:Clean /property:Configuration="Win8$(VSTUDIO_CONFIG)" /property:Version="$(PACKAGE_VERSION)" //p:Platform=$(ARCH) +endif +if VSTUDIO_WIN8_1 MSBuild.exe //nologo //maxcpucount datapath-windows/ovsext.sln /target:Clean /property:Configuration="Win8.1$(VSTUDIO_CONFIG)" /property:Version="$(PACKAGE_VERSION)" //p:Platform=$(ARCH) endif +if VSTUDIO_WIN10 + MSBuild.exe //nologo //maxcpucount datapath-windows/ovsext.sln /target:Clean /property:Configuration="Win10$(VSTUDIO_CONFIG)" /property:Version="$(PACKAGE_VERSION)" //p:Platform=$(ARCH) +endif +endif .PHONY: ovsext clang-analyze: clean diff --git a/appveyor.yml b/appveyor.yml index 0881e05..da31764 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,6 @@ version: 1.0.{build} branches: - only: + only: - master clone_folder: C:\openvswitch init: @@ -41,6 +41,6 @@ build_script: - C:\MinGW\msys\1.0\bin\bash -lc "cp /c/pthreads-win32/Pre-built.2/dll/x86/*.dll /c/openvswitch/." - C:\MinGW\msys\1.0\bin\bash -lc "mv /bin/link.exe /bin/link_copy.exe" - C:\MinGW\msys\1.0\bin\bash -lc "cd /c/openvswitch && ./boot.sh" -- C:\MinGW\msys\1.0\bin\bash -lc "cd /c/openvswitch && ./configure CC=build-aux/cccl LD=\"`which link`\" LIBS=\"-lws2_32 -liphlpapi -lwbemuuid -lole32 -loleaut32\" --with-pthread=C:/pthreads-win32/Pre-built.2 --with-openssl=C:/OpenSSL-Win32 --with-vstudiotarget=\"Debug\"" +- C:\MinGW\msys\1.0\bin\bash -lc "cd /c/openvswitch && ./configure CC=build-aux/cccl LD=\"`which link`\" LIBS=\"-lws2_32 -liphlpapi -lwbemuuid -lole32 -loleaut32\" --with-pthread=C:/pthreads-win32/Pre-built.2 --with-openssl=C:/OpenSSL-Win32 --with-vstudiotarget=\"Debug\" --with-vstudiotargetver=\"Win8,Win8.1\"" - C:\MinGW\msys\1.0\bin\bash -lc "cd /c/openvswitch && make" - C:\MinGW\msys\1.0\bin\bash -lc "cd /c/openvswitch && make datapath_windows_analyze" diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4 index de4d66c..78082d4 100644 --- a/m4/openvswitch.m4 +++ b/m4/openvswitch.m4 @@ -173,6 +173,32 @@ AC_ARG_WITH([vstudiotarget], ) AC_SUBST([VSTUDIO_CONFIG]) + +AC_ARG_WITH([vstudiotargetver], + [AS_HELP_STRING([--with-vstudiotargetver=target_ver1,target_ver2], + [Target versions: Win8,Win8.1,Win10])], + [ + targetver=`echo "$withval" | tr -s , ' ' ` + for ver in $targetver; do + case "$ver" in + "Win8") VSTUDIO_WIN8=true ;; + "Win8.1") VSTUDIO_WIN8_1=true ;; + "Win10") VSTUDIO_WIN10=true ;; + *) AC_MSG_ERROR([No valid Visual Studio target version found]) ;; + esac + done + + ], [ + VSTUDIO_WIN8=true + VSTUDIO_WIN8_1=true + VSTUDIO_WIN10=true + ] + ) + + AM_CONDITIONAL([VSTUDIO_WIN8], [test -n "$VSTUDIO_WIN8"]) + AM_CONDITIONAL([VSTUDIO_WIN8_1], [test -n "$VSTUDIO_WIN8_1"]) + AM_CONDITIONAL([VSTUDIO_WIN10], [test -n "$VSTUDIO_WIN10"]) + AC_DEFINE([VSTUDIO_DDK], [1], [System uses the Visual Studio build target.]) AM_CONDITIONAL([VSTUDIO_DDK], [test -n "$VSTUDIO_CONFIG"]) ]) @@ -573,7 +599,7 @@ TEST_ATOMIC_TYPE(unsigned long long int); dnl OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE(SIZE) dnl dnl Checks __atomic_always_lock_free(SIZE, 0) -AC_DEFUN([OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE], +AC_DEFUN([OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE], [AC_CACHE_CHECK( [value of __atomic_always_lock_free($1)], [ovs_cv_atomic_always_lock_free_$1],