build: add pkg-config support
authorClemens Gruber <clemens.gruber@pqgruber.com>
Mon, 22 Jan 2018 16:12:12 +0000 (17:12 +0100)
committerBartosz Golaszewski <bartekgola@gmail.com>
Tue, 23 Jan 2018 10:12:29 +0000 (11:12 +0100)
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 <clemens.gruber@pqgruber.com>
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Makefile.am
configure.ac
libgpiod.pc.in [new file with mode: 0644]

index af7aecb8c29f41d44c67ded08604fa9395ec4761..dfa6d47d6d2fabb4bf4a980705cfde48aeef7443 100644 (file)
@@ -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
index b4bf2144cd1566d8f174ebe73c431aa51d8997e6..bb188686bacda8ad1f75c7edf85150d2bf3cb12c 100644 (file)
@@ -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 (file)
index 0000000..48ff113
--- /dev/null
@@ -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}