Skip to content

SYSCONFDIR.imp isn't documented anywhere #4289

@WalterBright

Description

@WalterBright

@dkorpel writes:

Sysconfdir.imp is a file with the location where dmd should look for its 
configuration file, sc.ini/dmd.conf. Some dmd packages wanted to have a 
different location than the default /etc folder, so a string import 
import("SYSCONFDIR.imp") was used so a build script can overwrite that file 
before building dmd. You can't pass string constants on the command line, since 
you're against C's option to make arbitrary preprocessor defines on the command 
line which allows an 'open set' of versions as opposed to a closed set. This 
SYSCONFDIR mechanism works around that limitation.

It's because of this that you need the -J../.. flag by the way, because there is 
no allowed location for string imports enabled by default, which I really 
dislike. I've proposed too loosen this restriction, but ai got some opposition. 
Only OpenD implemented something that allows string imports to read files in 
places where you can already import regular source files, if I recall correctly.

It is incorrectly documented in the compiler source file here:

https://github.com/dlang/dmd/blob/master/compiler/src/dmd/dinifile.d#L61

It should be documented on this page:

https://dlang.org/dmd-linux.html#dmd-conf

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions