Currently we regenerate the pkg-config files on every install. Following
patch allows to only regen the files when the library version changed.
Ok?
natano
Index: lib/libcrypto/Makefile
===================================================================
RCS file: /cvs/src/lib/libcrypto/Makefile,v
retrieving revision 1.2
diff -u -p -r1.2 Makefile
--- lib/libcrypto/Makefile 3 Sep 2016 12:42:46 -0000 1.2
+++ lib/libcrypto/Makefile 3 Sep 2016 21:13:00 -0000
@@ -438,12 +438,12 @@ distribution:
${INSTALL} ${INSTALL_COPY} -g ${BINGRP} -m 444 \
${.CURDIR}/x509v3.cnf ${DESTDIR}/etc/ssl/x509v3.cnf
-beforeinstall:
+${PC_FILES}: opensslv.h
/bin/sh ${.CURDIR}/generate_pkgconfig.sh -c ${.CURDIR} -o ${.OBJDIR}
-.for p in ${PC_FILES}
+
+beforeinstall: ${PC_FILES}
${INSTALL} ${INSTALL_COPY} -o root -g ${SHAREGRP} \
- -m ${SHAREMODE} ${.OBJDIR}/$p ${DESTDIR}/usr/lib/pkgconfig/
-.endfor
+ -m ${SHAREMODE} ${.OBJDIR}/${PC_FILES} ${DESTDIR}/usr/lib/pkgconfig/
.include <bsd.prog.mk>
.include <bsd.subdir.mk>
Index: lib/libexpat/Makefile
===================================================================
RCS file: /cvs/src/lib/libexpat/Makefile,v
retrieving revision 1.9
diff -u -p -r1.9 Makefile
--- lib/libexpat/Makefile 2 Aug 2012 13:38:38 -0000 1.9
+++ lib/libexpat/Makefile 3 Sep 2016 21:08:37 -0000
@@ -17,8 +17,10 @@ includes:
${INSTALL} ${INSTALL_COPY} -m 444 -o $(BINOWN) -g $(BINGRP) \
${.CURDIR}/lib/expat_external.h
${DESTDIR}/usr/include/expat_external.h
-beforeinstall:
+${PC_FILES}: lib/expat.h
/bin/sh ${.CURDIR}/generate_pkgconfig.sh -c ${.CURDIR} -o ${.OBJDIR}
+
+beforeinstall: ${PC_FILES}
${INSTALL} ${INSTALL_COPY} -o root -g ${SHAREGRP} \
-m ${SHAREMODE} ${.OBJDIR}/${PC_FILES} ${DESTDIR}/usr/lib/pkgconfig/
Index: lib/libfuse/Makefile
===================================================================
RCS file: /cvs/src/lib/libfuse/Makefile,v
retrieving revision 1.8
diff -u -p -r1.8 Makefile
--- lib/libfuse/Makefile 30 Mar 2016 06:38:42 -0000 1.8
+++ lib/libfuse/Makefile 3 Sep 2016 21:08:57 -0000
@@ -29,8 +29,10 @@ includes:
eval "$$j"; \
done
-beforeinstall:
+${PC_FILES}: fuse_private.h
/bin/sh ${.CURDIR}/generate_pkgconfig.sh -c ${.CURDIR} -o ${.OBJDIR}
+
+beforeinstall: ${PC_FILES}
${INSTALL} ${INSTALL_COPY} -o root -g ${SHAREGRP} \
-m ${SHAREMODE} ${.OBJDIR}/${PC_FILES} ${DESTDIR}/usr/lib/pkgconfig/
Index: lib/libssl/Makefile
===================================================================
RCS file: /cvs/src/lib/libssl/Makefile,v
retrieving revision 1.20
diff -u -p -r1.20 Makefile
--- lib/libssl/Makefile 3 Sep 2016 12:42:42 -0000 1.20
+++ lib/libssl/Makefile 3 Sep 2016 19:42:32 -0000
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.20 2016/09/03 12:42:42 beck Exp $
+# $OpenBSD: Makefile,v 1.20 2016/09/02 17:00:14 beck Exp $
SUBDIR= man
PC_FILES=openssl.pc libssl.pc
@@ -48,10 +48,12 @@ includes:
.include <bsd.lib.mk>
-beforeinstall:
+${PC_FILES}: ${.CURDIR}/../libcrypto/opensslv.h
+ /bin/sh ${.CURDIR}/generate_pkgconfig.sh -c ${.CURDIR} -o ${.OBJDIR}
+
+beforeinstall: ${PC_FILES}
nm -o lib${LIB}.a | egrep -w 'printf|fprintf' && \
(echo please fix stdio usage in this library; false) || true
- /bin/sh ${.CURDIR}/generate_pkgconfig.sh -c ${.CURDIR} -o ${.OBJDIR}
.for p in ${PC_FILES}
${INSTALL} ${INSTALL_COPY} -o root -g ${SHAREGRP} \
-m ${SHAREMODE} ${.OBJDIR}/$p ${DESTDIR}/usr/lib/pkgconfig/
Index: lib/libz/Makefile
===================================================================
RCS file: /cvs/src/lib/libz/Makefile,v
retrieving revision 1.18
diff -u -p -r1.18 Makefile
--- lib/libz/Makefile 30 Mar 2016 06:38:43 -0000 1.18
+++ lib/libz/Makefile 3 Sep 2016 21:09:33 -0000
@@ -19,8 +19,10 @@ includes:
eval "$$j"; \
done
-beforeinstall:
+${PC_FILES}: zlib.h
/bin/sh ${.CURDIR}/generate_pkgconfig.sh -c ${.CURDIR} -o ${.OBJDIR}
+
+beforeinstall: ${PC_FILES}
${INSTALL} ${INSTALL_COPY} -o root -g ${SHAREGRP} \
-m ${SHAREMODE} ${.OBJDIR}/${PC_FILES} ${DESTDIR}/usr/lib/pkgconfig/