www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - compiling dmd on linux

reply Georg Wrede <georg.wrede iki.fi> writes:
Compiling dmd seems to need some tweaking. I downloaded the *updated* 
version of D2.026, copied ./dmd into a new directory an ran

$make -f linux.mak all

There was no *rule* for making dchar, so I compiled it manually and 
moved it with the others. (Not sensible, but at the time I thought 
that'd be the only problem...)

$ cd root
$ g++ -m32 -Wno-deprecated -D__near= -D__pascal= -fno-exceptions\
    -O2  -D__I 86__=1 -DMARS=1 -DTARGET_LINUX=1 -D_DH -c   dchar.c
$ mv dchar.o ..
$ cd ..
$ make -f linux.mak all


Got some errors, so I started editing linux.mak. Thus far it looks like

$ diff linux.mak.bak linux.mak
218c218
< dchar.o: ../root/dchar.c
---
 dchar.o: $(ROOT)/dchar.c
Then I changed "../mars/mars.h" to "../mars.h" in 2 files: backend/elfobj.c backend/dwarf.c Another thing, what about new.h? I'm on Fedora 10, and I suspect new.h is deprecated. $ grep -R "new\.h" * ph.c:#include <new.h> tk/mem.c:#include <new.h>
Mar 05 2009
next sibling parent Georg Wrede <georg.wrede iki.fi> writes:
Georg Wrede wrote:
 Compiling dmd seems to need some tweaking. I downloaded the *updated* 
 version of D2.026, copied ./dmd into a new directory an ran
I mean ./src/dmd
 $make -f linux.mak all
 
 There was no *rule* for making dchar, so I compiled it manually and 
 moved it with the others. (Not sensible, but at the time I thought 
 that'd be the only problem...)
 
 $ cd root
 $ g++ -m32 -Wno-deprecated -D__near= -D__pascal= -fno-exceptions\
    -O2  -D__I 86__=1 -DMARS=1 -DTARGET_LINUX=1 -D_DH -c   dchar.c
 $ mv dchar.o ..
 $ cd ..
 $ make -f linux.mak all
 
 
 Got some errors, so I started editing linux.mak. Thus far it looks like
 
 $ diff linux.mak.bak linux.mak
 218c218
 < dchar.o: ../root/dchar.c
 ---
  > dchar.o: $(ROOT)/dchar.c
 
 
 Then I changed "../mars/mars.h" to "../mars.h" in 2 files:
 backend/elfobj.c backend/dwarf.c
 
 
 Another thing, what about new.h?
 
 I'm on Fedora 10, and I suspect new.h is deprecated.
 
 $ grep -R "new\.h" *
 ph.c:#include    <new.h>
 tk/mem.c:#include    <new.h>
 
Mar 06 2009
prev sibling parent reply naryl <cy ngs.ru> writes:
Georg Wrede Wrote:
 Another thing, what about new.h?
 
 I'm on Fedora 10, and I suspect new.h is deprecated.
 
 $ grep -R "new\.h" *
 ph.c:#include	<new.h>
 tk/mem.c:#include	<new.h>
 
Latest Gentoo. new.h is nowhere to be found. IIRC it was part of the libstdc++, which is kept only for compatibility reasons and only in binaries.
Mar 06 2009
parent reply Walter Bright <newshound1 digitalmars.com> writes:
naryl wrote:
 Georg Wrede Wrote:
 Another thing, what about new.h?
 
 I'm on Fedora 10, and I suspect new.h is deprecated.
 
 $ grep -R "new\.h" * ph.c:#include	<new.h> tk/mem.c:#include
 <new.h>
 
Latest Gentoo. new.h is nowhere to be found. IIRC it was part of the libstdc++, which is kept only for compatibility reasons and only in binaries.
What do they use instead?
Mar 06 2009
parent reply naryl <cy ngs.ru> writes:
Walter Bright Wrote:

 naryl wrote:
 Georg Wrede Wrote:
 Another thing, what about new.h?
 
 I'm on Fedora 10, and I suspect new.h is deprecated.
 
 $ grep -R "new\.h" * ph.c:#include	<new.h> tk/mem.c:#include
 <new.h>
 
Latest Gentoo. new.h is nowhere to be found. IIRC it was part of the libstdc++, which is kept only for compatibility reasons and only in binaries.
What do they use instead?
Just replace <new.h> with <new> in addition to Georg's fixes. As a bonus dmd will not depend on ancient libstdc++ anymore.
Mar 07 2009
parent reply Walter Bright <newshound1 digitalmars.com> writes:
naryl wrote:
 Just replace <new.h> with <new> in addition to Georg's fixes. As a
 bonus dmd will not depend on ancient libstdc++ anymore.
Sounds good.
Mar 07 2009
parent naryl <cy ngs.ru> writes:
Uploaded source ebuilds for latest dmd:
http://www.assembla.com/wiki/show/d-overlay
Here are the patches:
http://code.assembla.com/d-overlay/subversion/nodes/dev-lang/dmd/files

Tango trunk compiles with dmd-1.041.
Mar 07 2009