diff options
author | Sam James <sam@gentoo.org> | 2023-10-03 19:01:03 +0000 |
---|---|---|
committer | Jan Rybar <jrybar@redhat.com> | 2023-10-03 19:01:03 +0000 |
commit | 67dba0e852505f018b01ef7373352e9b5de23304 (patch) | |
tree | c55e76460bda135becca393e51507c35bddefed3 | |
parent | 95c381977865d02d7fb955c540489daab394dd0f (diff) |
meson.build: only run HAVE_SETNETGRENT_RETURN check if setnetgrent found
-rw-r--r-- | meson.build | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/meson.build b/meson.build index 50d19c0..f01e4e1 100644 --- a/meson.build +++ b/meson.build @@ -177,19 +177,21 @@ config_h.set('HAVE_' + host_system.to_upper(), true) # Check whether setnetgrent has a return value config_h.set('HAVE_NETGROUP_H', cc.has_header('netgroup.h')) -setnetgrent_return_src = ''' - #include <stddef.h> - #ifdef HAVE_NETGROUP_H - #include <netgroup.h> - #else - #include <netdb.h> - #endif - int main() { - int r = setnetgrent (NULL); - }; -''' +if config_h.get('HAVE_SETNETGRENT', false) + setnetgrent_return_src = ''' + #include <stddef.h> + #ifdef HAVE_NETGROUP_H + #include <netgroup.h> + #else + #include <netdb.h> + #endif + int main() { + int r = setnetgrent (NULL); + }; + ''' -config_h.set('HAVE_SETNETGRENT_RETURN', cc.compiles(setnetgrent_return_src, name: 'setnetgrent return support')) + config_h.set('HAVE_SETNETGRENT_RETURN', cc.compiles(setnetgrent_return_src, name: 'setnetgrent return support')) +endif # Select wether to use libsystemd-login, libelogind or ConsoleKit for session tracking session_tracking = get_option('session_tracking') |