9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] mkfile question: mklib & co.
@ 2006-08-05  8:34 Sascha Retzki
  2006-08-05 14:06 ` erik quanstrom
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Sascha Retzki @ 2006-08-05  8:34 UTC (permalink / raw)
  To: 9fans


Hello list,


got a question regarding /sys/src/cmd/mklib, why aren't HFILES copied to /$objtype/include?

I mean, the library itsself is copied to LIBDIR, \o/ , but the headerfiles are not copied. It would be great if mk can at least copy them.

Something related: Does $objtype work in #pragma lib? If not, mk would have to put in #pragma lib to make library distribution a pleasure.


Or did I miss something so this all would work without problems?


Mfg, Sascha



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [9fans] mkfile question: mklib & co.
  2006-08-05  8:34 [9fans] mkfile question: mklib & co Sascha Retzki
@ 2006-08-05 14:06 ` erik quanstrom
  2006-08-05 14:27   ` Sascha Retzki
  2006-08-05 14:49 ` Christoph Lohmann
  2006-08-05 15:42 ` Russ Cox
  2 siblings, 1 reply; 12+ messages in thread
From: erik quanstrom @ 2006-08-05 14:06 UTC (permalink / raw)
  To: 9fans

there are no libraries in /sys/src/cmd and no header files which originate in
/sys/src/cmd that end up in /sys/include or /$objtype/include (modulo ape).
libraries should go in /sys/src/libfu.

these are the mkfiles that include /sys/src/cmd/mklib

; grep mklib `{find . | grep /mk}
./cmd/cc/mkfile:</sys/src/cmd/mklib
./cmd/map/libmap/mkfile:</sys/src/cmd/mklib
./cmd/plot/libplot/mkfile:</sys/src/cmd/mklib
./cmd/postscript/common/mkfile:</sys/src/cmd/mklib
./cmd/upas/common/mkfile:</sys/src/cmd/mklib
./cmd/usb/lib/mkfile:</sys/src/cmd/mklib

- erik

On Sat Aug  5 03:34:59 CDT 2006, sretzki@gmx.de wrote:
> 
> Hello list,
> 
> 
> got a question regarding /sys/src/cmd/mklib, why aren't HFILES copied to /$objtype/include?
> 
> I mean, the library itsself is copied to LIBDIR, \o/ , but the headerfiles are not copied. It would be great if mk can at least copy them.
> 
> Something related: Does $objtype work in #pragma lib? If not, mk would have to put in #pragma lib to make library distribution a pleasure.
> 
> 
> Or did I miss something so this all would work without problems?
> 
> 
> Mfg, Sascha
> 


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [9fans] mkfile question: mklib & co.
  2006-08-05 14:27   ` Sascha Retzki
@ 2006-08-05 14:19     ` erik quanstrom
  2006-08-05 14:37       ` Sascha Retzki
  2006-08-05 14:52       ` Christoph Lohmann
  0 siblings, 2 replies; 12+ messages in thread
From: erik quanstrom @ 2006-08-05 14:19 UTC (permalink / raw)
  To: 9fans

the source goes in /sys/src/libfu.  e.g. /sys/src/libdraw.

- erik

On Sat Aug  5 09:29:08 CDT 2006, sretzki@gmx.de wrote:
> > there are no libraries in /sys/src/cmd and no header files which originate in
> > /sys/src/cmd that end up in /sys/include or /$objtype/include (modulo ape).
> 
> Ah okay, did not notice.
> 
> > libraries should go in /sys/src/libfu.
> 
> Hm?
> 
> You mean, the binaries?


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [9fans] mkfile question: mklib & co.
  2006-08-05 14:06 ` erik quanstrom
@ 2006-08-05 14:27   ` Sascha Retzki
  2006-08-05 14:19     ` erik quanstrom
  0 siblings, 1 reply; 12+ messages in thread
From: Sascha Retzki @ 2006-08-05 14:27 UTC (permalink / raw)
  To: 9fans

> there are no libraries in /sys/src/cmd and no header files which originate in
> /sys/src/cmd that end up in /sys/include or /$objtype/include (modulo ape).

Ah okay, did not notice.

> libraries should go in /sys/src/libfu.

Hm?

You mean, the binaries?



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [9fans] mkfile question: mklib & co.
  2006-08-05 14:37       ` Sascha Retzki
