gcc version query

I build my ports with gcc45. I suspect ccache is not calling the correct version of the compiler, although I have defined in /usr/local/etc/buildflags.conf
Code:
BUILDFLAGS_GCC= 45

1. How can I find out what version of the compiler (42 vs 45) a port was built with?
2. How can I test whether ccache is calling the correct compiler version?
 
The __GNUC__, __GNUC_MINOR__ and __GNUC_PATCHLEVEL__ macros hold the gcc version. I don't know whether some port stores them (boost uses them but iirc it doesn't save them somewhere).

In case there isn't, just add a port for
Code:
#include <stdio.h>
#include <stdlib.h>

int main()
{
  printf("gcc version: %d.%d.%d\n", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
  return (EXIT_SUCCESS);
}
 
Thanks xibo.
I have no experience with C code or making ports, etc. Although your suggestion sounds reasonable, I more or less have absolutely no idea how to implement it :(

Thanks anyway...
 
Could I have a little more input / detail on how to make this port? Can I just [cmd=]# make install <filename>[/cmd] with a txt file containing this script?
 
Back
Top