[lazarus] OS and Architecture detection...

Michael.VanCanneyt at Wisa.be Michael.VanCanneyt at Wisa.be
Wed Jun 25 16:33:08 EDT 2003




On 25 Jun 2003, Tom Lisjac wrote:

>
> Today's project is to try and clean up the code I've written so it will
> work across the operating systems and architectures that FPC and Lazarus
> support. I've noticed conditionals for "i386", "BSD", "Solaris" etc, but
> I can't find the place where they're set.

They are set internally by the compiler.

>Getting a dump of them all and
> seeing when they're applied would be very useful.

When compiling, 'ppc386 -vm' will report all macros defined by the compiler,
and will report what the compiler does when it encounters a macro directive.

>
> I'm also interested in runtime capability detection. I have some
> routines for the IA-32 (processor type, SN, stepping, id, time stamp
> counter, clock speed etc) but nothing for any other architecture.

Neither have we, I suspect :-)

But you can ask:

Jonas Maebe (jonas at freepascal.org) is the PPC architecture expert.
Pierre Muller or Carl-Eric codere are M68k experts. (pierre at freepascal.org or carl at freepascal.org)
Peter Vreman or Mazen Neifer take care of the SPARC port (peter at freepascal.org, mazen at freepascal.org)
Feel free to start a new architecture yourself ;-)

It would be a good idea to have some cross-CPU capability detection routines.

Michael.






More information about the Lazarus mailing list