Sfoglia il codice sorgente

Fixed compile error without BitTorrent and Metalink support

Tatsuhiro Tsujikawa 14 anni fa
parent
commit
c8191700b1
2 ha cambiato i file con 13 aggiunte e 10 eliminazioni
  1. 8 8
      src/Makefile.am
  2. 5 2
      src/RpcMethodImpl.cc

+ 8 - 8
src/Makefile.am

@@ -237,6 +237,14 @@ SRCS += XmlAttr.cc XmlAttr.h\
 	ParserStateMachine.h
 endif # HAVE_SOME_XMLLIB
 
+if HAVE_LIBXML2
+SRCS +=  Xml2XmlParser.cc Xml2XmlParser.h
+endif # HAVE_LIBXML2
+
+if HAVE_LIBEXPAT
+SRCS +=  ExpatXmlParser.cc ExpatXmlParser.h
+endif # HAVE_LIBEXPAT
+
 if ENABLE_XML_RPC
 SRCS += XmlRpcRequestParserController.cc XmlRpcRequestParserController.h\
 	XmlRpcRequestParserStateMachine.cc XmlRpcRequestParserStateMachine.h\
@@ -496,14 +504,6 @@ SRCS += Metalinker.cc Metalinker.h\
 	MetalinkPostDownloadHandler.cc MetalinkPostDownloadHandler.h\
 	metalink_helper.cc metalink_helper.h
 
-if HAVE_LIBXML2
-SRCS +=  Xml2XmlParser.cc Xml2XmlParser.h
-endif # HAVE_LIBXML2
-
-if HAVE_LIBEXPAT
-SRCS +=  ExpatXmlParser.cc ExpatXmlParser.h
-endif # HAVE_LIBEXPAT
-
 endif # ENABLE_METALINK
 
 if !HAVE_ASCTIME_R

+ 5 - 2
src/RpcMethodImpl.cc

@@ -1137,8 +1137,11 @@ void changeOption
     }
   }
   if(option.defined(PREF_DIR) || option.defined(PREF_OUT)) {
-    if(dctx->getFileEntries().size() == 1 &&
-       !dctx->hasAttribute(bittorrent::BITTORRENT)) {
+    if(dctx->getFileEntries().size() == 1
+#ifdef ENABLE_BITTORRENT
+       && !dctx->hasAttribute(bittorrent::BITTORRENT)
+#endif // ENABLE_BITTORRENT
+       ) {
       dctx->getFirstFileEntry()->setPath
         (grOption->blank(PREF_OUT) ? A2STR::NIL :
          util::applyDir(grOption->get(PREF_DIR), grOption->get(PREF_OUT)));