public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Mcgovern, Matthew  CIV NAVAIR 521420E" <matthew.mcgovern@navy.mil>
To: "Bob Proulx" <bob@proulx.com>
Cc: <gcc-help@gcc.gnu.org>
Subject: RE: Gcc 3.4.6 Build error
Date: Wed, 28 Jun 2006 19:19:00 -0000	[thread overview]
Message-ID: <97EDE50C79AB8842828617E514853CC204E42477@NAWEMUGUEX03VA.nadsuswe.nads.navy.mil> (raw)
In-Reply-To: <20060628171423.GA20993@dementia.proulx.com>

Thank you, for your very detailed response.  

I did look at the system and I think I have the old K&R compiler.  I
have the /usr/ccs/bin directory and the /usr/ccs/bin/cc file in that
directory.  I don't have /usr/ccs/bin/cc symlinked to any cc_bundled.
The /usr/bin/cc is symlinked to /usr/ccs/bin/cc, not /opt/ansi/bin/cc.
The /etc/profile file does include the /usr/ccs/bin after the /usr/bin
in the PATH.

 As I read your response regarding "My notes show me doing this on HP-UX
to configure gcc for building" and "..before building gcc you actually
need to build up a tool chain to support the build which includes the
GNU assembler (binutils) too", I think I'm in way over my head here.  I
didn't really understand much of what you indicated I will need to do
(I'm not familiar with the CC, CFLAGS, LIBCFLAGS, or LIBCXXFLAGS
commands).  However, I think your final suggestion, "You might be able
to find a prebuild apache2 for hpux" may be the way to go for me.  I
don't even know if installing gcc will solve my Apache installation
problem (which is what I'm mainly interested in).

I do have a prebuilt Apache upgrade that was installed on another HP-UX
10.20 system.  I thought about installing it, before I went down the
path to install gcc and Apache from scratch.  But, the prebuilt Apache
is not installed in the same location my current web server is (as you
indicated may be an issue).  So I would have to modify my current
location to get it to work.  Or modify the "httpd.conf" file to match
with my current apache directory structure.  This looks like the
simplest solution for now.

Again, thank you for your assistance on this.  If I can't get the
prebuilt Apache to work I may return to this and try it again.

VR,
Matt

-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of Bob Proulx
Sent: Wednesday, June 28, 2006 10:14
To: Mcgovern, Matthew CIV NAVAIR 521420E
Cc: gcc-help@gcc.gnu.org
Subject: Re: Gcc 3.4.6 Build error

Mcgovern, Matthew  CIV NAVAIR 521420E wrote:
> The only option to configure was:  --prefix=/usr/local/gccbuild.

The prefix sets the root of the tree for the *installation* of the
resulting program.  By setting prefix to /usr/local/gccbuild you are
saying that you want the 'make install' (which comes much later) to
install the resulting files into the /usr/local/gccbuild directory.

Reading your message I don't think that is what you intended.  I think
you were intending the build files to be put there.  You need to do that
in a different way.

> I did a mkdir of "gccbuild", but the object directory is 
> /usr/local/gccobj.  I used the "gccbuild" directory because of the 
> recommendation that the object directory not be in the same path as 
> the build directory, or vice versa.  The source directory is in a 
> totally different path.

I think what you are talking about here is what is known as "VPATH"
builds where the source directory is not modified, could even be
read-only, and the build happens outside of it in another directory.
That can be useful but is not required.  This is not the --prefix
option.  Instead call configure from the build directory.  Here is a
stylized example.

  tar xzvf gcc-X.Y.Z.tar.gz
  mkdir gcc-build
  cd gcc-build
  ../gcc-X.Y.Z/configure --other-options-...
  make
  ...other.stuff...

Because configure is called using the path to the source it will know
that it is setting up the build in the current directory.  The build
files will be there and the source will be untouched.  Many people favor
this build method.  (I actually don't because I build from pristine
source (tar xvf ...) every time and so don't care if the source is the
build directory too.)

> I don't know if I'm using the native HP C compiler.  I don't think it 
> is installed on this system.

Normally every HP-UX system would have a C compiler.  PATH would include
/usr/ccs/bin and /usr/ccs/bin/cc would be a symlink pointing to
cc_bundled.  That is the old K&R compiler from before 1989.  The
c89 and later compiler is in /usr/bin/cc as a symlink to
/opt/ansi/bin/cc but that is an optional product and would need to be
installed separately.

I will assume that you are using the bundled compiler.  You can test
this by listing the directories.  PATH should be set in /etc/profile to
include /usr/ccs/bin and (hopefully) nothing is removing that particular
path.  It should be after /usr/bin.

  ls -ld /usr/bin/cc
  ls -ld /usr/ccs/bin/cc

> I'm trying to install gcc so that I can upgrade/install Apache web 
> server (httpd 2.0).  The Apache is not building and I think it's 
> because I don't have any compilers installed on the system.  The OS 
> load was conducted using a proprietary set of tapes with proprietary 
> software, not by installing from a factory released build, so I think 
> they didn't install any compilers on the system.

That would make it difficult.  But if you don't have *any* compilers
installed then you would not be able to compile gcc either.  A
bootstrapping chicken-or-the-egg issue.

For now I would assume that apache requires a modern c89 or c99 or later
compiler and only the old K&R one is available.  I believe gcc can still
bootstrap itself from the K&R compiler.  I am sure someone on the
mailing list will correct me if that is not the case.  I have not tried
it for years.

> I don' t know what the bundled K&R compiler or the ANSI C compiler
are.

At one time all Unix machines included a C compiler as standard on the
system.  As time went by vendors make the ANSI standard compiler
optional and charged an extra charge for it.  But they still needed
something to configure the operating system kernel.  That is, they
needed something themselves.  The K&R compiler from pre-1989 days could
be used to link the kernel and was enough basic functionality to do some
things on the system (e.g. such as unshar uudecode
compilation) but not sufficient for most things and so customers would
then buy the ANSI compiler.  Well actually most people installed gcc
instead.

My notes show me doing this on HP-UX to configure gcc for building.
(This is mostly for the email archive.)

  # The first time around without gcc available use these:
  #   CC=cc CFLAGS="-O" LIBCXXFLAGS="-g -O2 -fno-implicit-templates"
  # The second and later times with gcc available use these:
  #   LIBCXXFLAGS="-g -O2 -fno-implicit-templates"

  LIBCFLAGS="-O2" LIBCXXFLAGS="-O2 -fno-implicit-templates" \
    ./configure \
    --prefix=/usr \
    --mandir=\${prefix}/share/man \
    --infodir=\${prefix}/share/info \
    --program-suffix=-3.3 \
    --with-as=/usr/bin/gas \
    --with-gnu-as \
    --enable-version-specific-runtime-libs \
    --enable-languages=c,c++ \
    --enable-cxx-flags='-fPIC'

  make -j2 bootstrap

> As you can tell I'm not as knowledgeable as I should be, but I need to

> upgrade my web server for security reasons.

Well...  You are basically putting yourself in the role of software
distribution developer.  And that means you would need to either have or
develop some of those basic skills.  It is not really very hard but you
have to have the mind-set that you are going to need to figure out a lot
of software development issues and to develop the tool-chain to support
doing this.  If you were using a GNU/Linux distribution then this would
be done for you by the distro vendor.  But you are not and so on HP-UX
you have to build the tools to build the tools to build the tools
yourself.  After the whole machine gets built up and moving things work
pretty well.  But bootstrapping yourself up from first principles can be
tedious and time consuming.

What I would recommend is to search the web for precompiled gcc
binaries.  Looking for "HP-UX porting center" should google hit to a few
places with precompiled binaries.  I think one of those would meet your
needs and avoid a lot of time and effort learning how to build up gcc on
your platform.  In fact I think from the hp.com website there are
pointers to precompiled versions of gcc.  But I have not looked for a
while so I may be out of date.  But using one of the versions
recommended by hp would be reasonable.

Because before building 
Both of those need GNU sed to configure.  And GNU m4 may also be
required, not sure.  Additionally to do a good job of it you need
libiconv, gettext, and texinfo.  Whew!  Lots of stuff.  Probably more
that I forgot about.

I think you would be much better off getting a precompiled binary.  At
the very least you could use it to bootstrap yourself.  The prebuild gcc
could be used to build the new gcc.  And binutils and so on.  Look on
the hp.com web site for a pointer to precompiled gcc binaries.  I found
these just a moment ago:

 
http://h21007.www2.hp.com/dspp/tech/tech_TechSoftwareDetailPage_IDX/1,17
03,547,00.html
 
http://h21007.www2.hp.com/dspp/tech/tech_TechSoftwareDetailPage_IDX/1,17
03,7663,00.html

You might be able to find a prebuild apache2 for hpux as well.

One issue about prebuild binaries is that everyone decides to install
them in different places.  Which means that almost certainly none will
install where you want it to install.  Oh well.

Bob

  reply	other threads:[~2006-06-28 19:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-27 19:20 Mcgovern, Matthew  CIV NAVAIR 521420E
2006-06-28  8:34 ` Bob Proulx
2006-06-28 15:19   ` Mcgovern, Matthew  CIV NAVAIR 521420E
2006-06-28 17:14     ` Bob Proulx
2006-06-28 19:19       ` Mcgovern, Matthew  CIV NAVAIR 521420E [this message]
2006-06-28 23:44         ` Bob Proulx

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=97EDE50C79AB8842828617E514853CC204E42477@NAWEMUGUEX03VA.nadsuswe.nads.navy.mil \
    --to=matthew.mcgovern@navy.mil \
    --cc=bob@proulx.com \
    --cc=gcc-help@gcc.gnu.org \
    /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).