| 1 |
# |
| 2 |
# @(#)amiga.icn 1.4 3/14/91 |
| 3 |
# OS-specific code for Amiga Idol |
| 4 |
# |
| 5 |
global icontopt,cd,md,env,sysok,comp |
| 6 |
|
| 7 |
procedure mysystem(s) |
| 8 |
if \loud then write(s) |
| 9 |
return system(s) |
| 10 |
end |
| 11 |
|
| 12 |
procedure filename(s,ext) |
| 13 |
s[9:0] := "" |
| 14 |
s ||:= \ext |
| 15 |
return s |
| 16 |
end |
| 17 |
|
| 18 |
# if the filename s has extension ext then return the filename less the |
| 19 |
# extension, otherwise fail. |
| 20 |
procedure fileroot(s,ext) |
| 21 |
if s[- *ext : 0] == ext then return s[1 : - *ext] |
| 22 |
end |
| 23 |
|
| 24 |
procedure writesublink(s) |
| 25 |
writelink(env||"/"||s) |
| 26 |
end |
| 27 |
|
| 28 |
procedure envpath(filename) |
| 29 |
return env||"/"||filename |
| 30 |
end |
| 31 |
|
| 32 |
# |
| 33 |
# Installation. |
| 34 |
# Uses hierarchical filesystem on some systems (see initialize) |
| 35 |
# |
| 36 |
procedure install(args) |
| 37 |
if "-t" == !args then comp := -2 |
| 38 |
write("Installing idol environment in ",env) |
| 39 |
if env ~== "" then mysystem(md||env) |
| 40 |
fout := envopen("i_object.icn","w") |
| 41 |
write(fout,"record idol_object(__state,__methods)") |
| 42 |
close(fout) |
| 43 |
fout := &null |
| 44 |
cdicont(["i_object"]) |
| 45 |
end |
| 46 |
procedure uninstall(args) |
| 47 |
# not implemented yet |
| 48 |
end |
| 49 |
|
| 50 |
procedure makeexe(args,i) |
| 51 |
exe := args[i] |
| 52 |
if icont(exe) = \sysok then { |
| 53 |
mysystem("delete "||exe||".icn") |
| 54 |
if \exec then { |
| 55 |
write("Executing:") |
| 56 |
exe := "iconx "||exe |
| 57 |
every i := exec+1 to *args do exe ||:= " "||args[i] |
| 58 |
return mysystem(exe) |
| 59 |
} else return |
| 60 |
} |
| 61 |
end |
| 62 |
# |
| 63 |
# system-dependent compilation of idolfile.icn |
| 64 |
# (in the idol subdirectory, if there is one) |
| 65 |
# |
| 66 |
procedure cdicont(idolfiles) |
| 67 |
if comp = -2 then return # -t --> don't call icont at all |
| 68 |
args := " -c" |
| 69 |
rms := "" |
| 70 |
every ifile := !idolfiles do args ||:= " " || ifile |
| 71 |
every ifile := !idolfiles do rms ||:= " " || ifile || ".icn" |
| 72 |
|
| 73 |
mysystem("cd idolcode.env") |
| 74 |
if icont(args) = \sysok |
| 75 |
then every ifile := !idolfiles do mysystem("delete "||ifile||".icn") |
| 76 |
mysystem("cd /") |
| 77 |
return |
| 78 |
end |
| 79 |
procedure sysinitialize() |
| 80 |
icontopt := " -Sr500 -SF30 -Si1000 " |
| 81 |
cd := "cd " |
| 82 |
md := "makedir " |
| 83 |
env := getenv("IDOLENV") | "idolcode.env" |
| 84 |
sysok := 0 |
| 85 |
end |