Commit b15789d8 authored by Kenton Varda's avatar Kenton Varda

Add pkg-config support.

parent 40d86592
......@@ -117,6 +117,9 @@ includekjparsedir = $(includekjdir)/parse
dist_includecapnp_DATA = $(public_capnpc_inputs)
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = capnp.pc capnp-rpc.pc
includekj_HEADERS = \
src/kj/common.h \
src/kj/units.h \
......
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: Cap'n Proto RPC
Description: Fast object-oriented RPC system
Version: @VERSION@
Libs: -L${libdir} -lcapnp-rpc -lkj-async
Requires: capnp = @VERSION@
Cflags: -I${includedir}
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: Cap'n Proto
Description: Insanely fast serialization system
Version: @VERSION@
Libs: -L${libdir} -lcapnp -lkj @PTHREAD_CFLAGS@ @PTHREAD_LIBS@
Libs.private: @LIBS@
Cflags: -I${includedir} @PTHREAD_CFLAGS@
......@@ -59,5 +59,5 @@ CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
ac_configure_args="$ac_configure_args 'CXX=$CXX'"
AC_CONFIG_SUBDIRS([gtest])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([Makefile capnp.pc capnp-rpc.pc])
AC_OUTPUT
......@@ -6,16 +6,17 @@
set -exuo pipefail
capnpc -oc++ addressbook.capnp
c++ -std=c++11 -Wall addressbook.c++ addressbook.capnp.c++ -lcapnp -lkj -pthread -o addressbook
c++ -std=c++11 -Wall addressbook.c++ addressbook.capnp.c++ \
$(pkg-config --cflags --libs capnp) -o addressbook
./addressbook write | ./addressbook read
./addressbook dwrite | ./addressbook dread
rm addressbook addressbook.capnp.c++ addressbook.capnp.h
capnpc -oc++ calculator.capnp
c++ -std=c++11 -Wall calculator-client.c++ calculator.capnp.c++ -lcapnp-rpc -lcapnp -lkj-async \
-lkj -pthread -o calculator-client
c++ -std=c++11 -Wall calculator-server.c++ calculator.capnp.c++ -lcapnp-rpc -lcapnp -lkj-async \
-lkj -pthread -o calculator-server
c++ -std=c++11 -Wall calculator-client.c++ calculator.capnp.c++ \
$(pkg-config --cflags --libs capnp-rpc) -o calculator-client
c++ -std=c++11 -Wall calculator-server.c++ calculator.capnp.c++ \
$(pkg-config --cflags --libs capnp-rpc) -o calculator-server
rm -f /tmp/capnp-calculator-example-$$
./calculator-server unix:/tmp/capnp-calculator-example-$$ &
sleep 0.1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment