To get information about the licenses used by a compiler, use the -xlicinfo parameter. For example, for the C compiler type:
% cc -xlicinfo