ctdb-build: Use pcap-config when available
authorMartin Schwenke <martin@meltin.net>
Fri, 23 Jul 2021 04:39:05 +0000 (14:39 +1000)
committerJule Anger <janger@samba.org>
Tue, 29 Aug 2023 09:35:11 +0000 (09:35 +0000)
The build currently fails on AIX, which can't find the pcap headers
because they're installed in a non-standard place.  However, there is
a pcap-config script available.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit a83e9ca696a37b00231ce40cca5a043beb9b5590)

ctdb/wscript

index c082c3b7a7ddd566dd41445f1a292f74bac35369..8f6e2bb52035c6cf9b94c0b03df3a3c2b1a0ad79 100644 (file)
@@ -204,6 +204,12 @@ def configure(conf):
     if sys.platform.startswith('linux'):
         conf.SET_TARGET_TYPE('pcap', 'EMPTY')
     else:
+        conf.find_program('pcap-config', var='PCAP_CONFIG')
+        if conf.env.PCAP_CONFIG:
+            conf.CHECK_CFG(path=conf.env.PCAP_CONFIG,
+                           args="--cflags --libs",
+                           package="",
+                           uselib_store="PCAP")
         if not conf.CHECK_HEADERS('pcap.h'):
             Logs.error('Need libpcap')
             sys.exit(1)