# Stupid mkmf

**URL:** <https://www.ruby-forum.com/t/stupid-mkmf/159376>\
**Category:** Ruby\
**Created:** [February 3, 2009, 11:55pm UTC](https://www.ruby-forum.com/t/stupid-mkmf/159376 "2009-02-03T23:55:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![orlick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/53a042/32.png) [@orlick](https://www.ruby-forum.com/u/orlick)\
**Post date:** [February 3, 2009, 11:55pm UTC](https://www.ruby-forum.com/t/stupid-mkmf/159376/1 "2009-02-03T23:55:12Z")

</div>

The mkmf gets the list of C source files to be used for the shared  
library  
from the current directory only.  
Is this the only stupid way to list C source files for ruby extensions?

---

<div class="post-metadata">

**Author:** ![orlick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/53a042/32.png) [@orlick](https://www.ruby-forum.com/u/orlick)\
**Post date:** [February 4, 2009, 2:32am UTC](https://www.ruby-forum.com/t/stupid-mkmf/159376/2 "2009-02-04T02:32:10Z")

</div>

On Tue, Feb 3, 2009 at 11:54 PM, Alex K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> The mkmf gets the list of C source files to be used for the shared library  
> from the current directory only.  
> Is this the only stupid way to list C source files for ruby extensions?

I remember doing something like this in extconf.rb:

$srcs = [

# c files listed here

]  
$objs = [

# object files listed here

]

I looked at the mkmf sources and see that it use that global variables  
but I don’t know if there is better way. Btw. mkmf source is very  
poor… it would be nice to have better replacement for mkmf.

–  
Pozdrawiam

Rados³aw Bu³at  
[http://radarek.jogger.pl](http://radarek.jogger.pl) - mój blog

---

<div class="post-metadata">

**Author:** ![orlick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/53a042/32.png) [@orlick](https://www.ruby-forum.com/u/orlick)\
**Post date:** [February 4, 2009, 2:35pm UTC](https://www.ruby-forum.com/t/stupid-mkmf/159376/3 "2009-02-04T14:35:25Z")

</div>

2009/2/3 RadosÅ‚aw BuÅ‚at [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> # c files listed here
> 
> ]  
> $objs = [
> 
> # object files listed here
> 
> ]

I assume I should do something like $srcs = %w[…/src/foo.c  
…/src/more.c]

> I looked at the mkmf sources and see that it use that global variables  
> but I don’t know if there is better way. Btw. mkmf source is very  
> poor… it would be nice to have better replacement for mkmf.

If I have some time in the future I will write an autoconf & automake  
replacement for mkmf and give it to Matz. Ruby deserves better than  
this  
mkmf hack.

Thanks for responding!  
-Alex

---

<div class="post-metadata">

**Author:** ![orlick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/53a042/32.png) [@orlick](https://www.ruby-forum.com/u/orlick)\
**Post date:** [February 4, 2009, 6:05pm UTC](https://www.ruby-forum.com/t/stupid-mkmf/159376/4 "2009-02-04T18:05:06Z")

</div>

Rados³aw Bu³at wrote:

> Yes.
> 
> > If I have some time in the future I will write an autoconf & automake  
> > replacement for mkmf and give it to Matz. Ruby deserves better than this  
> > mkmf hack.
> 
> Ruby gives big possibility to build nice api and mkmf is just ugly  
> (both from programmer and source perspective).  
> Good luck!

What ever happened to mkrf?

[http://rubyforge.org/projects/mkrf/](http://rubyforge.org/projects/mkrf/)

---

<div class="post-metadata">

**Author:** ![orlick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/53a042/32.png) [@orlick](https://www.ruby-forum.com/u/orlick)\
**Post date:** [February 4, 2009, 5:59pm UTC](https://www.ruby-forum.com/t/stupid-mkmf/159376/5 "2009-02-04T17:59:14Z")

</div>

2009/2/4 Alex K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> 2009/2/3 Rados³aw Bu³at [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
> 
> > $srcs = [
> > 
> > # c files listed here
> > 
> > ]  
> > $objs = [
> > 
> > # object files listed here
> > 
> > ]
> 
> I assume I should do something like $srcs = %w[…/src/foo.c …/src/more.c]

Yes.

> If I have some time in the future I will write an autoconf & automake  
> replacement for mkmf and give it to Matz. Ruby deserves better than this  
> mkmf hack.

Ruby gives big possibility to build nice api and mkmf is just ugly  
(both from programmer and source perspective).  
Good luck!

–  
Pozdrawiam

Rados³aw Bu³at  
[http://radarek.jogger.pl](http://radarek.jogger.pl) - mój blog
