public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* gcc and linux newbie's question
@ 1999-12-19 23:31 Hankel O'Fung
  1999-12-20  5:58 ` Tim Prince
  1999-12-31 22:24 ` Hankel O'Fung
  0 siblings, 2 replies; 10+ messages in thread
From: Hankel O'Fung @ 1999-12-19 23:31 UTC (permalink / raw)
  To: help-gcc

Dear all,

[Please also reply by email. Thanks.]
According to http://gcc.gnu.org/install/configure.html ,

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

1) Is "source directory" the directory where I place the
   decompressed and unpackaged gcc bzip2 files?

  "... 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."

2) Does it mean I should set those things before configuration?
3) How to set 'cc' or 'gcc' or 'CC'?

Thanks in advance.
--
Cheers, Hankel

http://www.acad.polyu.edu.hk/~master


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

* Re: gcc and linux newbie's question
  1999-12-19 23:31 gcc and linux newbie's question Hankel O'Fung
@ 1999-12-20  5:58 ` Tim Prince
  1999-12-21 19:48   ` root
  1999-12-31 22:24   ` Tim Prince
  1999-12-31 22:24 ` Hankel O'Fung
  1 sibling, 2 replies; 10+ messages in thread
From: Tim Prince @ 1999-12-20  5:58 UTC (permalink / raw)
  To: help-gcc

>1) Is "source directory" the directory where I place the
>   decompressed and unpackaged gcc bzip2 files?

Yes, e.g. <source directory>/gcc-2.95.2...

>set
>   CC in your environment before running configure.

>2) Does it mean I should set those things before configuration?

yes, according to your shell, along the lines of

export CC=/usr/bin/gcc

or

setenv CC /bin/cc

so that $CC invokes the compiler you wish to use for initial bootstrap


Tim Prince
tprince@computer.org

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

* Re: gcc and linux newbie's question
  1999-12-20  5:58 ` Tim Prince
@ 1999-12-21 19:48   ` root
  1999-12-21 20:47     ` llewelly
                       ` (2 more replies)
  1999-12-31 22:24   ` Tim Prince
  1 sibling, 3 replies; 10+ messages in thread
From: root @ 1999-12-21 19:48 UTC (permalink / raw)
  To: help-gcc

Tim Prince wrote:

> > set CC in your environment before running configure.
>
> >2) Does it mean I should set those things before configuration?
>
> yes, according to your shell, along the lines of
>
> export CC=/usr/bin/gcc
> or
> setenv CC /bin/cc
>
> so that $CC invokes the compiler you wish to use for initial bootstrap

Thanks Tim, but I still encounter some problems.

According to http://gcc.gnu.org/install/configure.html ,

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

(a) I name the source dir and the object dir as follow:
    srcdir   /usr/local/src/gcc-2.95.2   (I unpacked the bzip2 files
here)
    objdir   /usr/local/bin/gcc-objdir   (currently empty)
Can I remove these two directories after the compiler
is built? If not, are there any preferred directories to
hold the "sources" and "objects"? Or are there any
preferred names for the directories?

(b) Now I set CC by   export CC=/usr/local/bin/gcc.
Am I correct?

(c) From objdir, I issue the command   src/configure.
However, I got the following error message: "config.guess
failed to determine the host type. You need to specify one".
It then list the option   --host=HOST. But what should
the HOST be (I use Linux on a PC with an AMD K6-2
300MHz CPU)? This wasn't mentioned in the installation
instruction.

Thanks in advance.
Cheers, Hankel

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

* Re: gcc and linux newbie's question
  1999-12-21 19:48   ` root
@ 1999-12-21 20:47     ` llewelly
  1999-12-31 22:24       ` llewelly
  1999-12-21 23:07     ` Tim Prince
  1999-12-31 22:24     ` root
  2 siblings, 1 reply; 10+ messages in thread
From: llewelly @ 1999-12-21 20:47 UTC (permalink / raw)
  To: root; +Cc: help-gcc

On Wed, 22 Dec 1999, root wrote:

> Tim Prince wrote:
> 
> > > set CC in your environment before running configure.
> >
> > >2) Does it mean I should set those things before configuration?
> >
> > yes, according to your shell, along the lines of
> >
> > export CC=/usr/bin/gcc
> > or
> > setenv CC /bin/cc
> >
> > so that $CC invokes the compiler you wish to use for initial bootstrap
> 
> Thanks Tim, but I still encounter some problems.
> 
> According to http://gcc.gnu.org/install/configure.html ,
> 
> "We use srcdir to refer to the toplevel source directory
> for GCC; we use objdir to refer to the toplevel
> build/object directory."
> 
> (a) I name the source dir and the object dir as follow:
>     srcdir   /usr/local/src/gcc-2.95.2   (I unpacked the bzip2 files
> here)
>     objdir   /usr/local/bin/gcc-objdir   (currently empty)

