Commit 152b845b authored by Philip Withnall's avatar Philip Withnall Committed by Ray Strode

build: Expose chosen path_wtmp value as a variable

This will be used in a following commit.
Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
parent d8b77951
...@@ -78,12 +78,32 @@ foreach func: check_functions ...@@ -78,12 +78,32 @@ foreach func: check_functions
endforeach endforeach
if cc.has_header_symbol('utmpx.h', 'WTMPX_FILENAME', prefix: '#define _GNU_SOURCE') if cc.has_header_symbol('utmpx.h', 'WTMPX_FILENAME', prefix: '#define _GNU_SOURCE')
code = '''#define _GNU_SOURCE
#include <utmpx.h>
int main (int argc, char **argv) {
printf ("%s\n", WTMPX_FILENAME);
return 0;
}
'''
result = cc.run(code, name : 'value of WTMPX_FILENAME')
path_wtmp = result.stdout().strip()
config_h.set('PATH_WTMP', 'WTMPX_FILENAME') config_h.set('PATH_WTMP', 'WTMPX_FILENAME')
elif cc.has_header_symbol('paths.h', '_PATH_WTMPX') elif cc.has_header_symbol('paths.h', '_PATH_WTMPX')
code = '''#include <paths.h>
int main (int argc, char **argv) {
printf ("%s\n", _PATH_WTMPX);
return 0;
}
'''
result = cc.run(code, name : 'value of _PATH_WTMPX')
path_wtmp = result.stdout().strip()
config_h.set('PATH_WTMP', '_PATH_WTMPX') config_h.set('PATH_WTMP', '_PATH_WTMPX')
else else
assert(run_command('test', '-e', '/var/log/utx.log').returncode() == 0, 'Do not know which filename to watch for wtmp changes') path_wtmp = '/var/log/utx.log'
config_h.set_quoted('PATH_WTMP', '/var/log/utx.log') assert(run_command('test', '-e', path_wtmp).returncode() == 0, 'Do not know which filename to watch for wtmp changes')
config_h.set_quoted('PATH_WTMP', path_wtmp)
endif endif
# compiler flags # compiler flags
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment