From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-b.sr.ht (mail-b.sr.ht [173.195.146.151]) by sourceware.org (Postfix) with ESMTPS id C572E385AE5A for ; Thu, 9 Jun 2022 05:50:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C572E385AE5A Received: from git.sr.ht (unknown [173.195.146.142]) by mail-b.sr.ht (Postfix) with ESMTPSA id 7D00E11EFF2; Thu, 9 Jun 2022 05:50:50 +0000 (UTC) From: ~eschwartz Date: Fri, 03 Jun 2022 01:09:12 -0400 Subject: [PATCH bzip2 6/6] install a pkg-config file with instructions for linking to libbz2 MIME-Version: 1.0 Message-ID: <165475384722.17277.18269615533597437835-5@git.sr.ht> X-Mailer: git.sr.ht Reply-to: ~eschwartz In-Reply-To: <165475384722.17277.18269615533597437835-0@git.sr.ht> To: bzip2-devel@sourceware.org Cc: eschwartz93@gmail.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-10.4 required=5.0 tests=BAYES_00, DATE_IN_PAST_96_XX, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_NUMSUBJECT, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: bzip2-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Bzip2-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2022 05:50:58 -0000 From: Eli Schwartz A pkg-config file is necessary in order to robustly communicate across build systems that bz2 is installed, *where* it is installed, and the correct CFLAGS / LDFLAGS to use in order to compile and link against it. --- Makefile.in | 3 +++ bzip2.pc.in | 11 +++++++++++ configure.ac | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 bzip2.pc.in diff --git a/Makefile.in b/Makefile.in index dff9422..86f1bdc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -78,6 +78,7 @@ test: bzip2 install: bzip2 bzip2recover if ( test ! -d $(DESTDIR)$(bindir) ) ; then mkdir -p $(DESTDIR)$(bindir) ; = fi if ( test ! -d $(DESTDIR)$(libdir) ) ; then mkdir -p $(DESTDIR)$(libdir) ; = fi + if ( test ! -d $(DESTDIR)$(libdir)/pkgconfig ) ; then mkdir -p $(DESTDIR)$(= libdir)/pkgconfig ; fi if ( test ! -d $(DESTDIR)$(mandir) ) ; then mkdir -p $(DESTDIR)$(mandir) ; = fi if ( test ! -d $(DESTDIR)$(mandir)/man1 ) ; then mkdir -p $(DESTDIR)$(mandi= r)/man1 ; fi if ( test ! -d $(DESTDIR)$(includedir) ) ; then mkdir -p $(DESTDIR)$(includ= edir) ; fi @@ -116,6 +117,7 @@ install: bzip2 bzip2recover echo ".so man1/bzgrep.1" > $(DESTDIR)$(mandir)/man1/bzfgrep.1 echo ".so man1/bzmore.1" > $(DESTDIR)$(mandir)/man1/bzless.1 echo ".so man1/bzdiff.1" > $(DESTDIR)$(mandir)/man1/bzcmp.1 + cp -f bzip2.pc $(DESTDIR)$(libdir)/pkgconfig/bzip2.pc =20 clean: rm -f *.o libbz2.a bzip2 bzip2recover \ @@ -165,6 +167,7 @@ dist: check manual $(DISTNAME)/configure.ac \ $(DISTNAME)/configure \ $(DISTNAME)/Makefile.in \ + $(DISTNAME)/bzip2.pc.in \ $(DISTNAME)/LICENSE \ $(DISTNAME)/bzip2.1 \ $(DISTNAME)/bzip2.1.preformatted \ diff --git a/bzip2.pc.in b/bzip2.pc.in new file mode 100644 index 0000000..11c14e1 --- /dev/null +++ b/bzip2.pc.in @@ -0,0 +1,11 @@ +prefix=3D@prefix@ +exec_prefix=3D@exec_prefix@ +includedir=3D@includedir@ +libdir=3D@libdir@ + +Name: bzip2 +URL: https://sourceware.org/bzip2/ +Description: A file compression library +Version: @PACKAGE_VERSION@ +Libs: -L${libdir} -lbz2 +Cflags: -I${includedir} diff --git a/configure.ac b/configure.ac index 8f26062..5936b5c 100644 --- a/configure.ac +++ b/configure.ac @@ -5,6 +5,6 @@ AC_PROG_CC AC_CHECK_TOOL([AR], [ar]) AC_CHECK_TOOL([RANLIB], [ranlib]) =20 -AC_CONFIG_FILES([Makefile Makefile-libbz2_so]) +AC_CONFIG_FILES([Makefile Makefile-libbz2_so bzip2.pc]) =20 AC_OUTPUT --=20 2.34.2