Solved

How to install gcc 2.7.2 in Solaris ?

Posted on 1997-09-03
2
684 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
2 Comments
 
LVL 2

Accepted Solution

by:
df020797 earned 10 total points
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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 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.:

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now