Subject: building under solaris?

From: Karl Hanzel <[email-masked]>
Date: Tue, 14 May 1996 13:24:56 -0600 (MDT)

I would have guessed that a 'build sol' would be one of the most straight
forward builds of pine out there, ...but no.  This is Solaris2.5.  It
splatters all over the place... see below. 

Any tips?

*----->

Karl Hanzel        UCAR/COMET Systems Administrator     Boulder, Colorado
------------------------------------+------------------------------------
(303)497-8479     >> WORK <<        |        (303)443-6602     >> HOME <<
[email-masked]   (MIME)        |        [email-masked]   (NeXT/MIME)

----------------------
make args are "CC=cc "

Making c-client library, mtest and imapd
make build SYSTYPE=non-ANSI OS=sol
echo sol > OSTYPE
rm -rf systype
ln -s non-ANSI systype
cd non-ANSI/c-client; make sol
make mtest OS=sol EXTRADRIVERS="" CC=ucbcc \
	STDPROTO=bezerkproto MAILSPOOL=/var/mail \
	ACTIVEFILE=/usr/share/news/active NEWSSPOOL=/var/spool/news \
	RSHPATH=/usr/bin/rsh \
	CFLAGS="-g -O2 -DNFSKLUDGE " \
	RANLIB=true LDFLAGS="-lsocket -lnsl -lgen"
./drivers  imap nntp pop3 mh tenex mtx mmdf bezerk news phile dummy
rm -f CCTYPE CFLAGS LDFLAGS osdep.h
echo ucbcc > CCTYPE
echo -g -O2 -DNFSKLUDGE > CFLAGS
echo -lsocket -lnsl -lgen  > LDFLAGS
ln -s os_sol.h osdep.h
ucbcc -g -O2 -DNFSKLUDGE  -c  mail.c
sh: ucbcc: not found
*** Error code 1
make: Fatal error: Command failed for target `mail.o'
Current working directory /usr/local/src/pine3.93/imap/non-ANSI/c-client
*** Error code 1
make: Fatal error: Command failed for target `sol'
Current working directory /usr/local/src/pine3.93/imap/non-ANSI/c-client
*** Error code 1
make: Fatal error: Command failed for target `build'
Current working directory /usr/local/src/pine3.93/imap
*** Error code 1
make: Fatal error: Command failed for target `sol'

Making Pico and Pilot
cc5.sol  -O -Dsv4 -DPOSIX -DJOB_CONTROL -DMOUSE main.c libpico.a  -ltermlib -o pico
/usr/ucb/cc:  language optional software package not installed
*** Error code 1
make: Fatal error: Command failed for target `pico'

Making Pine.
make: Fatal error: Don't know how to make target `../c-client/c-client.a'

Links to executables are in bin directory:
size: bin/pine: cannot open
size: bin/mtest: cannot open
size: bin/imapd: cannot open
size: bin/pico: cannot open
size: bin/pilot: cannot open
Done

---

From: Mark Crispin <[email-masked]>
Date: Tue, 14 May 1996 13:47:30 -0700

If you have GCC installed, use "build gso" instead of "build sol".

The problem with the sol build is that it is difficult to refer to a
compiler which will generate working binaries in any portable way.  The
Solaris development environment, to put it charitably, is not condusive
for the development of portable software.  There is another horror story
involving SUN's Seattle office and license keys that I'd rather not go
into. 

I can not, in good conscience, recommend the Solaris development
environment to anyone.  Get gcc and use it instead.  The only reason why
we have a separate "gso" port instead of making it be the "sol"  port is
that there are a few benighted sites which still don't have gcc. 

Pine on Solaris is SVR4, but on many Solaris systems, "cc" will give you
the BSD C compiler with BSD libraries (/usr/ucb/cc).  This mostly works,
but readdir()  will return the BSD structure instead of the SVR4
structure, and the file name is offset by 2 octets between the two.  The
end result is that in file listings, the first two characters are cut off.

"ucbcc" runs the BSD C compiler with SVR4 libraries (/usr/ccs/bin/ucbcc),
which will generate good code.  This is what we use when we do "build sol" 
on our site. 

The real SVR4 C compiler is hidden away, typically with some name such as
/opt/SUNWspro/bin/cc but even that is variable. 

"ucbcc" was chosen as a wretched compromise.  It builds good code.  You
can get the real SVR4 C compiler to work as well, with a few hacks to the
code.

You can avoid all this insanity by using gcc and the gso port.

On 14 May 1996, Karl Hanzel wrote:
> forward builds of pine out there, ...but no.  This is Solaris2.5.

-- Mark --

DoD #0105, R90/6 pilot, FAX: (206) 685-4045  ICBM: N 47 39'35" W 122 18'39"
Science does not emerge from voting, party politics, or public debate.

---

From: Ed Greshko <[email-masked]>
Date: Wed, 15 May 1996 12:09:41 +0800 (GMT)

> splatters all over the place... see below.

I've built pine3.92 under Solaris2.5 after making a few changes.
There are a few tips and tricks but it isn't very difficult....even if
you don't have the /usr/ucb stuff installed.  I don't and it worked fine.

BTW, I'm not a C programmer by any stretch.  I also fail to "document"
things....so if this doesn't work for you the first time around let me
know and maybe we can find the missing step.

Also, if you have documentaion on your Solaris compiler it may be useful
to read it.  There is a SPARCompiler - C Programmer's Guide that comes
in handy.  Almost as handy as the pine documentation.  :-)

