Browse Source

meson: Always check there is real utmpx.h or stub header

I think it should be checked through build system not through compiler.

Signed-off-by: Mobin "Hojjat" Aydinfar <mobin@mobintestserver.ir>
Mobin Aydinfar 3 months ago
parent
commit
7a900a5d83
2 changed files with 4 additions and 2 deletions
  1. 1 0
      build/mconfig.mesontemplate
  2. 3 2
      meson.build

+ 1 - 0
build/mconfig.mesontemplate

@@ -5,6 +5,7 @@
 
 // Defines
 
+#mesondefine USE_UTMPX
 #mesondefine USE_INITGROUPS
 #mesondefine SUPPORT_CGROUPS
 #mesondefine DEFAULT_AUTO_RESTART

+ 3 - 2
meson.build

@@ -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(