ygrek / ocurl

OCaml bindings to libcurl
https://ygrek.org/p/ocurl
MIT License
59 stars 32 forks source link

more robust CURLLIBS in ./configure #2

Closed ogunden closed 11 years ago

ogunden commented 11 years ago

On my gentoo box, curl-config --libs outputs:

-lcurl -lssl -lcrypto -lssl -lcrypto -lz -lrt

Currently, the configure script for ocurl runs:

curl-config --libs | cut -d ' ' -f 2-

but for me this cuts out -lcurl.

My suggestion is to change this to:

curl-config --libs | xargs -n 1 echo | grep -v -- -L | xargs echo

or similar (maybe add a sort -u for good measure), which produces the proper output on my gentoo box and will probably not break anyone else's setup (it also works on my ubuntu box which produces -L/usr/lib/x86_64-linux-gnu -lcurl).

The above is all for populating CURLLIBS. I have not given much thought to CURLFLAGS but it could probably be done in a similar manner.

ygrek commented 11 years ago

Thanks for the report! Please, could you test the version from git?

ogunden commented 11 years ago

Hey, just checked out the latest and I get this now, on my gentoo and ubuntu boxes both, from ./configure:

 checking for libcurl cflags... configure: error: libcurl was not found

I looked into configure.in, and I guess it's related to this line?

 CFLAGS=`pkg-config libcurl --cflags || curl-config --cflags`

The strange thing is, both of those work for me (although they produce no output, but they do exit 0).

ygrek commented 11 years ago

Sorry, just fixed it (again).

ogunden commented 11 years ago

I don't see any commits on github. have you pushed?

ygrek commented 11 years ago

Oops..

ogunden commented 11 years ago

works great now! thanks..