Subject: Re: [netatalk-admins] Solaris compilation problem w/ asun2.0a17.2 + AFS

From: Thomas Tornblom <[email-masked]>
Date: Thu, 11 Dec 1997 19:11:51 +0100 (MET)

> 
> Try adding " -lc -L/usr/ucblib -lucb" just after -lsocket -lnsl -lwrap. 
> At our site the first thing we do when we get a new Solaris release is;
> "cd /usr/lib;ln -s ../ucblib/libucb* ." and the we use "-lc -lucb" at the
> end of every piece of code that uses AFS on Solaris. Too much of AFS is
> still based on "BSD 4.2 C". There have been requests to Transarc to update
> their code to a more POSIX implementation.....
> 

>Shudder<

Read after me:

ucblibs are evil, evil, evil...

Applications that doesn't compile without resorting to the ucblibs should either 
be rewritten or ditched!

There are so many gotchas and mismatches between the standard libraries/include 
files and the ucb stuff that is almost impossible to successfully get things to 
work with them.

The type "DIR" in <dirent.h> and <sys/dir.h> is the first thing that comes to 
mind, although it seems they are mostly fixed in 2.6.

> Randall

Thomas

Real life:      Thomas Törnblom             Email:  [email-masked]
Snail mail:     HB Hax                      Phone:    +46  18 290 290
                Banvallsvägen 14            Fax:      +46  18 290 291
                S - 754 40 Uppsala, Sweden  Cellular: +46 708 323118

---

From: Pat Wilson <[email-masked]>
Date: Thu, 11 Dec 1997 13:23:12 +22306256

>  >=20
>  > Try adding " -lc -L/usr/ucblib -lucb" just after -lsocket -lnsl -lwrap.=
>  =20
>  > still based on "BSD 4.2 C". There have been requests to Transarc to updat=
>  e
>  >=20

It's all very well and good to take the high moral ground, but the fact is
that this is what's necessary to make the thing compile, so...  Apparently,
fixing their libraries to play nice isn't one of Transarc's top priorities.
At least the ucblibs are there.

Pat Wilson
[email-masked]

---

From: [email-masked]
Date: Thu, 11 Dec 1997 13:59:40 -0500

> From:    Pat Wilson <[email-masked]>
> To:      Thomas Tornblom <[email-masked]>

> that this is what's necessary to make the thing compile, so...

netatalk includes work around for this exact case, so I certainly
wouldn't recommend including libucb.

:wes

---

From: "Randall S. Winchester" <[email-masked]>
Date: Thu, 11 Dec 1997 14:04:40 -0500 (EST)

I agree with what you are saying, however please note that I said;
"-lc -lucb" 
It is important for others to understand the importance of this for those
times when there is no other option. You *always* want to include libc
before libucb,libBSD,libbsd,etc (Whatever your OS calles this library).
Linking with -lc *before* -lucb keeps one from getting wrong functions (The
signal() call is common problem) linked in to ones code. 

Heck with Solaris 2.4 you had to link with "-lc -lucb" just to get bcopy()
bcmp() and bzero(). (I just used a #define to call the mem* equivelents,
however...)

Thus to summarize;

But if you must use them, make sure you look at libc first;
link with "-lc -lucb"

If that does not work;
You probably do not want the software.

Randall

On Thu, 11 Dec 1997, Thomas Tornblom wrote:

: > 
: > Try adding " -lc -L/usr/ucblib -lucb" just after -lsocket -lnsl -lwrap. 
: > At our site the first thing we do when we get a new Solaris release is;
: > "cd /usr/lib;ln -s ../ucblib/libucb* ." and the we use "-lc -lucb" at the
: > end of every piece of code that uses AFS on Solaris. Too much of AFS is
: > still based on "BSD 4.2 C". There have been requests to Transarc to update
: > their code to a more POSIX implementation.....
: > 
: 
: >Shudder<
: 
: Read after me:
: 
: ucblibs are evil, evil, evil...
: 
: Applications that doesn't compile without resorting to the ucblibs should either 
: be rewritten or ditched!
: 
: There are so many gotchas and mismatches between the standard libraries/include 
: files and the ucb stuff that is almost impossible to successfully get things to 
: work with them.
: 
: The type "DIR" in <dirent.h> and <sys/dir.h> is the first thing that comes to 
: mind, although it seems they are mostly fixed in 2.6.
: 
: > Randall
: > 
: 
: Thomas
: 
: Real life:      Thomas Törnblom             Email:  [email-masked]
: Snail mail:     HB Hax                      Phone:    +46  18 290 290
:                 Banvallsvägen 14            Fax:      +46  18 290 291
:                 S - 754 40 Uppsala, Sweden  Cellular: +46 708 323118
: 
:

---

From: Derrick J Brashear <[email-masked]>
Date: Thu, 11 Dec 1997 14:28:29 -0500 (EST)

>  their code to a more POSIX implementation.....

Not really relevant to netatalk, but if:
a) you have Solaris 2.5 or later you don't have to worry about the b*()
functions
b) we have code which of course is only useful if you're compiling from source
to take care of e.g. sigvec and the like in the lwp "suite"
c) which leaves only flock, used in the ktc stuff, that most AFS-aware code
would need libucb to deal with, and the next time I build AFS I have a flock to
fcntl set of crap I'm going to use to take care of that.

So it's not that hard...

Oh, and we don't need -laudit either;-)

We now return you to your regularly scheduled netatalk....

-D