> Can I remove these two directories after the compiler
> is built? If not, are there any preferred directories to
> hold the "sources" and "objects"? Or are there any
> preferred names for the directories?

Yes, you may remove them after you run make install.

> 
> (b) Now I set CC by   export CC=/usr/local/bin/gcc.
> Am I correct?
> 
> (c) From objdir, I issue the command   src/configure.

If you are building in a separate dir (which is advised), you need
  to tell configure where the source directory is, using something akin
  to:

${srcdir}/configure --srcdir={srcdir}

or:

$/usr/local/src/gcc-2.95.2/configure --srcdir=/usr/local/src/gcc-2.95.2 

> However, I got the following error message: "config.guess
> failed to determine the host type. You need to specify one".
> It then list the option   --host=HOST. But what should
> the HOST be (I use Linux on a PC with an AMD K6-2
> 300MHz CPU)? This wasn't mentioned in the installation
> instruction.

It isn't usually needed; the only time I ever needed to use --host was
  when I tried to build gcc on an RS/6000 43P running linux - every other
  platform I have tried was easiy recognized by gcc's configure.

Probably, configure got confused because you did not tell it the srcdir.

If, for some inexplicable reason you do need the host string, here are 2
  ways to figure it out:

(1) Check install/CONFIGURE . I know you said you read the install file,
    but there are many INSTALL files in the gcc tree. Also, try

(2) If you already have a working gcc installed, run 'ls /usr/lib/gcc-lib'
  (for a gcc installed under /usr; that is where redhat linux puts it) or
  'ls /usr/local/lib/gcc-lib' if gcc was installed under /usr/local, its
  default. On a vanilla redhat linux box I get:
$ls /usr/lib/gcc-lib/
i386-redhat-linux

This directory is named after the host platform of the installed gcc
  (luckily) in the same format gcc's configure wants it in, which is more
  or less <cpu>-<vendor>-<os> or <cpu>-<machine-name>-<vendor>-<os>

On a non-redhat, or heavily modifed redhat system, you might get:
$ls /usr/lib/gcc-lib/
i386-pc-linux-gnu

Which should also work just fine.

As you said you have a k6,
k6-pc-linux-gnu

*may* work for you; I have never tried it, so I am sticking my neck *way*
  out here.

Warning: If /usr/lib/gcc-lib is nfs mounted, or if somebody has built a
  few cross compilers, it may contain dirs for many platforms.





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

* Re: gcc and linux newbie's question
  1999-12-21 19:48   ` root
  1999-12-21 20:47     ` llewelly
@ 1999-12-21 23:07     ` Tim Prince
  1999-12-31 22:24       ` Tim Prince
  1999-12-31 22:24     ` root
  2 siblings, 1 reply; 10+ messages in thread
From: Tim Prince @ 1999-12-21 23:07 UTC (permalink / raw)
  To: help-gcc

>    objdir   /usr/local/bin/gcc-objdir   (currently empty)

Normally, you would build into a directory distinct from the installation
prefix, which would default to /usr/local, however this should work.

>If not, are there any preferred directories to
>hold the "sources" and "objects"?

There are a few packages, such as binutils, which prefer the build directory to
be immediately below the top level source directory.  This works also for
building the compilers, but I believe a totally separate directory is
considered preferable, and would be more convenient in case you must repeat the
unpacking of the distribution.

>I set CC by   export CC=/usr/local/bin/gcc.
>Am I correct?

If that is the compiler you wish to use for the first phase in boot-strapping
the new one.  In a normal linux installation you would not require setting CC,
or (with the same effect) 'export CC=/usr/bin/gcc'

>config.guess
>failed to determine the host type. 

the common choices for gcc-2.95.2 on linux would be i586-pc-linux-gnu (if you
have glibc; makes no difference whether you use i586 or i686) or
i586-pc-linux-gnulibc1 (if you have libc5).  I'm not sure what configure does
to interrogate your system, some combination of uname -a and checking your
library version.  If there were a similar listing among the configure choices
which included k6, you could use that; otherwise I think you need to use one of
the above.  

In your decision, you should consider that the compiler will use a subdirectory
$prefix/lib/gcc-lib/$host/gcc-2.95.2 among others.  If your original compiler
is gcc it should have a similar directory, and by making the $host and $prefix
names match, you can use the version options e.g. -V2.95.2 to select between
them.  linux distributions may be installed with $host as i386-linux,
i586-vendor-linux, or some such.  Making the $host match this way also assures
that the compiler is built starting from the same set of include files, if
there is a directory such as $prefix/$host/include.
Tim Prince
tprince@computer.org

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

* Re: gcc and linux newbie's question
  1999-12-21 23:07     ` Tim Prince
