develooper Front page | perl.perl5.porters | Postings from January 2001

Re: have_library() and family

Thread Previous | Thread Next
From:
Jarkko Hietaniemi
Date:
January 17, 2001 08:06
Subject:
Re: have_library() and family
Message ID:
20010117100542.N21462@chaos.wustl.edu
On Wed, Jan 17, 2001 at 12:26:22PM +0000, Matt Sergeant wrote:
> Would anyone be interested in seeing MakeMaker add a have_library(),
> have_func() and so on be added? These names are taken from Ruby, where in

Oh, yes.  OH, YES.

> a ruby "Makefile.PL" equivalent you can go:

Yeah, let's do some retroactive stealing :-)

> have_library("ghttp");
> 
> To check it is installed without going all the way to the make phase. You
> can also go:
> 
> have_library("ghttp", "ghttp_get_header_names");
> 
> to check if a certain function exists. If it does, it sets
> -DHAVE_GHTTP_GET_HEADER_NAMES in DEFINES.
> 
> I've coded this up (mostly copying the Ruby code) for HTTP::GHTTP, but
> thought it could be made more generic, and could certainly be useful for
> ExtUtils::MakeMaker to be able to do in core.
> 
> I've only implemented have_library, but we could implement all of:
> 
> have_library($lib, $func)

-L/blah/blah

Sometimes you can't find -lblah unless the compiler is given some
special flags, e.g. -64.

> find_library($lib, $func, @paths)
> have_func($func, $header)

You might want to give some thought to -Defines, too, not to mention
the whole function signature enchilada.  I'm not saying that you should
go the whole hog and parse C, but e.g. being able to tell the difference
between

	type_a func()

and

	type_b func()

would be neat, and also knowing at least how many arguments they take.
Staying with libraries is easier as the signature ain't encoded there
(at least not in anyway nm et al can get into)

> have_header($header)

-I/blah/blah

> -- 
> <Matt/>
> 
>     /||    ** Director and CTO **
>    //||    **  AxKit.com Ltd   **  ** XML Application Serving **
>   // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
>  // \\| // **     Personal Web Site: http://sergeant.org/     **
>      \\//
>      //\\
>     //  \\
> 

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About