Thread overview
Disabling the Phobos include path?
Mar 09, 2005
Geoff Hickey
Mar 10, 2005
Geoff Hickey
March 09, 2005
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
March 09, 2005
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
March 09, 2005
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:

# dmd -nostdinc test.d                                 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...
March 10, 2005
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