@ 1999-12-31 22:24       ` Tim Prince
  0 siblings, 0 replies; 10+ messages in thread
From: Tim Prince @ 1999-12-31 22:24 UTC (permalink / raw)
  To: help-gcc

>    objdir   /usr/local/bin/gcc-objdir   (currently empty)

Normally, you would build into a directory distinct from the installation
prefix, which would default to /usr/local, however this should work.

>If not, are there any preferred directories to
>hold the "sources" and "objects"?

There are a few packages, such as binutils, which prefer the build directory to
be immediately below the top level source directory.  This works also for
building the compilers, but I believe a totally separate directory is
considered preferable, and would be more convenient in case you must repeat the
unpacking of the distribution.

>I set CC by   export CC=/usr/local/bin/gcc.
>Am I correct?

If that is the compiler you wish to use for the first phase in boot-strapping
the new one.  In a normal linux installation you would not require setting CC,
or (with the same effect) 'export CC=/usr/bin/gcc'

>config.guess
>failed to determine the host type. 

the common choices for gcc-2.95.2 on linux would be i586-pc-linux-gnu (if you
have glibc; makes no difference whether you use i586 or i686) or
i586-pc-linux-gnulibc1 (if you have libc5).  I'm not sure what configure does
to interrogate your system, some combination of uname -a and checking your
library version.  If there were a similar listing among the configure choices
which included k6, you could use that; otherwise I think you need to use one of
the above.  

In your decision, you should consider that the compiler will use a subdirectory
$prefix/lib/gcc-lib/$host/gcc-2.95.2 among others.  If your original compiler
is gcc it should have a similar directory, and by making the $host and $prefix
names match, you can use the version options e.g. -V2.95.2 to select between
them.  linux distributions may be installed with $host as i386-linux,
i586-vendor-linux, or some such.  Making the $host match this way also assures
that the compiler is built starting from the same set of include files, if
there is a directory such as $prefix/$host/include.
Tim Prince
tprince@computer.org

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

* Re: gcc and linux newbie's question
  1999-12-21 20:47     ` llewelly
@ 1999-12-31 22:24       ` llewelly
  0 siblings, 0 replies; 10+ messages in thread
From: llewelly @ 1999-12-31 22:24 UTC (permalink / raw)
  To: root; +Cc: help-gcc

On Wed, 22 Dec 1999, root wrote:

> Tim Prince wrote:
> 
> > > set CC in your environment before running configure.
> >
> > >2) Does it mean I should set those things before configuration?
> >
> > yes, according to your shell, along the lines of
> >
> > export CC=/usr/bin/gcc
> > or
> > setenv CC /bin/cc
> >
> > so that $CC invokes the compiler you wish to use for initial bootstrap
> 
> Thanks Tim, but I still encounter some problems.
> 
> According to http://gcc.gnu.org/install/configure.html ,
> 
> "We use srcdir to refer to the toplevel source directory
> for GCC; we use objdir to refer to the toplevel
> build/object directory."
> 
> (a) I name the source dir and the object dir as follow:
>     srcdir   /usr/local/src/gcc-2.95.2   (I unpacked the bzip2 files
> here)
>     objdir   /usr/local/bin/gcc-objdir   (currently empty)

> Can I remove these two directories after the compiler
> is built? If not, are there any preferred directories to
> hold the "sources" and "objects"? Or are there any
> preferred names for the directories?

Yes, you may remove them after you run make install.

> 
> (b) Now I set CC by   export CC=/usr/local/bin/gcc.
> Am I correct?
> 
> (c) From objdir, I issue the command   src/configure.

If you are building in a separate dir (which is advised), you need
  to tell configure where the source directory is, using something akin
  to:

${srcdir}/configure --srcdir={srcdir}

or:

$/usr/local/src/gcc-2.95.2/configure --srcdir=/usr/local/src/gcc-2.95.2 

> However, I got the following error message: "config.guess
> failed to determine the host type. You need to specify one".
> It then list the option   --host=HOST. But what should
> the HOST be (I use Linux on a PC with an AMD K6-2
> 300MHz CPU)? This wasn't mentioned in the installation
> instruction.

It isn't usually needed; the only time I ever needed to use --host was
  when I tried to build gcc on an RS/6000 43P running linux - every other
  platform I have tried was easiy recognized by gcc's configure.

Probably, configure got confused because you did not tell it the srcdir.

If, for some inexplicable reason you do need the host string, here are 2
  ways to figure it out:

(1) Check install/CONFIGURE . I know you said you read the install file,
    but there are many INSTALL files in the gcc tree. Also, try

(2) If you already have a working gcc installed, run 'ls /usr/lib/gcc-lib'
  (for a gcc installed under /usr; that is where redhat linux puts it) or
  'ls /usr/local/lib/gcc-lib' if gcc was installed under /usr/local, its
  default. On a vanilla redhat linux box I get:
$ls /usr/lib/gcc-lib/
i386-redhat-linux

This directory is named after the host platform of the installed gcc
  (luckily) in the same format gcc's configure wants it in, which is more
  or less <cpu>-<vendor>-<os> or <cpu>-<machine-name>-<vendor>-<os>

On a non-redhat, or heavily modifed redhat system, you might get:
$ls /usr/lib/gcc-lib/
i386-pc-linux-gnu

Which should also work just fine.

As you said you have a k6,
k6-pc-linux-gnu

*may* work for you; I have never tried it, so I am sticking my neck *way*
  out here.

Warning: If /usr/lib/gcc-lib is nfs mounted, or if somebody has built a
  few cross compilers, it may contain dirs for many platforms.





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

* gcc and linux newbie's question
  1999-12-19 23:31 gcc and linux newbie's question Hankel O'Fung
  1999-12-20  5:58 ` Tim Prince
