From: Alex Date: 2006-06-21T20:32:45+09:00 Subject: mkmf.rb issue (and patch) on FreeBSD 6-STABLE --------------070105040408000303000501 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello list, I was trying to install the id3lib-ruby gem using "gem install", but the install process kept complaining that it couldn't find id3.h. The file was in /usr/local/include, which is correctly configured in rbconfig.rb as CONFIG["includedir"]. The patch I have attached makes mkmf.rb add CONFIG["includedir"] as an -I flag to the C compiler when it is needed, and also adds it to the CPPFLAGS in the generated Makefile. Please note that I've not tested this extensively, and I've not checked whether I've covered all occurrences where this modification might be required. I'm not even sure if this is the correct solution to the problem (it may well be BSD specific and not an issue anywhere else), but it worked for me... --alex --------------070105040408000303000501 Content-Type: text/plain; name="mkmf.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mkmf.patch" --- mkmf.rb.old Fri May 26 05:26:49 2006 +++ mkmf.rb Wed Jun 21 11:45:12 2006 @@ -273,13 +273,13 @@ end def cc_command(opt="") - Config::expand("$(CC) -c #$INCFLAGS -I$(hdrdir) " \ + Config::expand("$(CC) -c #$INCFLAGS -I$(hdrdir) -I$(includedir) " \ "#$CPPFLAGS #$CFLAGS #$ARCH_FLAG #{opt} #{CONFTEST_C}", CONFIG.merge('hdrdir' => $hdrdir.quote)) end def cpp_command(outfile, opt="") - Config::expand("$(CPP) #$INCFLAGS -I$(hdrdir) " \ + Config::expand("$(CPP) #$INCFLAGS -I$(hdrdir) -I$(includedir) " \ "#$CPPFLAGS #$CFLAGS #{opt} #{CONFTEST_C} #{outfile}", CONFIG.merge('hdrdir' => $hdrdir.quote)) end @@ -959,7 +959,7 @@ LIBRUBYARG_STATIC = #$LIBRUBYARG_STATIC CFLAGS = #{CONFIG['CCDLFLAGS'] unless $static} #$CFLAGS #$ARCH_FLAG -CPPFLAGS = -I. -I$(topdir) -I$(hdrdir) -I$(srcdir) #{$defs.join(" ")} #{$CPPFLAGS} +CPPFLAGS = -I. -I$(topdir) -I$(hdrdir) -I$(includedir) -I$(srcdir) #{$defs.join(" ")} #{$CPPFLAGS} CXXFLAGS = $(CFLAGS) #{CONFIG['CXXFLAGS']} DLDFLAGS = #$LDFLAGS #$DLDFLAGS #$ARCH_FLAG LDSHARED = #{CONFIG['LDSHARED']} --------------070105040408000303000501--