create_library(flag,cmd,libname,path,listf)
Add here a paragraph of the function description. Other paragraph can be added
Add here a paragraph of the function description
Add here scilab instructions and comments
//create_library //Entrée flag : flag compilateur (GCC,LCC,VC) // cmd : commande du compilateur // libname : nom de la libraire (sans extension : ex mylibrary) // path : le chemin du répertoire de compilation // listfo : liste des fichiers à inclure sans extensions (ex:mymodule) function []=create_library(flag,cmd,libname,path,listf) printf(" Create shared library...\n"); select flag case 'GCC' then CCFLAG=[]; listf=listf+'.o' for i=1:size(listf,'*') CCFLAG=CCFLAG+listf(i)+" "; end CCFLAG=CCFLAG+'-shared -o '+libname+'.so'; cmd=cmd+CCFLAG; case 'G77' then FCFLAG=[] ; listf=listf+'.o' for i=1:size(listf,'*') FCFLAG=FCFLAG+listf(i)+" "; end FCFLAG=FCFLAG+'-shared -o '+libname+'.so'; cmd=cmd+FCFLAG; case 'LCC' then listf=listf+'.obj'; CCFLAG=[]; for i=1:size(listf,'*') CCFLAG=CCFLAG+listf(i)+" "; end cmd=[SCI+'\bin\dumpexts -o '+libname+'.def '+libname+'.dll '+CCFLAG]; //change directory rep=pwd(); chdir(MODNUM+path); unix_g(cmd); chdir(rep); if libname=='libmodnum_c' then CCFLAG=CCFLAG+' ..\mod_num_lib\libmodnum_lib.lib'; end sci_lib=[]; if fileinfo(SCI+'\bin\LibScilab.lib')<>[] then sci_lib=sci_lib+SCI+'\bin\LibScilab.lib '; end if fileinfo(SCI+'\bin\atlas.lib')<>[] then sci_lib=sci_lib+SCI+'\bin\atlas.lib '; end cmd=[SCI+'\lcc\bin\lcclnk -dll -nounderscores '+CCFLAG+' '+sci_lib+libname+'.def -o '+libname+'.dll']; cmd=pathconvert(cmd,%f,%t,'w'); case 'VC' then listf=listf+'.obj'; CCFLAG=[]; for i=1:size(listf,'*') CCFLAG=CCFLAG+listf(i)+" "; end cmd=[SCI+'\bin\dumpexts -o '+libname+'.def '+libname+'.dll '+CCFLAG]; //change directory rep=pwd(); chdir(MODNUM+path); unix_g(cmd); chdir(rep); if libname=='libmodnum_c' then CCFLAG=CCFLAG+' ..\mod_num_lib\libmodnum_lib.lib'; end sci_lib=[]; if fileinfo(SCI+'\bin\LibScilab.lib')<>[] then sci_lib=sci_lib+SCI+'\bin\LibScilab.lib '; end if fileinfo(SCI+'\bin\atlas.lib')<>[] then sci_lib=sci_lib+SCI+'\bin\atlas.lib '; end cmd=['link '+CCFLAG+' '+sci_lib+'/dll /out:'+libname+'.dll /def:'+libname+'.def']; case 'trash' then printf("Compilation aborted\n"); return; end //change directory rep=pwd(); chdir(MODNUM+path); //link unix_g(cmd); //change directory chdir(rep); endfunction