Fix cross-compiling for mingw64
This commit is contained in:
@@ -38,6 +38,10 @@
|
||||
|
||||
#include <check.h>
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#define dprintf(fd, ...) fprintf(stdout, __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
int destruction_confirmed(void);
|
||||
|
||||
// only defined in libcheck 0.11+ (linux distros still shipping 0.10)
|
||||
|
||||
+9
-1
@@ -27,6 +27,7 @@
|
||||
|
||||
PACKAGE=yubico-piv-tool
|
||||
OPENSSLVERSION=1.0.2l
|
||||
CHECKVERSION=0.12.0
|
||||
|
||||
all: usage 32bit 64bit
|
||||
|
||||
@@ -55,11 +56,18 @@ doit:
|
||||
rm $(PWD)/tmp$(ARCH)/root/bin/c_rehash && \
|
||||
rm -rf $(PWD)/tmp$(ARCH)/root/lib/engines/ && \
|
||||
cd .. && \
|
||||
cp ../check-$(CHECKVERSION).tar.gz . || \
|
||||
curl -L -O "https://github.com/libcheck/check/releases/download/$(CHECKVERSION)/check-$(CHECKVERSION).tar.gz" && \
|
||||
tar xfa check-$(CHECKVERSION).tar.gz && \
|
||||
cd check-$(CHECKVERSION) && \
|
||||
CC=$(HOST)-gcc PKG_CONFIG_PATH=$(PWD)/tmp$(ARCH)/root/lib/pkgconfig ./configure --host=$(HOST) --build=x86_64-unknown-linux-gnu --prefix=$(PWD)/tmp$(ARCH)/root --disable-subunit --enable-static --disable-shared && \
|
||||
make all install && \
|
||||
cd .. && \
|
||||
cp ../$(PACKAGE)-$(VERSION).tar.gz . && \
|
||||
tar xfa $(PACKAGE)-$(VERSION).tar.gz && \
|
||||
cd $(PACKAGE)-$(VERSION)/ && \
|
||||
CC=$(HOST)-gcc PKG_CONFIG_PATH=$(PWD)/tmp$(ARCH)/root/lib/pkgconfig lt_cv_deplibs_check_method=pass_all ./configure --host=$(HOST) --build=x86_64-unknown-linux-gnu --prefix=$(PWD)/tmp$(ARCH)/root LDFLAGS=-L$(PWD)/tmp$(ARCH)/root/lib CPPFLAGS=-I$(PWD)/tmp$(ARCH)/root/include && \
|
||||
make install $(CHECK) && \
|
||||
WINEPATH="/usr/$(HOST)/lib/" make install $(CHECK) && \
|
||||
rm $(PWD)/tmp$(ARCH)/root/lib/*.la && \
|
||||
rm -rf $(PWD)/tmp$(ARCH)/root/lib/pkgconfig/ && \
|
||||
cp COPYING $(PWD)/tmp$(ARCH)/root/licenses/$(PACKAGE).txt && \
|
||||
|
||||
@@ -42,6 +42,10 @@
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wpointer-sign"
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#define dprintf(fd, ...) fprintf(stdout, __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
void dump_hex(const unsigned char *buf, unsigned int len, FILE *output, int space) {
|
||||
unsigned int i;
|
||||
for (i = 0; i < len; i++) {
|
||||
|
||||
Reference in New Issue
Block a user