LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Help w/installing/config GCC (https://www.linuxquestions.org/questions/linux-newbie-8/help-w-installing-config-gcc-45665/)

xlnlif 02-16-2003 01:04 PM

Help w/installing/config GCC
 
I have unpacked GCC under /root/usr/local/bin/gcc-3.2.1 (I don't know if that's correct) but I don't know how to edit env variable to add GCC so I can use "./configure" on Apache among other things.

This is the error I receive:
[root@localhost bin]# cd gcc-3.2.1/
[root@localhost gcc-3.2.1]# ./configure
Configuring for a i686-pc-linux-gnuoldld host.
Created "Makefile" in /usr/local/bin/gcc-3.2.1 using "mt-frag"
./configure: gcc-3.2.1: command not found
*** The command 'gcc-3.2.1 -o conftest -g conftest.c' failed.
*** You must set the environment variable CC to a working compiler.

I guess I need to set the Env Variable - can you help me with this?

Any guidance is much appreciated. If I need to move my GCC files to a proper directory please guide me there.

Also, I unpacked Apache under "/home/username/httpd-2.0.44 and I don't think that is right either. Any guidance here is appreciated very much too.

Thanks!
:Pengy:
Newbie

yngwin 02-16-2003 07:45 PM

I don't know if it works in your distro, but you could try env-update. And do you have a working compiler in the first place? That is, are the development packages installed?

Downloaded source code is usually placed in /usr/local/src/ but you may put it elsewhere.

xlnlif 02-16-2003 08:31 PM

I don't believe I have a working compiler so I downloaded gcc. I assumed I didn't have one when I tried to install Apache and got the error in my first post. I did find another instance of gcc-3.2.1 under /usr/local/compiler/gcc-3.2.1 so I don't have a clue what I am doing I guess and could use some help to get this gcc-3.2.1 off the ground and get a working compiler going.

Thanks for replying. I do appreciate it.

PTBmilo 02-16-2003 10:38 PM

What distribution are you using? Did you install all of the glibc,gcc devel packages?

Let us know what you're using so that we can help you out a little easier.

PS-... you can put those sources anywhere you want, but really /usr/local/bin is kindof a wierd place ( bin/ directories usually only store binaries :) I usually put them in /usr/src/sources, /home/milo/sources, or somewhere in /mnt, but that's just my preferences.

xlnlif 02-17-2003 12:34 AM

The distro I am using is RH 7.3. That's great advice for the SRC. I will move GCC there.

I hope having the distro information helps. As far as the dev packages. All I have is from the GCC org site that I downloaded which was the gcc-3.2.1.tar.gz and I opened that up and let it do its unpacking. That's really all I did so far aside from moving the package to the /usr/local/bin/gcc-3.2.1 directory. I don't understand why I have a /usr/local/Compiler/gcc-3.2.1 directory though since I never put one there - unless the unpacking created it for me.

Anyway - I hope the helps a bit. Thanks!!

PTBmilo 02-17-2003 06:43 PM

I'm not too familiar with redhat, so you might want to get some more help with the redhat-specific stuff. But here's the overview:

You need a compiler to compile a compiler :) Whan you download the .tar.gz file, you are downloading the source code that will compile and give you the gcc executable. Since you can't do this, you need to install gcc from redhat rpm's.

The first thing you should do is "gcc -v" to see if you already have it installed. You might just need to install 'glibc-devel.rpm' or something like that.

Search around on this site... I'm sure it has been explained how to do this with redhat in much more detail than I can provide.

I think there's also a rpm command which will list all of the packages currently installed.

If you know that you have a compiler, you can set the environment variable CC with:

export CC='gcc'

Sorry I can't help more. Good luck with it all.

mhearn 02-18-2003 04:22 AM

You don't want to build gcc from the source. Trust me, esp on Redhat, you do not want to do this.

Instead, use the redhat packaging tools to find the development tools packages, and install them. When you can run gcc -v, you've got it set up. All distros ship with gcc as a package, but it's not always installed by default.


All times are GMT -5. The time now is 05:33 PM.