Menu

#221 Incorrect flags for static/dynamic linking under OS/X

open
cpptasks (103)
5
2008-04-21
2008-04-21
Constantine
No

In porting the XBiG project to the Mac, I found that the compiler task was generating the "-Bdynamic" rather than "-dynamic" for the Mac. My fix is silly, but it works:

net.sf.antcontrib.cpptasks.gcc.AbstractLdLinker
protected String getDynamicLibFlag() {
if (isDarwin()) {
return "-dynamic";
}
return "-Bdynamic";
}

protected String getStaticLibFlag() {
if (isDarwin()) {
return "-static";
}
return "-Bstatic";
}

This, naturally, requires a patch to the test: net.sf.antcontrib.cpptasks.gcc.TestAbstractLdLinker.testAddLibraryStatic to account for this.

Discussion


Log in to post a comment.