diff --git a/configure.ac b/configure.ac index 9c9f38cc1..155060ad1 100644 --- a/configure.ac +++ b/configure.ac @@ -181,7 +181,8 @@ AC_CONFIG_FILES([Makefile contrib/Makefile src/Makefile src/hashkit/Makefile - src/proto/Makefile]) + src/proto/Makefile + src/event/Makefile]) # Generate the "configure" script AC_OUTPUT diff --git a/src/Makefile.am b/src/Makefile.am index 210a6d53b..f755ce21a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -3,6 +3,7 @@ MAINTAINERCLEANFILES = Makefile.in AM_CPPFLAGS = -D_GNU_SOURCE -D_XOPEN_SOURCE AM_CPPFLAGS += -I $(top_srcdir)/src/hashkit AM_CPPFLAGS += -I $(top_srcdir)/src/proto +AM_CPPFLAGS += -I $(top_srcdir)/src/event AM_CPPFLAGS += -I $(top_srcdir)/contrib/yaml-0.1.4/include AM_CFLAGS = -Wall -Wshadow @@ -15,7 +16,7 @@ AM_CFLAGS += -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissin AM_LDFLAGS = -lm -lpthread -rdynamic -SUBDIRS = hashkit proto +SUBDIRS = hashkit proto event bin_PROGRAMS = nutcracker @@ -29,7 +30,6 @@ nutcracker_SOURCES = \ nc_request.c \ nc_response.c \ nc_mbuf.c nc_mbuf.h \ - nc_epoll.c nc_kqueue.c nc_event.h \ nc_conf.c nc_conf.h \ nc_stats.c nc_stats.h \ nc_signal.c nc_signal.h \ @@ -43,4 +43,5 @@ nutcracker_SOURCES = \ nutcracker_LDADD = $(top_builddir)/src/hashkit/libhashkit.a nutcracker_LDADD += $(top_builddir)/src/proto/libproto.a +nutcracker_LDADD += $(top_builddir)/src/event/libevent.a nutcracker_LDADD += $(top_builddir)/contrib/yaml-0.1.4/src/.libs/libyaml.a diff --git a/src/event/Makefile.am b/src/event/Makefile.am new file mode 100644 index 000000000..fa04b6eb2 --- /dev/null +++ b/src/event/Makefile.am @@ -0,0 +1,14 @@ +MAINTAINERCLEANFILES = Makefile.in + +AM_CPPFLAGS = -I $(top_srcdir)/src + +AM_CFLAGS = -Wall -Wshadow +AM_CFLAGS += -Wno-unused-parameter -Wno-unused-value + +noinst_LIBRARIES = libevent.a + +noinst_HEADERS = nc_event.h + +libevent_a_SOURCES = \ + nc_epoll.c \ + nc_kqueue.c diff --git a/src/nc_epoll.c b/src/event/nc_epoll.c similarity index 100% rename from src/nc_epoll.c rename to src/event/nc_epoll.c diff --git a/src/nc_event.h b/src/event/nc_event.h similarity index 100% rename from src/nc_event.h rename to src/event/nc_event.h diff --git a/src/nc_kqueue.c b/src/event/nc_kqueue.c similarity index 100% rename from src/nc_kqueue.c rename to src/event/nc_kqueue.c diff --git a/src/nc_core.c b/src/nc_core.c index 0211f6a13..ccd71f672 100644 --- a/src/nc_core.c +++ b/src/nc_core.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include diff --git a/src/nc_core.h b/src/nc_core.h index b5ad47ba2..8317b42fc 100644 --- a/src/nc_core.h +++ b/src/nc_core.h @@ -100,6 +100,7 @@ struct instance; #include #include #include +#include #include #include #include diff --git a/src/nc_proxy.c b/src/nc_proxy.c index 7f5ac2347..43077529a 100644 --- a/src/nc_proxy.c +++ b/src/nc_proxy.c @@ -19,7 +19,6 @@ #include #include -#include #include void diff --git a/src/nc_request.c b/src/nc_request.c index 7d7c17cbf..d89f99e15 100644 --- a/src/nc_request.c +++ b/src/nc_request.c @@ -17,7 +17,6 @@ #include #include -#include struct msg * req_get(struct conn *conn) diff --git a/src/nc_response.c b/src/nc_response.c index e8041ace7..57cdd34f3 100644 --- a/src/nc_response.c +++ b/src/nc_response.c @@ -17,7 +17,6 @@ #include #include -#include struct msg * rsp_get(struct conn *conn) diff --git a/src/nc_server.c b/src/nc_server.c index b34469500..1ec68f2b9 100644 --- a/src/nc_server.c +++ b/src/nc_server.c @@ -19,7 +19,6 @@ #include #include -#include #include #include diff --git a/src/nc_stats.c b/src/nc_stats.c index 21e53ced3..8633f9cd6 100644 --- a/src/nc_stats.c +++ b/src/nc_stats.c @@ -25,7 +25,6 @@ #include #include -#include struct stats_desc { char *name; /* stats name */ diff --git a/src/nc_stats.h b/src/nc_stats.h index 7adaaf21d..ab803cb13 100644 --- a/src/nc_stats.h +++ b/src/nc_stats.h @@ -19,7 +19,6 @@ #define _NC_STATS_H_ #include -#include #define STATS_POOL_CODEC(ACTION) \ /* client behavior */ \