--- /dev/null
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2014 - Scilab Enterprises - Antoine ELIAS
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+function ret = isDebug()
+ ret = ~isRelease();
+endfunction
--- /dev/null
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2014 - Scilab Enterprises - Antoine ELIAS
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+function ret = isRelease()
+ [a,b] = getversion();
+ ret = b(5) == "release";
+endfunction
envFlag = " -D__USE_DEPRECATED_STACK_FUNCTIONS__ ";
end
- if getenv("DEBUG_SCILAB_DYNAMIC_LINK","NO") == "YES" then
+ val = getenv("DEBUG_SCILAB_DYNAMIC_LINK", "");
+ if (val == "" & isDebug()) | val == "YES" then
envFlag = envFlag + " -g ";
end
target_build = "all";
end
+ //update DEBUG_SCILAB_DYNAMIC_LINK to match with Scilab compilation mode
+ val = getenv("DEBUG_SCILAB_DYNAMIC_LINK","");
+ if val <> "YES" & val <> "NO" & isDebug()then
+ setenv("DEBUG_SCILAB_DYNAMIC_LINK", "YES");
+ end
+
[msg, stat] = unix_g(make_command + makename + " " + target_build + " 2>&0");
+
+ //restore DEBUG_SCILAB_DYNAMIC_LINK
+ setenv("DEBUG_SCILAB_DYNAMIC_LINK", val);
+
if stat <> 0 then
// more feedback when compilation fails
[msg, stat, stderr] = unix_g(make_command + makename + " " + target_build + " 1>&2");
error(999, msprintf(_("%s: Wrong value for input argument #%d: existing file(s) expected.\n"), "ilib_gen_Make", 3));
end
+ //update DEBUG_SCILAB_DYNAMIC_LINK to map with Scilab compilation mode
+ val = getenv("DEBUG_SCILAB_DYNAMIC_LINK","");
+ if val <> "YES" & val <> "NO" & isDebug()then
+ setenv("DEBUG_SCILAB_DYNAMIC_LINK","YES");
+ end
+
// remove duplicated files
FILES_SRC_MATRIX = unique(FILES_SRC_MATRIX);
// TEMPLATE_MAKEFILE.VC not found
warning(SCI+"/modules/dynamic_link/src/scripts/TEMPLATE_MAKEFILE.VC"+ _("not found.") );
end
+
+ //restore DEBUG_SCILAB_DYNAMIC_LINK
+ setenv("DEBUG_SCILAB_DYNAMIC_LINK", val);
+
endfunction
//=============================================================================