ctdb-build: Check for libpcap
authorAmitay Isaacs <amitay@gmail.com>
Mon, 15 Sep 2014 06:10:16 +0000 (16:10 +1000)
committerMartin Schwenke <martins@samba.org>
Wed, 17 Sep 2014 05:29:10 +0000 (07:29 +0200)
AIX and FreeBSD do not support raw sockets.  So use libpcap interface
to watch for specific TCP messages.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/wscript

index fd7650a5cf007a7ec12153ed74c0c8b1a9da030b..96782af56f1a095d34cb0dea4124749626a821cb 100755 (executable)
@@ -93,6 +93,16 @@ def configure(conf):
     if not conf.CHECK_VARIABLE('ETIME', headers='errno.h'):
         conf.DEFINE('ETIME', 'ETIMEDOUT')
 
+    if sys.platform.startswith('linux'):
+        conf.SET_TARGET_TYPE('pcap', 'EMPTY')
+    else:
+        if not conf.CHECK_HEADERS('pcap.h'):
+            Logs.error('Need libpcap')
+            sys.exit(1)
+        if not conf.CHECK_FUNCS_IN('pcap_open_live', 'pcap', headers='pcap.h'):
+            Logs.error('Need libpcap')
+            sys.exit(1)
+
     have_pmda = False
     if Options.options.ctdb_pmda:
         pmda_support = True
@@ -246,7 +256,7 @@ def build(bld):
     bld.SAMBA_SUBSYSTEM('ctdb-system',
                         source=CTDB_SYSTEM_SRC,
                         includes='include include/internal',
-                        deps='replace talloc tevent tdb')
+                        deps='replace talloc tevent tdb pcap')
 
     bld.SAMBA_SUBSYSTEM('ctdb-client',
                         source=bld.SUBDIR('client', 'ctdb_client.c'),