diff --git a/Makefile.am b/Makefile.am index a3e8f1e..b3676ee 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,6 +31,8 @@ thisinclude_HEADERS = \ include/rs_vand/rs_galois.h \ include/rs_vand/liberasurecode_rs_vand.h +pkgconfig_DATA = erasurecode-$(API_VERSION).pc + install-exec-hook: -(mkdir -p $(DESTDIR)$(includedir) && \ cd $(DESTDIR)$(includedir) && \ diff --git a/configure.ac b/configure.ac index a3d62b3..d468b77 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,18 @@ ################################################################################ # Standard Stuff ################################################################################ -AC_INIT(liberasurecode,1.1.0) + +# Release version +m4_define([package_version_major],[1]) +m4_define([package_version_minor],[1]) +m4_define([package_version_micro],[2]) + +# API version +m4_define([api_version],[1]) + +AC_INIT(liberasurecode, + [package_version_major.package_version_minor.package_version_micro]) + AC_GNU_SOURCE AC_PREREQ([2.61]) @@ -25,6 +36,14 @@ AC_PROG_CXX AC_PROG_INSTALL AC_PROG_MAKE_SET +PKG_PROG_PKG_CONFIG +PKG_INSTALLDIR + +AC_SUBST([PACKAGE_VERSION_MAJOR],package_version_major) +AC_SUBST([PACKAGE_VERSION_MINOR],package_version_minor) +AC_SUBST([PACKAGE_VERSION_MICRO],package_version_micro) +AC_SUBST([API_VERSION],api_version) + AX_EXT() ################################################################################ @@ -202,10 +221,13 @@ AC_CONFIG_FILES([\ test/Makefile \ doc/Makefile \ Makefile \ - erasurecode.pc \ Xorcode.pc ]) +AC_CONFIG_FILES([\ + erasurecode-$API_VERSION.pc:erasurecode.pc], [], + [API_VERSION='$API_VERSION']) + AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"]) AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/doxygen.cfg])]) diff --git a/erasurecode.pc.in b/erasurecode.pc.in index cc73848..29f8192 100644 --- a/erasurecode.pc.in +++ b/erasurecode.pc.in @@ -7,9 +7,9 @@ includedir=@includedir@ Name: erasurecode Description: C library with pluggable erasure code backends -Version: @ERASURECODE_VERSION@ +Version: @PACKAGE_VERSION@ Requires: Conflicts: -Libs: -L${libdir} @ERASURECODE_RLD_FLAGS@ -lerasurecode +Libs: -L${libdir} -lerasurecode Libs.private: @ERASURECODE_STATIC_LIBS@ -Cflags: -I${includedir}/ -I${includedir}/liberasurecode @ERASURECODE_CFLAGS@ +Cflags: -I${includedir}/ -I${includedir}/liberasurecode