Add a pkgconfig file

Providing a pkg-config file makes is easy for 3rd party applications
to link against the libzfs libraries.  It also allows the libzfs
developers to modify the list of required libraries and cflags
without breaking existing applications.

The following example illustrates how pkg-config can be used:

cc `pkg-config --cflags --libs libzfs` -o myapp myapp.c

/*
 * myapp.c
 */
void main()
{
	libzfs_handle_t *hdl;

	hdl = libzfs_init();
	if (hdl)
		libzfs_fini(hdl);
}

Signed-off-by: Turbo Fredriksson <turbo@bayour.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes: #585
This commit is contained in:
Turbo Fredriksson
2014-06-07 01:23:22 +02:00
committed by Brian Behlendorf
parent 9ad656b2d0
commit c3f8dc2a48
6 changed files with 33 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
/libzfs.pc
/libzfs_core.pc
+4
View File
@@ -1,5 +1,9 @@
include $(top_srcdir)/config/Rules.am
libzfs_pcdir = $(datarootdir)/pkgconfig
libzfs_pc_DATA = $(top_srcdir)/lib/libzfs/libzfs.pc $(top_srcdir)/lib/libzfs/libzfs_core.pc
EXTRA_DIST = $(top_srcdir)/lib/libzfs/libzfs.pc $(top_srcdir)/lib/libzfs/libzfs_core.pc
DEFAULT_INCLUDES += \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib/libspl/include
+12
View File
@@ -0,0 +1,12 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: libzfs
Description: LibZFS library
Version: @VERSION@
URL: http://zfsonlinux.org
Requires: libzfs_core
Cflags: -I${includedir}/libzfs -I${includedir}/libspl
Libs: -L${libdir} -lzfs
+11
View File
@@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: libzfs_core
Description: LibZFS core library
Version: @VERSION@
URL: http://zfsonlinux.org
Cflags: -I${includedir}/libzfs -I${includedir}/libspl
Libs: -L${libdir} -lzfs_core