cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [Cross-compiling] "#error "CURL_SIZEOF_LONG definition is missing!""

From: Michael Wood <esiotrot_at_gmail.com>
Date: Sat, 11 Jun 2011 08:35:01 +0200

On 11 June 2011 01:34, Dan Fandrich <dan_at_coneharvesters.com> wrote:
> On Sat, Jun 11, 2011 at 12:37:11AM +0200, Gilles wrote:
>>       I'm trying to cross-compile an application for uClinux that relies
>> on Libcurl, but it fails compiling.
>
> That should be fine. Other people have reported success on various
> uClinux platforms.
>
>> First, I add the right toolchain in the PATH, and ran the following:
>> ================
>> ./configure --disable-gpg ac_cv_func_malloc_0_nonnull=yes
>> --build=i686-pc-linux --host=bfin-linux-uclibc
>> target=bfin-linux-uclibc CC=bfin-linux-uclibc-gcc
>> AR=bfin-linux-uclibc-ar RANLIB=bfin-linux-uclibc-ranlib CFLAGS="-O2
>> -Wall -I/usr/src/uClinux-dist-2010R1-RC5/linux-2.6.x/include
>> -I/usr/src/uClinux-dist-2010R1-RC5/lib/libcurl/curl-7.19.6/include"
>> LDFLAGS="-static
>> -L/usr/src/uClinux-dist-2010R1-RC5/lib/libcurl/build-curl-7.19.6/lib/.libs"
>
> Is this a curl configure command or one for your app?  --disable-gpg isn't a
> curl configure option, so I'm guessing it's an app configure command.
> It seems overly complicated to start--you should be able to let autoconf
> figure out most of that stuff itself.  You also should not be pointing apps
> into the curl source tree in the CPPFLAGS and LDFLAGS variables; you
> should use 'curl-config --cflags' and 'curl-config --libs' to get those
> flags from the installed curl location, i.e. the location that 'make
> install' puts libcurl after it's compiled.
>
> You should be able to use a configure line something like this instead:
>
> ./configure --host=bfin-linux-uclibc --disable-gpg \
>  CPPFLAGS=`/path/to/install/curl-config --cflags` \
>  LDFLAGS=`-static /path/to/install/curl-config --static-libs`

I suppose you meant something like this?

LDFLAGS="-static `/path/to/install/curl-config --static-libs`"

Does this work with a cross-compiled curl, though? (I haven't tried it.)

-- 
Michael Wood <esiotrot_at_gmail.com>
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-06-11