compiling and YP
Brendan Eich
brendan at illyria.wpd.sgi.com
Sat Oct 21 08:14:50 AEST 1989
> But, how do I get the "-l" options
> attached to the cc lines? The Makefile that comes with notes uses the
> internal rules for compiling the source code, creating the object files, and
> then links the objects with flags provided in the Makefile. So, as I under-
> stand it, I would need to alter the internal rules for Make to get the code
> compiled for use with YP.
The -l option should be used when compiling a .c into an executable, and
when linking one or more .o's into a single executable. I don't know the
particulars of the notes makefile, but it could use an inference (internal)
make rule only to do the former (the .c: inference rule -- you can see it
via make -n -p). The way to get those -l's through is to set LDFLAGS to
include -lsun -lbsd in the makefile. If the makefile links one or more .o
files into a program, it must be using an explicit rule, and should list
$(LDFLAGS) among the arguments to $(CC), *after* the objects.
> Now, to complicate matters, I have actually manually compiled all the
> source with the above syntax, and it still sees me as "Anonymous" unless I
> place myself in /etc/passwd as a local entry (w/o the +). That leaves the
> "install" command as the culprit...
If you were using -l when compiling .c's into .o's, no linking would be
done (nor would you get a usage error). Could this be the mistake? The
libsun code will query YP. Almost all SGI commands that use getpwent(3C)
routines link with it.
> Someone else is attempting to create an "installit" program to allow
> users to install their own software in designated directories; this program
> uses "install" and is bombing out on the YP entries. The only way we can see
> to fix this is to get the source to "install" and recompile it using the
> Yellow Pages stuff (sun and bsd include files and libraries).
/etc/install (documented in install(1)) does use YP. If this is the install
program you're describing, perhaps the YP client on which you're running it
is not bound to a YP server. Since 4D1-3.1, SGI's libsun YP-passwd code will
use /etc/passwd and treat + as a username character if ypbind has not bound
your domain. Try ypwhich(1) to see if you're bound.
> 2) Why wasn't the source code on the SGIs complied to use the sun and
> bsd libraries automatically? If you don't run YP, then the
> default is to use the normal stuff anyway, so everyone would have
> been happy!
Everything except passwd(1), netstat(1), and a few other hard cases, *is*
linked with libsun. Some people complain that linking with YP leaves them
at hanging when YP servers are unavailable. We've tried to take the sting
out of YP by falling back on the local /etc files when service is lost.
> Amy Swanson
Regards,
Brendan Eich
Silicon Graphics, Inc.
brendan at sgi.com
More information about the Comp.sys.sgi
mailing list