Hi,

Here a little patch proposal to build the example.

Kind regards.

Thanks in advance.
From e9be79654d9b1f7b63e3f13b9f61b5ad4543cdf3 Mon Sep 17 00:00:00 2001
From: David Carlier <devne...@gmail.com>
Date: Wed, 27 Dec 2017 13:19:14 +0000
Subject: [PATCH] BUILD/SMALL: contrib : spoa example

Change to the build to be able to build it in systems
different than Linux.
---
 contrib/spoa_example/Makefile | 8 +++++---
 contrib/spoa_example/spoa.c   | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/contrib/spoa_example/Makefile b/contrib/spoa_example/Makefile
index c44c2b879..71ba6107a 100644
--- a/contrib/spoa_example/Makefile
+++ b/contrib/spoa_example/Makefile
@@ -2,12 +2,14 @@ DESTDIR =
 PREFIX  = /usr/local
 BINDIR  = $(PREFIX)/bin
 
-CC = gcc
+CC ?= gcc
 LD = $(CC)
 
+EVENTLIB ?= event
+
 CFLAGS  = -g -O2 -Wall -Werror -pthread
-INCS += -I../../ebtree -I./include
-LIBS = -lpthread -levent -levent_pthreads
+INCS += -I../../ebtree -I./include -I$(PREFIX)/include
+LIBS = -lpthread -l$(EVENTLIB) -levent_pthreads -L$(PREFIX)/lib
 
 OBJS = spoa.o
 
diff --git a/contrib/spoa_example/spoa.c b/contrib/spoa_example/spoa.c
index d8defd192..760ad9210 100644
--- a/contrib/spoa_example/spoa.c
+++ b/contrib/spoa_example/spoa.c
@@ -53,7 +53,7 @@
                                                                         \
 		gettimeofday(&now, NULL);				\
 		fprintf(stderr, "%ld.%06ld [%02d] " fmt "\n",		\
-			now.tv_sec, now.tv_usec, (worker)->id, ##args);	\
+			(long int)now.tv_sec, now.tv_usec, (worker)->id, ##args);	\
 	} while (0)
 
 #define DEBUG(x...)				\
-- 
2.15.1

Reply via email to