hc
2023-02-14 0cc9b7c44253c93447ddf73e206fbdbb3d9f16b1
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
From 6180ca780e3a792bd632d8899c2b35991822c93d Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Date: Mon, 8 Feb 2016 23:32:57 +0100
Subject: [PATCH] Makefile: allow passing a custom path to libgcrypt-config
 
The libgcrypt-config program may not be in the PATH, so this patch
adjusts the Makefile so that it understands a LIBGCRYPT_CONFIG
variable. By default, its value is libgcrypt-config so that the
behavior is unchanged.
 
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 
 Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
 
diff --git a/Makefile b/Makefile
index ea2cd41..649ddfb 100644
--- a/Makefile
+++ b/Makefile
@@ -61,13 +61,14 @@ BINSRCS = $(addsuffix .c,$(BINS))
 VERSION ?= $(shell sh mk-version)
 RELEASE_VERSION := $(shell cat VERSION)
 
+LIBGCRYPT_CONFIG ?= libgcrypt-config
 CC ?= gcc
 CFLAGS ?= -O3 -g
 override CFLAGS += -W -Wall -Wmissing-declarations -Wwrite-strings
-override CFLAGS +=  $(shell libgcrypt-config --cflags) $(CRYPTO_CFLAGS)
+override CFLAGS +=  $(shell $(LIBGCRYPT_CONFIG) --cflags) $(CRYPTO_CFLAGS)
 override CPPFLAGS += -DVERSION=\"$(VERSION)\"
 LDFLAGS ?= -g
-LIBS += $(shell libgcrypt-config --libs) $(CRYPTO_LDADD)
+LIBS += $(shell $(LIBGCRYPT_CONFIG) --libs) $(CRYPTO_LDADD)
 
 ifeq ($(shell uname -s), SunOS)
 LIBS += -lnsl -lresolv -lsocket
-- 
2.6.4