[M3devel] m3-libs/m3core/src/runtime/common/Compiler.tmpl?
Jay K
jay.krell at cornell.edu
Thu Dec 30 13:14:21 CET 2010
So..I spent a few minutes tonight trying to use/build an old release: 5.4.0.
One of the problems I hit was building the 5.4.0 release with a current "I386_FREEBSD" compiler.
One of the problems in the system, just a small number of occurences, is m3makefiles having lists
of platforms, that don't have current platforms. In some ways this might be inevitable.
I have however reduced the problem by using lists of OS (Linux, FreeBSD, etc.) and processor architecture (x86, AMD64, SPARC32, etc.).
So new combinations thereof don't require visiting so many places.
However this reminded me of something that has bugged me a bit.
In m3core:
INTERFACE Compiler; (* this is generated by quake code *)
enum OS = { POSIX, WIN32} not so bad, hasn't changed in over 10 years
enum Platform = { big list of all targets } changes whenever a target is added, fairly often
CONST ThisOS = OS.POSIX or OS.WIN32 not so bad
CONST ThisPlatform:Platform = ... a small problem, the subject here
CONST ThisPlatform_String:TEXT = "..."; not a problem
I'd like to remove the enum Platform and ThisPlatform.
This increases portability in terms of the ability of older/newer cm3 to build newer/older cm3.
i.e...I guess...just...for a cm3 hosted on a renamed platform (I386_LINUX vs. LINUXLIBC6, etc.)
It also is one less file to edit when adding a new target.
Ideally that number is just one file, though currently it is a few.
I'll try it out, see if anything in our tree uses it.
Any uses are probably suspicious anyway.
Perhaps we should provide the two smaller "composed" enums
rename ThisOS to ThisOSType
then ThisOS in {Linux, OpenBSD, FreeBSD, Solaris, etc.}
and ThisProcessorArchitecture in {x86, AMD64, sparc32, etc.}
(possibly x86, sparc, powerpc, and then can check BITSIZE(INTEGER) to get 32/64).
The one place I knew of that used this stuff I changed to do something else -- use quake code to produce true/false.
- Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20101230/258bf162/attachment-0001.html>
More information about the M3devel
mailing list