title: Where does Ruby's have_header method look for header files?
body: <p>On a CentOS 5.7 box, I'm having trouble installing the newest version of the mysql2 gem; it's not finding errmsg.h:</p>
  
  <pre><code>/usr/bin/ruby extconf.rb
  checking for rb_thread_blocking_region()... yes
  checking for rb_wait_for_single_fd()... no
  checking for mysql_query() in -lmysqlclient... yes
  checking for mysql.h... no
  checking for mysql/mysql.h... yes
  checking for errmsg.h... no
  -----
  errmsg.h is missing.  please check your installation of mysql and try again.
  -----
  *** extconf.rb failed ***
  </code></pre>
  
  <p>The mysql header files exist at /usr/include/mysql. An older version of the gem exists on the server, so it must have been built successfully at one point.</p>
  
  <p>Note that it fails on a check for mysql.h, but succeeds on mysql/mysql.h. However, it doesn't repeat this for errmsg.h. By this I'm guessing that it's not looking at /usr/include, but I'm not sure.</p>
  
  <p>I've dug into the extconf.rb source code and discovered that it's using the <code>have_header</code> method to locate the header files. I debugged the execution to find out that it's looking for a relative path of "mysql/errmsg.h". But I haven't found any documentation that explains how it expands that into an absolute path.</p>
  
  <p>Where &amp; how does have_header locate its header files?</p>