mirror of
https://github.com/albfan/miraclecast.git
synced 2025-02-12 13:41:55 +00:00
Add ENABLE_SYSTEMD config to meson and autotools
This commit is contained in:
parent
85723432f9
commit
6f84dc8b7d
4 changed files with 28 additions and 6 deletions
|
@ -11,7 +11,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake
|
|||
set(CMAKE_C_FLAGS "-std=gnu11 ${CMAKE_C_FLAGS}")
|
||||
add_definitions(-D_GNU_SOURCE)
|
||||
|
||||
OPTION(ENABLE_SYSTEMD "Enable Systemd support" ON)
|
||||
OPTION(ENABLE_SYSTEMD "Enable Systemd" ON)
|
||||
|
||||
find_package(PkgConfig)
|
||||
|
||||
|
|
20
configure.ac
20
configure.ac
|
@ -45,16 +45,28 @@ AC_ARG_VAR(IP_BINARY, [Path for ip binary])
|
|||
if test -z "$IP_BINARY"; then
|
||||
IP_BINARY=/bin/ip
|
||||
fi
|
||||
AC_ARG_ENABLE([disable-systemd],
|
||||
AS_HELP_STRING([--disable-systemd], [Disable systemd]), [], [use_libsystemd=yes], [Disable systemd using elogind])
|
||||
AC_DEFINE_UNQUOTED([IP_BINARY], [$IP_BINARY], [Path for ip binary])
|
||||
|
||||
#
|
||||
# Mandatory dependencies
|
||||
#
|
||||
|
||||
m4_ifdef([PKG_CHECK_MODULES], [
|
||||
PKG_CHECK_MODULES([DEPS], [libudev libsystemd > 219])
|
||||
PKG_CHECK_MODULES([GLIB], [glib-2.0])
|
||||
])
|
||||
AS_IF([test "$use_libsystemd" == "yes"],
|
||||
[
|
||||
AC_DEFINE([ENABLE_SYSTEMD], [], [Use systemd])
|
||||
m4_ifdef([PKG_CHECK_MODULES], [
|
||||
PKG_CHECK_MODULES([DEPS], [libudev libsystemd > 219])
|
||||
PKG_CHECK_MODULES([GLIB], [glib-2.0])
|
||||
])
|
||||
],
|
||||
[
|
||||
m4_ifdef([PKG_CHECK_MODULES], [
|
||||
PKG_CHECK_MODULES([DEPS], [libudev libelogind])
|
||||
PKG_CHECK_MODULES([GLIB], [glib-2.0])
|
||||
])
|
||||
])
|
||||
|
||||
AC_CHECK_HEADERS(readline/readline.h,, AC_MSG_ERROR(GNU readline not found))
|
||||
|
||||
|
|
|
@ -32,11 +32,17 @@ if get_option('rely-udev')
|
|||
add_project_arguments('-DRELY_UDEV', language: 'c')
|
||||
endif
|
||||
|
||||
if get_option('enable-systemd')
|
||||
add_project_arguments('-DENABLE_SYSTEMD', language: 'c')
|
||||
libsystemd = dependency('libsystemd')
|
||||
else
|
||||
libsystemd = dependency('libelogind')
|
||||
endif
|
||||
|
||||
add_project_arguments('-DIP_BINARY='+get_option('ip-binary'), language: 'c')
|
||||
|
||||
glib2 = dependency('glib-2.0')
|
||||
udev = dependency('libudev')
|
||||
libsystemd = dependency('libsystemd')
|
||||
|
||||
subdir('src')
|
||||
subdir('res')
|
||||
|
|
|
@ -14,3 +14,7 @@ option('ip-binary',
|
|||
type: 'string',
|
||||
value: '/bin/ip',
|
||||
description: 'Path for ip binary')
|
||||
option('enable-systemd',
|
||||
type: 'boolean',
|
||||
value: 'true',
|
||||
description: 'Enable systemd')
|
||||
|
|
Loading…
Reference in a new issue