1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

metalink: build fixes and adjustments I

This commit is contained in:
Yang Tse 2012-06-07 23:49:27 +02:00
parent 2e48139fbf
commit 04ca9aecd1
9 changed files with 34 additions and 19 deletions

View 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}
])

View 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 \

View 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)

View File

@ -158,6 +158,7 @@ RELEASE_OBJS= \
tool_homedirr.obj \
tool_libinfor.obj \
tool_mainr.obj \
tool_metalinkr.obj \
tool_mfilesr.obj \
tool_msgsr.obj \
tool_operater.obj \
@ -201,6 +202,7 @@ DEBUG_OBJS= \
tool_homedird.obj \
tool_libinfod.obj \
tool_maind.obj \
tool_metalinkd.obj \
tool_mfilesd.obj \
tool_msgsd.obj \
tool_operated.obj \
@ -388,6 +390,8 @@ tool_libinfor.obj: tool_libinfo.c
$(CCR) $(CFLAGS) /Fo"$@" tool_libinfo.c
tool_mainr.obj: tool_main.c
$(CCR) $(CFLAGS) /Fo"$@" tool_main.c
tool_metalinkr.obj: tool_metalink.c
$(CCR) $(CFLAGS) /Fo"$@" tool_metalink.c
tool_mfilesr.obj: tool_mfiles.c
$(CCR) $(CFLAGS) /Fo"$@" tool_mfiles.c
tool_msgsr.obj: tool_msgs.c
@ -472,6 +476,8 @@ tool_libinfod.obj: tool_libinfo.c
$(CCD) $(CFLAGS) /Fo"$@" tool_libinfo.c
tool_maind.obj: tool_main.c
$(CCD) $(CFLAGS) /Fo"$@" tool_main.c
tool_metalinkd.obj: tool_metalink.c
$(CCD) $(CFLAGS) /Fo"$@" tool_metalink.c
tool_mfilesd.obj: tool_mfiles.c
$(CCD) $(CFLAGS) /Fo"$@" tool_mfiles.c
tool_msgsd.obj: tool_msgs.c

View 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 */
}
}

View 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 */

View 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

View 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)

View File

@ -239,6 +239,10 @@ SOURCE=.\tool_main.c
# End Source File
# Begin Source File
SOURCE=.\tool_metalink.c
# End Source File
# Begin Source File
SOURCE=.\tool_mfiles.c
# End Source File
# Begin Source File
@ -407,6 +411,10 @@ SOURCE=.\tool_main.h
# End Source File
# Begin Source File
SOURCE=.\tool_metalink.h
# End Source File
# Begin Source File
SOURCE=.\tool_mfiles.h
# End Source File
# Begin Source File