File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ add_project_arguments(
2525)
2626
2727cc = meson .get_compiler(' c' )
28+ fs = import (' fs' )
2829
2930prefix = get_option (' prefix' )
3031
@@ -38,8 +39,16 @@ libm = cc.find_library('m')
3839seccomp = dependency (' libseccomp' , required : get_option (' seccomp' ))
3940inih = dependency (' inih' )
4041
41- wob_version = ' "@0@"' .format(meson .project_version())
42- add_project_arguments (' -DWOB_VERSION=@0@' .format(wob_version), language : ' c' )
42+ sysconfdir = get_option (' sysconfdir' )
43+ if not fs.is_absolute(sysconfdir)
44+ sysconfdir = prefix / sysconfdir
45+ endif
46+
47+ global_configuration_h = configuration_data ({
48+ ' WOB_VERSION' : ' "@0@"' .format(meson .project_version()),
49+ ' WOB_ETC_CONFIG_FOLDER_PATH' : ' "@0@"' .format(sysconfdir),
50+ })
51+ configure_file (output : ' global_configuration.h' , configuration : global_configuration_h)
4352
4453wayland_scanner_code = generator (
4554 wayland_scanner,
Original file line number Diff line number Diff line change 1111#include <wordexp.h>
1212
1313#include "config.h"
14+
15+ #include "global_configuration.h"
1416#include "log.h"
1517
1618bool
@@ -466,7 +468,7 @@ wob_config_default_path()
466468 static const char * config_paths [] = {
467469 "$XDG_CONFIG_HOME/wob/wob.ini" ,
468470 "$HOME/.config/wob/wob.ini" ,
469- "/etc/wob /wob.ini" ,
471+ WOB_ETC_CONFIG_FOLDER_PATH " /wob.ini" ,
470472 };
471473
472474 for (size_t i = 0 ; i < sizeof (config_paths ) / sizeof (char * ); ++ i ) {
Original file line number Diff line number Diff line change 88#include <unistd.h>
99
1010#include "config.h"
11+ #include "global_configuration.h"
1112#include "log.h"
1213#include "wob.h"
1314
You can’t perform that action at this time.
0 commit comments