Skip to content

Commit

Permalink
Add ENABLE_SYSTEMD config to meson and autotools
Browse files Browse the repository at this point in the history
  • Loading branch information
albfan committed May 28, 2022
1 parent 665e3ac commit 188bd05
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ AC_ARG_VAR(IP_BINARY, [Path for ip binary])
if test -z "$IP_BINARY"; then
IP_BINARY=/bin/ip
fi
AC_ARG_ENABLE([enable-systemd],
AS_HELP_STRING([--enable-systemd], [Enable systemd]), AC_DEFINE([ENABLE_SYSTEMD], [], [Disable systemd using elogind]))
AC_DEFINE_UNQUOTED([IP_BINARY], [$IP_BINARY], [Path for ip binary])

#
Expand Down
4 changes: 4 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ 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')
endif

add_project_arguments('-DIP_BINARY='+get_option('ip-binary'), language: 'c')

glib2 = dependency('glib-2.0')
Expand Down
4 changes: 4 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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')

0 comments on commit 188bd05

Please sign in to comment.