From: Eric Hodel Date: 2004-09-12T16:35:04+09:00 Subject: Let mkmf's have_library specify headers --cjXvCArabh/jFWdZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I was trying to build GDChart, but its extconf.rb was unable to find libgdc because the conftest.c that mkmf builds did not have the right headers. try_func, which builds conftest.c allows specification of headers, but have_library does not allow them to be specified. The following patch allows a list of headers to be passed to try_func from have_library. Index: lib/mkmf.rb =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /src/ruby/lib/mkmf.rb,v retrieving revision 1.195 diff -u -r1.195 mkmf.rb --- lib/mkmf.rb 20 Aug 2004 21:41:31 -0000 1.195 +++ lib/mkmf.rb 12 Sep 2004 07:33:22 -0000 @@ -475,7 +475,7 @@ r end =20 -def have_library(lib, func =3D nil, &b) +def have_library(lib, func =3D nil, header=3Dnil, &b) func =3D "main" if !func or func.empty? lib =3D with_config(lib+'lib', lib) checking_for "#{func}() in #{LIBARG%lib}" do @@ -483,7 +483,7 @@ true else libs =3D append_library($libs, lib) - if try_func(func, libs, &b) + if try_func(func, libs, header, &b) $libs =3D libs true else --=20 Eric Hodel - drbrain@segment7.net - http://segment7.net All messages signed with fingerprint: FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 --cjXvCArabh/jFWdZ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQFBQ/whMypVHHlsnwQRAlIkAJ4lnnvCbfMwPFo4rsIXfTqgDz1kbQCgpVeS TV/e0FwgRBFeJ8MHZfmox+Q= =8HjB -----END PGP SIGNATURE----- --cjXvCArabh/jFWdZ--