From c1727287731dd0bd19ce36f58c1ce29a2a8603b3 Mon Sep 17 00:00:00 2001 From: Tomas Chvatal Date: Sat, 25 Jan 2014 11:44:27 +0100 Subject: [PATCH] Use pkgconfig to detect curl first, then fallback to curl-config. Change-Id: I3666c4d0298a76062a24ad8ae1c319f3480a9290 --- diff --git a/configure.ac b/configure.ac index 93c39d3..fb51308 100644 --- a/configure.ac +++ b/configure.ac @@ -8661,39 +8661,31 @@ AC_MSG_RESULT([external]) SYSTEM_CURL=YES - curl_version="" - if test "$cross_compiling" = "yes"; then - dnl At least the OBS mingw32-libcurl-devel package - dnl comes with a proper .pc file - PKG_CHECK_MODULES(CURL, libcurl,, [:]) - if test -n "$CURL_PKG_ERRORS"; then - AC_MSG_RESULT([no]) - else - curl_version=`$PKG_CONFIG --modversion libcurl` - fi - fi - if test -z "$curl_version"; then + AC_MSG_CHECKING([whether libcurl is >= 7.19.4]) + + # First try PKGCONFIG and then fall back + PKG_CHECK_MODULES(CURL, libcurl >= 7.19.4,, [:]) + + if test -n "$CURL_PKG_ERRORS"; then AC_PATH_PROG(CURLCONFIG, curl-config) if test -z "$CURLCONFIG"; then - AC_MSG_ERROR([install the libcurl development package]) + AC_MSG_ERROR([curl developement files not found]) fi CURL_LIBS=`$CURLCONFIG --libs` CURL_CFLAGS=$("$CURLCONFIG" --cflags | sed -e "s/-I/${ISYSTEM?}/g") curl_version=`$CURLCONFIG --version | $SED -e 's/^libcurl //'` + + case $curl_version in + dnl brackets doubled below because Autoconf uses them as m4 quote characters, + dnl so they need to be doubled to end up in the configure script + 7.19.4|7.19.[[5-9]]|7.[[2-9]]?.*|7.???.*|[[8-9]].*|[[1-9]][[0-9]].*) + ;; + *) + AC_MSG_ERROR([no, you have $curl_version]) + ;; + esac fi - - AC_MSG_CHECKING([whether libcurl is >= 7.19.4]) - - case $curl_version in - dnl brackets doubled below because Autoconf uses them as m4 quote characters, - dnl so they need to be doubled to end up in the configure script - 7.19.4|7.19.[[5-9]]|7.[[2-9]]?.*|7.???.*|[[8-9]].*|[[1-9]][[0-9]].*) - AC_MSG_RESULT([yes, you have $curl_version]) - ;; - *) - AC_MSG_ERROR([no, you have $curl_version]) - ;; - esac + AC_MSG_RESULT([yes]) libo_MINGW_CHECK_DLL([libcurl]) libo_MINGW_TRY_DLL([libintl])