diff --git a/fpcbuild/fpcsrc/utils/instantfpc/Makefile.fpc b/fpcbuild/fpcsrc/utils/instantfpc/Makefile.fpc index f862e64..92e38c1 100644 --- a/fpcbuild/fpcsrc/utils/instantfpc/Makefile.fpc +++ b/fpcbuild/fpcsrc/utils/instantfpc/Makefile.fpc @@ -3,7 +3,7 @@ # [package] -name=instantfpc +name=ifpc version=3.3.1 [require] diff --git a/fpcbuild/fpcsrc/utils/instantfpc/fpmake.pp b/fpcbuild/fpcsrc/utils/instantfpc/fpmake.pp index 1fee918..4fd667d 100644 --- a/fpcbuild/fpcsrc/utils/instantfpc/fpmake.pp +++ b/fpcbuild/fpcsrc/utils/instantfpc/fpmake.pp @@ -15,7 +15,7 @@ begin With Installer do begin P:=AddPackage('utils-instantfpc'); - P.ShortName:='instantfpc'; + P.ShortName:='ifpc'; P.Author := ''; P.License := 'LGPL with modification'; diff --git a/fpcbuild/fpcsrc/utils/instantfpc/instantfpc.pas b/fpcbuild/fpcsrc/utils/instantfpc/instantfpc.pas index b8dd584..9e7619c 100644 --- a/fpcbuild/fpcsrc/utils/instantfpc/instantfpc.pas +++ b/fpcbuild/fpcsrc/utils/instantfpc/instantfpc.pas @@ -28,39 +28,41 @@ const 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(Err : string); begin if (Err<>'') then Writeln('Error : ',Err); - 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] [program parameters]'); + writeln(BinName, ' [compiler options] [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:'); @@ -106,7 +108,7 @@ begin if (P='') then exit; if p='-v' then begin - writeln('instantfpc '+Version); + writeln(BinName, ' ', Version); Halt(1); end else if p='-h' then @@ -139,6 +141,8 @@ begin { 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);