[Git][NTPsec/ntpsec][master] Check for libseccomp via pkg-config first, then fall back to a direct search

Matt Selsky gitlab at mg.gitlab.com
Sun May 21 17:08:13 UTC 2017


Matt Selsky pushed to branch master at NTPsec / ntpsec


Commits:
fdb63ab2 by Matt Selsky at 2017-05-21T13:01:06-04:00
Check for libseccomp via pkg-config first, then fall back to a direct search

Needed on openSUSE, at least, where the libseccomp headers are not installed in
/usr/include

Fixes GitLab issue #308

- - - - -


1 changed file:

- wscript


Changes:

=====================================
wscript
=====================================
--- a/wscript
+++ b/wscript
@@ -825,8 +825,14 @@ int main(int argc, char **argv) {
         if ctx.env.DEST_OS != "linux":
             ctx.fatal("seccomp is only supported on Linux")
 
-        ctx.check_cc(header_name="seccomp.h")
-        ctx.check_cc(lib="seccomp")
+        # Check via pkg-config first, then fall back to a direct search
+        if not ctx.check_cfg(
+            package='libseccomp', args=['--libs', '--cflags'],
+            uselib_store='SECCOMP', define_name='HAVE_SECCOMP_H',
+            mandatory=False
+        ):
+            ctx.check_cc(header_name="seccomp.h")
+            ctx.check_cc(lib="seccomp")
 
     from wafhelpers.check_pthread import check_pthread_header_lib
     check_pthread_header_lib(ctx)



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/fdb63ab2a5ba621988fd647fe56395792dc39fe2

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/fdb63ab2a5ba621988fd647fe56395792dc39fe2
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170521/0febb3f4/attachment.html>


More information about the vc mailing list