Sophie

Sophie

distrib > Fedora > 13 > i386 > media > updates-src > by-pkgid > c91f0991796e9b0692397f569aba867f > files > 2

xrootd-3.0.3-2.fc13.src.rpm

diff -ur xrootd-3.0.3.orig/configure.ac xrootd-3.0.3/configure.ac
--- xrootd-3.0.3.orig/configure.ac	2011-04-22 12:17:39.633403184 +0200
+++ xrootd-3.0.3/configure.ac	2011-04-22 12:19:18.527396298 +0200
@@ -1113,6 +1113,70 @@
 
 AM_CONDITIONAL(ENABLE_SECSSL,test x"$activate_secssl" = xyes -o x"$activate_secssl" = xdefault_yes)
 
+###########################################
+# bonjour checks
+ACX_LIBOPTION(bonjour, [bonjour support], yes)
+
+if test x"$activate_bonjour" = xyes -o x"$activate_bonjour" = xdefault_yes; then
+  if test x"$acx_bonjour_incdir" != x; then
+    searchpath=$acx_bonjour_incdir
+  else
+    searchpath="$std_inc_path"
+  fi
+
+  ACX_LOCATEFILE([dns_sd.h],[$searchpath],
+                 [BONJOUR_INCDIR="-I$acx_founddir"
+                  AC_MSG_NOTICE([bonjour header dir set to: $dir ]) ],
+                 [activate_bonjour=no]
+                )
+
+  CPPFLAGS_BUP="$CPPFLAGS"
+  LDFLAGS_BUP=$LDFLAGS
+
+  CPPFLAGS="$BONJOUR_INCDIR $CPPFLAGS"
+
+  AC_CHECK_HEADER([dns_sd.h],
+                  [],[activate_bonjour=no]
+                  )
+
+  LDFLAGS="$BONJOUR_LIBDIR $LDFLAGS"
+  AC_CHECK_LIB([dns_sd],[TXTRecordCreate],
+               [:],[activate_bonjour=no],[]
+              )
+
+  CPPFLAGS="$CPPFLAGS_BUP"
+  LDFLAGS=$LDFLAGS_BUP
+
+  AC_SUBST(BONJOUR_INCDIR)
+  AC_SUBST(BONJOUR_LIBDIR)
+  AC_SUBST(BONJOUR_LIBS)
+fi
+
+rm -f src/XrdOuc/XrdOucFactoryBonjour.hh
+rm -f src/XrdOuc/XrdOucFactoryBonjour.cc
+if test x"$activate_bonjour" = xyes -o x"$activate_bonjour" = xdefault_yes; then
+case "$target_os" in
+   linux*)
+      ln -s XrdOucAvahiBonjour.hh src/XrdOuc/XrdOucFactoryBonjour.hh
+      ln -s XrdOucAvahiBonjour.cc src/XrdOuc/XrdOucFactoryBonjour.cc
+      BONJOUR_LIBS="-ldns_sd -lavahi-client -lavahi-common"
+      ;;
+   darwin*)
+      ln -s XrdOucFactoryBonjour.hh src/XrdOuc/XrdOucFactoryBonjour.hh
+      ln -s XrdOucFactoryBonjour.cc src/XrdOuc/XrdOucFactoryBonjour.cc
+      BONJOUR_LIBS="-ldns_sd"
+      ;;
+   *)
+      if test "x$activate_bonjour" = "xyes" ; then
+         echo "Sorry, the Bonjour/Avahi interface currently supported only for Linux/MacOsX - disabling ... (target: $target_os)"
+      fi
+      activate_bonjour=no
+      ;;
+esac
+fi
+
+AM_CONDITIONAL(ENABLE_BONJOUR,test x"$activate_bonjour" = xyes -o x"$activate_bonjour" = xdefault_yes)
+
 # Record the extension of dynamic libraries on this platform
 LT_SYS_MODULE_EXT
 
