# Newbie question about mkmf and dir\_config

**URL:** <https://www.ruby-forum.com/t/newbie-question-about-mkmf-and-dir-config/79993>\
**Category:** Ruby\
**Created:** [March 12, 2006, 12:13am UTC](https://www.ruby-forum.com/t/newbie-question-about-mkmf-and-dir-config/79993 "2006-03-12T00:13:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ralph\_Kon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/67e7ee/32.png) [@Ralph\_Kon](https://www.ruby-forum.com/u/Ralph_Kon)\
**Post date:** [March 12, 2006, 12:13am UTC](https://www.ruby-forum.com/t/newbie-question-about-mkmf-and-dir-config/79993/1 "2006-03-12T00:13:15Z")

</div>

Please help a beginner! I’m trying to write my first c-extension, and I  
don’t understand the dir\_config command. I need to include 2 .h headers  
and a library for some equipment. Does the ‘name’ in dir\_config(‘name’)  
refer to a directory, the header file, or the library? Do I need to  
include multiple dir\_config lines or multiple options in the command  
line, one for each seperate file? The pickaxe section on this wasn’t  
written with total beginners in mind.  
Thanks,  
Ralph

---

<div class="post-metadata">

**Author:** ![Ralph\_Kon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/67e7ee/32.png) [@Ralph\_Kon](https://www.ruby-forum.com/u/Ralph_Kon)\
**Post date:** [March 13, 2006, 3:20pm UTC](https://www.ruby-forum.com/t/newbie-question-about-mkmf-and-dir-config/79993/2 "2006-03-13T15:20:36Z")

</div>

Hi,

At Sun, 12 Mar 2006 08:13:36 +0900,  
Ralph Kon wrote in [ruby-talk:183710]:

> Please help a beginner! I’m trying to write my first c-extension, and I  
> don’t understand the dir\_config command. I need to include 2 .h headers  
> and a library for some equipment. Does the ‘name’ in dir\_config(‘name’)  
> refer to a directory, the header file, or the library? Do I need to  
> include multiple dir\_config lines or multiple options in the command  
> line, one for each seperate file? The pickaxe section on this wasn’t  
> written with total beginners in mind.

dir\_config(‘foo’) enables --with-foo-dir option, which implies  
–with-foo-include and --with-foo-lib options too, so you don’t  
need multiple dir\_config calls.

A dir\_config option has the effect on all checking methods, so  
you don’t need multiple options in the command line.
