From d7d44a8637b499cffcf7452f7642b6561aa9c859 Mon Sep 17 00:00:00 2001 From: ygrek Date: Sun, 3 Sep 2017 11:31:32 +0100 Subject: [PATCH] configure: check libcurl version --- README.md | 2 ++ configure | 14 ++++++++++++++ configure.ac | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/README.md b/README.md index d72bbf1..b7105ba 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ supporting HTTP and a multitude of other network protocols. This is a continuation of ocurl project by Lars Nilsson, previously hosted at http://ocurl.sourceforge.net/ +Minimum required libcurl version : 7.17.0 + Building on Windows with ocaml/msvc =================================== diff --git a/configure b/configure index 47d22a6..fd22924 100755 --- a/configure +++ b/configure @@ -2047,6 +2047,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +MIN_LIBCURL_VERSION=7.17.0 + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2859,6 +2861,18 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CURLLIBS" >&5 $as_echo "$CURLLIBS" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcurl version >= $MIN_LIBCURL_VERSION" >&5 +$as_echo_n "checking for libcurl version >= $MIN_LIBCURL_VERSION... " >&6; } +LIBCURL_VERSION=`pkg-config libcurl --modversion || curl-config --version` +(pkg-config libcurl && pkg-config libcurl --atleast-version=${MIN_LIBCURL_VERSION}) || curl-config --checkfor ${MIN_LIBCURL_VERSION} +if test "$?" -eq 0 ; then : + +else + as_fn_error $? "${LIBCURL_VERSION} is too old" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${LIBCURL_VERSION}" >&5 +$as_echo "${LIBCURL_VERSION}" >&6; } + ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then diff --git a/configure.ac b/configure.ac index 46dd134..ceb98bd 100644 --- a/configure.ac +++ b/configure.ac @@ -4,6 +4,8 @@ dnl AC_INIT(ocurl,0.7.10) +MIN_LIBCURL_VERSION=7.17.0 + AC_PROG_CC() AC_MSG_CHECKING([for libcurl cflags]) @@ -16,6 +18,12 @@ CURLLIBS=`pkg-config libcurl --libs || curl-config --libs` AS_IF([ test "$?" -eq 0 ],,[AC_MSG_ERROR([libcurl was not found])] ) AC_MSG_RESULT([$CURLLIBS]) +AC_MSG_CHECKING([for libcurl version >= $MIN_LIBCURL_VERSION]) +LIBCURL_VERSION=`pkg-config libcurl --modversion || curl-config --version` +(pkg-config libcurl && pkg-config libcurl --atleast-version=${MIN_LIBCURL_VERSION}) || curl-config --checkfor ${MIN_LIBCURL_VERSION} +AS_IF([ test "$?" -eq 0 ],,[AC_MSG_ERROR([${LIBCURL_VERSION} is too old])]) +AC_MSG_RESULT([${LIBCURL_VERSION}]) + AC_PROG_INSTALL() AC_PROG_OCAML() AC_PROG_FINDLIB() -- 2.11.4.GIT