|
@@ -1,6 +1,15 @@
|
|
|
|
+{$APPTYPE CONSOLE}
|
|
program FPimpdef;
|
|
program FPimpdef;
|
|
|
|
+{$DEFINE STANDALONE}
|
|
|
|
+{$IFNDEF FPC}
|
|
uses
|
|
uses
|
|
-ImpDef;
|
|
|
|
|
|
+ dmisc,
|
|
|
|
+ ImpDef;
|
|
|
|
+{$ELSE}
|
|
|
|
+uses
|
|
|
|
+ DOS,
|
|
|
|
+ ImpDef;
|
|
|
|
+{$ENDIF}
|
|
var
|
|
var
|
|
binname:string;
|
|
binname:string;
|
|
function Ofound(const short,full:string):longint;
|
|
function Ofound(const short,full:string):longint;
|
|
@@ -39,22 +48,52 @@ begin
|
|
end;
|
|
end;
|
|
writeln('Usage: ',fn,' [options]');
|
|
writeln('Usage: ',fn,' [options]');
|
|
writeln('Options:');
|
|
writeln('Options:');
|
|
- writeln('-i | --input <file> - set input file;');
|
|
|
|
- writeln('-o | --output <file> - set output file');
|
|
|
|
- writeln('-h | --help - show this screen');
|
|
|
|
|
|
+ writeln('-i | --input <file> - set input file;');
|
|
|
|
+ writeln('-o | --output <file> - set output .def file');
|
|
|
|
+ writeln('-l | --library <file> - set output static library');
|
|
|
|
+ writeln('-s | --assembler <name> - use <name> for assembler (default asw)');
|
|
|
|
+ writeln('-r | --archiver <name> - use <name> for archiver (default arw)');
|
|
|
|
+ writeln('-h | --help - show this screen');
|
|
halt;
|
|
halt;
|
|
end;
|
|
end;
|
|
|
|
+{$ifndef UNIX}
|
|
|
|
+procedure AddExt(var s:string);
|
|
|
|
+ var
|
|
|
|
+ s1:string;
|
|
|
|
+ i:longint;
|
|
|
|
+ begin
|
|
|
|
+ s1:=copy(s,length(s)-3,4);
|
|
|
|
+ for i:=1 to length(s1)do
|
|
|
|
+ s1[i]:=upcase(s1[i]);
|
|
|
|
+ if s1<>'.EXE'then
|
|
|
|
+ s:=s+'.EXE';
|
|
|
|
+ end;
|
|
|
|
+{$endif}
|
|
|
|
+var
|
|
|
|
+ EnvPath:string;
|
|
begin
|
|
begin
|
|
binname:=GetOption('-i','--input');
|
|
binname:=GetOption('-i','--input');
|
|
if(binname='')or(Ofound('-h','--help')>0)then
|
|
if(binname='')or(Ofound('-h','--help')>0)then
|
|
help_info;
|
|
help_info;
|
|
-if not makedef(binname,GetOption('-o','--output'))then
|
|
|
|
|
|
+ asw_name:=GetOption('-s','--assembler');
|
|
|
|
+ if asw_name='' then
|
|
|
|
+ asw_name:='asw';
|
|
|
|
+ arw_name:=GetOption('-r','--archiver');
|
|
|
|
+ if arw_name='' then
|
|
|
|
+ arw_name:='arw';
|
|
|
|
+{$ifndef UNIX}
|
|
|
|
+ AddExt(asw_name);
|
|
|
|
+ AddExt(arw_name);
|
|
|
|
+{$endif}
|
|
|
|
+ EnvPath:=GetEnv('Path');
|
|
|
|
+ if EnvPath='' then
|
|
|
|
+ EnvPath:=GetEnv('PATH');
|
|
|
|
+ asw_name:=FSearch(asw_name,EnvPath);
|
|
|
|
+ arw_name:=FSearch(arw_name,EnvPath);
|
|
|
|
+if not makedef(binname,GetOption('-o','--output'),GetOption('-l','--library'))then
|
|
begin
|
|
begin
|
|
writeln('Export names not found');
|
|
writeln('Export names not found');
|
|
halt(1);
|
|
halt(1);
|
|
end;
|
|
end;
|
|
-end. $Log$
|
|
|
|
-end. Revision 1.2 2000-07-13 11:32:55 michael
|
|
|
|
-end. + removed logs
|
|
|
|
-end.
|
|
|
|
-}
|
|
|
|
|
|
+end.
|
|
|
|
+
|