?
Solved

How to install gcc 2.7.2 in Solaris ?

Posted on 1997-09-03
2
Medium Priority
?
696 Views
Last Modified: 2013-12-26
I tried to install gcc 2.7.2.2 (x86). But it not works ("installation problem, cannot exec 'cpp' : No such file or directory"). Why? I copied gcc...tar.gz into /usr/local and ungzipped/untared. Also I copied all files into /usr/pkg/gcc-2.7.2/. May be I made something wrong?

0
Comment
Question by:vb138ff
[X]
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
2 Comments
 
LVL 2

Accepted Solution

by:
df020797 earned 20 total points
ID: 1294724
The problem is if you dont have buyed the SParc Works Compiler from Sun that you dont have a compielr to build gcc with. B ut dont fear. On ftp://ftp.darkface.pp.se/pub/sun do you find the package FSFgcc.gz and a gunzip to decompress it with. Then run pkgadd -d./FSFgcc and install that precompiled compiler. Its installed in /opt/gnu. NOW you got a compiler. Download the latest gcc and untar it. Then in the gcc directory run a ./configure (make sure /opt/gnu/bin is first in your path). After that run make. After that run 'make stage1' and after that run 'make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O2"', then run make stage2 and then run 'make CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O2"' and then run as root 'make install CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O"'. Take /opt/gnu/bin out of your path and try the new compiler out. If it works run pkgrm and deinstall the FSFgcc package. You should then have a brand new working gcc

Regards
//Patrik
0
 

Expert Comment

by:yakovlev
ID: 1294725
Probably, you have an already precompiled compiler. Check the
subdirectory "lib/gcc-lib" in your main GCC directory, then
goto it and search for another subdirectory, name of which
resembles your operating system (it's "sparc-sun-solaris2.5" on
my machine), then goto it and search for a subdirectory,
name of which is equal to GCC version (it's "2.7.2.2" on
my machine). This last subdirectory usually contains all the
parts of GCC, and you should use option -B to say the compiler,
where to search its parts. For example, insert the following
lines in your makefile:

  CC = ${GCCHOME}/gcc
  CFLAGS += -I${GCCHOME}/include -B${GCCHOME}/

and do the following command in your C-shell:

  setenv GCCHOME ${YOURGCCDIR}/lib/gcc-lib/<YourOS>/2.7.2.2

Of course, you can use a different name instead of GCCHOME.
Pay attention to "-I" option and last slash in "-B" option -
they are important. And this method doesn't require to have
GCC on your search path.

0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…
Suggested Courses

770 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