basho-labs / riak-c-client

Riak C Client
Apache License 2.0
20 stars 8 forks source link

Add pkg-config info for the riak-c-client #47

Closed bookshelfdave closed 10 years ago

bookshelfdave commented 10 years ago

Tested using a basic build:

./autogen.sh && ./configure && make && sudo make install
$ pkg-config --cflags --libs riak-c-client-sync
-lriak_c_client-0.5

$ pkg-config --cflags --libs riak-c-client-async
-D_THREAD_SAFE -I/usr/local/Cellar/libevent/2.0.21/include -L/usr/local/Cellar/libevent/2.0.21/lib -lriak_c_client-0.5 -levent_pthreads -levent
hazen commented 10 years ago

So I tried installing this branch in /tmp/riakc just for fun and found that we are missing the include path for riak-c-client itself:

gcc `pkg-config --cflags --libs riak-c-client-sync` taste_of_riak.c -o taste_of_riak
taste_of_riak.c:21:10: fatal error: 'riak.h' file not found
#include <riak.h>
         ^
1 error generated.
make: *** [all] Error 1

It looks like the -I includes are not being returned. I think the last line needs to be

Cflags: -I${includedir}
hazen commented 10 years ago

Also, how about simply riak-c-client.pc and riak-c-client-async.pc? The default is synchronous, right?

hazen commented 10 years ago

Looks like we also need this:

Libs: -L${libdir} -lriak_c_client-0.5
bookshelfdave commented 10 years ago

@javajolt updated based on your feedback.

$ pkg-config --list-all | grep riak
riak-c-client                       Riak C Client, synchronous implementation - A C client for the Riak Distributed Database
riak-c-client-async                 Riak C Client, async implementation - A C client for the Riak Distributed Database
bookshelfdave commented 10 years ago

Note: I'll need to update the Makefile in taste-of-riak/C

hazen commented 10 years ago

Didn't we want to leave this open? I can't remember why.

Otherwise, it looks good :+1:

bookshelfdave commented 10 years ago

@javajolt I was going to leave it open while I got the Taste of Riak working. I'm thinking of implementing another simple async version to go alongside the sync one, so there might be more changes coming in the next few days.