summaryrefslogtreecommitdiffstats
path: root/dnssd
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-22 00:00:04 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-22 00:00:04 +0000
commitcfa3abbed0a36890d0c5a41fff2ef6c0f850de25 (patch)
treef684d7ccb45eda21ee493632529d9666072b551f /dnssd
parente94d831806014d0a4d3fc66cf55efeac93680a6a (diff)
downloadtdelibs-cfa3abbed0a36890d0c5a41fff2ef6c0f850de25.tar.gz
tdelibs-cfa3abbed0a36890d0c5a41fff2ef6c0f850de25.zip
Configure fixes
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1152778 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'dnssd')
-rw-r--r--dnssd/configure.in.in48
1 files changed, 16 insertions, 32 deletions
diff --git a/dnssd/configure.in.in b/dnssd/configure.in.in
index 022ffe871..c112986f1 100644
--- a/dnssd/configure.in.in
+++ b/dnssd/configure.in.in
@@ -2,37 +2,21 @@
AC_ARG_ENABLE(dnssd, [ --disable-dnssd don't require libdns_sd (browsing and publishing DNS-SD services will not be possible) ], with_dnssd=$enableval, with_dnssd=yes)
if test "$with_dnssd" = "yes"; then
-AC_MSG_CHECKING(for DNS-SD support)
-save_dnssdtest_LIBS="$LIBS"
-save_dnssdtest_LDFLAGS="$LDFLAGS"
-save_dnssdtest_CPPFLAGS="$CPPFLAGS"
-LDFLAGS="$all_libraries $LDFLAGS"
-CPPFLAGS="$CPPFLAGS $all_includes"
-case $host_os in
- darwin*) LIBS="" ;;
- *) LIBS="-ldns_sd" ;;
-esac
-have_libdns_sd="no"
-AC_TRY_LINK( [
- #include <dns_sd.h>
- ],[
- DNSServiceRefDeallocate( (DNSServiceRef) 0);
- TXTRecordDeallocate( (TXTRecordRef*) 0);
- ],[
- AC_DEFINE(HAVE_DNSSD,1,[Define if dns-sd is available])
- case $host_os in
- darwin*) LIB_DNSSD="" ;;
- *) LIB_DNSSD="-ldns_sd" ;;
- esac
- have_libdns_sd="yes"
- AC_MSG_RESULT(yes)
- ],[
- AC_MSG_RESULT(no)
- LIB_DNSSD=""
-])
-CPPFLAGS=$save_dnssdtest_CPPFLAGS
-LDFLAGS=$save_dnssdtest_LDFLAGS
-LIBS=$save_dnssdtest_LIBS
+# Check for pkg-config manually first, as if its not installed the
+# PKG_PROG_PKG_CONFIG macro won't be defined.
+m4_pattern_allow(PKG_CONFIG_MIN_VERSION)
+AC_CHECK_PROG(have_pkg_config, pkg-config, yes, no)
+
+if test x"$have_pkg_config" == xno; then
+ AC_MSG_ERROR(pkg-config is required to install this program)
+fi
+
+PKG_PROG_PKG_CONFIG
+
+PKG_CHECK_MODULES( AVAHI, [ avahi-qt3 >= 0.4 , avahi-client >= 0.4 ])
+AC_SUBST(AVAHI_CFLAGS)
+AC_SUBST(AVAHI_LIBS)
+PKG_CHECK_EXISTS( [ avahi-client >= 0.6], AC_DEFINE(AVAHI_API_0_6,1,[Avahi API 0.6] ) )
+have_libdns_sd="yes"
fi
-AC_SUBST(LIB_DNSSD)
AM_CONDITIONAL(HAVE_DNSSD, test "$have_libdns_sd" = "yes")