scilab: simplify builder script file
This commit is contained in:
parent
fd1e387a0e
commit
1875f841e5
1 changed files with 6 additions and 14 deletions
|
|
@ -255,7 +255,7 @@ public:
|
||||||
|
|
||||||
// Add Builder footer code and save
|
// Add Builder footer code and save
|
||||||
if (generateBuilder) {
|
if (generateBuilder) {
|
||||||
saveBuilderFile(gatewayLibraryName);
|
saveBuilderFile(gatewayName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Close the init function and rename with module name */
|
/* Close the init function and rename with module name */
|
||||||
|
|
@ -894,7 +894,7 @@ public:
|
||||||
Printf(builderCode, "libs = [];\n");
|
Printf(builderCode, "libs = [];\n");
|
||||||
|
|
||||||
// Flags from command line arguments
|
// Flags from command line arguments
|
||||||
Printf(builderCode, "cflags = \"-g -I\" + builddir;\n");
|
Printf(builderCode, "cflags = [];\n");
|
||||||
for (int i = 0; i < Len(cflags); i++) {
|
for (int i = 0; i < Len(cflags); i++) {
|
||||||
String *cflag = Getitem(cflags, i);
|
String *cflag = Getitem(cflags, i);
|
||||||
Printf(builderCode, "cflags = cflags + \" %s\";\n", cflag);
|
Printf(builderCode, "cflags = cflags + \" %s\";\n", cflag);
|
||||||
|
|
@ -924,9 +924,9 @@ public:
|
||||||
for (int i = 0; i < Len(sourceFileList); i++) {
|
for (int i = 0; i < Len(sourceFileList); i++) {
|
||||||
String *sourceFile = Getitem(sourceFileList, i);
|
String *sourceFile = Getitem(sourceFileList, i);
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
Printf(builderCode, "files = fullpath(\"%s\");\n", sourceFile);
|
Printf(builderCode, "files = \"%s\";\n", sourceFile);
|
||||||
} else {
|
} else {
|
||||||
Printf(builderCode, "files($ + 1) = fullpath(\"%s\");\n", sourceFile);
|
Printf(builderCode, "files($ + 1) = \"%s\";\n", sourceFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -949,21 +949,13 @@ public:
|
||||||
* saveBuilderFile()
|
* saveBuilderFile()
|
||||||
* ----------------------------------------------------------------------- */
|
* ----------------------------------------------------------------------- */
|
||||||
|
|
||||||
void saveBuilderFile(String *gatewayLibraryName) {
|
void saveBuilderFile(String *gatewayName) {
|
||||||
Printf(builderCode, "];\n");
|
Printf(builderCode, "];\n");
|
||||||
Printf(builderCode, "ierr = 0;\n");
|
Printf(builderCode, "ierr = 0;\n");
|
||||||
Printf(builderCode, "if ~isempty(table) then\n");
|
Printf(builderCode, "if ~isempty(table) then\n");
|
||||||
Printf(builderCode, " libfilename = '%s' + getdynlibext();\n", gatewayLibraryName);
|
Printf(builderCode, " ierr = execstr(\"ilib_build(''%s'', table, files, libs, [], ldflags, cflags);\", 'errcatch');\n", gatewayName);
|
||||||
Printf(builderCode, " ierr = execstr(\"ilib_build(''%s'', table, files, libs, [], ldflags, cflags);\", 'errcatch');\n", gatewayLibraryName);
|
|
||||||
Printf(builderCode, " if ierr <> 0 then\n");
|
Printf(builderCode, " if ierr <> 0 then\n");
|
||||||
Printf(builderCode, " err_msg = lasterror();\n");
|
Printf(builderCode, " err_msg = lasterror();\n");
|
||||||
Printf(builderCode, " elseif ~isfile(libfilename) then\n");
|
|
||||||
Printf(builderCode, " ierr = 1;\n");
|
|
||||||
Printf(builderCode, " err_msg = 'Error while building library ' + libfilename;\n");
|
|
||||||
Printf(builderCode, " elseif ~isfile('loader.sce') then\n");
|
|
||||||
Printf(builderCode, " ierr = 1;\n");
|
|
||||||
Printf(builderCode, " err_msg = 'Error while generating loader script loader.sce.';\n");
|
|
||||||
Printf(builderCode, " end\n");
|
|
||||||
Printf(builderCode, "end\n");
|
Printf(builderCode, "end\n");
|
||||||
Printf(builderCode, "cd(originaldir);\n");
|
Printf(builderCode, "cd(originaldir);\n");
|
||||||
Printf(builderCode, "if ierr <> 0 then\n");
|
Printf(builderCode, "if ierr <> 0 then\n");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue