:: commit 5828609f98a382d497cd111ca458245b071f5b75

Caleb Maclennan <caleb@alerque.com> — 2022-05-16 12:59

parents: 63ff5c8eb6

Add and distribute a pkg-config file (#20)

diff --git a/Makefile.am b/Makefile.am
index df6e3e0..21c63ea 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,6 +5,8 @@ AM_LDFLAGS = -avoid-version
 
 EXTRA_DIST = LICENSE PORTING.md README.md build-aux/git-version-gen
 
+pkgconfig_DATA = bzip3.pc
+
 include_HEADERS = include/libbz3.h
 noinst_HEADERS = include/cm.h \
 						 include/common.h \
diff --git a/bzip3.pc.in b/bzip3.pc.in
new file mode 100644
index 0000000..cd7fb0f
--- /dev/null
+++ b/bzip3.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: @PACKAGE@
+Description: A better and stronger spiritual successor to BZip2
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir} -lbz3
+Cflags: -I${includedir}
diff --git a/configure.ac b/configure.ac
index 196daaa..ca050bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,6 +13,9 @@ AC_PROG_CC([clang gcc icc])
 AC_PROG_AWK
 LT_INIT
 
+PKG_PROG_PKG_CONFIG
+PKG_INSTALLDIR
+
 AC_ARG_WITH([pthread],
 			  AS_HELP_STRING([--without-pthread], [Disable use of pthread library]))
 AM_CONDITIONAL([WITH_PTHREAD], [test x"$with_pthread" != xno])
@@ -52,5 +55,6 @@ AM_COND_IF([PASSED_CFLAGS], [
 ])
 
 AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([bzip3.pc])
 AC_ARG_PROGRAM
 AC_OUTPUT
tab: 248 wrap: offon