summaryrefslogtreecommitdiffstats
path: root/lib/atf
diff options
context:
space:
mode:
authorjmmv <jmmv@FreeBSD.org>2014-01-12 21:56:26 +0000
committerjmmv <jmmv@FreeBSD.org>2014-01-12 21:56:26 +0000
commit50adf2d217f460c575055068c411e5932093fdf5 (patch)
treebb882f86a4a58b7ebdf62d45cd596cf86226ea0b /lib/atf
parent571f9839e43b0fc9c18d18e751aacf457c5cdefc (diff)
downloadFreeBSD-src-50adf2d217f460c575055068c411e5932093fdf5.zip
FreeBSD-src-50adf2d217f460c575055068c411e5932093fdf5.tar.gz
Generate and install pkg-config files for atf.
These files are required to get packages in ports to build against atf and also to get a couple of currently-failing tests to pass. I'm following the approach already used by the libusb pkg-config files installed by the system regarding the location and the install rules. MFC after: 5 days
Diffstat (limited to 'lib/atf')
-rw-r--r--lib/atf/common.mk19
-rw-r--r--lib/atf/libatf-c++/Makefile13
-rw-r--r--lib/atf/libatf-c/Makefile13
3 files changed, 45 insertions, 0 deletions
diff --git a/lib/atf/common.mk b/lib/atf/common.mk
new file mode 100644
index 0000000..6338207
--- /dev/null
+++ b/lib/atf/common.mk
@@ -0,0 +1,19 @@
+# $FreeBSD$
+#
+# Common Makefile code for all components of ATF.
+#
+
+.if !defined(ATF)
+.error "ATF must be defined and point to the contrib/atf directory"
+.endif
+
+# Depend on the atf-version target to generate a file that contains the
+# version number of the currently imported ATF release and that only
+# changes on new imports.
+atf-version: atf-version-real
+ @cmp -s atf-version atf-version-real \
+ || cp atf-version-real atf-version
+atf-version-real: .PHONY
+ @grep 'define VERSION' ${ATF}/bconfig.h \
+ | cut -d '"' -f 2 >atf-version-real
+CLEANFILES+= atf-version atf-version-real
diff --git a/lib/atf/libatf-c++/Makefile b/lib/atf/libatf-c++/Makefile
index f1d9dcf..ff05da7 100644
--- a/lib/atf/libatf-c++/Makefile
+++ b/lib/atf/libatf-c++/Makefile
@@ -76,8 +76,21 @@ INCSDIR_atf-c++.hpp= ${INCLUDEDIR}
MAN= atf-c++-api.3
+all: atf-c++.pc
+atf-c++.pc: atf-c++.pc.in atf-version
+ sed -e 's,__CXX__,${CXX},g' \
+ -e 's,__INCLUDEDIR__,${INCLUDEDIR},g' \
+ -e 's,__LIBDIR__,${LIBDIR},g' \
+ -e "s,__ATF_VERSION__,$$(cat atf-version),g" \
+ <${ATF}/atf-c++/atf-c++.pc.in >atf-c++.pc
+
+beforeinstall:
+ ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+ atf-c++.pc ${DESTDIR}${LIBDATADIR}/pkgconfig
+
.if ${MK_TESTS} != "no"
SUBDIR= tests
.endif
+.include "../common.mk"
.include <bsd.lib.mk>
diff --git a/lib/atf/libatf-c/Makefile b/lib/atf/libatf-c/Makefile
index b197958..829f8ff 100644
--- a/lib/atf/libatf-c/Makefile
+++ b/lib/atf/libatf-c/Makefile
@@ -74,8 +74,21 @@ INCSDIR_atf-c.h= ${INCLUDEDIR}
MAN= atf-c-api.3
+all: atf-c.pc
+atf-c.pc: atf-c.pc.in atf-version
+ sed -e 's,__CC__,${CC},g' \
+ -e 's,__INCLUDEDIR__,${INCLUDEDIR},g' \
+ -e 's,__LIBDIR__,${LIBDIR},g' \
+ -e "s,__ATF_VERSION__,$$(cat atf-version),g" \
+ <${ATF}/atf-c/atf-c.pc.in >atf-c.pc
+
+beforeinstall:
+ ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+ atf-c.pc ${DESTDIR}${LIBDATADIR}/pkgconfig
+
.if ${MK_TESTS} != "no"
SUBDIR= tests
.endif
+.include "../common.mk"
.include <bsd.lib.mk>
OpenPOWER on IntegriCloud