[前][次][番号順一覧][スレッド一覧]

ruby-changes:21685

From: akr <ko1@a...>
Date: Sun, 13 Nov 2011 19:58:27 +0900 (JST)
Subject: [ruby-changes:21685] akr:r33734 (trunk): * ext/dbm/extconf.rb: rollback for each headers for each libraries.

akr	2011-11-13 19:58:18 +0900 (Sun, 13 Nov 2011)

  New Revision: 33734

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33734

  Log:
    * ext/dbm/extconf.rb: rollback for each headers for each libraries.

  Modified files:
    trunk/ChangeLog
    trunk/ext/dbm/extconf.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 33733)
+++ ChangeLog	(revision 33734)
@@ -1,3 +1,7 @@
+Sun Nov 13 19:57:18 2011  Tanaka Akira  <akr@f...>
+
+	* ext/dbm/extconf.rb: rollback for each headers for each libraries.
+
 Sun Nov 13 16:24:48 2011  Tanaka Akira  <akr@f...>
 
 	* ext/dbm/extconf.rb: treat libc as a choice for a library which
Index: ext/dbm/extconf.rb
===================================================================
--- ext/dbm/extconf.rb	(revision 33733)
+++ ext/dbm/extconf.rb	(revision 33734)
@@ -29,10 +29,10 @@
 headers.found = []
 headers.defs = nil
 
-def headers.db_check(db)
+def headers.db_check(db, hdr)
   old_libs = $libs.dup
   old_defs = $defs.dup
-  result = db_check2(db)
+  result = db_check2(db, hdr)
   if !result
     $libs = old_libs
     $defs = old_defs
@@ -40,19 +40,17 @@
   result
 end
 
-def headers.db_check2(db)
+def headers.db_check2(db, hdr)
   hsearch = nil
 
   case db
   when /^db[2-5]?$/
     hsearch = "-DDB_DBM_HSEARCH"
-  when "gdbm"
   when "gdbm_compat"
     have_library("gdbm") or return false
   end
 
-  hdrs = self.fetch(db, ["ndbm.h"])
-  if (hdr = hdrs.find {|h| have_type("DBM", h, hsearch)} || hdrs.find {|h| have_type("DBM", ["db.h", h], hsearch)}) and
+  if (have_type("DBM", hdr, hsearch) || have_type("DBM", ["db.h", hdr], hsearch)) and
      (db == 'libc' ? have_func('dbm_open("", 0, 0)', hdr, hsearch) :
                      have_library(db, 'dbm_open("", 0, 0)', hdr, hsearch)) and
      have_func('dbm_clearerr((DBM *)0)', hdr, hsearch)
@@ -68,7 +66,7 @@
   end
 end
 
-if dblib.any? {|db| headers.db_check(db)}
+if dblib.any? {|db| headers.fetch(db, ["ndbm.h"]).any? {|hdr| headers.db_check(db, hdr) } }
   have_header("cdefs.h")
   have_header("sys/cdefs.h")
   have_func("dbm_pagfno((DBM *)0)", headers.found, headers.defs)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]