@ 1999-12-31 22:24 ` Hankel O'Fung
  1 sibling, 0 replies; 10+ messages in thread
From: Hankel O'Fung @ 1999-12-31 22:24 UTC (permalink / raw)
  To: help-gcc

Dear all,

[Please also reply by email. Thanks.]
According to http://gcc.gnu.org/install/configure.html ,

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

1) Is "source directory" the directory where I place the
   decompressed and unpackaged gcc bzip2 files?

  "... 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."

2) Does it mean I should set those things before configuration?
3) How to set 'cc' or 'gcc' or 'CC'?

Thanks in advance.
--
Cheers, Hankel

http://www.acad.polyu.edu.hk/~master


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

* Re: gcc and linux newbie's question
  1999-12-21 19:48   ` root
  1999-12-21 20:47     ` llewelly
  1999-12-21 23:07     ` Tim Prince
@ 1999-12-31 22:24     ` root
  2 siblings, 0 replies; 10+ messages in thread
From: root @ 1999-12-31 22:24 UTC (permalink / raw)
  To: help-gcc

Tim Prince wrote:

> > set CC in your environment before running configure.
>
> >2) Does it mean I should set those things before configuration?
>
> yes, according to your shell, along the lines of
>
> export CC=/usr/bin/gcc
> or
> setenv CC /bin/cc
>
> so that $CC invokes the compiler you wish to use for initial bootstrap

Thanks Tim, but I still encounter some problems.

According to http://gcc.gnu.org/install/configure.html ,

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

(a) I name the source dir and the object dir as follow:
    srcdir   /usr/local/src/gcc-2.95.2   (I unpacked the bzip2 files
here)
    objdir   /usr/local/bin/gcc-objdir   (currently empty)
Can I remove these two directories after the compiler
is built? If not, are there any preferred directories to
hold the "sources" and "objects"? Or are there any
preferred names for the directories?

(b) Now I set CC by   export CC=/usr/local/bin/gcc.
Am I correct?

(c) From objdir, I issue the command   src/configure.
However, I got the following error message: "config.guess
failed to determine the host type. You need to specify one".
It then list the option   --host=HOST. But what should
the HOST be (I use Linux on a PC with an AMD K6-2
300MHz CPU)? This wasn't mentioned in the installation
instruction.

Thanks in advance.
Cheers, Hankel

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

* Re: gcc and linux newbie's question
  1999-12-20  5:58 ` Tim Prince
  1999-12-21 19:48   ` root
@ 1999-12-31 22:24   ` Tim Prince
  1 sibling, 0 replies; 10+ messages in thread
From: Tim Prince @ 1999-12-31 22:24 UTC (permalink / raw)
  To: help-gcc

>1) Is "source directory" the directory where I place the
>   decompressed and unpackaged gcc bzip2 files?

Yes, e.g. <source directory>/gcc-2.95.2...

>set
>   CC in your environment before running configure.

>2) Does it mean I should set those things before configuration?

yes, according to your shell, along the lines of

export CC=/usr/bin/gcc

or

setenv CC /bin/cc

so that $CC invokes the compiler you wish to use for initial bootstrap


Tim Prince
tprince@computer.org

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

end of thread, other threads:[~1999-12-31 22:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-19 23:31 gcc and linux newbie's question Hankel O'Fung
1999-12-20  5:58 ` Tim Prince
1999-12-21 19:48   ` root
1999-12-21 20:47     ` llewelly
1999-12-31 22:24       ` llewelly
1999-12-21 23:07     ` Tim Prince
1999-12-31 22:24       ` Tim Prince
1999-12-31 22:24     ` root
1999-12-31 22:24   ` Tim Prince
1999-12-31 22:24 ` Hankel O'Fung

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).