diff -ur xrootd-3.0.3.orig/src/Xrd/Makefile.am xrootd-3.0.3/src/Xrd/Makefile.am
--- xrootd-3.0.3.orig/src/Xrd/Makefile.am	2011-04-22 12:17:39.595402419 +0200
+++ xrootd-3.0.3/src/Xrd/Makefile.am	2011-04-22 12:19:18.528396307 +0200
@@ -47,7 +47,8 @@
         XrdScheduler.cc XrdScheduler.hh XrdJob.hh  \
         XrdStats.cc XrdStats.hh \
                     XrdTrace.hh
-libXrd_la_LIBADD = ../XrdNet/libXrdNet.la \
+libXrd_la_LIBADD = ../XrdOuc/libXrdOucBonjour.la \
+                   ../XrdNet/libXrdNet.la \
                    ../XrdOuc/libXrdOuc.la \
                    ../XrdNetUtil/libXrdNetUtil.la \
                    ../XrdSys/libXrdSys.la \
diff -ur xrootd-3.0.3.orig/src/XrdOuc/Makefile.am xrootd-3.0.3/src/XrdOuc/Makefile.am
--- xrootd-3.0.3.orig/src/XrdOuc/Makefile.am	2011-04-22 12:17:39.608402681 +0200
+++ xrootd-3.0.3/src/XrdOuc/Makefile.am	2011-04-22 12:19:18.529396317 +0200
@@ -8,7 +8,7 @@
 ## Checked in by $Author$
 #######################################################################
 
-AM_CPPFLAGS = -I$(top_srcdir)/src
+AM_CPPFLAGS = -I$(top_srcdir)/src $(BONJOUR_INCDIR)
 
 #############################################################################
 ## extra installation directory definitions
@@ -18,7 +18,7 @@
 #############################################################################
 ## deliverables (to be built / installed)
 
-xrootdoucinc_HEADERS = \
+OUCHEADERS = \
     XrdOuca2x.hh    XrdOucChain.hh      XrdOucDLlist.hh \
     XrdOucEnv.hh    XrdOucErrInfo.hh    XrdOucExport.hh \
     XrdOucHash.hh   XrdOucHash.icc      XrdOucLock.hh  \
@@ -30,8 +30,18 @@
     XrdOucPup.hh    XrdOucCRC.hh        XrdOucArgs.hh \
     XrdOucNSWalk.hh XrdOucSxeq.hh       XrdOucXAttr.hh
 
+if ENABLE_BONJOUR
+xrootdoucinc_HEADERS = $(OUCHEADERS) XrdOucBonjour.hh
+nodist_xrootdoucinc_HEADERS = XrdOucFactoryBonjour.hh
+else
+xrootdoucinc_HEADERS = $(OUCHEADERS)
+nodist_xrootdoucinc_HEADERS =
+endif
+
 lib_LTLIBRARIES = libXrdOuc.la
 
+noinst_LTLIBRARIES = libXrdOucBonjour.la
+
 
 #############################################################################
 # Build rules
@@ -61,6 +71,19 @@
                       ../XrdSys/libXrdSys.la \
                       $(LIBPTHREAD) $(SEM_LIBRT) $(LIBNSL)
 
+if ENABLE_BONJOUR
+libXrdOucBonjour_la_SOURCES = XrdOucBonjour.cc
+nodist_libXrdOucBonjour_la_SOURCES = XrdOucFactoryBonjour.cc
+else
+libXrdOucBonjour_la_SOURCES =
+nodist_libXrdOucBonjour_la_SOURCES =
+endif
+libXrdOucBonjour_la_LIBADD = $(BONJOUR_LIBDIR) $(BONJOUR_LIBS)
+
+# sources not named in rules that still need to get rolled into the
+# distribution tarball
+EXTRA_DIST = XrdOucAppleBonjour.cc XrdOucAppleBonjour.hh \
+             XrdOucAvahiBonjour.cc XrdOucAvahiBonjour.hh
 
 # TODO: again as in classic? REFAC libXrdOuc_la_CXXFLAGS = -prefer-pic
 # TODO: again as in classic? REFAC libXrdOuc_la_LDFLAGS = -static