Operating System - Linux
1754936 Members
3085 Online
108827 Solutions
New Discussion

GCC: configuring srcdir 7 objdir

 
Tito Hall
Occasional Contributor

GCC: configuring srcdir 7 objdir

Hello,

I've been configuring Apache on Red Hat Linux 5 for the past 2 weeks and I’m at the point where I’m configuring gcc-4.5.1 as a pre-requisite for Apache. I’ve already installed autoconf and make/automake, which are pre-requisites for gcc. So, gcc has been download and extracted and I’m configuring before it can be built.

What is suggested is srcdir is used to refer to the top level source directory for GCC; and objdir for the top level build/object directory. So, my question is all the files located directly underneath /gcc-4.*.*/ such as ChangeLog, MAINTAINERS should be moved into the srcdir folder? And all the subfolders OR all the files within subfolders belong in the objdir folder? Lastly, does srcdir & objdir both belong along the same file structure underneath /gcc-4.*.*/?

Tito
2 REPLIES 2
Steven Schweda
Honored Contributor

Re: GCC: configuring srcdir 7 objdir

> I've been [...]

For newcomers:

http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1451791

> [...] I've already installed autoconf and
> make/automake, which are pre-requisites for
> gcc.

You seem to be working too hard (on the wrong
things).

> What is suggested [...]

Where? What are you looking at?

http://gcc.gnu.org/install/
http://gcc.gnu.org/install/prerequisites.html
http://gcc.gnu.org/install/configure.html

As I read the "Prerequisites for GCC" page,
many things are needed "for building GCC",
but autoconf and automake are needed only
"for modifying GCC", which you're unlikely to
be doing.

On the "Installing GCC: Configuration" page:

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

So, ".../gcc-4.x.x" _is_ "srcdir". As it
says there, ...

[...]
To configure GCC:

% mkdir objdir
% cd objdir
% srcdir/configure [options] [target]
[...]

So, for example:

cd xxx/gcc-4.5.1 # ("cd srcdir")
mkdir ../gcc-4.5.1_obj # "mkdir objdir"
cd ../gcc-4.5.1_obj # "cd objdir"
../gcc-4.5.1/configure [...] # "srcdir/configure [...]"

You start with an empty "objdir". The
builders will populate "objdir" as needed.

> Lastly, does srcdir & objdir both belong
> along the same file structure underneath
> /gcc-4.*.*/?

No. As it says:

[...]
[...] building where objdir is a
subdirectory of srcdir is unsupported.
[...]

Just pick a nice name (like, say,
"gcc-4.5.1_obj"), and put it next to "srcdir"
("gcc-4.5.1").


I still claim that you should be looking for
a pre-built GCC kit for your environment.
Steven Schweda
Honored Contributor

Re: GCC: configuring srcdir 7 objdir

> [...] Red Hat Linux 5 [...]

So you posted this in an HP-UX forum because,
...?