Gregor
Joined: 05 May 2006 Posts: 72 Location: Portland, OR
|
Posted: Mon Oct 09, 2006 4:04 pm Post subject: Some recommended changes to Unix with respect to libraries |
|
|
There are several changes I'd recommend to make libraries a bit less painful on Unix. All three of them are either fixing bugs or adding features - that is, it could not have possibly worked as is, but does work with this change. So, they're not harmful.
1) In build.d, the vShrLibExtention [sic] is `s` instead of `so`. .s files are assembly, .so files are shared objects This is wrong in both the provided .cfg and build.d.
2) Again in build.d, for DMD on GNU/Linux, the default vLinkLibSwitch is ``, instead of `-l`. If you try to link against some library with no switches, it'll be very unhappy (cannot find file 'phobos'). This should be -l. It's correct in the example .cfg file, so it's less important.
3) This is a hand-wavy one . There should be a mechanism for building shared libraries on Unix. I've written one for build used with DSSS (sorry, I have sort of a branch ), so I can generalize it a bit and submit it if you'd like. The method of generating shared libraries for Windows can't be generalized, since there's no equivalent of a DllMain, no such kludge is necessary on Unix. It gets even more confusing, since GDC on Windows can build shared libraries like GDC on Unix, generating its own DllMain et cetera . Unfortunately (well, fortunately for me) DMD doesn't support shared libraries on linux, so that makes the situation a bit more complicated (there needs to be a -shlib-support flag or something thereabout), but it's still very much an implementable plan.
(Note: This is not related to my library naming convention proposal, which I decided I'd implement at a higher level - it does make sense that build should be able to name things whatever the user feels like).
Sorry if I came off a bit ranty there
EDIT: one of these days I'll read my post before posting... |
|