Add new constants from libseccomp 2.3.2 and 2.3.3
[linux-seccomp.git] / Makefile.PL
index 7b4d612c333186cb15cacf02a08493da0ae26840..106d156a4ff7ace7165258344089d72ac5519af5 100644 (file)
@@ -1,10 +1,6 @@
 use 5.014000;
-use Devel::CheckLib;
 use ExtUtils::MakeMaker;
 
-check_lib_or_exit
-  lib => 'seccomp';
-
 WriteMakefile(
        NAME              => 'Linux::Seccomp',
        VERSION_FROM      => 'lib/Linux/Seccomp.pm',
@@ -13,12 +9,10 @@ WriteMakefile(
        MIN_PERL_VERSION  => '5.14.0',
        LICENSE           => 'perl',
        SIGN              => 1,
-       CONFIGURE_REQUIRES => {
-               qw/Devel::CheckLib     0
-                  ExtUtils::MakeMaker 0/,
-       },
        PREREQ_PM          => {},
-       LIBS               => ['-lseccomp'],
+       INC                => '-Ilibseccomp/include',
+       MYEXTLIB           => 'libseccomp/src/.libs/libseccomp$(LIB_EXT)',
+       clean              => { FILES => 'libseccomp/src/.libs/libseccomp$(LIB_EXT)' },
        META_ADD           => {
                dynamic_config => 1,
                resources      => {
@@ -27,6 +21,13 @@ WriteMakefile(
        }
 );
 
+sub MY::postamble {
+'
+$(MYEXTLIB): libseccomp/configure.ac libseccomp/Makefile.am libseccomp/autogen.sh
+       cd libseccomp && ./autogen.sh && ./configure && `which gmake || echo $(MAKE)` all
+'
+}
+
 if  (eval {require ExtUtils::Constant; 1}) {
   # If you edit these definitions to change the constants used by this module,
   # you will need to use the generated const-c.inc and const-xs.inc
@@ -147,6 +148,15 @@ if  (eval {require ExtUtils::Constant; 1}) {
                 __PNR_unlink __PNR_uselib __PNR_userfaultfd __PNR_usr26
                 __PNR_usr32 __PNR_ustat __PNR_utime __PNR_utimes __PNR_vfork
                 __PNR_vm86 __PNR_vm86old __PNR_vserver __PNR_waitpid),
+
+                # Added in libseccomp 2.3.2
+                qw(__PNR_pkey_mprotect __NR_pkey_mprotect __PNR_pkey_alloc
+                __NR_pkey_alloc __PNR_pkey_free __NR_pkey_free),
+
+                # Added in libseccomp 2.3.3
+                qw(__PNR_get_tls __NR_get_tls __PNR_s390_guarded_storage
+                __NR_s390_guarded_storage __PNR_s390_sthyi __NR_s390_sthyi),
+
               {name=>"SCMP_CMP_EQ", macro=>"1"},
               {name=>"SCMP_CMP_GE", macro=>"1"},
               {name=>"SCMP_CMP_GT", macro=>"1"},
@@ -158,6 +168,7 @@ if  (eval {require ExtUtils::Constant; 1}) {
               {name=>"SCMP_FLTATR_ACT_DEFAULT", macro=>"1"},
               {name=>"SCMP_FLTATR_CTL_NNP", macro=>"1"},
               {name=>"SCMP_FLTATR_CTL_TSYNC", macro=>"1"},
+              {name=>"SCMP_FLTATR_API_TSKIP", macro=>"1"}, # added in libseccomp 2.3.2
               {name=>"_SCMP_CMP_MAX", macro=>"1"},
               {name=>"_SCMP_CMP_MIN", macro=>"1"},
               {name=>"_SCMP_FLTATR_MAX", macro=>"1"},
This page took 0.009894 seconds and 4 git commands to generate.