FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

build3.03 on Linux with dmd

 
Post new topic   Reply to topic     Forum Index -> Build
View previous topic :: View next topic  
Author Message
keinfarbton



Joined: 03 Dec 2005
Posts: 224
Location: Stuttgart - Germany

PostPosted: Thu Sep 21, 2006 12:12 am    Post subject: build3.03 on Linux with dmd Reply with quote

Some issues on linux with dmd and the Makefile.unix:

1. ) the output file name is still 'build'
2. ) the version=BuildVerbose is not set in the Makefile.unix
3. ) the vLinkLibSwitch should be "-l" because gcc as linker needs this for the system libs.
4. ) the vLibExtention should be "so"?
5. ) To link a static lib ".a" which is in a certain directory it is necessary to give it to gcc like any other object file without any option. With vLibExtention = "a", this is not possible, because build allways removes the extension and so on.

In Source/build.d, I changed this, so it works for me. The Patch printed in this forum does not work due to missing spaces in html...
Code:

Index: build.d
===================================================================
--- build.d   (Revision 49)
+++ build.d   (Arbeitskopie)
@@ -109,7 +109,7 @@
 
     version(Posix) {
         char[] vExeExtention=``;
-        char[] vLibExtention=`a`;
+        char[] vLibExtention="so";
         char[] vObjExtention=`o`;
         char[] vShrLibExtention=`s`;
         char[] vLinkerStdOut = ">/dev/null";
@@ -142,6 +142,7 @@
             char[] vEtcPath    = "";
             char[] vSymInfoSwitch = "/co";
             char[] vOutFileSwitch = "-of";
+            char[] vLinkLibSwitch = "";
         }
 
         version(Posix) {
@@ -165,6 +166,7 @@
             char[] vEtcPath    = "/etc/";
             char[] vSymInfoSwitch = "-g";
             char[] vOutFileSwitch = "-o ";
+            char[] vLinkLibSwitch = "-l";
         }
 
         char[]     vVersionSwitch = "-version";
@@ -172,7 +174,6 @@
         char[][]   vCompilerDefs;
         char[]     vImportPath = "-I";
         bool       vUseModBaseName = false;
-        char[]     vLinkLibSwitch = "";
     }
 
     version(GNU) {
Back to top
View user's profile Send private message
sclytrack



Joined: 14 Jul 2006
Posts: 14

PostPosted: Fri Sep 22, 2006 7:11 am    Post subject: no such file or directory Reply with quote

I've a problem with bud

Digital Mars D Compiler v0.167
bud v3.03 (build)

simple hello world writefln application.

Code:

bud main.d

gcc: c: No such file or directory
gcc: phobos: No such file or directory
gcc: pthread: No such file or directory
gcc: m: No such file or directory



Code:

cat /etc/dmd.conf

[Environment]

DFLAGS=-I/home/sclytrack/applications/digitalmars/dmd/src/phobos


I've put bud into the /usr/local/bin
/usr/loal/bin/bud
/usr/local/bin/dmd
I've also copied mango and ddl sources into the phobos directory.
_________________
AMD Athlon 1800+
Debian Etch 4.0 (stable)
Geforce 2 MX
Please no comments about me passing a 4x4 matrix by value.
Back to top
View user's profile Send private message
keinfarbton



Joined: 03 Dec 2005
Posts: 224
Location: Stuttgart - Germany

PostPosted: Fri Sep 22, 2006 7:30 am    Post subject: Reply with quote

This is what my point 3 says. Change the 4 lines in Source/build.d like the patch says, rebuild, and it should work.
Back to top
View user's profile Send private message
Derek Parnell



Joined: 22 Apr 2004
Posts: 408
Location: Melbourne, Australia

PostPosted: Fri Sep 22, 2006 9:06 am    Post subject: Re: build3.03 on Linux with dmd Reply with quote

AAAAARRRRRHHHHHH!!!!!!


This utility is designed to be flexible. That means it has mechanisms that enable you to tweak its behaviour to something that you want - without changing code. The tool reads a configuration file that you control and it adjusts its behaviour accordingly.


keinfarbton wrote:
Some issues on linux with dmd and the Makefile.unix:

1. ) the output file name is still 'build'

So what?! Change it something else if you want to, or leave it as is. It doesn't matter what the output file is called. I certainly don't give a damn.
keinfarbton wrote:

2. ) the version=BuildVerbose is not set in the Makefile.unix

So what!? If you want it then add it. No-one says that the make file I gave you must build the debug version of the tool.
keinfarbton wrote:

3. ) the vLinkLibSwitch should be "-l" because gcc as linker needs this for the system libs.

Just because you are using gcc doesn't mean that everyone on Linux is also using gcc. Some people, for example, are using gdc.

The purpose of the build.cfg file is to allow people to pick their own tools and tell Build about them (via the .cfg file). So in your case set the line ...

INIT:LinkLibSwitch = "-l"

I've given you a number of example .cfg files for you to use and the documentation explains all the possibilities.

keinfarbton wrote:

4. ) the vLibExtention should be "so"?

Ditto. Update your .cfg file accordingly.

keinfarbton wrote:
5. ) To link a static lib ".a" which is in a certain directory it is necessary to give it to gcc like any other object file without any option. With vLibExtention = "a", this is not possible, because build allways removes the extension and so on.

Ditto again.
keinfarbton wrote:

In Source/build.d, I changed this, so it works for me. The Patch printed in this forum does not work due to missing spaces in html...

Please try using the .cfg file as it was meant to be used. If you do that but still can't get your toolset working, then come to me.

I'm not going to change my source code while such 'fixes' can be achieved via the configuration file.
_________________
--
Derek
skype name: derek.j.parnell
Back to top
View user's profile Send private message
keinfarbton



Joined: 03 Dec 2005
Posts: 224
Location: Stuttgart - Germany

PostPosted: Fri Sep 22, 2006 9:44 am    Post subject: Reply with quote

I am so sorry, I have to admit, I didn't read the documentation and thought it should work out of the box. Silly me.

Some other issues ....

* On linux, often symbolic links are used. Build does not follow those links when searching for build.cfg, so saying it looks in the directory of the executable is not correct. A common used scenario is that /usr/bin/build is a symbolic link to somewhere else. And build does not complain about a not found build.cfg.

* if build can not work out of the box without a build.cfg, it should complain if no such build.cfg is found.

* On linux, programs are often installed in /usr/bin or /usr/local/bin. This is no good place for configuration files. So the standard directory for build.cfg should be /etc on linux or it should be one of the first locations to look for.

* in build.d line 2238, an array bounds error occurs if compiler path is not given in build.cfg. I got it by simply trying the provided nix_dmd_build.cfg. In the release build this shows up with a segmentation fault without any message.

* The nix_dmd_build.cfg contains a "MakeSilent .... " which build complains about an unknown name.

* The nix_dmd_build.cfg should be changed
** SymInfoSwitch should be "-g" instead of "/co"
** OutFileSwitch should be "-o " instead of "-of" (note the space)

* The -version=BuildVerbose is important to be able to see what build does with the parameters. The parameters are not transfered unchanged, so it is important to be able to see them. Please enable the -V option to show the issued calls to dmd and gcc in the release build also.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Build All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group