File: Build.PL

package info (click to toggle)
liblinux-termios2-perl 0.01-2
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 116 kB
  • sloc: perl: 18; makefile: 2
file content (50 lines) | stat: -rw-r--r-- 1,006 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
use strict;
use warnings;

use Module::Build;
use ExtUtils::CChecker;

my $cc = ExtUtils::CChecker->new;

# It seems you have to use the <asm/termios.h> versions because those relate
# more to the kernel, whereas the straight <termios.h> lags massively behind
# and doesn't know of termios2

$cc->assert_compile_run(
   diag => "no struct termios2",
   source => <<'EOF' );
#include <asm/termios.h>

int main(int argc, char *argv[]) {
  struct termios2 t;
  return 0;
}
EOF

$cc->assert_compile_run(
   diag => "no TCGETS2",
   source => <<'EOF' );
#include <asm/termios.h>
#include <asm/ioctls.h>

int main(int argc, char *argv[]) {
  int a = TCGETS2;
  return 0;
}
EOF

$cc->new_module_build(
   module_name => 'Linux::Termios2',
   requires => {
   },
   configure_requires => {
      'Module::Build' => 0,
      'ExtUtils::CChecker' => 0,
   },
   build_requires => {
   },
   license => 'perl',
   create_makefile_pl => 'small',
   create_license => 1,
   create_readme  => 1,
)->create_build_script;