spec: need configuration for "sysroot"

This commit is contained in:
2025-01-04 18:35:05 +08:00
parent abb60fe3cb
commit cdb8e32e32
2 changed files with 4 additions and 2 deletions

View File

@@ -116,7 +116,7 @@ default:
%ifndef %{gcc_dir}
#% define gcc_dir /SW/compilers/GCC/Linux/x86_64/gcc-6.3.0
% define gcc_dir @@GCCDIR@@
% define sysroot_dir /usr/sw/standard-830-6b-test
% define sysroot_dir @@SYSROOT@@
%endif
# EDIT if needed: the preENV line adds library directories to the runtime

View File

@@ -63,13 +63,15 @@ export interface ConfigOptions {
gccdir: string;
optimize: string[];
ldflags: string[];
sysroot: string;
}
export function renderConfig(options: ConfigOptions) {
return `# Rendered from TypeScript ${new Date().toLocaleString()}, do not edit!\n\n\n` + specTemplate
.replace("@@GCCDIR@@", options.gccdir)
.replace("@@OPTIMIZE@@", options.optimize.join(' '))
.replace("@@LDFLAGS@@", options.ldflags.join(' '));
.replace("@@LDFLAGS@@", options.ldflags.join(' '))
.replace("@@SYSROOT@@", options.sysroot);
}