Skip to content

Commit 9432519

Browse files
notify example
1 parent 19b6693 commit 9432519

19 files changed

+205
-834
lines changed

Makefile.am

+21-108
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,15 @@
11
AUTOMAKE_OPTIONS = subdir-objects
22

3-
ACLOCAL_AMFLAGS = -I m4
4-
AM_CFLAGS = -std=gnu11 -flto -fuse-linker-plugin -I$(srcdir)/src
3+
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4
4+
AM_CFLAGS = -std=gnu11 -g -O3 -flto -I$(srcdir)/src
5+
AM_LDFLAGS = -static -pthread
56

67
SOURCE_FILES = \
7-
src/picohttpparser/picohttpparser.c \
8-
src/reactor/reactor.c \
9-
src/reactor/reactor_assert.c \
10-
src/reactor/reactor_vector.c \
11-
src/reactor/reactor_utility.c \
12-
src/reactor/reactor_user.c \
13-
src/reactor/reactor_core.c \
14-
src/reactor/reactor_stats.c \
15-
src/reactor/reactor_fd.c \
16-
src/reactor/reactor_timer.c \
17-
src/reactor/reactor_pool.c \
18-
src/reactor/reactor_resolver.c \
19-
src/reactor/reactor_net.c \
20-
src/reactor/reactor_stream.c \
21-
src/reactor/reactor_http.c \
22-
src/reactor/reactor_couch.c \
23-
src/reactor/reactor_server.c
8+
src/notify/notify.c
249

2510
HEADER_FILES = \
26-
src/picohttpparser/picohttpparser.h \
27-
src/reactor/reactor.h \
28-
src/reactor/reactor_assert.h \
29-
src/reactor/reactor_vector.h \
30-
src/reactor/reactor_utility.h \
31-
src/reactor/reactor_user.h \
32-
src/reactor/reactor_core.h \
33-
src/reactor/reactor_stats.h \
34-
src/reactor/reactor_fd.h \
35-
src/reactor/reactor_timer.h \
36-
src/reactor/reactor_pool.h \
37-
src/reactor/reactor_resolver.h \
38-
src/reactor/reactor_net.h \
39-
src/reactor/reactor_stream.h \
40-
src/reactor/reactor_http.h \
41-
src/reactor/reactor_couch.h \
42-
src/reactor/reactor_server.h
11+
src/reactor.h \
12+
src/notify/notify.h
4313

4414
lib_LTLIBRARIES = libreactor.la
4515
libreactor_la_SOURCES = $(SOURCE_FILES) $(HEADER_FILES)
@@ -55,46 +25,10 @@ pkgconfigdir = $(libdir)/pkgconfig
5525
pkgconfig_DATA = libreactor.pc
5626

5727
bin_PROGRAMS = \
58-
example/example \
59-
example/producer \
60-
example/resolver \
61-
example/tcp \
62-
example/tcpd \
63-
example/http \
64-
example/couch \
65-
example/httpd \
66-
example/server \
67-
example/hello
28+
example/notify
6829

69-
example_example_LDFLAGS = -pthread
70-
example_example_LDADD = libreactor.la -ldynamic
71-
72-
example_producer_LDFLAGS = -pthread
73-
example_producer_LDADD = libreactor.la -ldynamic
74-
75-
example_resolver_LDFLAGS = -pthread
76-
example_resolver_LDADD = libreactor.la -ldynamic
77-
78-
example_tcp_LDFLAGS = -pthread
79-
example_tcp_LDADD = libreactor.la -ldynamic
80-
81-
example_tcpd_LDFLAGS = -pthread
82-
example_tcpd_LDADD = libreactor.la -ldynamic
83-
84-
example_http_LDFLAGS = -pthread
85-
example_http_LDADD = libreactor.la -ldynamic
86-
87-
example_httpd_LDFLAGS = -pthread
88-
example_httpd_LDADD = libreactor.la -ldynamic
89-
90-
example_couch_LDFLAGS = -pthread
91-
example_couch_LDADD = libreactor.la -ldynamic -ljansson
92-
93-
example_server_LDFLAGS = -pthread
94-
example_server_LDADD = libreactor.la -ldynamic -ljansson
95-
96-
example_hello_LDFLAGS = -pthread
97-
example_hello_LDADD = libreactor.la -ldynamic -ljansson
30+
example_notify_LDFLAGS = -pthread
31+
example_notify_LDADD = libreactor.la -ldynamic
9832

9933
MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in libreactor-?.?.?.tar.gz
10034

