0005-meson-Add-bonjour-option.patch

text/plain

Filename: 0005-meson-Add-bonjour-option.patch
Type: text/plain
Part: 4
Message: Re: [RFC] building postgres with meson -v8

Patch

Format: format-patch
Series: patch 0005
Subject: meson: Add bonjour option
File+
meson.build 13 0
meson_options.txt 3 0
From c2599ec7f66c75c9c898fcf902dd3fc0209e42cb Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter@eisentraut.org>
Date: Wed, 11 May 2022 09:29:23 +0200
Subject: [PATCH 5/9] meson: Add bonjour option

---
 meson.build       | 13 +++++++++++++
 meson_options.txt |  3 +++
 2 files changed, 16 insertions(+)

diff --git a/meson.build b/meson.build
index 7cb2083936..e724fcc345 100644
--- a/meson.build
+++ b/meson.build
@@ -305,6 +305,19 @@ dir_data_extension = dir_data / 'extension'
 
 
 
+###############################################################
+# Library: bonjour
+###############################################################
+
+bonjouropt = get_option('bonjour')
+if not bonjouropt.disabled()
+  if cc.has_header('dns_sd.h', args: g_c_args, include_directories: g_c_inc, required: bonjouropt.enabled())
+    cdata.set('USE_BONJOUR', 1)
+  endif
+endif
+
+
+
 ###############################################################
 # Library: GSSAPI
 ###############################################################
diff --git a/meson_options.txt b/meson_options.txt
index 56440f81d0..cbef629ca0 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -50,6 +50,9 @@ option('extra_lib_dirs', type : 'array', value: [],
 
 # External dependencies
 
+option('bonjour', type : 'feature', value: 'auto',
+  description: 'Bonjour support')
+
 option('dtrace', type : 'feature', value: 'disabled',
   description: 'DTrace support')
 
-- 
2.35.1