shithub: libmujs

Download patch

ref: 9f40dfb0326d6fc6fe8319dae26fd032afc2906d
parent: 5f556004a271f9c0a6cc7589d2f77d6511429bd7
author: Tor Andersson <tor.andersson@artifex.com>
date: Tue Feb 12 07:16:18 EST 2019

Take DESTDIR into account when creating pkg-config file.

Also only create the file when installing.

--- a/Makefile
+++ b/Makefile
@@ -50,7 +50,7 @@
 HDRS := $(wildcard js*.h mujs.h utf.h regexp.h)
 
 default: static
-static: $(OUT)/mujs-pp $(OUT)/mujs $(OUT)/libmujs.a $(OUT)/mujs.pc
+static: $(OUT)/mujs-pp $(OUT)/mujs $(OUT)/libmujs.a
 shared: static $(OUT)/libmujs.so
 
 astnames.h: jsparse.h
@@ -88,19 +88,20 @@
 	@ mkdir -p $(dir $@)
 	$(CC) $(LDFLAGS) -o $@ $^ -lm
 
+.PHONY: $(OUT)/mujs.pc
 $(OUT)/mujs.pc:
 	@ echo Creating $@
 	@ echo > $@ Name: mujs
 	@ echo >> $@ Description: MuJS embeddable Javascript interpreter
 	@ echo >> $@ Version: $(VERSION)
-	@ echo >> $@ Cflags: -I$(incdir)
-	@ echo >> $@ Libs: -L$(libdir) -lmujs
+	@ echo >> $@ Cflags: -I$(DESTDIR)$(incdir)
+	@ echo >> $@ Libs: -L$(DESTDIR)$(libdir) -lmujs
 	@ echo >> $@ Libs.private: -lm
 
 watch:
 	@ while ! inotifywait -q -e modify $(SRCS) $(HDRS) ; do time -p $(MAKE) ; done
 
-install-common: release
+install-common: release $(OUT)/mujs.pc
 	install -d $(DESTDIR)$(incdir)
 	install -d $(DESTDIR)$(libdir)
 	install -d $(DESTDIR)$(libdir)/pkgconfig