summaryrefslogtreecommitdiff
blob: 46ec7ca619eb080450c93d9b5dc3775aff4607f9 (plain)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
From ac62674fa16b5a086f02dd208667ba65e22ec09d Mon Sep 17 00:00:00 2001
From: Paul Wankadia <junyer@google.com>
Date: Mon, 9 May 2016 14:42:37 +1000
Subject: [PATCH] Plumb more variables from Makefile to re2.pc.

Change-Id: I35509c273b0bd90242db127121c71be1f628c06f
Reviewed-on: https://code-review.googlesource.com/4710
Reviewed-by: Paul Wankadia <junyer@google.com>
---
 Makefile | 8 +++++---
 re2.pc   | 6 +++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index d0e2090..411e551 100644
--- a/Makefile
+++ b/Makefile
@@ -28,11 +28,9 @@ NMFLAGS?=-p
 # http://www.gnu.org/prep/standards/standards.html
 prefix=/usr/local
 exec_prefix=$(prefix)
-bindir=$(exec_prefix)/bin
 includedir=$(prefix)/include
 libdir=$(exec_prefix)/lib
 INSTALL=install
-INSTALL_PROGRAM=$(INSTALL)
 INSTALL_DATA=$(INSTALL) -m 644
 
 # ABI version
@@ -273,7 +271,11 @@ install: obj/libre2.a obj/so/libre2.$(SOEXT)
 	$(INSTALL) obj/so/libre2.$(SOEXT) $(DESTDIR)$(libdir)/libre2.$(SOEXTVER00)
 	ln -sf libre2.$(SOEXTVER00) $(DESTDIR)$(libdir)/libre2.$(SOEXTVER)
 	ln -sf libre2.$(SOEXTVER00) $(DESTDIR)$(libdir)/libre2.$(SOEXT)
-	sed -e "s#@prefix@#${prefix}#" re2.pc >$(DESTDIR)$(libdir)/pkgconfig/re2.pc
+	$(INSTALL_DATA) re2.pc $(DESTDIR)$(libdir)/pkgconfig/re2.pc
+	sed -i \
+	  -e "s#@prefix@#${prefix}#" -e "s#@exec_prefix@#${exec_prefix}#" \
+	  -e "s#@includedir@#${includedir}#" -e "s#@libdir@#${libdir}#" \
+	  $(DESTDIR)$(libdir)/pkgconfig/re2.pc
 
 testinstall: static-testinstall shared-testinstall
 	@echo
diff --git a/re2.pc b/re2.pc
index 91ba181..d66cf51 100644
--- a/re2.pc
+++ b/re2.pc
@@ -1,7 +1,7 @@
 prefix=@prefix@
-exec_prefix=${prefix}
-includedir=${prefix}/include
-libdir=${exec_prefix}/lib
+exec_prefix=@exec_prefix@
+includedir=@includedir@
+libdir=@libdir@
 
 Name: re2
 Description: RE2 is a fast, safe, thread-friendly regular expression engine.