# How can I get you to use mkrf?

**URL:** <https://www.ruby-forum.com/t/how-can-i-get-you-to-use-mkrf/66020>\
**Category:** Ruby\
**Created:** [August 22, 2006, 10:31pm UTC](https://www.ruby-forum.com/t/how-can-i-get-you-to-use-mkrf/66020 "2006-08-22T22:31:47Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![kdclark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ba9def/32.png) [@kdclark](https://www.ruby-forum.com/u/kdclark)\
**Post date:** [August 22, 2006, 10:31pm UTC](https://www.ruby-forum.com/t/how-can-i-get-you-to-use-mkrf/66020/1 "2006-08-22T22:31:47Z")

</div>

Hi guys,  
Google’s Summer of Code has officially come to a close but I in no way  
plan to abandon my project. It’s in a fairly stable place and working  
for the libraries that I’ve played with. That being said, I don’t  
think many are using the project. mkmf is old, and though it is ugly,  
I expect people are comfortable with it.

What can I do to help you make a switch? What feature does mkmf have  
that you -need- for your extension? How can I make this easier?

Finally, speak up if you’re already using mkrf or have played with it.  
I’m happy to hear criticism.

I hope this thread can give me a list of things to work on as I try to  
move the project along.

---

<div class="post-metadata">

**Author:** ![kdclark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ba9def/32.png) [@kdclark](https://www.ruby-forum.com/u/kdclark)\
**Post date:** [August 22, 2006, 10:37pm UTC](https://www.ruby-forum.com/t/how-can-i-get-you-to-use-mkrf/66020/2 "2006-08-22T22:37:48Z")

</div>

On 22/08/06, Kevin C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Finally, speak up if you’re already using mkrf or have played with it.  
> I’m happy to hear criticism.
> 
> I hope this thread can give me a list of things to work on as I try to  
> move the project along.
> 
> –  
> Kevin C.  
> [http://glu.ttono.us](http://glu.ttono.us)

Is it a replacement for a tool like rake? If not how easy would it be  
to use/integrate with rake?

Farrel

---

<div class="post-metadata">

**Author:** ![kdclark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ba9def/32.png) [@kdclark](https://www.ruby-forum.com/u/kdclark)\
**Post date:** [August 22, 2006, 11:05pm UTC](https://www.ruby-forum.com/t/how-can-i-get-you-to-use-mkrf/66020/3 "2006-08-22T23:05:54Z")

</div>

Kevin C. wrote:

> What can I do to help you make a switch? What feature does mkmf have  
> that you -need- for your extension? How can I make this easier?

Hi,

I tried it, but it doesn’t work with my C++ extension. Though I can  
specify ‘\*.cxx’ with Mkrf::Generator.new, the resulting Rakefile has no  
rule for .cxx and so the rake command just says:

Don’t know how to build task ‘id3lib\_api\_wrap.o’

When I manually change ‘.c’ to ‘.cxx’ in the Rakefile, everything works  
alright.

This is obviously a “feature” I need 😉

Robin S.

---

<div class="post-metadata">

**Author:** ![kdclark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ba9def/32.png) [@kdclark](https://www.ruby-forum.com/u/kdclark)\
**Post date:** [August 22, 2006, 11:39pm UTC](https://www.ruby-forum.com/t/how-can-i-get-you-to-use-mkrf/66020/4 "2006-08-22T23:39:57Z")

</div>

Kevin C. wrote:

> Finally, speak up if you’re already using mkrf or have played with it.  
> I’m happy to hear criticism.
> 
> I hope this thread can give me a list of things to work on as I try to  
> move the project along.

Were you able to add the features I described in my RubyForge forum  
post?

[http://rubyforge.org/forum/forum.php?thread\_id=7096&forum\_id=7153](http://rubyforge.org/forum/forum.php?thread_id=7096&forum_id=7153)

---

<div class="post-metadata">

**Author:** ![kdclark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ba9def/32.png) [@kdclark](https://www.ruby-forum.com/u/kdclark)\
**Post date:** [August 22, 2006, 11:45pm UTC](https://www.ruby-forum.com/t/how-can-i-get-you-to-use-mkrf/66020/5 "2006-08-22T23:45:59Z")

</div>

Hi Tim,  
Thought it’d be hacky, you can add to vars using the new  
.additional\_code accessor (same with the header flags). I’m not really  
satisfied with that either though, so I’m going to be investigating  
implementing those features for the next release. You’ll -definitely-  
have a better way to access LDFLAGS and friends.

Kev

---

<div class="post-metadata">

**Author:** ![kdclark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ba9def/32.png) [@kdclark](https://www.ruby-forum.com/u/kdclark)\
**Post date:** [August 22, 2006, 11:48pm UTC](https://www.ruby-forum.com/t/how-can-i-get-you-to-use-mkrf/66020/6 "2006-08-22T23:48:00Z")

</div>

Farrel,  
mkrf is for building Rakefiles to build extensions to Ruby. It uses  
rake, but isn’t a replacement for it. It aims to replace mkmf.

Kev

---

<div class="post-metadata">

**Author:** ![kdclark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ba9def/32.png) [@kdclark](https://www.ruby-forum.com/u/kdclark)\
**Post date:** [August 22, 2006, 11:52pm UTC](https://www.ruby-forum.com/t/how-can-i-get-you-to-use-mkrf/66020/7 "2006-08-22T23:52:00Z")

</div>

Kevin C. wrote:

> > Kevin C. wrote:
> > 
> > > Finally, speak up if you’re already using mkrf or have played with it.

Thanks for responding, Kevin. How about creating a “config.h” file for  
the 100+ feature test preprocessor symbols?

---

<div class="post-metadata">

**Author:** ![kdclark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ba9def/32.png) [@kdclark](https://www.ruby-forum.com/u/kdclark)\
**Post date:** [August 23, 2006, 12:00am UTC](https://www.ruby-forum.com/t/how-can-i-get-you-to-use-mkrf/66020/8 "2006-08-23T00:00:00Z")

</div>

> Thanks for responding, Kevin. How about creating a “config.h” file for  
> the 100+ feature test preprocessor symbols?

Something like that may work. An optional .h file would fix your  
issues certainly. I’ll see what makes sense in the code.

---

<div class="post-metadata">

**Author:** ![kdclark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ba9def/32.png) [@kdclark](https://www.ruby-forum.com/u/kdclark)\
**Post date:** [August 23, 2006, 12:30am UTC](https://www.ruby-forum.com/t/how-can-i-get-you-to-use-mkrf/66020/9 "2006-08-23T00:30:04Z")

</div>

John,  
I setup a mailing list at rubyforge just a moment ago. I’ll send an  
announcment to ruby-talk when it’s up and ready to go.

I’ll try to get a basic homepage up this week.

---

<div class="post-metadata">

**Author:** ![kdclark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ba9def/32.png) [@kdclark](https://www.ruby-forum.com/u/kdclark)\
**Post date:** [August 23, 2006, 12:02am UTC](https://www.ruby-forum.com/t/how-can-i-get-you-to-use-mkrf/66020/10 "2006-08-23T00:02:00Z")

</div>

On 8/22/06, Kevin C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi guys,  
> Google’s Summer of Code has officially come to a close but I in no way  
> plan to abandon my project.

Great. 🙂

> move the project along.  
> Well, you might make use of rubyforge to set up a mailing list. Then,  
> after some archives accrete and you have a better idea of what users  
> want/need, maybe get a tutorial together. That’s what I’d like to see.  
> Also, a basic homepage (even if you just put the README up there)  
> would be nice.

I’m hoping to use mkrf in the next couple of weeks, but still need to  
learn my way around a bit better.

—John

---

<div class="post-metadata">

**Author:** ![kdclark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ba9def/32.png) [@kdclark](https://www.ruby-forum.com/u/kdclark)\
**Post date:** [August 23, 2006, 2:02am UTC](https://www.ruby-forum.com/t/how-can-i-get-you-to-use-mkrf/66020/11 "2006-08-23T02:02:14Z")

</div>

My MKRF requirements can be translated into the following issue: Can  
MKRF make the following ugy mess of a MKMF file easier and more  
portable ?

--------------WARNING: UGLY MKMf script below: --------------

# Loads mkmf which is used to make makefiles for Ruby extensions

require ‘mkmf’

# Give it a name

extension\_name = ‘digimarc’

# The destination

dir\_config(extension\_name)

# Get home directory (unfortunately not portable).

home = ENV[“HOME”]

# Setup Digimarc Sdk path, add to includes and link. Assumes the sdk is

in

# a directory called “DigimarcSdk” directly in the user’s home

directory but

# this can be overriden using the normal -with-digimarcSdk-include &

# -with-digimarcSdk-lib command line options.

digimarcSdkInclude, digimarcSdkLib = dir\_config(“digimarcSdk”,  
home+"/DigimarcSdk/Include", home+"/DigimarcSdk/lib")

# Non-portable way of linking our dynamic extension library with some

static library files

# from digimarc the sdk (".a" on linux). Uses full path since these

files are not affected

# by GCC/g++'s -L path settings.

# BTW: Not sure $LOCAL\_LIBS is used correctly here but it works.

staticLibs = [“libBitmapIO”, “libDWMEmb”, “libDWMRdr”, “libIWMPCom”,  
“libIWMRdr”]  
staticLibExtension = “.a”  
staticLibs.each { |x| $LOCAL\_LIBS = $LOCAL\_LIBS + " " + digimarcSdkLib

- “/” + x + staticLibExtension}

# Non-portable way of specifying a C++ linker as required by Digimarc.

CONFIG[‘LDSHARED’]=“g++ -shared”

# Defines that os-specific flags that the digimarc SDK uses (also

non-portable)  
$CFLAGS=$CFLAGS+" -D"UNIX=1""

# Create our makefile.

create\_makefile(extension\_name)

* * *

Cheers,  
Morten

Kevin C. skrev:

---

<div class="post-metadata">

**Author:** ![kdclark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ba9def/32.png) [@kdclark](https://www.ruby-forum.com/u/kdclark)\
**Post date:** [August 23, 2006, 2:20am UTC](https://www.ruby-forum.com/t/how-can-i-get-you-to-use-mkrf/66020/12 "2006-08-23T02:20:16Z")

</div>

Morten,  
Almost certainly. If you want to contact me off list I may be able to  
help test mkrf with your library.  
Kev

---

<div class="post-metadata">

**Author:** ![kdclark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ba9def/32.png) [@kdclark](https://www.ruby-forum.com/u/kdclark)\
**Post date:** [August 23, 2006, 2:40am UTC](https://www.ruby-forum.com/t/how-can-i-get-you-to-use-mkrf/66020/13 "2006-08-23T02:40:17Z")

</div>

The mailing list is up. Let’s continue this there.

[http://rubyforge.org/mailman/listinfo/mkrf-users](http://rubyforge.org/mailman/listinfo/mkrf-users)

---

<div class="post-metadata">

**Author:** ![kdclark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ba9def/32.png) [@kdclark](https://www.ruby-forum.com/u/kdclark)\
**Post date:** [August 23, 2006, 6:10am UTC](https://www.ruby-forum.com/t/how-can-i-get-you-to-use-mkrf/66020/14 "2006-08-23T06:10:35Z")

</div>

Trans,  
Email me off list and we can figure it out.  
Kev

---

<div class="post-metadata">

**Author:** ![kdclark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ba9def/32.png) [@kdclark](https://www.ruby-forum.com/u/kdclark)\
**Post date:** [August 23, 2006, 5:40am UTC](https://www.ruby-forum.com/t/how-can-i-get-you-to-use-mkrf/66020/15 "2006-08-23T05:40:33Z")

</div>

Kevin C. wrote:

> Finally, speak up if you’re already using mkrf or have played with it.  
> I’m happy to hear criticism.
> 
> I hope this thread can give me a list of things to work on as I try to  
> move the project along.

I would love to support it in my new build/task system to be release in  
the next few days. I’m not a C coder myself, but if we could work  
together on that, it would be great.

T.

---

<div class="post-metadata">

**Author:** ![kdclark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ba9def/32.png) [@kdclark](https://www.ruby-forum.com/u/kdclark)\
**Post date:** [August 23, 2006, 6:50am UTC](https://www.ruby-forum.com/t/how-can-i-get-you-to-use-mkrf/66020/16 "2006-08-23T06:50:41Z")

</div>

Hi,

At Wed, 23 Aug 2006 09:00:03 +0900,  
mortench wrote in [ruby-talk:210014]:

> - “/” + x + staticLibExtension}  
> mkmf support static libraries, of course,

by just

[BitmapIO DWMEmb DWMRdr IWMPCom libIWMRdr].each {|lib|  
have\_library(lib)}
