www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Disabling the Phobos include path?

reply Geoff Hickey <ardri comcast.net> writes:
I'm doing some experimenting with writing Windows kernel-mode code in D. 
(It's nothing to get excited about at the moment, I'm still just feeling 
my way around). This involves replacing Phobos, because of course you 
can't run Phobos or the std.c libraries in kernel mode as-is.

Anyway, I'd like to disable the compiler's use of \dmd\src\phobos\std\* 
include path. Is there any way to do this with a compiler switch? I can 
specify -I followed by my own include paths, but anything not found 
there will still be searched for in the usual Phobos location. I'm 
writing the pieces of the runtime library as I need them, but I need the 
compiler to fail if something isn't written yet, not go grab the 
user-mode code.

I seem to remember reading something about this at one point, but now I 
can't find it.

If the answer is no, my next question is, shouldn't there be a way to do 
this? (Short of renaming the Phobos directory so the compiler can't find 
it).

- Geoff
Mar 08 2005
parent reply "Carlos Santander B." <csantander619 gmail.com> writes:
Geoff Hickey wrote:
 I'm doing some experimenting with writing Windows kernel-mode code in D. 
 (It's nothing to get excited about at the moment, I'm still just feeling 
 my way around). This involves replacing Phobos, because of course you 
 can't run Phobos or the std.c libraries in kernel mode as-is.
 
 Anyway, I'd like to disable the compiler's use of \dmd\src\phobos\std\* 
 include path. Is there any way to do this with a compiler switch? I can 
 specify -I followed by my own include paths, but anything not found 
 there will still be searched for in the usual Phobos location. I'm 
 writing the pieces of the runtime library as I need them, but I need the 
 compiler to fail if something isn't written yet, not go grab the 
 user-mode code.
 
 I seem to remember reading something about this at one point, but now I 
 can't find it.
 
 If the answer is no, my next question is, shouldn't there be a way to do 
 this? (Short of renaming the Phobos directory so the compiler can't find 
 it).
 
 - Geoff
Edit dmd\bin\sc.ini. There you'll find something like "-Ic:\dmd\src\phobos". Remove that path. Listo! _______________________ Carlos Santander Bernal
Mar 09 2005
next sibling parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Carlos Santander B. wrote:

 Anyway, I'd like to disable the compiler's use of 
 \dmd\src\phobos\std\* include path. 
 Edit dmd\bin\sc.ini. There you'll find something like 
 "-Ic:\dmd\src\phobos". Remove that path. Listo!
For the GDC compiler, use the "-nostdinc" flag: Error: Error reading file 'object.d' (It's the same flag that GCC uses, by the way) --anders PS. "dmd" here is a wrapper script that converts DMD syntax into the regular GDC/GCC syntax...
Mar 09 2005
prev sibling parent Geoff Hickey <ardri comcast.net> writes:
Carlos Santander B. wrote:
 Geoff Hickey wrote:
 
 Anyway, I'd like to disable the compiler's use of 
 \dmd\src\phobos\std\* include path. Is there any way to do this with a 
 compiler switch? I can specify -I followed by my own include paths, 
 but anything not found there will still be searched for in the usual 
 Phobos location. I'm writing the pieces of the runtime library as I 
 need them, but I need the compiler to fail if something isn't written 
 yet, not go grab the user-mode code.
Edit dmd\bin\sc.ini. There you'll find something like "-Ic:\dmd\src\phobos". Remove that path. Listo! _______________________ Carlos Santander Bernal
Aha! I forgot all about sc.ini, and was thinking that the path was hardcoded in the compiler. Shame on me. Gracias! - Geoff
Mar 09 2005