On Sat, 18 Jun 2005 12:18:32 +0200
"Jos I. Boumans" <[EMAIL PROTECTED]> wrote:

    Well, I did learn a lot from reading all this.

    So I took some time to check the 3 XS packages I'm using:
Compress-Zlib, Compress-Bzip2 and DBD-mysql.  They all check the
availability of their required external libraries by themselves.  No,
there is no clue of those libraries in the Makefile.

    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.

    So, we are not greedy.  Being able to check the required C header
files, libraries and executables.  What else?  Even GNU autoconf and
automake can only gone this far.

    Then, if something goes wrong here, ExtUtils::MakeMaker croak with a
specific return status (2, maybe?) and when CPANPLUS sees that return
status it knows to stop and collect the output now.  What else do we
need here?  Do CPANPLUS need to know exactly which library fails?  No. 
The report text is for the human.

    Then, we need an interface for the XS module authors to specify the
dependencies.  Of course, 'XS' implies $Confg{"cc"}.  Maybe:

WriteMakefile(
    ...
    PREREQ_BIN  => [qw(bison byacc flex mawk m4)],
    PREREQ_LIB  => [qw(z bz2 mysqlclient db3 milter)],
    PREREQ_INC  => [qw(pam.h ndbm.h postgresql/server/postgres.h)],
);

    Of course if the XS module authors don't specify them, everything
goes as the old days.  No one gets hurt.  But if they specify them, then
they save a lot of code to detect that themselves, like what
Compress-Bzip2 does now, and win pretty CPAN testers reports.

    Then there comes the platform portability issue.  The simple test.c
is the same, but the compiler syntax may be different (or maybe they
are the same and I'm talking non-sense?  I don't have Visual C.)  In
that case the actual compiling syntax can be put into MM_{OS}.pm.

    Just some simple thought.  I do wish this helps.  Please correct me
if I missed something.

--
Best regards,
imacat ^_*' <[EMAIL PROTECTED]>
PGP Key: http://www.imacat.idv.tw/me/pgpkey.txt

<<Woman's Voice>> News: http://www.wov.idv.tw/
Tavern IMACAT's: http://www.imacat.idv.tw/
TLUG List Manager: http://www.linux.org.tw/mailman/listinfo/tlug

Attachment: pgp6ObLXGYg5E.pgp
Description: PGP signature

Reply via email to