aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-04-26 22:59:52 +0900
committerDaniel Stenberg <daniel@haxx.se>2012-05-26 23:07:42 +0200
commitb5fdbe848bc3d088445817aa890d3f2f74ac5b02 (patch)
treec74203901cba4d4b9916fad127bdfe6778622ee6 /configure.ac
parentefb8471a69e0b5b9fe2296954b4917e294392372 (diff)
Support Metalink.
This change adds experimental Metalink support to curl. To enable Metalink support, run configure with --with-libmetalink. To feed Metalink file to curl, use --metalink option like this: $ curl -O --metalink foo.metalink We use libmetalink to parse Metalink files.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac59
1 files changed, 59 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index db40f1874..395abaeab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -164,6 +164,7 @@ curl_verbose_msg="enabled (--disable-verbose)"
curl_rtsp_msg="no (--enable-rtsp)"
curl_rtmp_msg="no (--with-librtmp)"
init_ssl_msg=${curl_ssl_msg}
+curl_metalink_msg="no (--with-libmetalink)"
dnl
dnl Save anything in $LIBS for later
@@ -2217,6 +2218,63 @@ dnl **********************************************************************
CURL_CHECK_CA_BUNDLE
dnl **********************************************************************
+dnl Check for libmetalink
+dnl **********************************************************************
+
+OPT_LIBMETALINK=no
+
+AC_ARG_WITH(libmetalink,dnl
+AC_HELP_STRING([--with-libmetalink=PATH],[where to look for libmetalink, PATH points to the installation root])
+AC_HELP_STRING([--without-libmetalink], [disable libmetalink detection]),
+ OPT_LIBMETALINK=$withval)
+
+if test X"$OPT_LIBMETALINK" != Xno; then
+
+ addlib=""
+ addld=""
+ addcflags=""
+ version=""
+ libmetalinklib=""
+ PKGTEST="no"
+ if test "x$OPT_LIBMETALINK" = "xyes"; then
+ dnl this is with no partiular path given
+ PKGTEST="yes"
+ CURL_CHECK_PKGCONFIG(libmetalink)
+ else
+ dnl When particular path is given, set PKG_CONFIG_LIBDIR using the path.
+ LIBMETALINK_PCDIR="$OPT_LIBMETALINK/lib/pkgconfig"
+ AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$LIBMETALINK_PCDIR"])
+ if test -f "$LIBMETALINK_PCDIR/libmetalink.pc"; then
+ PKGTEST="yes"
+ fi
+ if test "$PKGTEST" = "yes"; then
+ CURL_CHECK_PKGCONFIG(libmetalink, [$LIBMETALINK_PCDIR])
+ fi
+ fi
+ if test "$PKGTEST" = "yes" && test "$PKGCONFIG" != "no"; then
+ addlib=`$PKGCONFIG --libs-only-l libmetalink`
+ addld=`$PKGCONFIG --libs-only-L libmetalink`
+ addcflags=`$PKGCONFIG --cflags-only-I libmetalink`
+ version=`$PKGCONFIG --modversion libmetalink`
+ libmetalinklib=`echo $addld | $SED -e 's/-L//'`
+ fi
+ if test -n "$addlib"; then
+
+ AC_MSG_NOTICE([detected libmetalink version $version])
+ curl_metalink_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])
+
+ fi
+fi
+AM_CONDITIONAL([HAVE_LIBMETALINK], [test -n "x$LIBMETALINK_LIBS"])
+
+dnl **********************************************************************
dnl Check for the presence of LIBSSH2 libraries and headers
dnl **********************************************************************
@@ -3319,6 +3377,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}
Protocols: ${SUPPORT_PROTOCOLS}
])