From adbdfee2a4f8923365e8afa1cb1ddc366a14833b Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Mon, 14 Aug 2023 11:33:03 +0200 Subject: [PATCH] Add pkg-config file --- Makefile | 20 ++++++++++++++++++++ stdthreads.pc.in | 11 +++++++++++ 2 files changed, 31 insertions(+) create mode 100644 stdthreads.pc.in diff --git a/Makefile b/Makefile index fab9f97..b681fb8 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ LIB= stdthreads +PACKAGE_VERSION?= 0.2 +PREFIX?= /usr HDR= threads.h SRCS= threads.h call_once.c cnd.c mtx.c thrd.c tss.c @@ -17,4 +19,22 @@ includes: echo $$j; \ eval "$$j"; \ +stdthreads.pc: stdthreads.pc.in + @sed -e 's#@prefix@#${PREFIX}#g' \ + -e 's#@exec_prefix@#$${prefix}#g' \ + -e 's#@libdir@#$${exec_prefix}/lib#g' \ + -e 's#@includedir@#$${prefix}/include#g' \ + -e 's#@PACKAGE_VERSION@#'${PACKAGE_VERSION}'#g' \ + < ${.CURDIR}/stdthreads.pc.in > $@ + +all: stdthreads.pc + +CLEANFILES+= stdthreads.pc + +install-pc: stdthreads.pc + ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 444 \ + stdthreads.pc ${LIBDIR}/pkgconfig + +realinstall: install-pc + .include diff --git a/stdthreads.pc.in b/stdthreads.pc.in new file mode 100644 index 0000000..78cdb85 --- /dev/null +++ b/stdthreads.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: stdthreads +Description: The C11 standard threads library +Version: @PACKAGE_VERSION@ + +Cflags: -I${includedir} +Libs: -L${libdir} -lstdthreads