🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3294

Re: Libraries specified in source?

#3294
From: Glenn S. Fowler
Date: Mon, 25 Jan 1993 05:13
35 lines
1914 bytes
In article <1993Jan23.194202.20332@druid.uucp> darcy@druid.uucp (D'Arcy J.M. Cain) writes:
>ray@astro.ocis.temple.edu (Ray Lauff) writes:
>>but why not just have a line in the main program such as
>>
>>#library "/lib/libc.a"
>
>Two problems I can think of right off.  How do you know that the
>function you want is in that library on every system and how do
>you know that the libraries reside in that directory?
>> ...
>How is this easier than using the Make file?

something like #[pragma] library would be very useful for providers of
non standard libraries

[warning -- concrete example follows]

take unix sockets (or leave them)
on BSD derived systems
	#include <sys/socket.h>
in the source is sufficient because all the gunk is in libc
but on sys5r4 you need to link with -lsocket -lnsl (and maybe some others)
while on 10th edition you need -ltcp -lyou-get-the-picture

if the <sys/socket.h> provider uses #[pragma] library ... then
no makefile mods are needed and the provider can partition the
library objects any which way, even change them from release to release

however I would prefer a notation that more closely follows the unix cc
-l option that abstracts the library name out of the file system namespace
	#pragma library "socket"	/* -lsocket */
	#pragma library "nsl"		/* -lnsl */

Glenn Fowler    (908)-582-2195    AT&T Bell Laboratories, Murray Hill, NJ
uucp: {att,ucbvax}!ulysses!gsf              internet: gsf@ulysses.att.com
Technical Details
Message-ID: <1993Jan25.051319.17737@ulysses.att.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!uwm.edu!linac!att!att!dptg!ulysses!ulysses.att.com!gsf
References: <1993Jan21.182949.29796@cronkite.ocis.temple.edu> <1993Jan23.194202.20332@druid.uucp>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!uwm.edu!linac!att!att!dptg!ulysses!ulysses.att.com!gsf
From: gsf@ulysses.att.com (Glenn S. Fowler)
Subject: Re: Libraries specified in source?
Message-ID: <1993Jan25.051319.17737@ulysses.att.com>
Date: Mon, 25 Jan 1993 05:13:19 GMT
References: <1993Jan21.182949.29796@cronkite.ocis.temple.edu> <1993Jan23.194202.20332@druid.uucp>
Organization: AT&T Bell Labs
Lines: 35