metalink: build fixes and adjustments I
authorYang Tse <yangsita@gmail.com>
Thu, 7 Jun 2012 21:49:27 +0000 (23:49 +0200)
committerYang Tse <yangsita@gmail.com>
Thu, 7 Jun 2012 21:50:12 +0000 (23:50 +0200)
configure.ac
packages/Symbian/group/curl.mmp
src/Makefile.inc
src/Makefile.vc6
src/tool_getparam.c
src/tool_metalink.c
src/tool_metalink.h
src/tool_operate.c
src/vc6curlsrc.dsp

index ef3ef77..8e7fe6d 100644 (file)
@@ -163,8 +163,9 @@ curl_verbose_msg="enabled (--disable-verbose)"
   curl_ldaps_msg="no      (--enable-ldaps)"
    curl_rtsp_msg="no      (--enable-rtsp)"
    curl_rtmp_msg="no      (--with-librtmp)"
+  curl_mtlnk_msg="no      (--with-libmetalink)"
+
     init_ssl_msg=${curl_ssl_msg}
-curl_metalink_msg="no      (--with-libmetalink)"
 
 dnl
 dnl Save anything in $LIBS for later
@@ -2265,18 +2266,17 @@ if test X"$OPT_LIBMETALINK" != Xno; then
   if test -n "$addlib"; then
 
     AC_MSG_NOTICE([detected libmetalink version $version])
-    curl_metalink_msg="enabled"
+    curl_mtlnk_msg="enabled"
     LIBMETALINK_LIBS=$addlib
     LIBMETALINK_LDFLAGS=$addld
     LIBMETALINK_CFLAGS=$addcflags
     AC_SUBST([LIBMETALINK_LIBS])
     AC_SUBST([LIBMETALINK_LDFLAGS])
     AC_SUBST([LIBMETALINK_CFLAGS])
-    AC_DEFINE(HAVE_LIBMETALINK, 1, [if libmetalink is available])
+    AC_DEFINE(USE_METALINK, 1, [Define to enable metalink support])
 
   fi
 fi
-AM_CONDITIONAL([HAVE_LIBMETALINK], [test -n "$LIBMETALINK_LIBS"])
 
 dnl **********************************************************************
 dnl Check for the presence of LIBSSH2 libraries and headers
@@ -3381,7 +3381,7 @@ AC_MSG_NOTICE([Configured to build curl/libcurl:
   LDAPS support:    ${curl_ldaps_msg}
   RTSP support:     ${curl_rtsp_msg}
   RTMP support:     ${curl_rtmp_msg}
-  metalink support: ${curl_metalink_msg}
+  metalink support: ${curl_mtlnk_msg}
   Protocols:        ${SUPPORT_PROTOCOLS}
 ])
 
index 3b6d22a..ab9a8fa 100644 (file)
@@ -30,6 +30,7 @@ SOURCE \
     tool_homedir.c \
     tool_libinfo.c \
     tool_main.c \
+    tool_metalink.c \
     tool_mfiles.c \
     tool_msgs.c \
     tool_operate.c \
index 3265ea9..76d6b7b 100644 (file)
@@ -36,6 +36,7 @@ CURL_CFILES = hugehelp.c \
        tool_homedir.c \
        tool_libinfo.c \
        tool_main.c \
+       tool_metalink.c \
        tool_mfiles.c \
        tool_msgs.c \
        tool_operate.c \
@@ -50,8 +51,7 @@ CURL_CFILES = hugehelp.c \
        tool_vms.c \
        tool_writeenv.c \
        tool_writeout.c \
-       tool_xattr.c \
-       tool_metalink.c
+       tool_xattr.c
 
 CURL_HFILES = hugehelp.h \
        tool_binmode.h \
@@ -75,6 +75,7 @@ CURL_HFILES = hugehelp.h \
        tool_homedir.h \
        tool_libinfo.h \
        tool_main.h \
+       tool_metalink.h \
        tool_mfiles.h \
        tool_msgs.h \
        tool_operate.h \
@@ -92,8 +93,7 @@ CURL_HFILES = hugehelp.h \
        tool_vms.h \
        tool_writeenv.h \
        tool_writeout.h \
-       tool_xattr.h \
-       tool_metalink.h
+       tool_xattr.h
 
 curl_SOURCES = $(CURL_CFILES) $(CURLX_ONES) $(CURL_HFILES)
 
index 650246f..f8b3066 100644 (file)
@@ -158,6 +158,7 @@ RELEASE_OBJS= \
        tool_homedirr.obj \\r
        tool_libinfor.obj \\r
        tool_mainr.obj \\r
+       tool_metalinkr.obj \\r
        tool_mfilesr.obj \\r
        tool_msgsr.obj \\r
        tool_operater.obj \\r
@@ -201,6 +202,7 @@ DEBUG_OBJS= \
        tool_homedird.obj \\r
        tool_libinfod.obj \\r
        tool_maind.obj \\r
+       tool_metalinkd.obj \\r
        tool_mfilesd.obj \\r
        tool_msgsd.obj \\r
        tool_operated.obj \\r
