scilab: in library name remove suffix lib, add option to choose name instead
This commit is contained in:
parent
656f2b8932
commit
4c426d47a0
3 changed files with 23 additions and 9 deletions
|
|
@ -1611,7 +1611,7 @@ scilab_version:
|
||||||
# -----------------------------------------------------------------
|
# -----------------------------------------------------------------
|
||||||
|
|
||||||
scilab_clean:
|
scilab_clean:
|
||||||
rm -f *.sce *.so lib*lib.c *_wrap.*
|
rm -f *.sce *.so lib*.c *_wrap.*
|
||||||
|
|
||||||
##################################################################
|
##################################################################
|
||||||
##### Go ######
|
##### Go ######
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ swigtestname = strsubst(fileparts(names, "fname"), "_runme", "");
|
||||||
testdir = swigtestname + ".dir";
|
testdir = swigtestname + ".dir";
|
||||||
|
|
||||||
// Does the library exists? If not then exit!
|
// Does the library exists? If not then exit!
|
||||||
libname = "lib" + swigtestname + "lib" + getdynlibext();
|
libname = "lib" + swigtestname + getdynlibext();
|
||||||
if ~isfile(fullfile(testdir, libname)) then
|
if ~isfile(fullfile(testdir, libname)) then
|
||||||
mfprintf(0, "*** LIBRARY NOT FOUND: %s ***\n", libname);
|
mfprintf(0, "*** LIBRARY NOT FOUND: %s ***\n", libname);
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,8 @@ Scilab options (available with -scilab)\n\
|
||||||
-vbl <level> - Sets the build verbose <level> (default 0)\n\
|
-vbl <level> - Sets the build verbose <level> (default 0)\n\
|
||||||
-buildflags <file> - Uses a Scilab script in <file> to set build flags\n\
|
-buildflags <file> - Uses a Scilab script in <file> to set build flags\n\
|
||||||
-nobuilder - Do not generate builder script\n\
|
-nobuilder - Do not generate builder script\n\
|
||||||
-gwid <id> - Gateway ID \n\n"
|
-gwid <id> - Gateway ID \n\
|
||||||
|
-ol <library name> - Set name of the output library\n\n"
|
||||||
;
|
;
|
||||||
|
|
||||||
static const char *SWIG_CREATE_VARIABLES_FUNCTION_NAME = "SWIG_CreateScilabVariables";
|
static const char *SWIG_CREATE_VARIABLES_FUNCTION_NAME = "SWIG_CreateScilabVariables";
|
||||||
|
|
@ -55,6 +56,8 @@ protected:
|
||||||
String *gatewayID;
|
String *gatewayID;
|
||||||
int primitiveID;
|
int primitiveID;
|
||||||
|
|
||||||
|
String *libraryName;
|
||||||
|
|
||||||
bool generateBuilder;
|
bool generateBuilder;
|
||||||
bool extraWarning;
|
bool extraWarning;
|
||||||
public:
|
public:
|
||||||
|
|
@ -71,6 +74,7 @@ public:
|
||||||
buildFlagsScript = NULL;
|
buildFlagsScript = NULL;
|
||||||
generateBuilder = true;
|
generateBuilder = true;
|
||||||
gatewayID = NULL;
|
gatewayID = NULL;
|
||||||
|
libraryName = NULL;
|
||||||
extraWarning = false;
|
extraWarning = false;
|
||||||
|
|
||||||
/* Manage command line arguments */
|
/* Manage command line arguments */
|
||||||
|
|
@ -91,13 +95,13 @@ public:
|
||||||
} else if (strcmp(argv[argIndex], "-addcflag") == 0) {
|
} else if (strcmp(argv[argIndex], "-addcflag") == 0) {
|
||||||
Swig_mark_arg(argIndex);
|
Swig_mark_arg(argIndex);
|
||||||
if (argv[argIndex + 1] != NULL) {
|
if (argv[argIndex + 1] != NULL) {
|
||||||
DohInsertitem(cflags, Len(cflags), argv[argIndex + 1]);
|
DohInsertitem(cflags, Len(cflags), argv[argIndex + 1]);
|
||||||
Swig_mark_arg(argIndex + 1);
|
Swig_mark_arg(argIndex + 1);
|
||||||
}
|
}
|
||||||
} else if (strcmp(argv[argIndex], "-addldflag") == 0) {
|
} else if (strcmp(argv[argIndex], "-addldflag") == 0) {
|
||||||
Swig_mark_arg(argIndex);
|
Swig_mark_arg(argIndex);
|
||||||
if (argv[argIndex + 1] != NULL) {
|
if (argv[argIndex + 1] != NULL) {
|
||||||
DohInsertitem(ldflags, Len(ldflags), argv[argIndex + 1]);
|
DohInsertitem(ldflags, Len(ldflags), argv[argIndex + 1]);
|
||||||
Swig_mark_arg(argIndex + 1);
|
Swig_mark_arg(argIndex + 1);
|
||||||
}
|
}
|
||||||
} else if (strcmp(argv[argIndex], "-vbl") == 0) {
|
} else if (strcmp(argv[argIndex], "-vbl") == 0) {
|
||||||
|
|
@ -117,6 +121,11 @@ public:
|
||||||
gatewayID = NewString(argv[argIndex + 1]);
|
gatewayID = NewString(argv[argIndex + 1]);
|
||||||
Swig_mark_arg(argIndex + 1);
|
Swig_mark_arg(argIndex + 1);
|
||||||
}
|
}
|
||||||
|
else if (strcmp(argv[argIndex], "-ol") == 0) {
|
||||||
|
Swig_mark_arg(argIndex);
|
||||||
|
libraryName = NewString(argv[argIndex + 1]);
|
||||||
|
Swig_mark_arg(argIndex + 1);
|
||||||
|
}
|
||||||
else if (strcmp(argv[argIndex], "-Wextra") == 0) {
|
else if (strcmp(argv[argIndex], "-Wextra") == 0) {
|
||||||
extraWarning = true;
|
extraWarning = true;
|
||||||
}
|
}
|
||||||
|
|
@ -153,6 +162,11 @@ public:
|
||||||
/* Get the module name */
|
/* Get the module name */
|
||||||
String *moduleName = Getattr(node, "name");
|
String *moduleName = Getattr(node, "name");
|
||||||
|
|
||||||
|
/* Set the library name if not specified */
|
||||||
|
if (libraryName == NULL) {
|
||||||
|
libraryName = moduleName;
|
||||||
|
}
|
||||||
|
|
||||||
/* Get the output file name */
|
/* Get the output file name */
|
||||||
String *outputFilename = Getattr(node, "outfile");
|
String *outputFilename = Getattr(node, "outfile");
|
||||||
|
|
||||||
|
|
@ -755,7 +769,7 @@ public:
|
||||||
|
|
||||||
Printf(builderCode, "ilib_verbose(%s);\n", verboseBuildLevel);
|
Printf(builderCode, "ilib_verbose(%s);\n", verboseBuildLevel);
|
||||||
|
|
||||||
Printf(builderCode, "ilib_name = \"%slib\";\n", moduleName);
|
Printf(builderCode, "lib_name = \"%s\";\n", libraryName);
|
||||||
|
|
||||||
Printf(builderCode, "libs = [];\n");
|
Printf(builderCode, "libs = [];\n");
|
||||||
|
|
||||||
|
|
@ -808,8 +822,8 @@ public:
|
||||||
Printf(builderCode, "];\n");
|
Printf(builderCode, "];\n");
|
||||||
Printf(builderCode, "err_msg = [];\n");
|
Printf(builderCode, "err_msg = [];\n");
|
||||||
Printf(builderCode, "if ~isempty(table) then\n");
|
Printf(builderCode, "if ~isempty(table) then\n");
|
||||||
Printf(builderCode, " ilib_build(ilib_name, table, files, libs, [], ldflags, cflags);\n");
|
Printf(builderCode, " ilib_build('%s', table, files, libs, [], ldflags, cflags);\n", libraryName);
|
||||||
Printf(builderCode, " libfilename = 'lib' + ilib_name + getdynlibext();\n");
|
Printf(builderCode, " libfilename = 'lib%s' + getdynlibext();\n", libraryName);
|
||||||
Printf(builderCode, " if ~isfile(libfilename) then\n");
|
Printf(builderCode, " if ~isfile(libfilename) then\n");
|
||||||
Printf(builderCode, " err_msg = 'Error while building library ' + libfilename ' + '.');\n");
|
Printf(builderCode, " err_msg = 'Error while building library ' + libfilename ' + '.');\n");
|
||||||
Printf(builderCode, " end\n");
|
Printf(builderCode, " end\n");
|
||||||
|
|
@ -824,7 +838,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------
|
/* -----------------------------------------------------------------------
|
||||||
* saveBuilderCode():
|
* saveBuilderCode()
|
||||||
* ----------------------------------------------------------------------- */
|
* ----------------------------------------------------------------------- */
|
||||||
void saveBuilderFile() {
|
void saveBuilderFile() {
|
||||||
Printv(builderFile, builderCode, NIL);
|
Printv(builderFile, builderCode, NIL);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue