Skip to content

Commit

Permalink
EXEC_PREFIX can be different from PREFIX
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyan4973 committed Jul 26, 2020
1 parent ea9e402 commit 74e58d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -379,11 +379,11 @@ prefix ?= /usr/local
PREFIX ?= $(prefix)
exec_prefix ?= $(PREFIX)
EXEC_PREFIX ?= $(exec_prefix)
libdir ?= $(exec_prefix)/lib
libdir ?= $(EXEC_PREFIX)/lib
LIBDIR ?= $(libdir)
includedir ?= $(PREFIX)/include
INCLUDEDIR ?= $(includedir)
bindir ?= $(exec_prefix)/bin
bindir ?= $(EXEC_PREFIX)/bin
BINDIR ?= $(bindir)
datarootdir ?= $(PREFIX)/share
mandir ?= $(datarootdir)/man
Expand Down Expand Up @@ -413,6 +413,7 @@ INSTALL_DATA ?= $(INSTALL) -m 644

PCLIBDIR ?= $(shell echo "$(LIBDIR)" | $(SED) -n $(SED_ERE_OPT) -e "s@^$(EXEC_PREFIX)(/|$$)@@p")
PCINCDIR ?= $(shell echo "$(INCLUDEDIR)" | $(SED) -n $(SED_ERE_OPT) -e "s@^$(PREFIX)(/|$$)@@p")
PCEXECDIR?= $(if $(filter $(PREFIX),$(EXEC_PREFIX)), $$\{prefix\}, $(EXEC_PREFIX))

ifeq (,$(PCLIBDIR))
# Additional prefix check is required, since the empty string is technically a
Expand All @@ -433,6 +434,7 @@ endif
libxxhash.pc: libxxhash.pc.in
@echo creating pkgconfig
$(Q)$(SED) $(SED_ERE_OPT) -e 's|@PREFIX@|$(PREFIX)|' \
-e 's|@EXECPREFIX@|$(PCEXECDIR)|' \
-e 's|@LIBDIR@|$(PCLIBDIR)|' \
-e 's|@INCLUDEDIR@|$(PCINCDIR)|' \
-e 's|@VERSION@|$(VERSION)|' \
Expand Down
2 changes: 1 addition & 1 deletion libxxhash.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# BSD 2-Clause License (https://www.opensource.org/licenses/bsd-license.php)

prefix=@PREFIX@
exec_prefix=${prefix}
exec_prefix=@EXECPREFIX@
includedir=${prefix}/@INCLUDEDIR@
libdir=${exec_prefix}/@LIBDIR@

Expand Down

0 comments on commit 74e58d4

Please sign in to comment.