@@ -105,45 +39,24 @@ CLEANFILES = {.,test/,src/reactor/,src/picohttpparser}/*.{gcno,gcda,gcov}
10539

10640
### unit tests ###
10741

108-
CHECK_CFLAGS = -std=gnu11 -O0 -g -ftest-coverage -fprofile-arcs -I$(srcdir)/src -DGCOV_BUILD
109-
CHECK_LDADD = -L. libreactor_test.a -lcmocka -ldynamic
110-
CHECK_LDFLAGS_EXTRA = -pthread -Wl,--wrap=abort
111-
11242
check_LIBRARIES = libreactor_test.a
11343
libreactor_test_a_CFLAGS = $(CHECK_CFLAGS)
11444
libreactor_test_a_SOURCES = $(SOURCE_FILES) $(HEADER_FILES)
11545

46+
CHECK_CFLAGS = -std=gnu11 -O0 -g -ftest-coverage -fprofile-arcs -I$(srcdir)/src -DGCOV_BUILD
47+
CHECK_LDADD = -L. libreactor_test.a -lcmocka -ldynamic
48+
CHECK_LDFLAGS_EXTRA = -pthread \
49+
-Wl,--wrap=abort \
50+
-Wl,--wrap=read \
51+
-Wl,--wrap=inotify_init1
52+
11653
check_PROGRAMS =
11754

118-
check_PROGRAMS += test/reactor
119-
test_reactor_CFLAGS = $(CHECK_CFLAGS)
120-
test_reactor_LDADD = $(CHECK_LDADD)
121-
test_reactor_LDFLAGS = $(CHECK_LDFLAGS_EXTRA)
122-
test_reactor_SOURCES = test/reactor.c test/mock.c
123-
124-
check_PROGRAMS += test/reactor_assert
125-
test_reactor_assert_CFLAGS = $(CHECK_CFLAGS)
126-
test_reactor_assert_LDADD = $(CHECK_LDADD)
127-
test_reactor_assert_LDFLAGS = $(CHECK_LDFLAGS_EXTRA)
128-
test_reactor_assert_SOURCES = test/reactor_assert.c test/mock.c
129-
130-
check_PROGRAMS += test/reactor_core
131-
test_reactor_core_CFLAGS = $(CHECK_CFLAGS)
132-
test_reactor_core_LDADD = $(CHECK_LDADD)
133-
test_reactor_core_LDFLAGS = $(CHECK_LDFLAGS_EXTRA)
134-
test_reactor_core_SOURCES = test/reactor_core.c test/mock.c
135-
136-
check_PROGRAMS += test/reactor_pool
137-
test_reactor_pool_CFLAGS = $(CHECK_CFLAGS)
138-
test_reactor_pool_LDADD = $(CHECK_LDADD)
139-
test_reactor_pool_LDFLAGS = $(CHECK_LDFLAGS_EXTRA)
140-
test_reactor_pool_SOURCES = test/reactor_pool.c test/mock.c
141-
142-
check_PROGRAMS += test/reactor_resolver
143-
test_reactor_resolver_CFLAGS = $(CHECK_CFLAGS)
144-
test_reactor_resolver_LDADD = $(CHECK_LDADD)
145-
test_reactor_resolver_LDFLAGS = $(CHECK_LDFLAGS_EXTRA)
146-
test_reactor_resolver_SOURCES = test/reactor_resolver.c test/mock.c
55+
check_PROGRAMS += test/notify
56+
test_notify_CFLAGS = $(CHECK_CFLAGS)
57+
test_notify_LDADD = $(CHECK_LDADD)
58+
test_notify_LDFLAGS = $(CHECK_LDFLAGS_EXTRA)
59+
test_notify_SOURCES = test/notify.c test/mock.c
14760

14861
dist_noinst_SCRIPTS = test/valgrind.sh test/coverage.sh Dockerfile
14962

autogen.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/sh
22

33
mkdir -p autotools m4
44
autoreconf --force --install

configure.ac

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AC_INIT([libreactor], [1.0.1], [[email protected]])
1+
AC_INIT([libreactor], [2.0.0], [[email protected]])
22
AC_CONFIG_AUX_DIR(autotools)
33
AC_CONFIG_MACRO_DIR([m4])
44
AM_INIT_AUTOMAKE([-Wall -Werror foreign no-define])
@@ -9,5 +9,6 @@ AM_PROG_AR
99
AC_PROG_LIBTOOL
1010
AM_PROG_CC_C_O
1111

12+
AC_PREFIX_DEFAULT(/usr)
1213
AC_CONFIG_FILES([Makefile libreactor.pc])
1314
AC_OUTPUT

example/couch.c

-65
This file was deleted.

example/example.c

-59
This file was deleted.

example/hello.c

-41
This file was deleted.

0 commit comments

Comments
 (0)