Having a hard time configuring gcc on Solaris 8

Posted on 2004-04-13
Medium Priority
Last Modified: 2013-12-21
I am working on setting up mysql and php on a Sun Box running Solaris 8 and one of the packages that I need to install is gcc.  I have downloaded and followed instructions on how to go about configuring but I am getting the following error:

# /usr/local/gcc-2.95.3/configure
Configuring for a sparc-sun-solaris2.8 host.
Created "Makefile" in /usr/local/gcc-2.95.3/objdir using "mh-frag"
/usr/local/gcc-2.95.3/configure: cc: not found
*** The command 'cc -o conftest -g   conftest.c' failed.
*** You must set the environment variable CC to a working compiler.

I would appreciate some guidance on this.  I have been searching for a quick answer but as usual "no such thing"
Question by:roduno
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 3
  • +3
LVL 48

Expert Comment

ID: 10820120
You need a C compiler or at least a bootstrap to compile gcc.

However, unless you *really* like doing things the hard way, the easiest way to install gcc is to download the package from http://sunfreeware.com/
LVL 40

Expert Comment

ID: 10820152
To be able to configure and build Gcc you must have a C compiler on the system, which you aparently don't. One solution might be to build Gcc on some other Solars 8 system that has a C compiler and install it on this box, if that's a possibility. An easier solution would be to get a pre-built copy of Gcc from http://www.sunfreeware.com/

Note that you may find that you need to install the Solaris developer cluster to get the header files, libs and tools that you'll need for building php & MySQL. Those are on your Solaris 8 CD's.

Expert Comment

ID: 10820662
Get the gcc package from www.sunfreeware.com.  Then you want to make sure your $PATH and $LD_LIBRARY_PATH include all the directories of the  required libraries and files.  From there you should be ready to go.  

config it
make it
install it

:-) my my *nix is Cool
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 12

Expert Comment

ID: 10823209
Hi Tintin,
> doing things the hard way
Be aware that the last time I did this on a 4 CPU Sun with parallel make, it took more than two hours and >1GB of HD space. So "hard way" is no exaggeration - it's a three stage bootstrap process with tons of source files.

It works, but it takes ages (especially when you're compiling the full gcc package). And yes, you'd need Sun cc.


Expert Comment

ID: 10825414
Hi Roduno

As stated in 2 prior comments go to www.sunfreeware.com, select your Processor/OS then below that select your package (gcc-2.95.3).
In the middle screen you will see "gcc-2.95.3-sol8-sparc-local.gz" this is a compiled version of gcc all you need to do is unzip this file and run pkgadd to install.

I have used this at it worked just fine.

Good luck
Steve ...

Author Comment

ID: 10838447
     I tried to run pkgadd and I received this error: pkgadd: ERROR: no packages were found in </var/spool/pkg>
Am I missing something?

LVL 40

Expert Comment

ID: 10838934
After unpacking the download you need to execute 'pkgadd -d .' while in the directory containg the Gcc package.

Author Comment

ID: 10838960
Yes, thanks, I had actually figured that out in the interim but I ran into another problem where I get an error because of not enough space in the var/ directory.  I heard from another comment that I could ''symbolically link" this directory to another with more space in order to get the pkgadd to work so I am trying to find out how exactly I can do this.
LVL 48

Expert Comment

ID: 10839002
Is /var on a separate filesystem?

Is there stuff in /var/log that you can clean up?

What's the output from

df -k

Author Comment

ID: 10839012
# df -k
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c0t0d0s0      90079   49343   31729    61%    /
/dev/dsk/c0t0d0s6     798495  716033   26568    97%    /usr
/proc                      0       0       0     0%    /proc
fd                         0       0       0     0%    /dev/fd
mnttab                     0       0       0     0%    /etc/mnttab
/dev/dsk/c0t0d0s3      32847    8621   20942    30%    /var
swap                  674584      16  674568     1%    /var/run
swap                  674592      24  674568     1%    /tmp
/dev/dsk/c0t0d0s5      26615    2133   21821     9%    /opt
/dev/dsk/c0t2d0s7    38476820       9 38092043     1%    /export/home0
/dev/dsk/c0t0d0s7    36827276  120234 36338770     1%    /export/home
/dev/dsk/c0t0d0s1     337815  218529   85505    72%    /usr/openwin
LVL 48

Expert Comment

ID: 10839126
That is an extremely small size allocated to /var.

What you could do is move /var/log (assuming that's where most of the space is being taken up) and move it under /export/home, eg:

cd /var
mv log /export/home
ln -s /export/home/log /var/log
LVL 40

Accepted Solution

jlevie earned 2000 total points
ID: 10839214
I don't remember if pkgadd needs space in /var/spool/some-place or /var/tmp when unpacking a package as a part of the install and I'm not where I can check the man page to find out right now. I'd guess it would be /var/tmp and you could solve that by:

mkdir /home/temp-dir
cd /var/
mv tmp hold-tmp
ln -s /home/temp-dir tmp

Then when the Gcc is installed you can undo the workaround by removing the symlink and renaming hold-tmp to tmp.

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question