ruby1.8-dev: /usr/lib/ruby/1.8/mkmf.rb have_func() fails to find functions in libc

Bug #28424 reported by Debian Bug Importer on 2006-01-12
4
Affects Status Importance Assigned to Milestone
ruby1.8 (Debian)
Fix Released
Unknown
ruby1.8 (Ubuntu)
High
Unassigned

Bug Description

Automatically imported from Debian bug report #347759 http://bugs.debian.org/347759

Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Thu, 12 Jan 2006 14:01:20 +0000
From: Roger Leigh <email address hidden>
To: Debian Bug Tracking System <email address hidden>
Subject: ruby1.8-dev: /usr/lib/ruby/1.8/mkmf.rb have_func() fails to find functions
 in libc

Package: ruby1.8-dev
Version: 1.8.4-1
Severity: serious
Justification: Causes other packages to FTBFS

>From libintl-gettext-ruby/0.11-5; Bug #322648:

$ cat extconf.rb
require 'mkmf'

$LDFLAGS = "-L/usr/local/lib";
$CFLAGS = "-I/usr/local/include";
have_library( "xpg4", "setlocale" );
have_header( "locale.h" );
if ( have_header( "libintl.h" ) and (have_library( "intl", "gettext" )
or have_func( "gettext" )) )
    create_makefile( "intl" );
end

This fails to find gettext() in libc, and so the build fails.

Regards,
Roger

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (990, 'unstable')
Architecture: powerpc (ppc)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)

Versions of packages ruby1.8-dev depends on:
ii libruby1.8 1.8.4-1 Libraries necessary to run Ruby 1.

Versions of packages ruby1.8-dev recommends:
ii ruby1.8 1.8.4-1 Interpreter of object-oriented scr

-- no debconf information

Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Thu, 12 Jan 2006 23:21:00 +0900
From: akira yamada <email address hidden>
To: Roger Leigh <email address hidden>, <email address hidden>
Subject: Re: Bug#347759: ruby1.8-dev: /usr/lib/ruby/1.8/mkmf.rb have_func()
 fails to find functions in libc

Roger Leigh wrote:
> $ cat extconf.rb
> require 'mkmf'
>
> $LDFLAGS = "-L/usr/local/lib";
> $CFLAGS = "-I/usr/local/include";
> have_library( "xpg4", "setlocale" );
> have_header( "locale.h" );
> if ( have_header( "libintl.h" ) and (have_library( "intl", "gettext" )
> or have_func( "gettext" )) )
> create_makefile( "intl" );
> end
>
> This fails to find gettext() in libc, and so the build fails.

I think it is not a bug of mkmf.rb.

  $ ruby1.8 -rmkmf -e 'have_func("gettext")'
  checking for gettext()... no
  $ ruby1.8 -rmkmf -e 'have_func("gettext", "libintl.h")'
  checking for gettext()... yes

How about the following patch?:

--- extconf.rb.orig 2006-01-12 23:17:49.000000000 +0900
+++ extconf.rb 2006-01-12 23:17:27.000000000 +0900
@@ -1,11 +1,11 @@
 require 'mkmf'

 $LDFLAGS = "-L/usr/local/lib";
 $CFLAGS = "-I/usr/local/include";
 have_library( "xpg4", "setlocale" );
 have_header( "locale.h" );
 if ( have_header( "libintl.h" ) and
     (have_library( "intl", "gettext" ) or
- have_func( "gettext" )) )
+ have_func( "gettext", "libintl.h" )) )
     create_makefile( "intl" );
 end

--
akira yamada

Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Thu, 12 Jan 2006 14:58:45 +0000
From: Roger Leigh <email address hidden>
To: akira yamada <email address hidden>
Cc: <email address hidden>
Subject: Re: Bug#347759: ruby1.8-dev: /usr/lib/ruby/1.8/mkmf.rb have_func() fails to find functions
 in libc

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

akira yamada <email address hidden> writes:

> Roger Leigh wrote:
>> $ cat extconf.rb
>> require 'mkmf'
>>
>> $LDFLAGS = "-L/usr/local/lib";
>> $CFLAGS = "-I/usr/local/include";
>> have_library( "xpg4", "setlocale" );
>> have_header( "locale.h" );
>> if ( have_header( "libintl.h" ) and (have_library( "intl", "gettext" )
>> or have_func( "gettext" )) )
>> create_makefile( "intl" );
>> end
>>
>> This fails to find gettext() in libc, and so the build fails.
>
> I think it is not a bug of mkmf.rb.
>
> $ ruby1.8 -rmkmf -e 'have_func("gettext")'
> checking for gettext()... no
> $ ruby1.8 -rmkmf -e 'have_func("gettext", "libintl.h")'
> checking for gettext()... yes
>
> How about the following patch?:

This looks great, thanks.

I'm not a Ruby hacker myself, and assumed it was emulating the
autoconf AC_TRY_LINK, which does not require the header to be present.

I'll post the patch to the original bug.

Many thanks,
Roger

- --
Roger Leigh
                Printing on GNU/Linux? http://gimp-print.sourceforge.net/
                Debian GNU/Linux http://www.debian.org/
                GPG Public Key: 0x25BFB848. Please sign and encrypt your mail.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8+ <http://mailcrypt.sourceforge.net/>

iD8DBQFDxm6kVcFcaSW/uEgRAgpHAJ4jHpdbNOZ0IRWO6bn3bytbGuhpMQCg5f+T
mbgpOiN84MunDpHv5fPmkCw=
=DHqR
-----END PGP SIGNATURE-----

Lucas Nussbaum (lucas) on 2006-03-31
Changed in ruby1.8:
status: Unconfirmed → Rejected
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.