1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
From c150e7773764d100a21eb5ee4c586fe1edf4673b Mon Sep 17 00:00:00 2001
From: Guillem Jover <guillem@hadrons.org>
Date: Sat, 28 Nov 2020 22:10:00 +0100
Subject: [PATCH] build: Add a pkg-config file
The .pc are a better replacement for library detection and linking
usage, than libtool .la files or hardcoding the flags in the using
code.
---
configure.ac | 1 +
lib/Makefile.am | 5 +++++
lib/libsysfs.pc.in | 11 +++++++++++
3 files changed, 17 insertions(+)
create mode 100644 lib/libsysfs.pc.in
--- a/configure.ac
+++ b/configure.ac
@@ -50,6 +50,7 @@ AC_CHECK_FUNCS([bzero isascii memset str
AC_CONFIG_FILES([Makefile
lib/Makefile
+ lib/libsysfs.pc
cmd/Makefile
test/Makefile])
AC_OUTPUT
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,3 +1,8 @@
+EXTRA_DIST = libsysfs.pc.in
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libsysfs.pc
+
lib_LTLIBRARIES = libsysfs.la
libsysfs_la_SOURCES = sysfs_utils.c sysfs_attr.c sysfs_class.c dlist.c \
sysfs_device.c sysfs_driver.c sysfs_bus.c sysfs_module.c sysfs.h
--- /dev/null
+++ b/lib/libsysfs.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libsysfs
+Description: interface to Linux sysfs
+Version: @VERSION@
+URL: https://github.com/linux-ras/sysfsutils
+Libs: -L${libdir} -lsysfs
+Cflags: -I${includedir}
|