1

I have these lines in my make file:

ifeq ($(SYSTEM),SOLARIS)
    # SUN Solaris 8 no c99
    ifeq ($(OSVER),510)
        CC=c99 -Xa -mt 
        LD=c99
    else
        CC=cc -Xa -mt -xc99=no_lib
        LD=cc 

I have to compile my code in Solaris 11. Previously someone compiled in Solaris 10 or 9. Not sure which.

If I execute which CC its giving "no CC in user/bin" error. But my Solaris 11 has GCC installed in it. Do I have change CC=GCC or I have install new CC. If i have to install new CC which one I have to install?

Tim
  • 4,790
  • 4
  • 33
  • 41
bhanu
  • 35
  • 5
  • 3
    Executables are case sensitive, maybe `CC` doesn't exist, but `cc` does. What is the output of `which cc`? – Tim Jul 18 '19 at 17:27
  • Hi Tim thanks for the response.which cc which: no cc in (/usr/bin:/usr/sbin) this what i am getting. – bhanu Jul 19 '19 at 05:50
  • @Tim The upper-case `CC` here is a `make` variable, that by convention is used to identify the C compiler to be used by the makefile. For example: https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html – Andrew Henle Jul 19 '19 at 11:18

1 Answers1

1

cc typically points to the system default compiler. On Solaris this would be part of SolarisStudio (which may or may not be installed).

If cc is not available (test with which cc), but gcc is, then your Makefile should be adjusted to point to the gcc location.

Your Makefile may now look like:

ifeq ($(SYSTEM),SOLARIS)
    # SUN Solaris 8 no c99
    ifeq ($(OSVER),510)
        CC=c99 -Xa -mt 
        LD=c99
    else ifeq ($(OSVER),11)
        CC:=/usr/sfw/bin/gcc
    else
        CC=cc -Xa -mt -xc99=no_lib
        LD=cc 
fiidim
  • 157
  • 8
  • Thanks.If cc is not installed, and if I want to install what version I have to install.Where can I get that? – bhanu Jul 19 '19 at 05:53
  • 1
    Try following the thread [here](https://unix.stackexchange.com/questions/12731/usr-ucb-cc-language-optional-software-package-not-installed). You may find a compiler in `/usr/sfw/bin` or install SolarisStudio downloaded from [here](http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index.html) – fiidim Jul 19 '19 at 13:31
  • Thank you fiifim. I have installed SolarisStudio. – bhanu Aug 01 '19 at 05:46