summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile.am1
-rw-r--r--configure.ac9
-rw-r--r--lib/sqfs/Makemodule.am2
-rw-r--r--lib/sqfs/libsquashfs.pc.in14
5 files changed, 27 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index ff178be..fbca44d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,6 +21,7 @@ config.*
*.la
*.a
*~
+*.pc
gensquashfs
rdsquashfs
sqfs2tar
diff --git a/Makefile.am b/Makefile.am
index b6525c3..72e1302 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -10,6 +10,7 @@ bin_PROGRAMS =
lib_LTLIBRARIES =
dist_man1_MANS =
check_PROGRAMS =
+pkgconfig_DATA =
EXTRA_DIST = autogen.sh LICENSE-gpl.txt LICENSE-lgpl.txt README.md CHANGELOG.md
TESTS =
diff --git a/configure.ac b/configure.ac
index d62f5a0..015c1e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,6 +16,7 @@ m4_ifndef([PKG_PROG_PKG_CONFIG],
environment variable AL_OPTS="-I/other/macro/dir" before running
./autogen.sh or autoreconf again. Make sure pkg-config is installed.])])
PKG_PROG_PKG_CONFIG
+PKG_INSTALLDIR
UL_WARN_ADD([-Wall])
UL_WARN_ADD([-Wextra])
@@ -108,6 +109,13 @@ PKG_CHECK_MODULES(ZSTD, [libzstd],
[AM_CONDITIONAL([WITH_ZSTD], [true])],
[AM_CONDITIONAL([WITH_ZSTD], [false])])
+libsqfs_dep_mod=""
+AM_COND_IF([WITH_GZIP], [libsqfs_dep_mod="$libsqfs_dep_mod zlib"], [])
+AM_COND_IF([WITH_XZ], [libsqfs_dep_mod="$libsqfs_dep_mod liblzma >= 5.0.0"], [])
+AM_COND_IF([WITH_LZ4], [libsqfs_dep_mod="$libsqfs_dep_mod liblz4"], [])
+AM_COND_IF([WITH_ZSTD], [libsqfs_dep_mod="$libsqfs_dep_mod libzstd"], [])
+AC_SUBST([LIBSQFS_DEP_MOD], ["$libsqfs_dep_mod"])
+
AM_CONDITIONAL([WITH_LZO], [false])
if test "x$want_lzo" != "xno"; then
@@ -180,5 +188,6 @@ AC_CHECK_HEADERS([sys/xattr.h], [], [])
##### generate output #####
AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_FILES([lib/sqfs/libsquashfs.pc])
AC_OUTPUT([Makefile])
diff --git a/lib/sqfs/Makemodule.am b/lib/sqfs/Makemodule.am
index 72e3987..920172c 100644
--- a/lib/sqfs/Makemodule.am
+++ b/lib/sqfs/Makemodule.am
@@ -66,3 +66,5 @@ sqfsincludedir = $(includedir)/sqfs
sqfsinclude_HEADERS = $(LIBSQFS_HEARDS)
lib_LTLIBRARIES += libsquashfs.la
+
+pkgconfig_DATA += lib/sqfs/libsquashfs.pc
diff --git a/lib/sqfs/libsquashfs.pc.in b/lib/sqfs/libsquashfs.pc.in
new file mode 100644
index 0000000..6105248
--- /dev/null
+++ b/lib/sqfs/libsquashfs.pc.in
@@ -0,0 +1,14 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: @PACKAGE_NAME@
+Version: @PACKAGE_VERSION@
+Description: A library for working with SquashFS file systems.
+
+Cflags: -I${includedir}
+Libs: -L${libdir} -lsquashfs
+
+Requires.private: @LIBSQFS_DEP_MOD@
+Libs.private: @LZO_LIBS@ @PTHREAD_LIBS@