| 1 | use strictscip-perl cpan Linux-Termios2 0.01 strict/; |
| 2 | use warningsscip-perl cpan Linux-Termios2 0.01 warnings/; |
| 3 | |
| 4 | use Module::Buildscip-perl cpan Linux-Termios2 0.01 Module/Build/; |
| 5 | use ExtUtils::CCheckerscip-perl cpan Linux-Termios2 0.01 ExtUtils/CChecker/; |
| 6 | |
| 7 | my $cc = ExtUtils::CChecker->newscip-perl cpan Linux-Termios2 0.01 ExtUtils/CChecker/new().; |
| 8 | |
| 9 | # It seems you have to use the <asm/termios.h> versions because those relate |
| 10 | # more to the kernel, whereas the straight <termios.h> lags massively behind |
| 11 | # and doesn't know of termios2 |
| 12 | |
| 13 | $cc->assert_compile_runscip-perl cpan Linux-Termios2 0.01 ExtUtils/CChecker/assert_compile_run().( |
| 14 | diag => "no struct termios2", |
| 15 | source => <<'EOF' ); |
| 16 | #include <asm/termios.h> |
| 17 | |
| 18 | int main(int argc, char *argv[]) { |
| 19 | struct termios2 t; |
| 20 | return 0; |
| 21 | } |
| 22 | EOF |
| 23 | |
| 24 | $cc->assert_compile_runscip-perl cpan Linux-Termios2 0.01 ExtUtils/CChecker/assert_compile_run().( |
| 25 | diag => "no TCGETS2", |
| 26 | source => <<'EOF' ); |
| 27 | #include <asm/termios.h> |
| 28 | #include <asm/ioctls.h> |
| 29 | |
| 30 | int main(int argc, char *argv[]) { |
| 31 | int a = TCGETS2; |
| 32 | return 0; |
| 33 | } |
| 34 | EOF |
| 35 | |
| 36 | $cc->new_module_buildscip-perl cpan Linux-Termios2 0.01 ExtUtils/CChecker/new_module_build().( |
| 37 | module_name => 'Linux::Termios2', |
| 38 | requires => { |
| 39 | }, |
| 40 | configure_requires => { |
| 41 | 'Module::Build' => 0, |
| 42 | 'ExtUtils::CChecker' => 0, |
| 43 | }, |
| 44 | build_requires => { |
| 45 | }, |
| 46 | license => 'perl', |
| 47 | create_makefile_pl => 'small', |
| 48 | create_license => 1, |
| 49 | create_readme => 1, |
| 50 | )->create_build_scriptscip-perl cpan Linux-Termios2 0.01 main/create_build_script().; |