File: fix-cross-build.patch

package info (click to toggle)
xob 0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 864 kB
  • sloc: ansic: 972; makefile: 62
file content (25 lines) | stat: -rw-r--r-- 912 bytes parent folder | download
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
Subject: Allow overwriting the path to pkg-config
Author: Helmut Grohne <helmut@subdivi.de>
Forwarded: https://github.com/florentc/xob/pull/52
Bug-Debian: https://bugs.debian.org/1120810

During cross-compilation, it may be necessary to use a different pkg-config
than the one for the build architecture. Using a Makefile variable allows
substituting the pkg-config with the one from the host architecture.

diff --git a/Makefile b/Makefile
index 728f74d..31f4011 100644
--- a/Makefile
+++ b/Makefile
@@ -14,8 +14,9 @@ else
 endif
 
 OBJECTS = $(SOURCES:.c=.o)
-CFLAGS  += $(shell pkg-config --cflags $(LIBS)) -std=c99 -Wall -Wextra -pedantic
-LDFLAGS += $(shell pkg-config --libs $(LIBS))
+PKG_CONFIG ?= pkg-config
+CFLAGS  += $(shell $(PKG_CONFIG) --cflags $(LIBS)) -std=c99 -Wall -Wextra -pedantic
+LDFLAGS += $(shell $(PKG_CONFIG) --libs $(LIBS))
 
 INSTALL         ?= install
 INSTALL_PROGRAM ?= $(INSTALL)