# Building source, understanding pkg-config

**URL:** <https://www.ruby-forum.com/t/building-source-understanding-pkg-config/231830>\
**Category:** Ruby-Gnome 2\
**Created:** [September 1, 2014, 11:31pm UTC](https://www.ruby-forum.com/t/building-source-understanding-pkg-config/231830 "2014-09-01T23:31:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [September 1, 2014, 11:31pm UTC](https://www.ruby-forum.com/t/building-source-understanding-pkg-config/231830/1 "2014-09-01T23:31:18Z")

</div>

Building from latest git ruby-gnome2 git source.  
Ruby 2.1.2p95  
pkg-config (1.1.5)  
CentOS 6.5

So I’m finally getting some free time to start tinkering with Ruby  
again. On my system, (CentOS 6.5) gio2 won’t build, because I have glib2  
2.26, and it looks like gio2 requires glib2 2.28. That’s fine.

However, it passes the “ruby extconf.rb” test, and the fails in  
compilation.

I started looking at what I could do to extconf.rb to make it fail  
earlier, which is always nice… I’m not sure the best way to go about  
this, but I was trying to do something like

adding the following to gio2/ext/gio2/extconf.rb (maybe add some more  
details on error?)

PKGConfig.check\_version?(‘glib-2.0’, 2, 28) or exit 1

I did not see anything else doing this in the source. Is there a better  
way to do this, or how would this functionality fit in with the standard  
that Ruby/Gtk currently has.

Thanks
