meson: add firewalld build option

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
This commit is contained in:
Pavel Hrdina 2020-06-24 13:25:51 +02:00
parent 8b7dbdf19a
commit 3f6b78746c
4 changed files with 10 additions and 50 deletions

View File

@ -82,10 +82,6 @@ if test $with_linux = no; then
with_storage_scsi=no with_storage_scsi=no
fi fi
if test $with_freebsd = yes; then
with_firewalld=no
fi
AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"]) AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"])
AM_CONDITIONAL([WITH_FREEBSD], [test "$with_freebsd" = "yes"]) AM_CONDITIONAL([WITH_FREEBSD], [test "$with_freebsd" = "yes"])
@ -114,7 +110,6 @@ fi
# Check for compiler and library settings. # Check for compiler and library settings.
LIBVIRT_ARG_FIREWALLD
LIBVIRT_ARG_FIREWALLD_ZONE LIBVIRT_ARG_FIREWALLD_ZONE
LIBVIRT_ARG_FUSE LIBVIRT_ARG_FUSE
LIBVIRT_ARG_GLUSTER LIBVIRT_ARG_GLUSTER
@ -141,7 +136,6 @@ LIBVIRT_ARG_VIRTUALPORT
LIBVIRT_ARG_WIRESHARK LIBVIRT_ARG_WIRESHARK
LIBVIRT_ARG_YAJL LIBVIRT_ARG_YAJL
LIBVIRT_CHECK_FIREWALLD
LIBVIRT_CHECK_FIREWALLD_ZONE LIBVIRT_CHECK_FIREWALLD_ZONE
LIBVIRT_CHECK_FUSE LIBVIRT_CHECK_FUSE
LIBVIRT_CHECK_GLIB LIBVIRT_CHECK_GLIB
@ -457,7 +451,6 @@ LIBVIRT_RESULT_DRIVER_MODULES
AC_MSG_NOTICE([]) AC_MSG_NOTICE([])
AC_MSG_NOTICE([Libraries]) AC_MSG_NOTICE([Libraries])
AC_MSG_NOTICE([]) AC_MSG_NOTICE([])
LIBVIRT_RESULT_FIREWALLD
LIBVIRT_RESULT_FIREWALLD_ZONE LIBVIRT_RESULT_FIREWALLD_ZONE
LIBVIRT_RESULT_FUSE LIBVIRT_RESULT_FUSE
LIBVIRT_RESULT_GLIB LIBVIRT_RESULT_GLIB

View File

@ -1,43 +0,0 @@
dnl The firewalld support
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_ARG_FIREWALLD], [
LIBVIRT_ARG_WITH_FEATURE([FIREWALLD], [firewalld], [check])
])
AC_DEFUN([LIBVIRT_CHECK_FIREWALLD], [
AC_REQUIRE([LIBVIRT_CHECK_DBUS])
if test "x$with_firewalld" = "xcheck" ; then
with_firewalld=$with_dbus
fi
if test "x$with_firewalld" = "xyes" ; then
if test "x$with_dbus" != "xyes" ; then
AC_MSG_ERROR([You must have dbus enabled for firewalld support])
fi
AC_DEFINE_UNQUOTED([WITH_FIREWALLD], [1], [whether firewalld support is enabled])
fi
AM_CONDITIONAL([WITH_FIREWALLD], [test "x$with_firewalld" != "xno"])
])
AC_DEFUN([LIBVIRT_RESULT_FIREWALLD], [
LIBVIRT_RESULT_LIB([FIREWALLD])
])

View File

@ -1138,6 +1138,14 @@ if bash_completion_dep.found()
endif endif
endif endif
if host_machine.system() != 'freebsd'
if not get_option('firewalld').disabled() and dbus_dep.found()
conf.set('WITH_FIREWALLD', 1)
elif get_option('firewalld').enabled()
error('You must have dbus enabled for firewalld support')
endif
endif
# define top include directory # define top include directory
@ -1168,6 +1176,7 @@ libs_summary = {
'curl': curl_dep.found(), 'curl': curl_dep.found(),
'dbus': dbus_dep.found(), 'dbus': dbus_dep.found(),
'dlopen': dlopen_dep.found(), 'dlopen': dlopen_dep.found(),
'firewalld': conf.has('WITH_FIREWALLD'),
'readline': readline_dep.found(), 'readline': readline_dep.found(),
} }
summary(libs_summary, section: 'Libraries', bool_yn: true) summary(libs_summary, section: 'Libraries', bool_yn: true)

View File

@ -19,6 +19,7 @@ option('blkid', type: 'feature', value: 'auto', description: 'blkid support')
option('capng', type: 'feature', value: 'auto', description: 'cap-ng support') option('capng', type: 'feature', value: 'auto', description: 'cap-ng support')
option('curl', type: 'feature', value: 'auto', description: 'curl support') option('curl', type: 'feature', value: 'auto', description: 'curl support')
option('dbus', type: 'feature', value: 'auto', description: 'dbus-1 support') option('dbus', type: 'feature', value: 'auto', description: 'dbus-1 support')
option('firewalld', type: 'feature', value: 'auto', description: 'firewalld support')
option('readline', type: 'feature', value: 'auto', description: 'readline support') option('readline', type: 'feature', value: 'auto', description: 'readline support')