@@ -388,6 +390,8 @@ tool_libinfor.obj: tool_libinfo.c
        $(CCR) $(CFLAGS) /Fo"$@" tool_libinfo.c\r
 tool_mainr.obj: tool_main.c\r
        $(CCR) $(CFLAGS) /Fo"$@" tool_main.c\r
+tool_metalinkr.obj: tool_metalink.c\r
+       $(CCR) $(CFLAGS) /Fo"$@" tool_metalink.c\r
 tool_mfilesr.obj: tool_mfiles.c\r
        $(CCR) $(CFLAGS) /Fo"$@" tool_mfiles.c\r
 tool_msgsr.obj: tool_msgs.c\r
@@ -472,6 +476,8 @@ tool_libinfod.obj: tool_libinfo.c
        $(CCD) $(CFLAGS) /Fo"$@" tool_libinfo.c\r
 tool_maind.obj: tool_main.c\r
        $(CCD) $(CFLAGS) /Fo"$@" tool_main.c\r
+tool_metalinkd.obj: tool_metalink.c\r
+       $(CCD) $(CFLAGS) /Fo"$@" tool_metalink.c\r
 tool_mfilesd.obj: tool_mfiles.c\r
        $(CCD) $(CFLAGS) /Fo"$@" tool_mfiles.c\r
 tool_msgsd.obj: tool_msgs.c\r
index c8dc7ae..cc01efb 100644 (file)
@@ -823,7 +823,7 @@ ParameterError getparameter(char *flag,    /* f or -long-flag */
         break;
       case 'J': /* --metalink */
         {
-#ifdef HAVE_LIBMETALINK
+#ifdef USE_METALINK
           if(parse_metalink(config, nextarg) == -1) {
             warnf(config, "Could not parse Metalink file: %s\n", nextarg);
             /* TODO Is PARAM_BAD_USE appropriate here? */
@@ -1563,9 +1563,9 @@ ParameterError getparameter(char *flag,    /* f or -long-flag */
           if(curlinfo->features & feats[i].bitmask)
             printf("%s ", feats[i].name);
         }
-#ifdef HAVE_LIBMETALINK
+#ifdef USE_METALINK
         printf("Metalink ");
-#endif /* HAVE_LIBMETALINK */
+#endif
         puts(""); /* newline */
       }
     }
index 58aae83..375cdd3 100644 (file)
@@ -31,7 +31,7 @@
 #  include <fcntl.h>
 #endif
 
-#ifdef HAVE_LIBMETALINK
+#ifdef USE_METALINK
 
 #include <metalink/metalink_parser.h>
 
@@ -416,7 +416,7 @@ int metalink_check_hash(struct Configurable *config,
 
 #endif /* METALINK_HASH_CHECK */
 
-#ifdef HAVE_LIBMETALINK
+#ifdef USE_METALINK
 
 static metalink_checksum *new_metalink_checksum(const char *hash_name,
                                                 const char *hash_value)
@@ -538,7 +538,7 @@ int parse_metalink(struct Configurable *config, const char *infile)
   return 0;
 }
 
-#endif /* HAVE_LIBMETALINK */
+#endif /* USE_METALINK */
 
 /*
  * Returns nonzero if content_type includes mediatype.
@@ -621,4 +621,4 @@ void clean_metalink(struct Configurable *config)
   config->metalinkfile_last = 0;
 }
 
-#endif /* HAVE_LIBMETALINK */
+#endif /* USE_METALINK */
index 25feddc..c382402 100644 (file)
@@ -52,7 +52,7 @@ typedef struct metalinkfile {
 /*
  * Counts the resource in the metalinkfile.
  */
-#ifdef HAVE_LIBMETALINK
+#ifdef USE_METALINK
 int count_next_metalink_resource(metalinkfile *mlfile);
 void clean_metalink(struct Configurable *config);
 #else
index 7c70fd2..2da92ca 100644 (file)
@@ -1559,7 +1559,7 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
         }
 #endif
 
-#ifdef HAVE_LIBMETALINK
+#ifdef USE_METALINK
         if(!metalink && res == CURLE_OK && outs.filename) {
           /* Check the content-type header field and if it indicates
              Metalink file, parse it and add getout for them. */
@@ -1585,7 +1585,7 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
           }
         }
 #  endif /* METALINK_HASH_CHECK */
-#endif /* HAVE_LIBMETALINK */
+#endif /* USE_METALINK */
 
         /* No more business with this output struct */
         if(outs.alloc_filename)
index a2d9e7b..7c75765 100644 (file)
@@ -239,6 +239,10 @@ SOURCE=.\tool_main.c
 # End Source File\r
 # Begin Source File\r
 \r
+SOURCE=.\tool_metalink.c\r
+# End Source File\r
+# Begin Source File\r
+\r
 SOURCE=.\tool_mfiles.c\r
 # End Source File\r
 # Begin Source File\r
@@ -407,6 +411,10 @@ SOURCE=.\tool_main.h
 # End Source File\r
 # Begin Source File\r
 \r
+SOURCE=.\tool_metalink.h\r
+# End Source File\r
+# Begin Source File\r
+\r
 SOURCE=.\tool_mfiles.h\r
 # End Source File\r
 # Begin Source File\r