[Vm-dev] __VERSION__ in squeakvm classic
David T. Lewis
lewis at mail.msen.com
Sun Mar 29 17:33:46 UTC 2020
On Sun, Mar 29, 2020 at 08:49:29AM -0500, stes wrote:
>
> In the subversion sources of "Squeakvm" classic
>
> platforms/unix/vm/config.cmake
>
> there is a line
>
> SET (VM_BUILD_STRING "\"Unix built on \"__DATE__ \" \"__TIME__\" Compiler:
> \"__VERSION__")
>
>
>
> Now on Solaris 11.4 or 11.3 with SunPRO C compiler there is an issue with
> __VERSION__
>
> the following sample program:
>
> bash-4.4$ cat x.c
>
> #include <stdio.h>
>
> int main(int argc,char *argv[])
> {
> printf("%s\n",__DATE__);
> printf("%s\n",__TIME__);
> printf("%s\n",__VERSION__);
> }
>
>
> when compiled with GCC 9.2 on Solaris I get:
>
> $ gcc x.c
> $ ./a.out
> Mar 29 2020
> 15:43:33
> 9.2.0
>
> when compiling with SunPRO C 12.6 on Solaris the result is :
>
> $ cc x.c
> "x.c", line 8: undefined symbol: __VERSION__
> cc: acomp failed for x.c
>
>
> I could be using GCC 9.2 to build the squeakvm of course but because I tried
> with the SunPRO C,
> this only defines __DATE__ and __TIME__ but not __VERSION__ (as far as I
> know).
>
> So perhaps the best level to fix this (minor and only) issue with the
> compile of the squeakvm with the SunPRO C would be at the
>
> platforms/unix/vm/config.cmake
>
> level
>
Yes, that sounds right to me.
Here is a web page that gives some reference information on predefined
macros for various compilers:
http://beefchunk.com/documentation/lang/c/pre-defined-c/precomp.html
So maybe there is a way to use the __SUNPRO_C macro in config.cmake. I am
only guessing here, but possibly something like this will work:
IF (__SUNPRO_C)
SET (VM_BUILD_STRING "\"Unix built on \"__DATE__ \" \"__TIME__\" Compiler: \"__SUNPRO_C")
ELSE ()
SET (VM_BUILD_STRING "\"Unix built on \"__DATE__ \" \"__TIME__\" Compiler: \"__VERSION__")
ENDIF (__SUNPRO_C)
Dave
More information about the Vm-dev
mailing list