@ 2006-08-05 14:37         ` erik quanstrom
  0 siblings, 0 replies; 12+ messages in thread
From: erik quanstrom @ 2006-08-05 14:37 UTC (permalink / raw)
  To: 9fans

it's just different.  having knowledge of modern unix impedes understanding
of plan 9 in the same way that basic programming impedes one's ability
to learn how to program. (yup.  i startedwith integer basic.)

i'm not sure what HFILES are used for other than mk update, which i haven't used.
i think this is superceeded by pull.

in general, plan 9 libraries don't install header files as part of their mk process.
the header files are just put where they belong to begin with.

- erik

On Sat Aug  5 09:38:18 CDT 2006, sretzki@gmx.de wrote:
> > the source goes in /sys/src/libfu.  e.g. /sys/src/libdraw.
> > 
> 
> Okay, so using /sys/src/cmd/mklib is not what I want. I found libdraw using /sys/src/cmd/mksyslib, and draw.h is copied to 'one of the' include-dirs, but I don't see it cp $HFILES to /sys/include/ *scratchhead*
> 
> Is it me or is this all a bit overcomplicated?
> 
> > - erik
> > 
> > On Sat Aug  5 09:29:08 CDT 2006, sretzki@gmx.de wrote:
> >> > there are no libraries in /sys/src/cmd and no header files which originate in
> >> > /sys/src/cmd that end up in /sys/include or /$objtype/include (modulo ape).
> >> 
> >> Ah okay, did not notice.
> >> 
> >> > libraries should go in /sys/src/libfu.
> >> 
> >> Hm?
> >> 
> >> You mean, the binaries?


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [9fans] mkfile question: mklib & co.
  2006-08-05 14:19     ` erik quanstrom
@ 2006-08-05 14:37       ` Sascha Retzki
  2006-08-05 14:37         ` erik quanstrom
  2006-08-05 14:52       ` Christoph Lohmann
  1 sibling, 1 reply; 12+ messages in thread
From: Sascha Retzki @ 2006-08-05 14:37 UTC (permalink / raw)
  To: 9fans

> the source goes in /sys/src/libfu.  e.g. /sys/src/libdraw.
> 

Okay, so using /sys/src/cmd/mklib is not what I want. I found libdraw using /sys/src/cmd/mksyslib, and draw.h is copied to 'one of the' include-dirs, but I don't see it cp $HFILES to /sys/include/ *scratchhead*

Is it me or is this all a bit overcomplicated?

> - erik
> 
> On Sat Aug  5 09:29:08 CDT 2006, sretzki@gmx.de wrote:
>> > there are no libraries in /sys/src/cmd and no header files which originate in
>> > /sys/src/cmd that end up in /sys/include or /$objtype/include (modulo ape).
>> 
>> Ah okay, did not notice.
>> 
>> > libraries should go in /sys/src/libfu.
>> 
>> Hm?
>> 
>> You mean, the binaries?



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [9fans] mkfile question: mklib & co.
  2006-08-05  8:34 [9fans] mkfile question: mklib & co Sascha Retzki
  2006-08-05 14:06 ` erik quanstrom
@ 2006-08-05 14:49 ` Christoph Lohmann
  2006-08-05 17:06   ` Sascha Retzki
  2006-08-05 15:42 ` Russ Cox
  2 siblings, 1 reply; 12+ messages in thread
From: Christoph Lohmann @ 2006-08-05 14:49 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Good day.

Am Sat, 5 Aug 2006 10:34:10 +0200
"Sascha Retzki" <sretzki@gmx.de> schrieb:

> got a question regarding /sys/src/cmd/mklib, why aren't HFILES copied to /$objtype/include?
> 
> I mean, the library itsself is copied to LIBDIR, \o/ , but the headerfiles are not copied. It would be great if mk can at least copy them.

Why does this need to be in the default mk file?

installheader:
	cp *.h /sys/include

But beware that you need the rights to write there, so it is better to have
$HOME/include and bind it before /sys/include, in your profile.

> Something related: Does $objtype work in #pragma lib? If not, mk would have to put in #pragma lib to make library distribution a pleasure.

You write the library, so you put it there.

Sincerely,

Christoph


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [9fans] mkfile question: mklib & co.
  2006-08-05 14:19     ` erik quanstrom
  2006-08-05 14:37       ` Sascha Retzki
@ 2006-08-05 14:52       ` Christoph Lohmann
  2006-08-05 15:15         ` erik quanstrom
  1 sibling, 1 reply; 12+ messages in thread
From: Christoph Lohmann @ 2006-08-05 14:52 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Good day.

Am Sat, 5 Aug 2006 09:19:58 -0500
erik quanstrom <quanstro@quanstro.net> schrieb:

> the source goes in /sys/src/libfu.  e.g. /sys/src/libdraw.

Wrong. Source files of libraries that are not in the distribution go to somewhere, where the user has access to (like $HOME/src/$somelib) and
then everything is bound over the sys directories, so the user can use
this library.

Sincerely,

Christoph


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [9fans] mkfile question: mklib & co.
  2006-08-05 14:52       ` Christoph Lohmann
