Skip to content

Commit 9b9cb3c

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 bd65e0c commit 9b9cb3c

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
@@ -11124,6 +11124,64 @@ else
1112411124
fi
1112511125

1112611126

11127+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing DNSServiceRefSockFD" >&5
11128+
$as_echo_n "checking for library containing DNSServiceRefSockFD... " >&6; }
11129+
if ${ac_cv_search_DNSServiceRefSockFD+:} false; then :
11130+
$as_echo_n "(cached) " >&6
11131+
else
11132+
ac_func_search_save_LIBS=$LIBS
11133+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11134+
/* end confdefs.h. */
11135+
11136+
/* Override any GCC internal prototype to avoid an error.
11137+
Use char because int might match the return type of a GCC
11138+
builtin and then its argument prototype would still apply. */
11139+
#ifdef __cplusplus
11140+
extern "C"
11141+
#endif
11142+
char DNSServiceRefSockFD ();
11143+
int
11144+
main ()
11145+
{
11146+
return DNSServiceRefSockFD ();
11147+
;
11148+
return 0;
11149+
}
11150+
_ACEOF
11151+
for ac_lib in '' dns_sd; do
11152+
if test -z "$ac_lib"; then
11153+
ac_res="none required"
11154+
else
11155+
ac_res=-l$ac_lib
11156+
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
11157+
fi
11158+
if ac_fn_c_try_link "$LINENO"; then :
11159+
ac_cv_search_DNSServiceRefSockFD=$ac_res
11160+
fi
11161+
rm -f core conftest.err conftest.$ac_objext \
11162+
conftest$ac_exeext
11163+
if ${ac_cv_search_DNSServiceRefSockFD+:} false; then :
11164+
break
11165+
fi
11166+
done
11167+
if ${ac_cv_search_DNSServiceRefSockFD+:} false; then :
11168+
11169+
else
11170+
ac_cv_search_DNSServiceRefSockFD=no
11171+
fi
11172+
rm conftest.$ac_ext
11173+
LIBS=$ac_func_search_save_LIBS
11174+
fi
11175+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_DNSServiceRefSockFD" >&5
11176+
$as_echo "$ac_cv_search_DNSServiceRefSockFD" >&6; }
11177+
ac_res=$ac_cv_search_DNSServiceRefSockFD
11178+
if test "$ac_res" != no; then :
11179+
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
11180+
11181+
else
11182+
as_fn_error $? "could not find function 'DNSServiceRefSockFD' required for Bonjour" "$LINENO" 5
11183+
fi
11184+
1112711185
fi
1112811186

1112911187
# for contrib/uuid-ossp

configure.in

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,8 +1061,8 @@ if test "$with_openssl" = yes ; then
10611061
AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])])
10621062
AC_CHECK_LIB(ssl, SSL_new, [], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])])
10631063
else
1064-
AC_SEARCH_LIBS(CRYPTO_new_ex_data, eay32 crypto, [], [AC_MSG_ERROR([library 'eay32' or 'crypto' is required for OpenSSL])])
1065-
AC_SEARCH_LIBS(SSL_new, ssleay32 ssl, [], [AC_MSG_ERROR([library 'ssleay32' or 'ssl' is required for OpenSSL])])
1064+
AC_SEARCH_LIBS(CRYPTO_new_ex_data, [eay32 crypto], [], [AC_MSG_ERROR([library 'eay32' or 'crypto' is required for OpenSSL])])
1065+
AC_SEARCH_LIBS(SSL_new, [ssleay32 ssl], [], [AC_MSG_ERROR([library 'ssleay32' or 'ssl' is required for OpenSSL])])
10661066
fi
10671067
AC_CHECK_FUNCS([SSL_get_current_compression])
10681068
# Functions introduced in OpenSSL 1.1.0. We used to check for
@@ -1262,6 +1262,8 @@ fi
12621262

12631263
if test "$with_bonjour" = yes ; then
12641264
AC_CHECK_HEADER(dns_sd.h, [], [AC_MSG_ERROR([header file <dns_sd.h> is required for Bonjour])])
1265+
AC_SEARCH_LIBS(DNSServiceRefSockFD, dns_sd, [],
1266+
[AC_MSG_ERROR([could not find function 'DNSServiceRefSockFD' required for Bonjour])])
12651267
fi
12661268

12671269
# for contrib/uuid-ossp

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy