Subject: Re: HELP: bugs in pine3.91 under solaris 5.3

From: [email-masked] (David Barr)
Date: 6 Nov 1994 21:03:54 -0500

In article <[email-masked]>,
>You've been bit by the wonderful Solaris ``I dunno which library to link,
>so I'll guess the wrong one'' bug.  This problem has been bedeviling us
>for ages.  The Collective Wisdom Of The Net has been applied, and nothing 
>has worked.  Or rather, worked for everyone.
>
>We found ourselves with a situation in which the c-client/imapd programmer
>(me) can correctly build imapd but not Pine, and the Pine programmer can
>correctly build Pine but not c-client -- with no apparent differences in
>our environments!! 
>
>The basic problem is that Solaris has two environments, BSD and SVR4, each
>with a slightly different directory entry structure that is offset from
>each other by two bytes.  Pine on Solaris is SVR4, but for some reason the
>!@#$%^&* Solaris linker decides to link it to be BSD. 

The "collective wisdom of the net", eh?

Did you try reading the Solaris FAQ?

6.10) Why doesn't readdir work?

    You're probably linking with libucb and didn't read the
    previous question.  (The readdir in libucb.so wants you to
    include sys/dir.h, many SunOS 4.1.x programs included
    <dirent.h>, consequently, you're mixing native <dirent.h>
    struct dirent with libucb readdir().
    The symptom of this mixup is that the first two characters
    of each filename are missing.  Make sure you use the native
    compiler (default /opt/SUNWspro/bin/cc, which may not be in
    your PATH), and not /usr/ucb/cc.

IMHO you should trust that use user has the correct path, and 'cc'
is indeed the right C compiler.  I bet that one of you if you were
to say "which cc" returns "/usr/ucb/cc".

If you try to build Pine with /usr/ucb/cc you WILL have trouble.

I'd just put a warning message if you type 'build sol' that warns
that you can't use /usr/ucb/cc.  In fact you could even hack the
build script to return an error if [ `which cc` = "/usr/ucb/cc" ].).

--Dave

---

From: [email-masked] (Thang M Nguyen)
Date: Fri, 4 Nov 1994 21:02:41 GMT

I installed pine3.91 using 'build sv4' for System V version-4.  
Everythings seem to be working fine except folder listing.  Whenever I 
type 'L' to list the folders, the first two characters of the 
folder-names, except the INBOX,  do not display on the screen.  And 
whenever I tried to open the folders or delete those folders, the error 
message was folders doesn't exist.  Can anyone help me on this problem?  
Thanks in advace.

---

From: Mark Crispin <[email-masked]>
Date: Sun, 6 Nov 1994 16:30:06 -0800

> message was folders doesn't exist.  Can anyone help me on this problem?  

Hello.

First, you should use ``build sol'' instead of ``build sv4''.

We've pulled hair on this for months.  What makes things worse is that the
outside Solaris world seems to be split just like we are: some can build
imapd correctly but not Pine; others can build Pine correctly but not
imapd.  Then there are other lucky people who can build both.

The cc5 hack (courtesy of the Collected Wisdom Of The Net) used to build
Pine works fine for the Pine programmer, but not for me.  cc works fine 
for me when building imapd, but not when building a short C program that 
demonstrates the problem.

As far as we know, SUN denies that there is anything at all wrong.  It's
probably some wierd environment variable that needs to be set, but we're
stumped.  It is an abomination that SUN dares to ship a system in which a
program can be compiled SVR4, but lunk BSD, without generating any
``incompatible library'' error messages.  I'm embarassed enough about this
problem (it's my code that's getting confused), but SUN should be ashamed
that their development tools permit it to happen.

The binaries on our FTP server are built correctly.  Unless you need to
have locally-built binaries, you may want to use our pre-built Solaris
binaries instead.  We're aware of the problem, and careful to test our
Solaris binaries to make sure they've been built correctly. 

Thank you for bearing with us.  Sooner or later, we'll find out what's 
wrong and fix it once and for all.

---

From: Mike O'Connor <[email-masked]>
Date: Thu, 10 Nov 1994 01:36:54 GMT

In article <[email-masked]>,
David Barr <[email-masked]> wrote:

:I'd just put a warning message if you type 'build sol' that warns
:that you can't use /usr/ucb/cc.  In fact you could even hack the
:build script to return an error if [ `which cc` = "/usr/ucb/cc" ].).

"which" of course is a csh-ism, which may or not make sense for your
shell of choice.  

						...Mike

--
 Michael J. O'Connor                 Internet: [email-masked] (email address)
 InterNIC WHOIS: MJO                 http://www.msen.com/~mjo/ (WWW home page)

"History is made at night!"                            -from _Buckaroo Banzai_

---

From: [email-masked] (David Barr)
Date: 10 Nov 1994 10:35:46 -0500

>"which" of course is a csh-ism, which may or not make sense for your

That's okay.

#!/bin/sh
IFS=:
for i in $PATH; do
	if [ -x $i/$1 ] ; then
		echo $i/$1
		exit 0
	fi
done
echo "$1: Command not found." 1>&2
exit 1

A mod of this script to do as I described above is left as an exercise
to the reader.  :-)

--Dave