@ 2006-08-05 15:15         ` erik quanstrom
  0 siblings, 0 replies; 12+ messages in thread
From: erik quanstrom @ 2006-08-05 15:15 UTC (permalink / raw)
  To: 9fans

many people have standalone systems (or systems they admin themselves).  
just dropping the source in /sys/src has been enough for me.  i'm not doing
anything complicated enough to warrent your approach.  (though i'll
keep it in mind in case i do.)

- erik

On Sat Aug  5 09:53:16 CDT 2006, 20h@r-36.net wrote:
> Good day.
> 
> Am Sat, 5 Aug 2006 09:19:58 -0500
> erik quanstrom <quanstro@quanstro.net> schrieb:
> 
> > the source goes in /sys/src/libfu.  e.g. /sys/src/libdraw.
> 
> Wrong. Source files of libraries that are not in the distribution go to somewhere, where the user has access to (like $HOME/src/$somelib) and
> then everything is bound over the sys directories, so the user can use
> this library.
> 
> Sincerely,
> 
> Christoph


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [9fans] mkfile question: mklib & co.
  2006-08-05  8:34 [9fans] mkfile question: mklib & co Sascha Retzki
  2006-08-05 14:06 ` erik quanstrom
  2006-08-05 14:49 ` Christoph Lohmann
@ 2006-08-05 15:42 ` Russ Cox
  2006-08-05 20:27   ` Charles Forsyth
  2 siblings, 1 reply; 12+ messages in thread
From: Russ Cox @ 2006-08-05 15:42 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> got a question regarding /sys/src/cmd/mklib, why aren't HFILES copied to /$objtype/include?

the headers aren't programmatically generated
so the mkfiles don't get involved.
a human writes them and saves them in the appropriate
place.  your question is a little like asking why *.c isn't
copied to /sys/src/cmd.

also, /$objtype/include does not hold many header files
at all.  the portable headers go in /sys/include, and only
machine-dependent headers (u.h) go in /$objtype/include.

russ


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [9fans] mkfile question: mklib & co.
  2006-08-05 14:49 ` Christoph Lohmann
@ 2006-08-05 17:06   ` Sascha Retzki
  0 siblings, 0 replies; 12+ messages in thread
From: Sascha Retzki @ 2006-08-05 17:06 UTC (permalink / raw)
  To: 9fans

> Good day.
> 
> Am Sat, 5 Aug 2006 10:34:10 +0200
> "Sascha Retzki" <sretzki@gmx.de> schrieb:
> 
>> got a question regarding /sys/src/cmd/mklib, why aren't HFILES copied to /$objtype/include?
>> 
>> I mean, the library itsself is copied to LIBDIR, \o/ , but the headerfiles are not copied. It would be great if mk can at least copy them.
> 
> Why does this need to be in the default mk file?
> 

Because those can then be used to not reinvent the wheel for 3rd-party library programmers. Currently, you either do:

> installheader:
> 	cp *.h /sys/include
> 

and then mention that target in your README ("who reads files named README?" ;) ).

or you rewrite half of mklib in your own mkfile.

> But beware that you need the rights to write there, so it is better to have
> $HOME/include and bind it before /sys/include, in your profile.
> 

Or HDIR:

install:
	cp $LIB $LIBDIR/
	for (i in $HFILES) {
		cp $HFILES $HDIR/
	}

I did that in every library I have written up to date (and I deleted every single one of them up to date, btw ;))

>> Something related: Does $objtype work in #pragma lib? If not, mk would have to put in #pragma lib to make library distribution a pleasure.
> 

I found out you don't actually have *any* path in there, just #pragma lib "libf00.a". It will just work(tm).

> You write the library, so you put it there.
> 
> Sincerely,
> 
> Christoph



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [9fans] mkfile question: mklib & co.
  2006-08-05 15:42 ` Russ Cox
@ 2006-08-05 20:27   ` Charles Forsyth
  0 siblings, 0 replies; 12+ messages in thread
From: Charles Forsyth @ 2006-08-05 20:27 UTC (permalink / raw)
  To: 9fans

> also, /$objtype/include does not hold many header files
> at all.  the portable headers go in /sys/include, and only
> machine-dependent headers (u.h) go in /$objtype/include.

term% wc -l /386/include/*.h
     64 /386/include/u.h
     25 /386/include/ureg.h
     89 total

term% wc -l /power/include/*.h
     84 /power/include/u.h
     51 /power/include/ureg.h
    135 total

that one tiny fact makes an enormous difference.  try wading through
the tar pits of /usr/include on linux by comparison.
who could write so much of that stuff and apparently leave with the
satisfaction of a job well done?



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2006-08-05 20:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-05  8:34 [9fans] mkfile question: mklib & co Sascha Retzki
2006-08-05 14:06 ` erik quanstrom
2006-08-05 14:27   ` Sascha Retzki
2006-08-05 14:19     ` erik quanstrom
2006-08-05 14:37       ` Sascha Retzki
2006-08-05 14:37         ` erik quanstrom
2006-08-05 14:52       ` Christoph Lohmann
2006-08-05 15:15         ` erik quanstrom
2006-08-05 14:49 ` Christoph Lohmann
2006-08-05 17:06   ` Sascha Retzki
2006-08-05 15:42 ` Russ Cox
2006-08-05 20:27   ` Charles Forsyth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).