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

Build 3.02 on linux

 
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 Jul 06, 2006 3:43 pm    Post subject: Build 3.02 on linux Reply with quote

A was asked several time for the patch and how to get build working on linux.

1. Check out the source of build out. (revision 48)
2. Apply the patch (following)
3. Always use the options "-op -T<name>"

This patch changes:
1. On linux use "-g" for debug symbols instead of "/co"
2. On linux, the linker gcc used the option '-o' for the outputfile. Changing '-of' to '-o' conflicts with the '-op' option, so we use '-o ' including space.
3. Multiple -L-l options need spaces to be separated.
4. You can add <lib>.a directly like object files on the commandline.
5. On linux the pthread lib is needed for every app.

keinfarbton

Code:

Index: Source/build.d
===================================================================
--- /home/frank/DLibs/buildtool/Source/build.d  (Revision 48)
+++ /home/frank/DLibs/buildtool/Source/build.d  (Arbeitskopie)
@@ -138,6 +138,8 @@
             char[] vLibrarianOpts = `-c -p256`;
             char[] vHomePathId = "HOME";
             char[] vEtcPath    = "";
+           char[]     vSymInfoSwitch = "/co";
+           char[]     vOutFileSwitch = "-of";
         }

         version(Posix) {
@@ -159,16 +161,16 @@
             char[] vLibrarianOpts = `-r`;
             char[] vHomePathId = "HOME";
             char[] vEtcPath    = "/etc/";
+           char[] vSymInfoSwitch = "-g";
+           char[] vOutFileSwitch = "-o ";
         }

         char[]     vVersionSwitch = "-version";
         char[]     vDebugSwitch = "-debug";
         char[][]   vCompilerDefs;
-        char[]     vOutFileSwitch = "-of";
         char[]     vImportPath = "-I";
         bool       vUseModBaseName = false;
         char[]     vLinkLibSwitch = "-l";
-        char[]     vSymInfoSwitch = "/co";
     }

     version(GNU) {
@@ -220,7 +222,7 @@
         char[]     vOutFileSwitch = "-o ";
         char[][]   vCompilerDefs;
         char[]     vImportPath = "-I ";
-        char[]     vSymInfoSwitch = "/co";
+        char[]     vSymInfoSwitch = "-g";
         /* GDC places object files in the directory from which it is called */
         bool       vUseModBaseName = true;
     }
@@ -935,16 +937,16 @@
         if (lFileName.length > 0)
         {
             lCmdItem = lFileName;
-            if ( util.str.ends(lCmdItem, "." ~ vLibExtention) == True)
-            {
-                // Cut off extention.
-                lCmdItem.length = lCmdItem.length - vLibExtention.length - 1;
-                lLibraryFiles ~= lCmdItem;
-            }
-            else
-            {
+            //if ( util.str.ends(lCmdItem, "." ~ vLibExtention) == True)
+            //{
+            //    // Cut off extention.
+            //    lCmdItem.length = lCmdItem.length - vLibExtention.length - 1;
+            //    lLibraryFiles ~= lCmdItem;
+            //}
+            //else
+            //{
                 lFilesToLink ~= lCmdItem;
-            }
+            //}
         }
     }

@@ -1121,7 +1123,7 @@
                 {
                     if (util.str.begins(lCompileArg, "-L") == True)
                     {
-                        lLinkerSwitches ~= lCompileArg[2..$];
+                        lLinkerSwitches ~= " " ~ lCompileArg[2..$];
                     }
                 }
                 foreach( char[] lSwitch; std.string.split(vLinkerDefs ~ lLinkerSwitches, "/"))
@@ -2210,6 +2212,7 @@
         {
             vDefaultLibs ~= "c";
             vDefaultLibs ~= "phobos";
+            vDefaultLibs ~= "pthread";
             vDefaultLibs ~= "m";
         }
     }
Back to top
View user's profile Send private message
keinfarbton



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

PostPosted: Sat Jul 22, 2006 10:19 am    Post subject: Reply with quote

the patch does not work for two reasons:

    It contains absolute paths
    The forum changed the count of spaces.

I don't know how to post it in a way, one can cut/paste it unmodified.
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Sat Jul 22, 2006 6:35 pm    Post subject: Reply with quote

You could stick the patch in the bindings project and post a link to it in this forum. Everyone has access to the bindings project, I believe.

-JJR
Back to top
View user's profile Send private message
keinfarbton



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

PostPosted: Sun Jul 23, 2006 6:17 am    Post subject: Reply with quote

Ok, here is the working patch:
http://tionex.de/download/build-r48.patch
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