Do a test compile/link within Makefile.PL
I currently do that.
The source includes a file named 'try.in' that contains:
/*
Check whether erfl and isnanl can be linked.
*/
#include <stdio.h>
#include <math.h>
int main(void) {
long double rop, op = 0.6L;
int ret;
rop = erfl(op);
ret = isnanl(op);
return 0;
}
The Makefile.PL builds the executable:
my $out = `$cc $opt -o try.exe -x c try.in -lm 2>&1`;
and then runs it:
my $diag = $^O =~ /mswin32/i ? `try.exe 2>&1` : `./try.exe 2>&1`;
All of which is done successfully - though there's a warning about erfl() during the building of the executable.
However, it's just occurred to me that the executable actually doesn't do anything.
Could it be that success is achieved only because the problem I'm trying to expose is being optimised away ?
I'll rewrite the script so that it actually does something, and see if that catches the unavailability of erfl().
Or is the warning I'm seeing during the building of the executable sufficient to indicate that erfl() is unavailable ? That warning is:
try.in:12:8: warning: incompatible implicit declaration of built-in fu
+nction 'erfl'
Is there anything else I might've missed ?
(I guess I'll try Devel::CheckLib if I can't get this right, myself.)
Thanks guys.
Cheers,
Rob
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.