First for the Tips:

1.	Type "which cc".  You should come up with something along the
	lines of "/usr/opt/SUNWspro/bin/cc".

	If you get "/usr/ucb/cc" then fix your PATH so that /usr/ucb
	comes after "/usr/opt/SUNWspro/bin" or wherever else the Admin
	may have installed/hid it.

2.	Check to make sure you don't have /usr/ucbinclude in
	your LD_LIBRARY_PATH environment variable.  Mine is simply
	set to /usr/opt/SUNWspro/lib:/usr/openwin/lib.

Now for the changes (This is where I may forget somthing...):

1.	In the file imap/non-ANSI/c-client/Makefile:

	Near the line starting with "sol" change:

	$(MAKE) mtest OS=$@ EXTRADRIVERS="$(EXTRADRIVERS)" CC=ucbcc \

	to

	$(MAKE) mtest OS=$@ EXTRADRIVERS="$(EXTRADRIVERS)" CC=cc \

	Also find the line reading:

	$(CC) $(CFLAGS) -o mtest mtest.o $(ARCHIVE) $(LDFLAGS)

	and change it to:

	$(CC) -o mtest mtest.o $(ARCHIVE) $(LDFLAGS)

2.	In the imap/non-ANSI/imapd/Makefile.

	Change:

	$(CC) $(CFLAGS) -o imapd imapd.o $(LDFLAGS)

	to

	$(CC) -o imapd imapd.o $(LDFLAGS)

3.	In the imap/non-ANSI/ipopd/Makefile.

	Change:

	$(CC) $(CFLAGS) -o ipop2d ipop2d.o $(LDFLAGS)

	to:

	$(CC) -o ipop2d ipop2d.o $(LDFLAGS)

	AND

	$(CC) $(CFLAGS) -o ipop3d ipop3d.o $(LDFLAGS)

	to:

	$(CC) -o ipop3d ipop3d.o $(LDFLAGS)

4.	In the pico directory.....

	Try using the cc5.sol file that I've attached instead of the
	one supplied.

	I think that is about all I had to do......

	Let me know if you have troubles....

	Regards,

		Ed

Edward M. Greshko                       Technical Manager, Electronic Commerce
                                        Control Data Asia/Pacific Region
Voice: +886-2-715-2222 x287             6/F, 131 Nanking East Road, Section 3
FAX  : +886-2-712-9197                  Taipei, Taiwan R.O.C

#!/sbin/sh
#	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
#	  All Rights Reserved

#	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
#	The copyright notice above does not evidence any
#	actual or intended publication of such source code.

#ident	"@(#)cc.sh	1.8	92/05/26 SMI"	/* SVr4.0 1.4	*/

#		PROPRIETARY NOTICE (Combined)
#
#This source code is unpublished proprietary information
#constituting, or derived under license from AT&T's UNIX(r) System V.
#In addition, portions of such source code were derived from Berkeley
#4.3 BSD under license from the Regents of the University of
#California.
#
#
#
#		Copyright Notice
#
#Notice of copyright on this source code product does not indicate
#publication.
#
#	(c) 1986,1987,1988,1989  Sun Microsystems, Inc
#	(c) 1983,1984,1985,1986,1987,1988,1989  AT&T.
#	          All rights reserved.

# cc command for BSD compatibility package:
#
#	BSD compatibility package header files (/usr/ucbinclude)
#	are included before SVr4 default (/usr/include) files but
#       after any directories specified on the command line via
#	the -I option.  Thus, the BSD header files are included
#	next to last, and SVr4 header files are searched last.
#
#	BSD compatibility package libraries (/usr/ucblib) are
#	searched next to third to last.  SVr4 default libraries
#	(/usr/ccs/lib and /usr/lib) are searched next to last
#
#	Because the BSD compatibility package C library does not
#	contain all the C library routines of /usr/ccs/lib/libc.a,
#	the BSD package C library is named /usr/ucblib/libucb.a
#	and is passed explicitly to cc.  This ensures that libucb.a
#	will be searched first for routines and that
#	/usr/ccs/lib/libc.a will be searched afterwards for routines
#	not found in /usr/ucblib/libucb.a.  Also because sockets is
#       provided in libc under BSD, /usr/lib/libsocket and /usr/lib/nsl
#       are also included as default libraries.
#
#	NOTE: the -Y L, and -Y U, options of cc are not valid

	# get the directory where ucbcc points to and set the LD_LIBRARY_PATH
	# to that directory so as to get the necessary libraries.
	CC=`which cc`
	cclink=`/usr/bin/ls -ln $CC | awk '{print $11}'`
	ccdir=`/usr/bin/dirname $cclink`

	$CC \
	-YP,:$ccdir:/usr/ccs/lib:/usr/lib "$@" \
	-lsocket -lnsl -lelf -laio
	ret=$?
	exit $ret

---

From: [email-masked] (Steve Hanson)
Date: 14 May 1996 23:30:20 -0500

I think the build environment provided in the pine source is the REAL problem 
here, not solaris - 

If you just have your path set properly, with the path to the compiler 
as part of your path, you can merrily  go through ALL the make files and
change them so CC is cc and everything builds just fine.

If the working environment on your computer is set up right - that is,
with /opt/SUNWspro/bin in your path (or wherever you put the compiler) then
all this ucbcc stuff just keeps the make from working.  
-- 
Steve Hanson - FERMILAB, Batavia, Il.
[email-masked]