aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libgcrypt/cross-tools.patch
blob: ab3555bf82af024f13fd5cfd5f9a2765eb581daa (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
diff --git a/cipher/Makefile.am b/cipher/Makefile.am
index ea9014c..8aeedb7 100644
--- a/cipher/Makefile.am
+++ b/cipher/Makefile.am
@@ -19,6 +19,13 @@
 
 # Process this file with automake to produce Makefile.in
 
+# Building host tools for native triplet, or not at all
+CPPFLAGS_FOR_BUILD = $(CPPFLAGS)
+CFLAGS_FOR_BUILD = $(CFLAGS)
+LDFLAGS_FOR_BUILD = $(LDFLAGS)
+# Using native tools, either this build or from host triplet
+HOST_TOOLS_PREFIX ?= .
+
 # Need to include ../src in addition to top_srcdir because gcrypt.h is
 # a built header.
 AM_CPPFLAGS = -I../src -I$(top_srcdir)/src -I../mpi -I$(top_srcdir)/mpi
@@ -160,8 +167,8 @@ EXTRA_libcipher_la_SOURCES = \
 	blake2s-amd64-avx.S blake2s-amd64-avx512.S
 
 gost28147.lo: gost-sb.h
-gost-sb.h: gost-s-box$(EXEEXT_FOR_BUILD)
-	./gost-s-box$(EXEEXT_FOR_BUILD) $@
+gost-sb.h: $(HOST_TOOLS_PREFIX)/gost-s-box$(EXEEXT_FOR_BUILD)
+	$(HOST_TOOLS_PREFIX)/gost-s-box$(EXEEXT_FOR_BUILD) $@
 
 gost-s-box$(EXEEXT_FOR_BUILD): gost-s-box.c
 	$(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) \