aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2020-05-18 16:33:32 +0000
committerXin LI <delphij@FreeBSD.org>2020-05-18 16:33:32 +0000
commitc0c4afa7536b73938a0c70f75aa9534ce4de4dbb (patch)
treef4d9e096e682b802265179d651d3d82fe48009d9
parent7cfe04239d86856773f86b2ec712e0982ce23ac8 (diff)
downloadsrc-c0c4afa7536b73938a0c70f75aa9534ce4de4dbb.tar.gz
src-c0c4afa7536b73938a0c70f75aa9534ce4de4dbb.zip
MFS r361069: MFC r360952: Generate zlib.pc from source.
Approved by: re (gjb)
Notes
Notes: svn path=/releng/11.4/; revision=361219
-rw-r--r--lib/libz/Makefile11
-rw-r--r--lib/libz/zlib.pc14
2 files changed, 11 insertions, 14 deletions
diff --git a/lib/libz/Makefile b/lib/libz/Makefile
index cffe6d06f6fe..773bbda87b62 100644
--- a/lib/libz/Makefile
+++ b/lib/libz/Makefile
@@ -52,6 +52,17 @@ INCS= zconf.h zlib.h
.PATH: ${ZLIBSRC}/test
+ZLIB_VERSION!= sed -n '/define.*ZLIB_VERSION/{s,[^0-9.],,gp;q;}' ${ZLIBSRC}/zlib.h
+
+zlib.pc: zlib.pc.in
+ sed -e 's,@prefix@,/usr,g ; \
+ s,@exec_prefix@,$${prefix},g ; \
+ s,@libdir@,$${exec_prefix}/lib,g ; \
+ s,@sharedlibdir@,$${libdir},g ; \
+ s,@includedir@,$${prefix}/include,g ; \
+ s,@VERSION@,${ZLIB_VERSION},g ;' \
+ ${.ALLSRC} > ${.TARGET}
+
minigzip: all minigzip.o
$(CC) -o minigzip minigzip.o -L. -lz
diff --git a/lib/libz/zlib.pc b/lib/libz/zlib.pc
deleted file mode 100644
index b9ad734e1df5..000000000000
--- a/lib/libz/zlib.pc
+++ /dev/null
@@ -1,14 +0,0 @@
-# $FreeBSD$
-prefix=/usr
-exec_prefix=${prefix}
-libdir=${exec_prefix}/lib
-sharedlibdir=${libdir}
-includedir=${prefix}/include
-
-Name: zlib
-Description: zlib compression library
-Version: 1.2.10
-
-Requires:
-Libs: -L${libdir} -L${sharedlibdir} -lz
-Cflags: -I${includedir}