Go Premium for a chance to win a PS4. Enter to Win


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
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
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 find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses
Course of the Month7 days, 11 hours left to enroll

824 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