On Sat, 18 Jun 2005, Ken Williams wrote: > On Jun 18, 2005, at 6:58 AM, imacat wrote: > > But, what if we make clues there? Please correct me if I'm wrong, > > but from my experience working with GNU autoconf and automake, > > something > > like: > > > > test.c: > > ============ > > int > > main() > > { > > } > > ============ > > $(CC) -lsomelib test.c > > > > can be used to check the availability of libsomelib.(a|so|dll). > > Something like: > > > > test.c: > > ============ > > #define <someheader.h> > > int > > main() > > { > > } > > ============ > > $(CC) test.c > > > > can be used to check the availability of someheader.h. And there > > is > > already an existing method to check the availability of executables. > > Yeah, that might work well enough (but I don't have much experience > with Configure/autoconf myself). > > Think we should add this to ExtUtils::CBuilder? That's the module that > Module::Build uses to do all its C compiling and linking. It already > has a have_compiler() method, we could add have_library($foo) and > have_header($foo) methods too.
There's also a have_library() method within, eg, http://search.cpan.org/src/PHISH/XML-LibXML-Common-0.13/Makefile.PL which might be considered for ExtUtils::CBuilder. Although more complicated than the above, this tests if some xs glue can be built with $foo, and so can catch some perl-specific problems. It also has some necessary tweaks to work on Win32. -- best regards, randy