Re: [PATCH v2 1/2] parallels: build with parallels SDK

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 22.08.2014 19:48, Dmitry Guryanov wrote:
> Executing prlctl command is not an optimal way to interact with
> Parallels Cloud Server (PCS), it's better to use parallels SDK,
> which is a remote API to paralles dispatcher service.
> 
> We prepared opensource version of this SDK and published it on
> github, it's distributed under LGPL license. Here is a git repo:
> https://github.com/Parallels/parallels-sdk.
> 
> To build with parallels SDK user should get compiler and linker
> options from pkg-config 'parallels-sdk' file. So fix checks in
> configure script and build with parallels SDK, if that pkg-config
> file exists and add gcc options to makefile.
> 
> Signed-off-by: Dmitry Guryanov <dguryanov@xxxxxxxxxxxxx>
> ---
>   configure.ac    | 11 +++++------
>   src/Makefile.am |  4 +++-
>   2 files changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index f93c6c2..4318d24 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1046,15 +1046,14 @@ dnl
>   dnl Checks for the Parallels driver
>   dnl
>   
> +PKG_CHECK_MODULES([PARALLELS_SDK], [parallels-sdk], [PARALLELS_SDK_FOUND=yes], [PARALLELS_SDK_FOUND=no])
> +
>   if test "$with_parallels" = "check"; then
> -    with_parallels=$with_linux
> -    if test ! $host_cpu = 'x86_64'; then
> -        with_parallels=no
> -    fi
> +    with_parallels=$PARALLELS_SDK_FOUND
>   fi

This run the check even if configure is run with --without-parallels. I'd feel better if it follows the pattern used in the rest of --with-* attributes.

>   
> -if test "$with_parallels" = "yes" && test "$with_linux" = "no"; then
> -    AC_MSG_ERROR([The Parallels driver can be enabled on Linux only.])
> +if test "$with_parallels" = "yes" && test "$PARALLELS_SDK_FOUND" = "no"; then
> +    AC_MSG_ERROR([Parallels Virtualization SDK is needed to build the Parallels driver.])
>   fi
>   
>   if test "$with_parallels" = "yes"; then
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 538530e..dad7c7f 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -1352,7 +1352,9 @@ if WITH_PARALLELS
>   noinst_LTLIBRARIES += libvirt_driver_parallels.la
>   libvirt_la_BUILT_LIBADD += libvirt_driver_parallels.la
>   libvirt_driver_parallels_la_CFLAGS = \
> -		-I$(top_srcdir)/src/conf $(AM_CFLAGS)
> +		-I$(top_srcdir)/src/conf $(AM_CFLAGS) \
> +		$(PARALLELS_SDK_CFLAGS)
> +libvirt_driver_parallels_la_LIBADD = $(PARALLELS_SDK_LIBS)
>   libvirt_driver_parallels_la_SOURCES = $(PARALLELS_DRIVER_SOURCES)
>   endif WITH_PARALLELS
>   
> 

This is the diff I'm looking for:

diff --git a/configure.ac b/configure.ac
index b4fb99a..0062d5d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1046,19 +1046,21 @@ dnl
 dnl Checks for the Parallels driver
 dnl
 
-if test "$with_parallels" = "check"; then
-    with_parallels=$with_linux
-    if test ! $host_cpu = 'x86_64'; then
-        with_parallels=no
-    fi
-fi
 
-if test "$with_parallels" = "yes" && test "$with_linux" = "no"; then
-    AC_MSG_ERROR([The Parallels driver can be enabled on Linux only.])
-fi
+if test "$with_parallels" = "yes" ||
+   test "$with_parallels" = "check"; then
+    PKG_CHECK_MODULES([PARALLELS_SDK], [parallels-sdk],
+                      [PARALLELS_SDK_FOUND=yes], [PARALLELS_SDK_FOUND=no])
+
+    if test "$with_parallels" = "yes" && test "$PARALLELS_SDK_FOUND" = "no"; then
+        AC_MSG_ERROR([Parallels Virtualization SDK is needed to build the Parallels driver.])
+    fi
 
-if test "$with_parallels" = "yes"; then
-    AC_DEFINE_UNQUOTED([WITH_PARALLELS], 1, [whether Parallels driver is enabled])
+    with_parallels=$PARALLELS_SDK_FOUND
+    if test "$with_parallels" = "yes"; then
+        AC_DEFINE_UNQUOTED([WITH_PARALLELS], 1,
+                           [whether Parallels driver is enabled])
+    fi
 fi
 AM_CONDITIONAL([WITH_PARALLELS], [test "$with_parallels" = "yes"])

Michal

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]