From a4a8b288a5ce92cace12f83fff2d527db263243a Mon Sep 17 00:00:00 2001 From: Ahmet Artu Yildirim Date: Sun, 25 Dec 2022 01:59:56 -0800 Subject: [PATCH] Generate pkg-config file --- .gitignore | 1 + AUTHORS | 2 +- ChangeLog | 1 + build-debug.sh | 3 --- build-release.sh | 3 --- configure.ac | 6 ++++++ libprogbuf.pc.in | 10 ++++++++++ scripts/clean.sh | 2 +- src/Makefile.am | 6 ++++-- 9 files changed, 24 insertions(+), 10 deletions(-) delete mode 100755 build-debug.sh delete mode 100755 build-release.sh create mode 100644 libprogbuf.pc.in diff --git a/.gitignore b/.gitignore index dbba428..c9f7431 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ src/check_progbuf.log src/check_progbuf.trs src/progbuf.lo src/test-suite.log +src/libprogbuf.pc test-driver stamp-h1 .vscode/ diff --git a/AUTHORS b/AUTHORS index e8431ea..6ae4afa 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1 +1 @@ -Ahmet Artu Yildirim +- Ahmet Artu Yildirim (ahmet@artulab.com) diff --git a/ChangeLog b/ChangeLog index 9f72435..509a4aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ +- (2022-12-25) Generate pkg-config file - (2022-12-24) Add a script to generate a ChangeLog file - (2022-12-23) Add getter and setter to support nested message - (2022-12-23) Add a unit test for raw getter and setter functions diff --git a/build-debug.sh b/build-debug.sh deleted file mode 100755 index e70a968..0000000 --- a/build-debug.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -./configure CPPFLAGS=-DDEBUG CFLAGS="-g -O0" && make diff --git a/build-release.sh b/build-release.sh deleted file mode 100755 index 5bb11df..0000000 --- a/build-release.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -./configure && make diff --git a/configure.ac b/configure.ac index a29fb11..2f9fde5 100644 --- a/configure.ac +++ b/configure.ac @@ -3,11 +3,17 @@ AM_INIT_AUTOMAKE([-Wall -Werror gnu]) AC_PROG_CC AM_PROG_AR LT_INIT + +PKG_PROG_PKG_CONFIG +PKG_INSTALLDIR + PKG_CHECK_MODULES([CHECK], [check]) + AC_CONFIG_MACRO_DIRS([m4]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([ Makefile src/Makefile + src/libprogbuf.pc:libprogbuf.pc.in ]) AC_OUTPUT diff --git a/libprogbuf.pc.in b/libprogbuf.pc.in new file mode 100644 index 0000000..1ddb4ae --- /dev/null +++ b/libprogbuf.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libprogbuf +Description: Library to serialize structured data in a programmatic way. +Version: 1.0.0 +Libs: -L${libdir} -lprogbuf +Cflags: -I${includedir}/libprogbuf diff --git a/scripts/clean.sh b/scripts/clean.sh index 18ff4c4..66866b6 100755 --- a/scripts/clean.sh +++ b/scripts/clean.sh @@ -1,3 +1,3 @@ #!/bin/sh -rm -rf aclocal.m4 config.sub configure depcomp m4 ar-lib compile config.guess config.h install-sh test-driver Makefile Makefile.in autom4te.cache config.h.in ltmain.sh missing libtool config.status config.log INSTALL stamp-h1 src/Makefile.in src/.libs src/.deps src/*.o src/Makefile src/libprogbuf.la src/progbuf.lo src/check_progbuf build config.h.in~ +rm -rf aclocal.m4 config.sub configure depcomp m4 ar-lib compile config.guess config.h install-sh test-driver Makefile Makefile.in autom4te.cache config.h.in ltmain.sh missing libtool config.status config.log INSTALL stamp-h1 src/Makefile.in src/.libs src/.deps src/*.o src/Makefile src/libprogbuf.la src/progbuf.lo src/check_progbuf src/test-suite.log src/libprogbuf_la-progbuf.lo src/check_progbuf.log src/check_progbuf.trs src/libprogbuf.pc build config.h.in~ diff --git a/src/Makefile.am b/src/Makefile.am index 9fe2ea1..fc65b31 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,8 +1,10 @@ lib_LTLIBRARIES = libprogbuf.la libprogbuf_la_SOURCES = progbuf.c -libprogbuf_la_LDFLAGS = -version-info 0:1:0 +libprogbuf_la_LDFLAGS = -version-info 1:0:0 libprogbuf_la_CFLAGS = -Wall -Wextra -Wpedantic -Werror -include_HEADERS = progbuf.h + +pkginclude_HEADERS = progbuf.h +pkgconfig_DATA = libprogbuf.pc noinst_PROGRAMS = check_progbuf TESTS = check_progbuf -- 2.20.1