[Gambas-devel] Re: A little help

Benoit Minisini gambas at ...1...
Mon Jan 5 13:13:55 CET 2004


On Monday 05 January 2004 16:34, you wrote:
> Hello Benoît:
>
>  I'm working now with CURL, and it seems that soon I'll can send
> you a beta version of HTTPClient "powered" by libcurl, however,
> I don't know how to modify makefiles and configure script to
> detect and pass the correct parameters to the compiler to
> link with libcurl. There's some information provided by Curl
> people about that:
>
> http://curl.haxx.se/libcurl/using/autoconf.html
>
> However, I have no idea how to adapt Gambas makefiles using
> that information, so, by now, I'm linking it "by hand", writing
> values in "CFLAGS" sections of Makefile, that, of course, works
> for my box, but will not work for other people. Could you adapt
> Gambas makefiles and configuration scripts to do that?
>
> thanks in advance,
>
> Daniel Campos
>

You never have to adapt the Makefile files.

Look in configure.in. You will see a call to a macro named GB_COMPONENT for 
each component. This macro does all the job for you.

Look now the GB_COMPONENT for KDE: you will see a call to kde-config. This is 
a program that returns the path of KD directories.

libcurl has a config program too, named curl-config (amazing, no ?). See there 
for more info: http://curl.haxx.se/libcurl/c/the-guide.html

So you can try to modify the GB_COMPONENT call dedicated to the networking 
component this way:

BEFORE:

GB_COMPONENT(
  net,
  NET,
  [Networking component],
  [],
  [],
  [$C_LIB $THREAD_LIB],
  [$THREAD_INC])

AFTER:

GB_COMPONENT(
  net,
  NET,
  [Networking component],
  [GB_FIND(curl.h, `curl-config --prefix 2> /dev/null`, include)],
  [GB_FIND(libcurl.$SHLIBEXT, `curl-config --prefix 2> /dev/null`, lib)],
  [$C_LIB $THREAD_LIB `curl-config --libs 2> /dev/null`],
  [$THREAD_INC])


As this macro search for the real path of include files, you don't need to do:
  #include <curl/curl.h>
But just:
  #include <curl.h>

I have just tried what I told you, and it seems to work :-)

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...





More information about the Devel mailing list