public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: llewelly@198.dsl.xmission.com
To: root <master@polyu.edu.hk>
Cc: help-gcc@gnu.org
Subject: Re: gcc and linux newbie's question
Date: Tue, 21 Dec 1999 20:47:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.10.9912212112090.2397-100000@198.dsl.xmission.com> (raw)
In-Reply-To: <38604854.E5CEA5DE@polyu.edu.hk>

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.





WARNING: multiple messages have this Message-ID
From: llewelly@198.dsl.xmission.com
To: root <master@polyu.edu.hk>
Cc: help-gcc@gnu.org
Subject: Re: gcc and linux newbie's question
Date: Fri, 31 Dec 1999 22:24:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.10.9912212112090.2397-100000@198.dsl.xmission.com> (raw)
Message-ID: <19991231222400.LbeIRM4ZLi2YHekmcjfqzPmfvKXoVYkDjik_iAKvpPQ@z> (raw)
In-Reply-To: <38604854.E5CEA5DE@polyu.edu.hk>

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.





  reply	other threads:[~1999-12-21 20:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-19 23:31 Hankel O'Fung
1999-12-20  5:58 ` Tim Prince
1999-12-21 19:48   ` root
1999-12-21 20:47     ` llewelly [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.10.9912212112090.2397-100000@198.dsl.xmission.com \
    --to=llewelly@198.dsl.xmission.com \
    --cc=help-gcc@gnu.org \
    --cc=master@polyu.edu.hk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).