1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
This patch renames instantfpc to ifpc (Instant Free Pascal Compiler) and adds
man files for it.
--- /dev/null
+++ fpcbuild-2.6.2/install/man/man1/ifpc.1
@@ -0,0 +1,54 @@
+.TH ifpc 1 "18 May 2013" "Free Pascal" "Instant pascal code interpreter"
+.SH NAME
+ifpc \- The Free Pascal Interpreter.
+
+.SH SYNOPSIS
+
+.B ifpc
+[\fI\-h\fR] [\fI\-v\fR] [\fIcompiler options\fR] <\fIsource file\fR>
+[\fIprogram parameters\fR]
+
+.SH DESCRIPTION
+
+.B ifpc
+This is a pascal code interpreter program. It compiles source and runs the
+ generated program.
+
+Source is compared with the cache. If cache is not valid then then source is
+copied to cache with the shebang line commented and cached source is compiled.
+If compilation fails the fpc output is written to stdout and and exit code 1
+is returned
+If compilation was successful the program is executed.
+If the compiler options contains \-B the program is always recompiled.
+If the environment option INSTANTFPCOPTIONS is set it is passed to compiler as
+the first parameters.
+
+.SH USAGE
+
+.B ifpc
+takes the following arguments:
+.TP
+.B \-h
+Prints this help message and exit.
+.TP
+.B \-v
+Prints version and exit.
+.TP
+.B \-\-get\-cache
+Prints current cache directory and exit.
+.TP
+.B \-\-set\-cache=<path to cache>
+Set the cache to be used. Otherwise using environment variable INSTANTFPCCACHE.
+.TP
+.B \-\-compiler=<path to compiler>
+Normally fpc is searched in PATH and used as compiler.
+.TP
+.B \-\-skip\-run
+Do not execute the program. Useful to test if script compiles
+.TP
+.B \-B
+Always recompile.
+
+.SH SEE ALSO
+.IP
+.BR fpc (1)
--- fpcbuild-2.6.2/fpcsrc/utils/instantfpc/instantfpc.pas
+++ fpcbuild-2.6.2/fpcsrc/utils/instantfpc/instantfpc.pas
@@ -27,37 +27,38 @@
Version = '1.3';
// 1.3 compile in a separate directory, so that parallel invocations do not overwrite link.res files
+var
+ BinPath, BinName: string;
Procedure Usage;
-
begin
- writeln('instantfpc '+Version);
+ writeln(BinName, ' ', Version);
writeln;
writeln('Run pascal source files as scripts.');
writeln('Normal usage is to add to a program source file a first line');
- writeln('("shebang") "#!/usr/bin/instantfpc".');
+ writeln('("shebang") "#!', BinPath, BinName, '".');
writeln('Then you can execute the source directly in the terminal/console.');
writeln;
- writeln('instantfpc -h');
+ writeln(BinName, ' -h');
writeln(' Print this help message and exit.');
writeln;
- writeln('instantfpc -v');
+ writeln(BinName, ' -v');
writeln(' Print version and exit.');
writeln;
- writeln('instantfpc [compiler options] <source file> [program parameters]');
+ writeln(BinName, ' [compiler options] <source file> [program parameters]');
writeln(' Compiles source and runs program.');
writeln(' Source is compared with the cache. If cache is not valid then');
writeln(' source is copied to cache with the shebang line commented and');
writeln(' cached source is compiled.');
writeln(' If compilation fails the fpc output is written to stdout and');
- writeln(' instantfpc exits with error code 1.');
+ writeln(' ', BinName, ' exits with error code 1.');
writeln(' If compilation was successful the program is executed.');
writeln(' If the compiler options contains -B the program is always');
writeln(' compiled.');
writeln(' If the environment option INSTANTFPCOPTIONS is set it is');
writeln(' passed to the compiler as first parameters.');
writeln;
- writeln('instantfpc --get-cache');
+ writeln(BinName, ' --get-cache');
writeln(' Prints current cache directory and exit.');
writeln;
writeln('Options:');
@@ -104,7 +105,7 @@
if (P='') then exit;
if p='-v' then
begin
- writeln('instantfpc '+Version);
+ writeln(BinName, ' ', Version);
Halt(1);
end
else if p='-h' then
@@ -137,6 +138,8 @@
{ For example:
/usr/bin/instantfpc -MObjFpc -Sh ./envvars.pas param1
}
+ BinPath := ExtractFilePath(ParamStr(0));
+ BinName := 'ifpc';
for i:=1 to Paramcount do
begin
p:=ParamStr(i);
--- fpcbuild-2.6.2/fpcsrc/utils/instantfpc/Makefile.fpc
+++ fpcbuild-2.6.2/fpcsrc/utils/instantfpc/Makefile.fpc
@@ -3,7 +3,7 @@
#
[package]
-name=instantfpc
+name=ifpc
version=2.6.4
[install]
@@ -13,7 +13,7 @@
packages=fcl-process
[target]
-programs=instantfpc
+programs=ifpc
[compiler]
options=-S2h
--- fpcbuild-2.6.2/fpcsrc/utils/instantfpc/ifpc.pas
+++ fpcbuild-2.6.2/fpcsrc/utils/instantfpc/ifpc.pas
@@ -0,0 +1,1 @@
+{$INCLUDE instantfpc.pas}
|