# Mkmf.rb question

**URL:** <https://www.ruby-forum.com/t/mkmf-rb-question/79172>\
**Category:** Ruby\
**Created:** [December 12, 2006, 8:26pm UTC](https://www.ruby-forum.com/t/mkmf-rb-question/79172 "2006-12-12T20:26:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrickharlan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/77aa72/32.png) [@patrickharlan](https://www.ruby-forum.com/u/patrickharlan)\
**Post date:** [December 12, 2006, 8:26pm UTC](https://www.ruby-forum.com/t/mkmf-rb-question/79172/1 "2006-12-12T20:26:05Z")

</div>

I keep getting lost in the mkmf code, so I was hoping to find a guide.

I have an extension that under Windows will use an external dll, but  
under Unix the files are linked directly into the extension. So my  
question is:

Can I explicitly exclude certain files in extconf.rb, that it has  
found (by extension in the current directory) or (even better) can I  
explicitly include source files in a different directory.

Thanks  
pth

---

<div class="post-metadata">

**Author:** ![patrickharlan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/77aa72/32.png) [@patrickharlan](https://www.ruby-forum.com/u/patrickharlan)\
**Post date:** [December 12, 2006, 10:50pm UTC](https://www.ruby-forum.com/t/mkmf-rb-question/79172/2 "2006-12-12T22:50:53Z")

</div>

Patrick H. wrote:

> I keep getting lost in the mkmf code, so I was hoping to find a guide.
> 
> I have an extension that under Windows will use an external dll, but  
> under Unix the files are linked directly into the extension. So my  
> question is:
> 
> Can I explicitly exclude certain files in extconf.rb, that it has  
> found (by extension in the current directory) or (even better) can I  
> explicitly include source files in a different directory.

I might have misunderstood you, but you can do this:

# extconf.rb

dir\_config(‘foo’)  
have\_header(‘foo.h’)

And then from the command line:

ruby extconf.rb --with-foo-include=c:/path/to/foo/include

Is that what you meant?

Regards,

Dan
