mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 17:29:42 +02:00
* new file
This commit is contained in:
parent
85a15f1788
commit
96ba65165b
54
packages/gdbint/gdbver.pp
Normal file
54
packages/gdbint/gdbver.pp
Normal file
@ -0,0 +1,54 @@
|
||||
{
|
||||
$Id$
|
||||
|
||||
Program to detect the version of libgdb that will be
|
||||
used for linking
|
||||
}
|
||||
program find_gdb_version;
|
||||
|
||||
{$Linklib gdb}
|
||||
|
||||
uses
|
||||
strings;
|
||||
|
||||
const
|
||||
{$ifdef unix}
|
||||
ver_name = 'version';
|
||||
{$else not unix}
|
||||
ver_name = '_version';
|
||||
{$endif}
|
||||
var
|
||||
v5_version : array[0..0] of char;external name ver_name;
|
||||
v4_version : pchar;external name ver_name;
|
||||
version : pchar;
|
||||
version_number : longint;
|
||||
only_ver : boolean;
|
||||
|
||||
begin
|
||||
only_ver:=(Paramcount>0) and (ParamStr(1)='-n');
|
||||
getmem(version,5);
|
||||
strlcopy(version,@v5_version,4);
|
||||
if (version[0] in ['4','5','6','7','8','9']) and (version[1]='.') then
|
||||
begin
|
||||
if not only_ver then
|
||||
Writeln('GDB version is ',pchar(@v5_version));
|
||||
version_number:=ord(version[0])-ord('0');
|
||||
end
|
||||
else
|
||||
begin
|
||||
if not only_ver then
|
||||
Writeln('GDB version is ',v4_version);
|
||||
version_number:=ord(v4_version[0])-ord('0');
|
||||
end;
|
||||
freemem(version,5);
|
||||
if only_ver then
|
||||
Write(version_number);
|
||||
Halt(version_number);
|
||||
end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.2 2001-04-08 11:44:01 peter
|
||||
* new file
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user