Subject: Re: Trouble building the libraries
To: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
From: Alistair G. Crooks <agc@uts.amdahl.com>
List: current-users
Date: 08/04/1995 01:56:07
> > First, nowhere in the tar's did there seem to be the corresponding
> > current /include files.

Take a look in the .../tar_files/src/include.tar.gz, which has most of
the include files for current.  There are others that get added later,
as you found out - curses.h, the flex stuff (FlexLexer.h etc), and the
g++ includes too, IIRC.  They'll all be installed if you follow the
instructions about moving from 1.0 to -current.  We went through the
discussion (about having all header files in a centralised
place/installed in one fell swoop) about a month ago, and there was no
consensus of opinion then.

> > In libl, there aren't any files other than Makefile.  It's looking for
> >     SRCS=	libmain.c libyywrap.c
> > which don't exist.

I won't labour the point, but you have to copy initscan.c to scan.c,
in lex, or lex/obj, if you use the directory hierarchy, see the upgrade
instructions.
 
> > I also have more or less of a question about the libraries.  They
> > don't include libfl, libg++, libgcc, or libgnumalloc, which I got
> > from the binary release last year.  Have these been eliminated or
> > integrated into other libraries?
> 
> libg++ and libgnumalloc are built from gnu/lib, not lib.  libgcc is
> built as part of gcc, in gnu/usr.bin/gcc2.  libfl I don't recognize.

It's the flex library. I think POSIX mandated that you link with the
library to get the "perhaps I need them" functions for flex/lex, like
yywrap and/or main.
 
And so to the latest and greatest upgrade instructions:

1. I apologise for posting them here, but Amdahl are re-arranging the
firewall systems, which has meant increased functionality for us
people behind the firewall, but has temporarily stopped my ability to
put things up for anon ftp on our servers.

2. I received some mail from Mark Willey with a suggestion for these
instructions which I haven't yet incorporated.

3. There will be a snapshot report on July 29th tar_files coming as
soon as I can find the time.

4. Is anyone else pissed off by the mailing list time-lags?

5. I think the FAQ has an out-of-date version of these instructions.

6. We're working on getting some form of these instructions onto
www.netbsd.org

The following instructions have helped other people upgrade to -current

[The last update of these instructions was at Wed Jul 12 00:30:03 PDT 1995]

[Remember to make yourself a new config (not config.old) kernel config file.]
[Make sure you have COMPAT_10 as part of your kernel config options.]
[This assumes that the -current source is in /usr/src]

(cd /usr/src/usr.sbin/config ; make && make install && make cleandir)
# if you don't do this, config of your kernel config file will
# fail with errors in files.i386

(cd /usr/src/gnu/usr.bin/gas ; make && make install && make cleandir)
# if you don't do this, you won't be able to build locore.s, with
# errors about cpuid instruction not found

(cd /sys/arch/i386/conf ; config MYKERNEL)
(cd /sys/arch/i386/compile/MYKERNEL ; make depend && make)
# copy  new kernel to /, and boot off it

(cd /usr/src/share/mk ; make install)
# if you don't do this, you'll get errors building gcc, when it
# doesn't know how to make the manual pages (don't know how to make gcc.0)

(cd /usr/src/gnu/usr.bin/gcc2 ; make && make install && make cleandir)

(cd /usr/src/usr.bin/rpcgen ; make && make install && make cleandir)
# this makes the new (ANSI-C) rpcgen and installs it. Otherwise you'll
# have problems with any programs that use it, like rpc.rstatd etc

# Bernd Wiserner says that the ld.so that will be built next will
# work only with libc.so.12.0, not with libc.so.12.3
# His instructions to make a working ld.so follow:
# Do NOT run ldconfig while doing the following 7 lines ...
(cd /usr/src/include ; make && make install)
cp -p /usr/libexec/ld.so /usr/libexec/ld.so.good
(cd /usr/src/gnu/usr.bin/ld ; make && make install && make cleandir)
cp -p /usr/libexec/ld.so.good /usr/libexec/ld.so
(cd /usr/src/lib/libcurses ; make && make install)
# otherwise libterm won't be made correctly - invalid prototype
(cd /usr/src/lib ; make && make install && make cleandir)
# Then build ld.so again ...
(cd /usr/src/gnu/usr.bin/ld ; make && make install && make cleandir)  
# Thanks, Bernd...

# it was at this stage that I got REALLY fed up with the
# sh: warning: running as root with dot in PATH
(cd /usr/src/bin/sh ; make && make install &&  make cleandir)

# and now back to the beginning and make the world
(cd /usr/src/bin ; make && make install && make cleandir)
(cd /usr/src/sbin ; make && make install && make cleandir)

mkdir /usr/share/doc/usd/13.viref
# otherwise "make install" in /usr/src/usr.bin will fail because
# the destination directory doesn't exist - from Tom Thai

# if you're using the obj directory hierarchy, use
(cd /usr/src/usr.bin/lex ; cp initscan.c obj/scan.c)
# otherwise (i.e. no obj directory hierarchy)
(cd /usr/src/usr.bin/lex ; cp initscan.c scan.c)
# if you don't, then lex won't be built

# Bootstrap xlint
mkdir -p /usr/libdata/lint
(cd /usr/src/usr.bin/xlint ; make ; make install ; make ; make install)

(cd /usr/src/usr.bin ; make && make install && make cleandir)
(cd /usr/src/usr.sbin ; make && make install && make cleandir)
(cd /usr/src/libexec ; make && make install && make cleandir)
(cd /usr/src/gnu ; make && make install && make cleandir)
(cd /usr/src/share ; make && make install && make cleandir)

mkdir /usr/share/doc/usd/30.rogue /usr/share/doc/usd/31.trek
# otherwise "make install" in /usr/src/games will fail
# actually, last time I tried this, the dirs were already there - agc

(cd /usr/src/games ; make && make install && make cleandir)

Cheers,
Alistair
--
Alistair G. Crooks (agc@uts.amdahl.com)			   +44 125 234 6377
Amdahl European HQ, Dogmersfield Park, Hartley Wintney, Hants RG27 8TE, UK.
[These are only my opinions, and certainly not those of Amdahl Corporation]