1
function [ok]=do_ccomlink(funam,txt)
3
if stripblanks(funam)==emptystr() then
4
ok=%f;x_message('sorry C file name not defined');return
7
out_f = strsubst(TMPDIR,'/','\')+'\'+funam+'.c';
10
unix_s('\rm -f '+TMPDIR+'/'+funam+'.c');
12
write(TMPDIR+'/'+funam+'.c',txt,'(a)')
14
[a,b]=c_link(funam); while a ; ulink(b);[a,b]=c_link(funam);end
17
if (getenv('COMPILER','NO')=='ABSOFT')
18
cmd_win='amake /f '"'+SCI+'\util\MakeC.amk'" TARGET=';
20
cmd_win='nmake /f '"'+SCI+'\util\MakeC.mak'" TARGET=';
22
cmd_win=cmd_win+funam+' SCIDIR1='"'+strsubst(SCI,'/','\')+''"';
26
ww=unix_g('cd '+TMPDIR+'; make -f '+SCI+'/util/Make.unx '+funam+'.o SCIDIR='+SCI);
29
if ww==emptystr() then
30
ok=%f;x_message('sorry compilation problem');return
32
errcatch(-1,'continue')
34
junk=link(TMPDIR+'/'+funam+'.dll',funam,'c');
36
[a,b]=c_link(funam); while a; ulink(b);[a,b]=c_link(funam);end
37
junk=link(TMPDIR+'/'+funam+'.o',funam,'c');
39
if iserror(-1)==1 then
40
ok=%f;x_message('sorry link problem');