public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Pathetic Newbie Problem
@ 2001-01-02 12:55 Ben Ocean
  2001-01-02 14:16 ` Les Newell
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Ocean @ 2001-01-02 12:55 UTC (permalink / raw)
  To: gcc-help

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1709 bytes --]

Hi;

Okay, I looked in
the archives, but everybody else must be a lot smarter than me because I didnÂ’t
find my answer there nor in the *Installation Instructions*. Here goes. For the
record, I have my own server built on RedHat 6.2. I read the following off the
Web site and have these questions:

 

Like most GNU software, GCC must be configured before it can be
built. This document describes the recommended configuration procedure for both
native and cross targets. 

>>What is the difference between *native* and *cross targets*?

We use srcdir to
refer to the toplevel source directory for GCC; we use objdir to refer to the toplevel
build/object directory. 

>>What is the *top level source directory*? What is the *top
level build/object directory*? Can someone give me an example? Shall I build on
/usr/bin/ ?

First, we highly recommend that GCC be built into a separate
directory than the sources which does not reside within the source tree. This
is how we generally build GCC; building where srcdir
== objdir should still work, but
doesn't get extensive testing; building where objdir
is a subdirectory of srcdir is
unsupported. 

>>What are we calling the *source tree*? Is this like the
doc root? Or the folder from which everything is built, like
/usr/bin/gcc-2.95whateveritis.

Second, when configuring a native system, either "cc" or
"gcc" must be in your path or you must set CC in your environment
before running configure. Otherwise the configuration scripts may fail. 

>>IÂ’m lost. What does that mean?

IÂ’m really not as dumb as this must make me sound. I know enough
UNIX to be dangerous (especially to myself), but I code in high level
languages.

TIA,

BenO

 







^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Pathetic Newbie Problem
  2001-01-02 12:55 Pathetic Newbie Problem Ben Ocean
@ 2001-01-02 14:16 ` Les Newell
  0 siblings, 0 replies; 2+ messages in thread
From: Les Newell @ 2001-01-02 14:16 UTC (permalink / raw)
  To: gcc-help

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3737 bytes --]

Hi Ben,

I am a bit of a newbie myself but hopefully I can help a bit. My following
comments are my interpretation of the instructions and I can't guarante
their accuracy...

> Like most GNU software, GCC must be configured before it can be built.
This
> document describes the recommended configuration procedure for both native
> and cross targets.
> >>What is the difference between *native* and *cross targets*?

native targets are when the target (resulting object code) is for the same
archicture as it is compiled on e.g compiling on Linux on a PC to run under
Linux on a PC. Cross targets are when the object code is for a different
target, e.g compiling on linux on a PC to run under Cygwin.


> We use srcdir to refer to the toplevel source directory for GCC; we use
> objdir to refer to the toplevel build/object directory.
> >>What is the *top level source directory*? What is the *top level
> build/object directory*? Can someone give me an example? Shall I build on
> /usr/bin/ ?
> First, we highly recommend that GCC be built into a separate directory
than
> the sources which does not reside within the source tree. This is how we
> generally build GCC; building where srcdir == objdir should still work,
but
> doesn't get extensive testing; building where objdir is a subdirectory of
> srcdir is unsupported.
> >>What are we calling the *source tree*? Is this like the doc root? Or the
> folder from which everything is built, like /usr/bin/gcc-2.95whateveritis.

GCC sources come as a directory tree - called the source tree. The top level
source directory is the topmost directory in that tree, usually something
like gcc-2.95.2. When you run the configure script it generates a similar
tree, specifically set up to your specifications. This contains the source
that you will actually build. You have to specify somewhere to put this
tree. This is the build/source directory. I normally use 'build-gcc' but it
can be anything.

This is the way I normally do this sort of thing:

in my home directory (/home/les) I untar my copy of gcc-2.95.2 (for
example). I will now have a directory called gcc-2.95.2 containing the
source tree.

mkdir build-gcc
cd build-gcc

../gcc-2.95.2/configure [options]
If you want a simple native compiler then you probably don't need to specify
any options.

wait a while as loads of obscure message fly up the screen

make all install

Wait even longer as it all compiles....

Unless you have specified --prefix=xxxx for configure then the compiler will
be installed in /usr/local (binaries will go in /usr/local/bin, libraries
into /usr/local/lib etc)

> Second, when configuring a native system, either "cc" or "gcc" must be in
> your path or you must set CC in your environment before running configure.
> Otherwise the configuration scripts may fail.
> >>IÂ’m lost. What does that mean?

All this means is that you must have a working compiler on your path to
compile the source. If it is not on your path or is not called "cc" or "gcc"
then you need to set the environment variable CC to point to it. In most
cases you dont have to worry about this unless you are trying something
clever as this should already be set up.

> IÂ’m really not as dumb as this must make me sound. I know enough UNIX to
be
> dangerous (especially to myself), but I code in high level languages.
> TIA,
> BenO
>

I know the feeling - I had it slightly worse, being a DOS type trying to
build a cross compiler for a h8300hms target.

BTW You should already have gcc with Red Hat 6.2. If not you should be able
to find it as a binary RPM on your installation CD. I am not sure exactly
what version you will have but it should be fairly up to date. Do you
actually need to go through this process?

Les



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-01-02 14:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-02 12:55 Pathetic Newbie Problem Ben Ocean
2001-01-02 14:16 ` Les Newell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).