1445 – Add default library options to sc.ini / dmd.conf

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1445 - Add default library options to sc.ini / dmd.conf
Summary: Add default library options to sc.ini / dmd.conf
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 All
: P2 enhancement
Assignee: Walter Bright
URL:
Keywords:
Depends on:
Blocks:
Reported: 2007年08月27日 13:42 UTC by Sean Kelly
Modified: 2014年02月16日 15:22 UTC (History)
2 users (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Sean Kelly 2007年08月27日 13:42:06 UTC
It would be quite useful if the DMD configuration file provided a means of specifying the name of the default libraries to link based on the presence of "-release" on the command-line. In short, I'd like for something like this to happen:
* Specify "phobos.lib" as the library to use for release builds and "phobos_d.lib" as the library to use for debug builds.
* Command "dmd foo.d" links "phobos_d.lib" as specified in sc.ini
* Command "dmd -release foo.d" links "phobos.lib" as specified in sc.ini
If either of these fields are not set, the built-in default (phobos.lib or libphobos.a) will be used instead.
This has the advantage of both simplifying the use of alternate runtime libraries and providing a means of linking a debug lib when doing so may be beneficial to the user.
Comment 1 BCS 2007年08月27日 19:34:40 UTC
along the same line, it would be vary nice to be able to select phobos vs. tango builds. Something like have a DMDLIB environment variable that picks a section out of the sc.ini file.
Comment 2 Walter Bright 2007年08月30日 14:29:37 UTC
I'll do this as command line switches, which can be set via DFLAGS in sc.ini/dmd.conf.
Comment 3 david 2007年09月12日 07:54:57 UTC
some part of this proposal seems to duplicate with bug 987
*** This bug has been marked as a duplicate of 987 ***
Comment 4 david 2007年09月12日 07:58:57 UTC
oh why not make the current -debuglib a little bit more advanced?
I mean make the -debuglib work together with -debug version , different debug
version uses different debuglib, 
and -g symbolic stuff should be also controllable with -debug version stuff, so the compiler debug system goes consistent
Comment 5 david 2007年09月12日 08:00:05 UTC
sorry for the bad mouse clicking, reopen this issue for a little bit more enhancement
Comment 6 Brad Roberts 2009年06月07日 23:48:22 UTC
This was added back in versions 1.021 and 2.004:
-debuglib=libname
 link in libname as the default library when compiling for
 symbolic debugging instead of libphobos2.a 
-defaultlib=libname
 link in libname as the default library when not compiling
 for symbolic debugging instead of libphobos2.a
It's based off the -g option rather than the -release option, but.. close enough.


AltStyle によって変換されたページ (->オリジナル) /