SCons D tool: need help with building static library

2012-12-13 Thread H. S. Teoh
Hi Russel, I've been using your BitBucket scons_d_tooling version of SCons for my D projects, and it's been great! However, I needed to make a static library today and I'm having some trouble with it. Here's a reduced testcase: env = Environment( DC = '/usr/src/d/dmd/src/

Re: SCons D tool: need help with building static library

2012-12-13 Thread Russel Winder
Hi, I can't look at this today as I am at Groovy and Grails eXchange 2012 and have to give a talk which needs some reworking in the light of happenings yesterday. Ping me a couple of times over the weekend to make sure I get this looked into by Monday morning. Thanks. On Thu, 2012-12-13 at 14:4

Re: SCons D tool: need help with building static library

2012-12-13 Thread Jacob Carlborg
On 2012-12-13 23:49, H. S. Teoh wrote: The compilation steps work fine, but when it should be running ar to create the library archive, it runs a non-existent 'lib' instead, which fails. Isn't "lib" what Windows uses? You know that you can also use the "-lib" flag directly with dmd. -- /Jac

Re: SCons D tool: need help with building static library

2012-12-15 Thread Russel Winder
On Thu, 2012-12-13 at 14:49 -0800, H. S. Teoh wrote: > Hi Russel, > > I've been using your BitBucket scons_d_tooling version of SCons for my D > projects, and it's been great! However, I needed to make a static > library today and I'm having some trouble with it. Here's a reduced > testcase: > >

Re: SCons D tool: need help with building static library

2012-12-15 Thread H. S. Teoh
On Sat, Dec 15, 2012 at 06:42:45PM +, Russel Winder wrote: > On Thu, 2012-12-13 at 14:49 -0800, H. S. Teoh wrote: > > Hi Russel, > > > > I've been using your BitBucket scons_d_tooling version of SCons for > > my D projects, and it's been great! However, I needed to make a > > static library to

Re: SCons D tool: need help with building static library

2012-12-17 Thread Russel Winder
On Sat, 2012-12-15 at 11:19 -0800, H. S. Teoh wrote: […] > But I have trouble when I try to link to it. For some reason, the dmd > link command isn't picking up the value of LIBPATH, so the linker can't > find the library. Here's a reduced test case: > > #!/usr/src/scons/russel/scons_d_tooli

Re: SCons D tool: need help with building static library

2012-12-17 Thread H. S. Teoh
On Mon, Dec 17, 2012 at 06:32:57PM +, Russel Winder wrote: > On Sat, 2012-12-15 at 11:19 -0800, H. S. Teoh wrote: > […] > > But I have trouble when I try to link to it. For some reason, the dmd > > link command isn't picking up the value of LIBPATH, so the linker can't > > find the library. Her

Re: SCons D tool: need help with building static library

2012-12-17 Thread H. S. Teoh
On Mon, Dec 17, 2012 at 11:08:00AM -0800, H. S. Teoh wrote: [...] > Anyway. The command is missing a "-L-L." option. It should read: > > /usr/src/d/dmd/src/dmd -ofprog prog.o -L-L. -L-lmylib > > which passes a "-L." option to the linker to make it search the current > directory for the lib

Re: SCons D tool: need help with building static library

2012-12-17 Thread Russel Winder
On Mon, 2012-12-17 at 11:08 -0800, H. S. Teoh wrote: […] > I'm a GDC/GCC person as well. :-) Except that GDC for my platform is > horribly outdated, so I've had to resort to DMD for my newer projects. > Plus, sometimes I'm testing fixes for Phobos, which often requires the > latest git dmd to even

Re: SCons D tool: need help with building static library

2012-12-17 Thread H. S. Teoh
On Mon, Dec 17, 2012 at 07:28:53PM +, Russel Winder wrote: > On Mon, 2012-12-17 at 11:08 -0800, H. S. Teoh wrote: > […] > > > I'm a GDC/GCC person as well. :-) Except that GDC for my platform is > > horribly outdated, so I've had to resort to DMD for my newer > > projects. Plus, sometimes I'm

Re: SCons D tool: need help with building static library

2012-12-17 Thread David Nadlinger
On Monday, 17 December 2012 at 19:29:04 UTC, Russel Winder wrote: I tried this on spec earlier and got: |> dmd -ofprog prog.o -L-L. -L-lmylib /usr/lib/x86_64-linux-gnu/libphobos2.a(dmain2_45f_1a5.o): In function `_D2rt6dmain24mainUiPPaZi7runMainMFZv': src/rt/dmain2.d:(.text._D2rt6dmain24mainUiP

Re: SCons D tool: need help with building static library

2012-12-17 Thread Russel Winder
On Mon, 2012-12-17 at 11:37 -0800, H. S. Teoh wrote: […] > I haven't tried LDC yet, though I've heard good things about it. Maybe I > should check it out sometime. I checked out the Git repository and build master/HEAD, but then I am an unstable, bleeding-edge kind of person. > Did you define ma

Re: SCons D tool: need help with building static library

2012-12-17 Thread Russel Winder
On Mon, 2012-12-17 at 20:37 +0100, David Nadlinger wrote: > On Monday, 17 December 2012 at 19:29:04 UTC, Russel Winder wrote: […] > Your program seems to be missing a main() function, the rest is > just noise (DMD emits certain symbols to the main module only). Indeed. I guess I just failed to re

Re: SCons D tool: need help with building static library

2012-12-17 Thread David Nadlinger
On Monday, 17 December 2012 at 20:09:01 UTC, Russel Winder wrote: Indeed. I guess I just failed to read the message on the grounds it was mentioning stuff I had no interest in. My problem I guess. DMD from Git master should emit an explicit error for this now (by parsing the linker output).

Re: SCons D tool: need help with building static library

2012-12-30 Thread H. S. Teoh
On Mon, Dec 17, 2012 at 07:28:53PM +, Russel Winder wrote: > On Mon, 2012-12-17 at 11:08 -0800, H. S. Teoh wrote: [...] > > Anyway. The command is missing a "-L-L." option. It should read: > > > > /usr/src/d/dmd/src/dmd -ofprog prog.o -L-L. -L-lmylib > > > > which passes a "-L." option t

Re: SCons D tool: need help with building static library

2012-12-31 Thread Russel Winder
On Sun, 2012-12-30 at 20:32 -0800, H. S. Teoh wrote: […] > Just wondering if there's any update on this issue. I did a 'hg pull; hg > update', which pulled in a bunch of updates, but the '-L-L.' option is > still missing from the link command. The period Dec 20 → Jan 2 is a (generally far too shor

Re: SCons D tool: need help with building static library

2012-12-31 Thread Russel Winder
On Sun, 2012-12-30 at 20:32 -0800, H. S. Teoh wrote: […] > Just wondering if there's any update on this issue. I did a 'hg pull; hg > update', which pulled in a bunch of updates, but the '-L-L.' option is > still missing from the link command. […] I have put a "quick hack" in place to make things

Re: SCons D tool: need help with building static library

2012-12-31 Thread H. S. Teoh
On Mon, Dec 31, 2012 at 12:15:07PM +, Russel Winder wrote: > On Sun, 2012-12-30 at 20:32 -0800, H. S. Teoh wrote: > […] > > Just wondering if there's any update on this issue. I did a 'hg > > pull; hg update', which pulled in a bunch of updates, but the > > '-L-L.' option is still missing from