find_incl_path - search path which must be include for building routines of the toolbox
tt = find_incl_path
- tt : vector of character strings containing the included path at the compilation.
//find_incl_path
//besoin machine.h scicos_block.h f2c.h
// mex.h stack-c.h stack-def.h
//sortie tt est une liste de chaine de caractère contenant
// les répertoires à inclure lors de la compilation
function tt=find_incl_path()
printf("... Search Headers of Scilab ...\n");
//define headers to find (to search!)
routines_dir=[SCI+"/routines/"];
routines_head=["machine.h";"mex.h";"stack-c.h";"stack-def.h"];
routines_flag=[%t;%t;%t;%t];
scicos_dir=[SCI+"/routines/scicos/"];
scicos_head=["scicos_block.h"];
scicos_flag=[%t];
f2c_dir=[SCI+"/routines/f2c/"];
f2c_head=["f2c.h"];
f2c_flag=[%t];
dir_flag=[%t;%t;%t]; //3 répertoires
//define provided headers directory
prov_dir=MODNUM+"/routines/sci_headers/";
//incl_list : (1) liste des répertoires de taille n
// (2) flags correspondant aux répertoires
// (2*i+1..2*i+1+n) fichiers d'en-têtes correspondant
// (2*i+2..2*i+2+n) flags correspondant aux fichiers
incl_list=list([routines_dir;scicos_dir;f2c_dir],..
dir_flag,..
routines_head,routines_flag,..
scicos_head,scicos_flag,f2c_head,f2c_flag);
if MSDOS then
incl_list(1)=pathconvert(incl_list(1),%f,%t,'w');
for i=1:size(incl_list(1),'*')
incl_list(1)(i)=part(incl_list(1)(i),1:length(incl_list(1)(i))-1);
end
prov_dir=pathconvert(prov_dir,%f,%t,'w');
//doit-être vérifier
//incl_list(1)=""""+pathconvert(incl_list(1),%f,%t,'w')+"""";
//prov_dir=""""+pathconvert(prov_dir,%f,%t,'w')+"""";
end
prov_head_must_be_includ = %f;
for i=1:size(incl_list(1),'*')
if fileinfo(incl_list(1)(i))==[] then
incl_list(2)(i)=%f;
printf(" Directory %s isn''t found\n",incl_list(1)(i));
prov_head_must_be_includ = %t;
else
num_head=size(incl_list(2*i+1),'*');
if MSDOS then
sep="\";
else
sep="";
end
for j=1:num_head
if fileinfo(incl_list(1)(i)+sep+incl_list(2*i+1)(j))==[] then
incl_list(2*i+2)(j)=%f;
printf(" File %s isn''t found\n",incl_list(2*i+1)(j));
prov_head_must_be_includ = %t;
end
end
flag_dir=%f;
for j=1:num_head
flag_dir=flag_dir | incl_list(2*i+2)(j);
end
if ~flag_dir then incl_list(2)(i)=%f; end
end
end
if prov_head_must_be_includ then
printf(" Use provided header\n");
else
printf(" Scilab Source Version found\n");
end;
tt=[];k=1;
for i=1:size(incl_list(1),'*')
if incl_list(2)(i) then
tt(k)=incl_list(1)(i);
k=k+1;
end
end
if prov_head_must_be_includ tt(k)=prov_dir; end;
endfunction
IRCOM Group
Alan Layec