Opened 10 years ago

Closed 10 years ago

#4110 closed defect (fixed)

libcurl configure problems

Reported by: crschmidt Owned by: warmerdam
Priority: normal Milestone: 1.9.0
Component: ConfigBuild Version: 1.8.0
Severity: normal Keywords:
Cc:

Description

Hi,

When libcurl isn't included in the default path, but GDAL can find curl-config, the configure script does not appear to use curl-config --libs when building the test script in order to check whether curl support exists.

This results in configure output like this:

checking for curl-config... /home/dotcloud/env/bin/curl-config found libcurl version 7.21.6
checking for curl_global_init in -lcurl... no

In config.log, this looks like:

configure:22167: checking for curl_global_init in -lcurl
configure:22192: gcc -o conftest -g -O2 -fPIC   conftest.c -lcurl  -ljpeg -lpng -L/usr/local/lib -lpq -lz -lpthread -lm -lrt -ldl  >&5

On this machine:

$ curl-config --libs
-L/home/dotcloud/lib -lcurl

It looks like the problem is that the curl libs are never added to $LIBS or any other variable in this section of configure.in:

if test "$LIBCURL_CONFIG" != "no" ; then

  CURL_VERNUM=`$LIBCURL_CONFIG --vernum`
  CURL_VER=`$LIBCURL_CONFIG --version | awk '{print $2}'`

  AC_MSG_RESULT([        found libcurl version $CURL_VER])
  AC_CHECK_LIB(curl,curl_global_init,CURL_SETTING=yes,CURL_SETTING=no,$LIBCURL_LIB)

fi

Adding this in near:

LIBS="$LIBS  `$LIBCURL_CONFIG --libs`"
...
if test "${ac_cv_lib_curl_curl_global_init+set}" = set; then :
  $as_echo_n "(cached) " >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lcurl  $LIBS"

will cause the build to succeed (and GDAL does properly use curl-config in actual building).

I'm not sure exactly what the right approach is here, I'm just pretty sure that something is missing here :)

Change History (2)

comment:1 Changed 10 years ago by warmerdam

Status: newassigned

Chris,

I have tried passing curl-config --libs in the sub libraries portion of AC_CHECK_LIB. could you try the new configure in svn when you get a chance?

Fix applied in trunk (r22515).

comment:2 Changed 10 years ago by Even Rouault

Milestone: 1.8.11.9.0
Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.