Skip to content

Commit

Permalink
meson: Always check there is real utmpx.h or stub header
Browse files Browse the repository at this point in the history
I think it should be checked through build system not through compiler.

Signed-off-by: Mobin "Hojjat" Aydinfar <[email protected]>
  • Loading branch information
mobin-2008 committed Jan 3, 2024
1 parent cc6d3e7 commit 7ebc8c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions build/mconfig.mesontemplate
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

// Defines

#mesondefine USE_UTMPX
#mesondefine USE_INITGROUPS
#mesondefine SUPPORT_CGROUPS
#mesondefine DEFAULT_AUTO_RESTART
Expand Down
5 changes: 3 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ mconfig_data.set10('USE_INITGROUPS', use_initgroups)
if support_cgroups.auto() and platform == 'linux' or support_cgroups.enabled()
mconfig_data.set('SUPPORT_CGROUPS', '1')
endif
if use_utmpx.enabled()
if use_utmpx.enabled() or (use_utmpx.auto() and compiler.has_header_symbol('utmpx.h', '_PATH_UTMPX') and
compiler.has_header_symbol('utmpx.h', '_PATH_WTMPX'))
mconfig_data.set('USE_UTMPX', '1')
elif use_utmpx.disabled()
else
mconfig_data.set('USE_UTMPX', '0')
endif
configure_file(
Expand Down

0 comments on commit 7ebc8c4

Please sign in to comment.