[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-core
Subject:    mkmf.rb issue (and patch) on FreeBSD 6-STABLE
From:       Alex <alexb () netservicesplc ! com>
Date:       2006-06-21 11:32:45
Message-ID: 44992E5A.5050203 () netservicesplc ! com
[Download RAW message or body]

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

["mkmf.patch" (text/plain)]

--- 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']}


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic