From 8e3225999cca8ba270075edbcadb285f7b8c6fdd Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sun, 13 Mar 2016 01:10:38 +0100 Subject: [PATCH] Add pkg-config support Signed-off-by: Joachim Nilsson --- .gitignore | 6 +++++- Makefile.am | 2 ++ README.md | 16 ++++++++++++++++ configure.ac | 2 +- libuev.pc.in | 12 ++++++++++++ 5 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 libuev.pc.in diff --git a/.gitignore b/.gitignore index d426f48..d157cb0 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ *.so *.so.* *.a +*.la +*.lo .deps .libs compile @@ -22,4 +24,6 @@ ar-lib autom4te.cache bench test -libuev* \ No newline at end of file +libuev*.tar.* +libuev.pc +!libuev.pc.in diff --git a/Makefile.am b/Makefile.am index 4fb2758..0bdb773 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,6 +12,8 @@ libuev_la_CPPFLAGS = -D_GNU_SOURCE libuev_la_CFLAGS = -W -Wall -Wextra libuev_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0 +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libuev.pc doc_DATA = README.md LICENSE EXTRA_DIST = README.md LICENSE AUTHORS ChangeLog.md diff --git a/README.md b/README.md index a0fd804..465c31f 100644 --- a/README.md +++ b/README.md @@ -270,6 +270,22 @@ library) for [reference benchmarks][7] against [libevent][1] and [libev][2]. +Using -luev +----------- + +LibuEv is by default installed as a library with a single include file. + + #include + +The output from the `pkg-config` tool holds no surprises: + + $ pkg-config --libs --static --cflags libuev + -I/usr/local/include -L/usr/local/lib -luev + +The prefix path `/usr/local/` used here is only the default. Use the +`configure` script to select a different path when installing libuEv. + + Build & Install --------------- diff --git a/configure.ac b/configure.ac index bf91bee..bd056ed 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ AM_SILENT_RULES([yes]) AC_CONFIG_SRCDIR(uev.c) AM_CONFIG_HEADER(config.h) -AC_CONFIG_FILES([Makefile examples/Makefile]) +AC_CONFIG_FILES([Makefile libuev.pc examples/Makefile]) AC_CONFIG_MACRO_DIR([m4]) AC_PROG_CC diff --git a/libuev.pc.in b/libuev.pc.in new file mode 100644 index 0000000..9f831a6 --- /dev/null +++ b/libuev.pc.in @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: @PACKAGE@ +Description: Simple event loop for Linux +Version: @VERSION@ +Requires: +Libs: -L${libdir} -luev +Cflags: -I${includedir} +