Bugfix: example: Deal with build and portability issues

This commit is contained in:
Luke Dashjr
2016-08-13 07:23:14 +00:00
parent 2d822c6bbc
commit 130cfbdb3e
2 changed files with 8 additions and 3 deletions

View File

@@ -54,10 +54,10 @@ dist_noinst_DATA = \
if CAN_COMPILE_EXAMPLE
EXTRA_PROGRAMS = example
example_SOURCES = example.c
example_LDADD = libblkmaker-$(LIBBLKMAKER_API_VERSION).la libblkmaker_jansson-$(LIBBLKMAKER_API_VERSION).la $(LIBGCRYPT_LIBS)
example_CFLAGS = $(LIBGCRYPT_CFLAGS)
example_CFLAGS = $(libbase58_CFLAGS) $(JANSSON_CFLAGS) $(LIBGCRYPT_CFLAGS)
example_LDADD = $(libbase58_LIBS) libblkmaker-@LIBBLKMAKER_API_VERSION@.la libblkmaker_jansson-@LIBBLKMAKER_API_VERSION@.la $(JANSSON_LIBS) $(LIBGCRYPT_LIBS)
else
example:
@echo "libgcrypt is required to build the example, but was not found"
@echo "libgcrypt is required to build the example, but was not found"
.PHONY: example
endif

View File

@@ -9,7 +9,11 @@
#include <inttypes.h>
#include <stdint.h>
#ifndef WIN32
#include <arpa/inet.h>
#else
#include <winsock2.h>
#endif
#include <gcrypt.h>
#include <libbase58.h>
@@ -127,4 +131,5 @@ int main(int argc, char**argv) {
send_json(req);
}
blktmpl_free(tmpl);
return 0;
}