From 819e2f5ee3e6b21b9cf7f07ee6ad3c57f48bfbef Mon Sep 17 00:00:00 2001 From: Clemens Gruber Date: Mon, 22 Jan 2018 17:12:12 +0100 Subject: [PATCH] build: add pkg-config support Create a libgpiod.pc file for pkg-config. Allows to use PKG_CHECK_MODULES([gpiod], [libgpiod >= 1.0],,) in other autoconf-based projects. Signed-off-by: Clemens Gruber Signed-off-by: Bartosz Golaszewski --- Makefile.am | 3 +++ configure.ac | 3 ++- libgpiod.pc.in | 11 +++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 libgpiod.pc.in diff --git a/Makefile.am b/Makefile.am index af7aecb..dfa6d47 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,6 +11,9 @@ ACLOCAL_AMFLAGS = -I m4 AUTOMAKE_OPTIONS = foreign SUBDIRS = include src +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libgpiod.pc + if WITH_TESTS SUBDIRS += tests diff --git a/configure.ac b/configure.ac index b4bf214..bb18868 100644 --- a/configure.ac +++ b/configure.ac @@ -120,7 +120,8 @@ then AC_MSG_NOTICE([doxygen not found - documentation cannot be generated]) fi -AC_CONFIG_FILES([Makefile +AC_CONFIG_FILES([libgpiod.pc + Makefile include/Makefile src/Makefile src/lib/Makefile diff --git a/libgpiod.pc.in b/libgpiod.pc.in new file mode 100644 index 0000000..48ff113 --- /dev/null +++ b/libgpiod.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libgpiod +Description: Library and tools for the Linux GPIO chardev +URL: @PACKAGE_URL@ +Version: @PACKAGE_VERSION@ +Libs: -L${libdir} -lgpiod +Cflags: -I${includedir} -- 2.30.2