Ticket #17: build.d.r43.bsd-posix-fix.diff

File build.d.r43.bsd-posix-fix.diff, 4.2 kB (added by rasmus at-flajm-dot-se, 6 years ago)

Modifications made to build.d r41

  • trunk/Source/build.d

    old new  
    120120            char[] vConfigSep = ";"; 
    121121            char[] vLibrarian = `lib`; 
    122122            char[] vLibrarianOpts = `-c -p256`; 
     123            char[] vLinkerDebugSymInfoSwitch = " /co"; 
    123124        } 
    124125 
    125126        version(Posix) { 
    126             char[] vCompilerExe=`dmd`; 
     127            char[] vCompilerExe=`gdmd`; 
    127128            char[] vCompileOnlySwitch= ` -c`; 
    128129            char[] vLinkerExe=`ld`; 
    129130            char[] vConfigFile=`dmd.conf`; 
    130131            char[] vCompilerPath=``; 
    131132            char[] vLinkerPath=``; 
    132             char[] vLinkerDefSwitches=`/noi/map`; 
     133            char[] vLinkerDefSwitches=``; 
    133134            char[] vConfigPath=`/etc/`; 
    134135            char[] vLibPaths = ``; 
    135136            char[] vConfigSep = ":"; 
    136137            char[] vLibrarian = `ar`; 
    137138            char[] vLibrarianOpts = `-r`; 
     139            char[] vLinkerDebugSymInfoSwitch = " -g"; 
    138140        } 
    139141 
    140142        char[]     vVersionSwitch = "-version="; 
     
    143145        char[]     vOutFileSwitch = "-of"; 
    144146        char[]     vImportPathSwitch = "-I"; 
    145147        char[]     vNoLinkSwitch    = "-c"; 
     148        char[]     vLinkOutputSwitch    = "-o "; 
     149        char[]     vLinkLibSwitch = "-l"; 
    146150    } 
    147151 
    148152    version(GNU) { 
     
    159163            char[] vConfigSep = ";"; 
    160164            char[] vLibrarian = `lib`; 
    161165            char[] vLibrarianOpts = `-c`; 
     166 
     167                char[]     vVersionSwitch = "-fversion="; 
     168              char[]     vDebugSwitch = "-fdebug"; 
     169              char[]     vOutFileSwitch = "-o "; 
     170              char[]     vKeepPathSwitch = ""; 
     171              char[]     vImportPathSwitch = "-I "; 
     172              char[]     vLinkOutputSwitch    = "-o "; 
     173              char[]     vLinkLibSwitch = "-l"; 
     174            char[] vLinkerDebugSymInfoSwitch = " /co"; 
    162175        } 
    163176 
    164177        version(Posix) { 
    165             char[] vCompilerExe=`gdc`; 
     178                // Using GDC's GDMD wrapper script 
     179                char[] vCompilerExe=`gdmd`; 
    166180            char[] vCompileOnlySwitch= ` -c`; 
    167             char[] vLinkerExe=`ld`; 
    168             char[] vConfigFile=null
    169             char[] vCompilerPath=`/opt/gdc/bin`; 
     181            char[] vLinkerExe=`gdmd`; // using gdmd/gdc as linker 
     182            char[] vConfigFile=``
     183            char[] vCompilerPath=``; 
    170184            char[] vLinkerPath=``; 
    171185            char[] vLinkerDefSwitches=``; 
    172             char[] vConfigPath=null
     186            char[] vConfigPath=`/etc/`
    173187            char[] vLibPaths = ``; 
    174188            char[] vConfigSep = ":"; 
    175189            char[] vLibrarian = `ar`; 
    176190            char[] vLibrarianOpts = `-r`; 
     191 
     192                char[]     vVersionSwitch = "-version="; 
     193              char[]     vDebugSwitch = "-debug"; 
     194              char[]     vKeepPathSwitch = "-op"; 
     195              char[]     vOutFileSwitch = "-of"; 
     196              char[]     vImportPathSwitch = "-I"; 
     197              char[]     vLinkOutputSwitch    = "-of"; 
     198              char[]     vLinkLibSwitch = "-L-l"; 
     199            char[] vLinkerDebugSymInfoSwitch = " -g"; 
    177200        } 
    178         char[]     vVersionSwitch = "-fversion="; 
    179         char[]     vDebugSwitch = "-fdebug"; 
    180         char[]     vOutFileSwitch = "-o "; 
    181         char[]     vKeepPathSwitch = ""; 
    182         char[]     vImportPathSwitch = "-I "; 
    183201        char[]     vNoLinkSwitch    = "-c"; 
    184202    } 
    185203 
     
    11381156                } 
    11391157 
    11401158                // (2) Set the output file name 
    1141                 lCommandLine ~= "-o " ~ util.str.enquote(util.pathex.AbbreviateFileName(lTargetName)) ~ "\n"; 
     1159                lCommandLine ~= vLinkOutputSwitch ~ util.str.enquote(util.pathex.AbbreviateFileName(lTargetName)) ~ "\n"; 
    11421160 
    11431161                // (3) Set the map name 
    11441162                if (IsMapping == True) 
     
    11481166                // Include the default libraries first. 
    11491167                foreach( char[] lLib; vDefaultLibs ~ lLibraryFiles) 
    11501168                { 
    1151                     lCommandLine ~= "-l" ~ util.str.enquote(lLib) ~ "\n"; 
     1169                    lCommandLine ~= vLinkLibSwitch ~ util.str.enquote(lLib) ~ "\n"; 
    11521170                } 
    11531171 
    11541172                if (vLibPaths.length > 1) 
     
    24052423                if (pArg == "-g") 
    24062424                { 
    24072425                    // Requires symbolic debug info. 
    2408                     vLinkerDefSwitches ~= "/co"
     2426                    vLinkerDefSwitches ~= vLinkerDebugSymInfoSwitch
    24092427                    AddCompilerArg(pArg); 
    24102428                    break; 
    24112429                }