Install debugger.scm to XSYS4_DATA_DIR

This commit is contained in:
Nunuhara Cabbage
2022-03-28 17:54:26 -07:00
parent ba0b97e163
commit 0780442e13
2 changed files with 10 additions and 4 deletions
+4 -3
View File
@@ -1,7 +1,7 @@
project('system4', 'c',
default_options : ['c_std=c11'])
add_project_arguments('-D_DEFAULT_SOURCE', language : 'c')
add_project_arguments('-DXSYS4_DATA_DIR="' + get_option('prefix') / 'share' / 'xsystem4"', language : 'c')
add_project_arguments('-DXSYS4_DATA_DIR="' + get_option('prefix') / get_option('datadir') / 'xsystem4"', language : 'c')
zlib = dependency('zlib')
libm = meson.get_compiler('c').find_library('m', required: false)
@@ -36,5 +36,6 @@ libsys4_dep = libsys4_proj.get_variable('libsys4_dep')
subdir('src')
install_subdir('shaders', install_dir : 'share' / 'xsystem4')
install_subdir('fonts', install_dir : 'share' / 'xsystem4')
install_subdir('shaders', install_dir : get_option('datadir') / 'xsystem4')
install_subdir('fonts', install_dir : get_option('datadir') / 'xsystem4')
install_data('debugger.scm', install_dir : get_option('datadir') / 'xsystem4')
+6 -1
View File
@@ -20,6 +20,7 @@
#include <assert.h>
#include <chibi/eval.h>
#include "system4/file.h"
#include "system4/instructions.h"
#include "system4/string.h"
#include "system4/utfsjis.h"
@@ -239,7 +240,11 @@ void dbg_init(void)
sexp_eval_string(dbg_ctx, "(define *prompt* (make-parameter \"dbg> \"))", -1, NULL);
sexp_eval_string(dbg_ctx, "(define breakpoint-count (make-parameter 0))", -1, NULL);
sexp_eval_string(dbg_ctx, "(define (repl-make-prompt m) (*prompt*))", -1, NULL);
sexp_eval_string(dbg_ctx, "(load \"./debugger.scm\")", -1, NULL);
if (file_exists("./debugger.scm"))
sexp_eval_string(dbg_ctx, "(load \"./debugger.scm\")", -1, NULL);
else
sexp_eval_string(dbg_ctx, "(load \"" XSYS4_DATA_DIR "/debugger.scm\")", -1, NULL);
}
void dbg_fini(void)