Skip to content

Commit 08d440b

Browse files
committed
Allow --with-bonjour to work with non-macOS implementations of Bonjour.
On macOS the relevant functions require no special library, but elsewhere we need to pull in libdns_sd. Back-patch to supported branches. No docs change since the docs do not suggest that this is a Mac-only feature. Luke Lonergan Discussion: https://postgr.es/m/2D8331C5-D64F-44C1-8717-63EDC6EAF7EB@brightforge.com
1 parent b89ad38 commit 08d440b

File tree

2 files changed

+62
-2
lines changed

2 files changed

+62
-2
lines changed

configure

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10736,6 +10736,64 @@ else
1073610736
fi
1073710737

1073810738

10739+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing DNSServiceRefSockFD" >&5
10740+
$as_echo_n "checking for library containing DNSServiceRefSockFD... " >&6; }
10741+
if ${ac_cv_search_DNSServiceRefSockFD+:} false; then :
10742+
$as_echo_n "(cached) " >&6
10743+
else
10744+
ac_func_search_save_LIBS=$LIBS
10745+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10746+
/* end confdefs.h. */
10747+
10748+
/* Override any GCC internal prototype to avoid an error.
10749+
Use char because int might match the return type of a GCC
10750+
builtin and then its argument prototype would still apply. */
10751+
#ifdef __cplusplus
10752+
extern "C"
10753+
#endif
10754+
char DNSServiceRefSockFD ();
10755+
int
10756+
main ()
10757+
{
10758+
return DNSServiceRefSockFD ();
10759+
;
10760+
return 0;
10761+
}
10762+
_ACEOF
10763+
for ac_lib in '' dns_sd; do
10764+
if test -z "$ac_lib"; then
10765+
ac_res="none required"
10766+
else
10767+
ac_res=-l$ac_lib
10768+
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
10769+
fi
10770+
if ac_fn_c_try_link "$LINENO"; then :
10771+
ac_cv_search_DNSServiceRefSockFD=$ac_res
10772+
fi
10773+
rm -f core conftest.err conftest.$ac_objext \
10774+
conftest$ac_exeext
10775+
if ${ac_cv_search_DNSServiceRefSockFD+:} false; then :
10776+
break
10777+
fi
10778+
done
10779+
if ${ac_cv_search_DNSServiceRefSockFD+:} false; then :
10780+
10781+
else
10782+
ac_cv_search_DNSServiceRefSockFD=no
10783+
fi
10784+
rm conftest.$ac_ext
10785+
LIBS=$ac_func_search_save_LIBS
10786+
fi
10787+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_DNSServiceRefSockFD" >&5
10788+
$as_echo "$ac_cv_search_DNSServiceRefSockFD" >&6; }
10789+
ac_res=$ac_cv_search_DNSServiceRefSockFD
10790+
if test "$ac_res" != no; then :
10791+
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
10792+
10793+
else
10794+
as_fn_error $? "could not find function 'DNSServiceRefSockFD' required for Bonjour" "$LINENO" 5
10795+
fi
10796+
1073910797
fi
1074010798

1074110799
# for contrib/uuid-ossp

configure.in

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,8 +1115,8 @@ if test "$with_openssl" = yes ; then
11151115
AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])])
11161116
AC_CHECK_LIB(ssl, SSL_new, [], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])])
11171117
else
1118-
AC_SEARCH_LIBS(CRYPTO_new_ex_data, eay32 crypto, [], [AC_MSG_ERROR([library 'eay32' or 'crypto' is required for OpenSSL])])
1119-
AC_SEARCH_LIBS(SSL_new, ssleay32 ssl, [], [AC_MSG_ERROR([library 'ssleay32' or 'ssl' is required for OpenSSL])])
1118+
AC_SEARCH_LIBS(CRYPTO_new_ex_data, [eay32 crypto], [], [AC_MSG_ERROR([library 'eay32' or 'crypto' is required for OpenSSL])])
1119+
AC_SEARCH_LIBS(SSL_new, [ssleay32 ssl], [], [AC_MSG_ERROR([library 'ssleay32' or 'ssl' is required for OpenSSL])])
11201120
fi
11211121
AC_CHECK_FUNCS([SSL_get_current_compression])
11221122
# Functions introduced in OpenSSL 1.1.0. We used to check for
@@ -1322,6 +1322,8 @@ fi
13221322

13231323
if test "$with_bonjour" = yes ; then
13241324
AC_CHECK_HEADER(dns_sd.h, [], [AC_MSG_ERROR([header file <dns_sd.h> is required for Bonjour])])
1325+
AC_SEARCH_LIBS(DNSServiceRefSockFD, dns_sd, [],
1326+
[AC_MSG_ERROR([could not find function 'DNSServiceRefSockFD' required for Bonjour])])
13251327
fi
13261328

13271329
# for contrib/uuid-ossp

0 commit comments

Comments
 (0)