[libvirt PATCH 076/351] meson: add win32 build dependency

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

 



Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 configure.ac          |  3 ---
 m4/virt-win-common.m4 | 42 ------------------------------------------
 m4/virt-win-mingw.m4  | 28 ----------------------------
 meson.build           | 26 ++++++++++++++++++++++++++
 4 files changed, 26 insertions(+), 73 deletions(-)
 delete mode 100644 m4/virt-win-common.m4
 delete mode 100644 m4/virt-win-mingw.m4

diff --git a/configure.ac b/configure.ac
index 86e4b63ddf7..0b02b259c65 100644
--- a/configure.ac
+++ b/configure.ac
@@ -291,8 +291,6 @@ AC_SUBST(RUNUTF8)
 
 
 dnl MinGW checks
-LIBVIRT_WIN_CHECK_COMMON
-LIBVIRT_WIN_CHECK_MINGW
 LIBVIRT_WIN_CHECK_SYMBOLS
 LIBVIRT_WIN_CHECK_WINDRES
 
@@ -402,7 +400,6 @@ LIBVIRT_RESULT_YAJL
 AC_MSG_NOTICE([])
 AC_MSG_NOTICE([Windows])
 AC_MSG_NOTICE([])
-LIBVIRT_WIN_RESULT_COMMON
 LIBVIRT_WIN_RESULT_WINDRES
 AC_MSG_NOTICE([])
 AC_MSG_NOTICE([Miscellaneous])
diff --git a/m4/virt-win-common.m4 b/m4/virt-win-common.m4
deleted file mode 100644
index ebc9d0836e4..00000000000
--- a/m4/virt-win-common.m4
+++ /dev/null
@@ -1,42 +0,0 @@
-dnl The MinGW common checks
-dnl
-dnl Copyright (C) 2016 Red Hat, Inc.
-dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License, or (at your option) any later version.
-dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl Lesser General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library.  If not, see
-dnl <http://www.gnu.org/licenses/>.
-dnl
-
-AC_DEFUN([LIBVIRT_WIN_CHECK_COMMON], [
-  WIN32_EXTRA_CFLAGS=
-  WIN32_EXTRA_LIBS=
-
-  case "$host" in
-    *-*-mingw* )
-      WIN32_EXTRA_LIBS="-lole32 -loleaut32"
-      # If the host is Windows, and shared libraries are disabled, we
-      # need to add -DLIBVIRT_STATIC to the CFLAGS for proper linking
-      if test "x$enable_shared" = "xno"; then
-        WIN32_EXTRA_CFLAGS="-DLIBVIRT_STATIC"
-      fi
-      ;;
-  esac
-
-  AC_SUBST([WIN32_EXTRA_CFLAGS])
-  AC_SUBST([WIN32_EXTRA_LIBS])
-])
-
-AC_DEFUN([LIBVIRT_WIN_RESULT_COMMON], [
-  details="CFLAGS='$WIN32_EXTRA_CFLAGS' LIBS='$WIN32_EXTRA_LIBS'"
-  LIBVIRT_RESULT([MinGW], [$with_win], [$details])
-])
diff --git a/m4/virt-win-mingw.m4 b/m4/virt-win-mingw.m4
deleted file mode 100644
index 3003bcf031f..00000000000
--- a/m4/virt-win-mingw.m4
+++ /dev/null
@@ -1,28 +0,0 @@
-dnl The MinGW check
-dnl
-dnl Copyright (C) 2016 Red Hat, Inc.
-dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License, or (at your option) any later version.
-dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl Lesser General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library.  If not, see
-dnl <http://www.gnu.org/licenses/>.
-dnl
-
-AC_DEFUN([LIBVIRT_WIN_CHECK_MINGW], [
-  MINGW_EXTRA_LDFLAGS=
-  case "$host" in
-    *-*-mingw*)
-      MINGW_EXTRA_LDFLAGS="-no-undefined"
-  esac
-
-  AC_SUBST([MINGW_EXTRA_LDFLAGS])
-])
diff --git a/meson.build b/meson.build
index f5cc0e1d41f..3f05a1c0c6b 100644
--- a/meson.build
+++ b/meson.build
@@ -1383,6 +1383,27 @@ if not get_option('virtualport').disabled()
   endif
 endif
 
+if host_machine.system() == 'windows'
+  ole32_dep = cc.find_library('ole32')
+  oleaut32_dep = cc.find_library('oleaut32')
+  win32_dep = declare_dependency(
+    dependencies: [
+      ole32_dep,
+      oleaut32_dep,
+    ],
+  )
+  if get_option('default_library') == 'static'
+    win32_flags = [ '-DLIBVIRT_STATIC' ]
+  else
+    win32_flags = []
+  endif
+  win32_link_flags = [ '-Wl,-no-undefined' ]
+else
+  win32_dep = dependency('', required: false)
+  win32_flags = []
+  win32_link_flags = []
+endif
+
 
 # generic build dependencies checks
 
@@ -1501,6 +1522,11 @@ libs_summary = {
 }
 summary(libs_summary, section: 'Libraries', bool_yn: true)
 
+win_summary = {
+  'MinGW': host_machine.system() == 'windows',
+}
+summary(win_summary, section: 'Windows', bool_yn: true)
+
 test_summary = {
   'Coverage': coverage_flags.length() > 0,
 }
-- 
2.26.2




[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]

  Powered by Linux