Skip to content

Commit

Permalink
use static libphobos2.a as default
Browse files Browse the repository at this point in the history
- except for OSX where -Bstatic isn't available
  • Loading branch information
Martin Nowak committed Sep 17, 2015
1 parent 94c66ea commit 25fbe4d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/link.d
Original file line number Diff line number Diff line change
Expand Up @@ -623,9 +623,9 @@ extern (C++) int runLINK()
char* buf = cast(char*)malloc(3 + slen + 1);
strcpy(buf, "-l");

if (slen > 3 + 2 && memcmp(libname, cast(char*)"lib", 3) == 0)
if (slen > 3 + 2 && memcmp(libname, "lib".ptr, 3) == 0)
{
if (memcmp(libname + slen - 2, cast(char*)".a", 2) == 0)
if (memcmp(libname + slen - 2, ".a".ptr, 2) == 0)
{
argv.push("-Xlinker");
argv.push("-Bstatic");
Expand All @@ -634,7 +634,7 @@ extern (C++) int runLINK()
argv.push("-Xlinker");
argv.push("-Bdynamic");
}
else if (memcmp(libname + slen - 3, cast(char*)".so", 3) == 0)
else if (memcmp(libname + slen - 3, ".so".ptr, 3) == 0)
{
strncat(buf, libname + 3, slen - 3 - 3);
argv.push(buf);
Expand Down
4 changes: 2 additions & 2 deletions src/mars.d
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,11 @@ extern (C++) int tryMain(size_t argc, const(char)** argv)
global.params.is64bit = false;
global.params.defaultlibname = "phobos";
}
else static if (TARGET_LINUX)
else static if (TARGET_LINUX || TARGET_FREEBSD || TARGET_OPENBSD || TARGET_SOLARIS)
{
global.params.defaultlibname = "libphobos2.a";
}
else static if (TARGET_OSX || TARGET_FREEBSD || TARGET_OPENBSD || TARGET_SOLARIS)
else static if (TARGET_OSX)
{
global.params.defaultlibname = "phobos2";
}
Expand Down

0 comments on commit 25fbe4d

Please sign in to comment.