From: Antoine ELIAS Date: Thu, 26 Jan 2017 16:59:13 +0000 (+0100) Subject: fix dllinfo call X-Git-Tag: 6.0.0~105 X-Git-Url: http://gitweb.scilab.org/?p=scilab.git;a=commitdiff_plain;h=749e894a2b3794412be28514a4af9d5a5cb9fbef;hp=29964417fc9456ded7d1631091776598645bb501 fix dllinfo call Change-Id: I8f66e6b78b1ea823687b9c39ed5243c18ff5bcb8 --- diff --git a/scilab/modules/dynamic_link/macros/windows/dlwDllInfo.sci b/scilab/modules/dynamic_link/macros/windows/dlwDllInfo.sci index f2ebcc8..61e7c0b 100644 --- a/scilab/modules/dynamic_link/macros/windows/dlwDllInfo.sci +++ b/scilab/modules/dynamic_link/macros/windows/dlwDllInfo.sci @@ -13,9 +13,28 @@ //============================================================================= function dllinfolist = dlwDllInfo(dllname, options) //============================================================================= + + function cmd = getEnvCmd() + if win64() then + if dlwIsExpress() then + arch = "x86_amd64"; + else + arch = "x64"; + end + else + arch = "x86"; + end + + path = dlwGetVisualStudioPath(); + cmd = """" + path + "\VC\vcvarsall.bat"" " + arch; + endfunction + function symbolslist = dllinfoimports(dllname) symbolslist = list(); - [result,bOK] = dos("dumpbin /IMPORTS """ + dllname +""""); + + cmd = getEnvCmd() + " && dumpbin /IMPORTS """ + dllname +"""" + + [result,bOK] = dos(cmd); if bOK == %T then // cleaning output result = stripblanks(result); @@ -54,7 +73,8 @@ function dllinfolist = dlwDllInfo(dllname, options) function symbolslist = dllinfoexports(dllname) symbolslist = list(); symbolsdll = []; - [result, bOK] = dos("dumpbin /EXPORTS """ + dllname +""""); + cmd = getEnvCmd() + " && dumpbin /EXPORTS """ + dllname +""""; + [result, bOK] = dos(cmd); if bOK == %T then result(result == "") = []; ilastcomment = grep(result, "ordinal hint RVA"); @@ -77,7 +97,8 @@ function dllinfolist = dlwDllInfo(dllname, options) function dllinfolist = dllinfomachine(dllname) dllinfolist = list(); machine = ""; - [result,bOK] = dos("dumpbin /HEADERS """ + dllname +""""); + cmd = getEnvCmd() + " && dumpbin /HEADERS """ + dllname +""""; + [result, bOK] = dos(cmd); if bOK == %T then iMachine = grep(result, "machine ("); if iMachine <> [] then diff --git a/scilab/modules/dynamic_link/tests/nonreg_tests/bug_4853.tst b/scilab/modules/dynamic_link/tests/nonreg_tests/bug_4853.tst index 5d215df..9da274f 100644 --- a/scilab/modules/dynamic_link/tests/nonreg_tests/bug_4853.tst +++ b/scilab/modules/dynamic_link/tests/nonreg_tests/bug_4853.tst @@ -7,6 +7,7 @@ // <-- ENGLISH IMPOSED --> // <-- CLI SHELL MODE --> +// <-- WINDOWS ONLY --> // <-- Non-regression test for bug 4853 --> // @@ -17,11 +18,8 @@ // test only for windows -if getos() == 'Windows' then - ilib_verbose(0); - exec SCI/modules/dynamic_link/tests/unit_tests/addinter.tst; - r = dllinfo(TMPDIR + '/addinter/libintertest.dll','imports'); - if (r(1)(1) == 'libmmd.dll') | (r(2)(1) == 'libmmd.dll') then pause,end -end +exec SCI/modules/dynamic_link/tests/unit_tests/addinter.tst; +r = dllinfo(TMPDIR + '/addinter/libintertest.dll','imports'); +if (r(1)(1) == 'libmmd.dll') | (r(2)(1) == 'libmmd.dll') then pause,end // ============================================================================= diff --git a/scilab/modules/dynamic_link/tests/unit_tests/schur_external.tst b/scilab/modules/dynamic_link/tests/unit_tests/schur_external.tst index e8403bb..09dbead 100644 --- a/scilab/modules/dynamic_link/tests/unit_tests/schur_external.tst +++ b/scilab/modules/dynamic_link/tests/unit_tests/schur_external.tst @@ -26,7 +26,7 @@ mputl(C,TMPDIR+'/schur_test/mytest.c'); //build and link lp=ilib_for_link('mytest','mytest.c',[],'c'); -link(lp,'mytest','c'); +link(lp,'mytest','c'); //run it [U,dim,T]=schur(A,'mytest');