1Dev(3) User Contributed Perl Documentation Dev(3)
2
3
4
6 PDL::Core::Dev - PDL development module
7
9 This module encapsulates most of the stuff useful for PDL development
10 and is often used from within Makefile.PL's.
11
13 use PDL::Core::Dev;
14
16 isbigendian
17 Is the machine big or little endian?
18
19 print "Your machins is big endian.\n" if isbigendian();
20
21 returns 1 if the machine is big endian, 0 if little endian, or dies if
22 neither. It uses the "byteorder" element of perl's %Config array.
23
24 my $retval = isbigendian();
25
26 trylink
27 a perl configure clone
28
29 if (trylink 'libGL', '', 'char glBegin(); glBegin();', '-lGL') {
30 $libs = '-lGLU -lGL';
31 $have_GL = 1;
32 } else {
33 $have_GL = 0;
34 }
35 $maybe =
36 trylink 'libwhatever', $inc, $body, $libs, $cflags,
37 {MakeMaker=>1, Hide=>0, Clean=>1};
38
39 Try to link some C-code making up the body of a function with a given
40 set of library specifiers
41
42 return 1 if successful, 0 otherwise
43
44 trylink $infomsg, $include, $progbody, $libs [,$cflags,{OPTIONS}];
45
46 Takes 4 + 2 optional arguments.
47
48 • an informational message to print (can be empty)
49
50 • any commands to be included at the top of the generated C program
51 (typically something like "#include "mylib.h"")
52
53 • the body of the program (in function main)
54
55 • library flags to use for linking. Preprocessing by MakeMaker
56 should be performed as needed (see options and example).
57
58 • compilation flags. For example, something like "-I/usr/local/lib".
59 Optional argument. Empty if omitted.
60
61 • OPTIONS
62
63 MakeMaker
64 Preprocess library strings in the way MakeMaker does things.
65 This is advisable to ensure that your code will actually work
66 after the link specs have been processed by MakeMaker.
67
68 Hide
69 Controls if linking output etc is hidden from the user or not.
70 On by default except within the build of the PDL distribution
71 where the config value set in perldl.conf prevails.
72
73 Clean
74 Remove temporary files. Enabled by default. You might want to
75 switch it off during debugging.
76
77 generate_core_flags
78 prints on "STDOUT" XS text with core flags, for Core.xs.
79
80 got_complex_version
81 PDL::Core::Dev::got_complex_version($func_name, $num_params)
82
83 For a given function appearing in C99's "complex.h", will return a
84 boolean of whether the system being compiled on has the complex version
85 of that. E.g. for "sin", will test whether "csinl" exists (before
86 2.069, would only check for "csin", causing build failures on non-C99
87 compliant "libc" which mandates long-double versions).
88
89
90
91perl v5.38.0 2023-07-21 Dev(3)