cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Fri, 10 Jun 2011 16:34:01 -0700

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`

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