Preserve the variables unexpanded in the pkg-config file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
diff --git a/Makefile b/Makefile
index 6ba703b..df8e4fe 100644
--- a/Makefile
+++ b/Makefile
@@ -82,13 +82,13 @@ CFLAGS ?= -g -Wall -Wextra -Wno-unused-variable
MK_CFLAGS := -Iinclude/ -include bsd/bsd.h -D_GNU_SOURCE -D__REENTRANT
-prefix := /usr
-exec_prefix :=
-libdir := ${exec_prefix}/lib
-usrlibdir := ${prefix}/lib
-includedir := ${prefix}/include
-pkgconfigdir := ${usrlibdir}/pkgconfig
-mandir := ${prefix}/share/man
+prefix = /usr
+exec_prefix =
+libdir = ${exec_prefix}/lib
+usrlibdir = ${prefix}/lib
+includedir = ${prefix}/include
+pkgconfigdir = ${usrlibdir}/pkgconfig
+mandir = ${prefix}/share/man
.PHONY: libs
libs: $(LIB_STATIC) $(LIB_SHARED_SO) $(LIB_PKGCONFIG)
@@ -108,13 +108,12 @@ man/md5.3bsd: man/mdX.3
src/hash/md5hl.c: src/hash/helper.c
sed -e 's:hashinc:bsd/md5.h:g' -e 's:HASH:MD5:g' $< > $@
-# FIXME: the variables should be preserved unexpanded in the .pc file
$(LIB_PKGCONFIG): $(LIB_PKGCONFIG).in
sed -e 's:@VERSION@:$(LIB_VERSION):' \
- -e 's:@prefix@:$(prefix):' \
- -e 's:@exec_prefix@:$(exec_prefix):' \
- -e 's:@libdir@:$(libdir):' \
- -e 's:@includedir@:$(includedir):' \
+ -e 's:@prefix@:$(value prefix):' \
+ -e 's:@exec_prefix@:$(value exec_prefix):' \
+ -e 's:@libdir@:$(value libdir):' \
+ -e 's:@includedir@:$(value includedir):' \
$< > $@
$(LIB_STATIC): $(LIB_STATIC_OBJS)