aboutsummaryrefslogtreecommitdiff
path: root/src/examples/Makefile.am
blob: 7946745a46316692bc386abf4595035023b119f2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
# This Makefile.am is in the public domain
SUBDIRS  = .

AM_CPPFLAGS = \
  -I$(top_srcdir)/src/include \
  $(CPPFLAGS_ac) \
  -DDATA_DIR=\"$(top_srcdir)/src/datadir/\"

AM_CFLAGS = $(CFLAGS_ac) @LIBGCRYPT_CFLAGS@

AM_LDFLAGS = $(LDFLAGS_ac)

MHD_CPU_COUNT_DEF = -DMHD_CPU_COUNT=$(CPU_COUNT)

AM_TESTS_ENVIRONMENT = $(TESTS_ENVIRONMENT_ac)

if USE_COVERAGE
  AM_CFLAGS += --coverage
endif


# example programs
noinst_PROGRAMS = \
 benchmark \
 benchmark_https \
 chunked_example \
 minimal_example \
 minimal_example_empty \
 dual_stack_example \
 minimal_example_comet \
 querystring_example \
 timeout \
 fileserver_example \
 fileserver_example_dirs \
 fileserver_example_external_select \
 refuse_post_example

if HAVE_EXPERIMENTAL
noinst_PROGRAMS += \
  websocket_chatserver_example
endif

if MHD_HAVE_EPOLL
noinst_PROGRAMS += \
  suspend_resume_epoll
endif

EXTRA_DIST = msgs_i18n.c
noinst_EXTRA_DIST = msgs_i18n.c

if ENABLE_HTTPS
noinst_PROGRAMS += \
 https_fileserver_example \
 minimal_example_empty_tls
endif
if HAVE_POSTPROCESSOR
noinst_PROGRAMS += \
  post_example
if HAVE_POSIX_THREADS
noinst_PROGRAMS += demo
if ENABLE_HTTPS
noinst_PROGRAMS += demo_https
endif
endif
endif

if ENABLE_DAUTH
noinst_PROGRAMS += \
 digest_auth_example
endif

if ENABLE_BAUTH
noinst_PROGRAMS += \
 authorization_example
endif

if HAVE_POSIX_THREADS
if ENABLE_UPGRADE
noinst_PROGRAMS += \
 upgrade_example \
 websocket_threaded_example
endif
endif

if HAVE_ZLIB
noinst_PROGRAMS += \
 http_compression \
 http_chunked_compression
endif

if HAVE_W32
AM_CFLAGS += -DWINDOWS
endif

minimal_example_SOURCES = \
 minimal_example.c
minimal_example_LDADD = \
 $(top_builddir)/src/microhttpd/libmicrohttpd.la

minimal_example_empty_SOURCES = \
 minimal_example_empty.c
minimal_example_empty_LDADD = \
 $(top_builddir)/src/microhttpd/libmicrohttpd.la

minimal_example_empty_tls_SOURCES = \
 minimal_example_empty_tls.c
minimal_example_empty_tls_LDADD = \
 $(top_builddir)/src/microhttpd/libmicrohttpd.la

upgrade_example_SOURCES = \
 upgrade_example.c
upgrade_example_CFLAGS = \
  $(PTHREAD_CFLAGS) $(AM_CFLAGS)
upgrade_example_LDADD = \
  $(top_builddir)/src/microhttpd/libmicrohttpd.la \
  $(PTHREAD_LIBS)

websocket_threaded_example_SOURCES = \
 websocket_threaded_example.c
websocket_threaded_example_CFLAGS = \
  $(PTHREAD_CFLAGS) $(AM_CFLAGS)
websocket_threaded_example_LDADD = \
  $(top_builddir)/src/microhttpd/libmicrohttpd.la \
  $(PTHREAD_LIBS)

timeout_SOURCES = \
 timeout.c
timeout_LDADD = \
 $(top_builddir)/src/microhttpd/libmicrohttpd.la

chunked_example_SOURCES = \
 chunked_example.c
chunked_example_LDADD = \
 $(top_builddir)/src/microhttpd/libmicrohttpd.la

websocket_chatserver_example_SOURCES = \
 websocket_chatserver_example.c
websocket_chatserver_example_LDADD = \
 $(top_builddir)/src/microhttpd_ws/libmicrohttpd_ws.la \
 $(top_builddir)/src/microhttpd/libmicrohttpd.la

demo_SOURCES = \
 demo.c
demo_CFLAGS = \
 $(PTHREAD_CFLAGS) $(AM_CFLAGS)
demo_CPPFLAGS = \
 $(AM_CPPFLAGS) $(MHD_CPU_COUNT_DEF)
demo_LDADD = \
 $(top_builddir)/src/microhttpd/libmicrohttpd.la  \
 $(PTHREAD_LIBS)
if MHD_HAVE_LIBMAGIC
demo_LDADD += -lmagic
endif

demo_https_SOURCES = \
 demo_https.c
demo_https_CFLAGS = \
 $(PTHREAD_CFLAGS) $(AM_CFLAGS)
demo_https_CPPFLAGS = \
 $(AM_CPPFLAGS) $(MHD_CPU_COUNT_DEF)
demo_https_LDADD = \
 $(top_builddir)/src/microhttpd/libmicrohttpd.la  \
 $(PTHREAD_LIBS)
if MHD_HAVE_LIBMAGIC
demo_https_LDADD += -lmagic
endif

benchmark_SOURCES = \
 benchmark.c
benchmark_CPPFLAGS = \
 $(AM_CPPFLAGS) $(MHD_CPU_COUNT_DEF)
benchmark_LDADD = \
 $(top_builddir)/src/microhttpd/libmicrohttpd.la

suspend_resume_epoll_SOURCES = \
 suspend_resume_epoll.c
suspend_resume_epoll_CPPFLAGS = \
 $(AM_CPPFLAGS) $(MHD_CPU_COUNT_DEF)
suspend_resume_epoll_LDADD = \
 $(top_builddir)/src/microhttpd/libmicrohttpd.la

benchmark_https_SOURCES = \
 benchmark_https.c
benchmark_https_CPPFLAGS = \
 $(AM_CPPFLAGS) $(MHD_CPU_COUNT_DEF)
benchmark_https_LDADD = \
 $(top_builddir)/src/microhttpd/libmicrohttpd.la

dual_stack_example_SOURCES = \
 dual_stack_example.c
dual_stack_example_LDADD = \
 $(top_builddir)/src/microhttpd/libmicrohttpd.la

post_example_SOURCES = \
 post_example.c
post_example_LDADD = \
 $(top_builddir)/src/microhttpd/libmicrohttpd.la

minimal_example_comet_SOURCES = \
 minimal_example_comet.c
minimal_example_comet_LDADD = \
 $(top_builddir)/src/microhttpd/libmicrohttpd.la

authorization_example_SOURCES = \
 authorization_example.c
authorization_example_LDADD = \
 $(top_builddir)/src/microhttpd/libmicrohttpd.la

digest_auth_example_SOURCES = \
 digest_auth_example.c
digest_auth_example_LDADD = \
 $(top_builddir)/src/microhttpd/libmicrohttpd.la

refuse_post_example_SOURCES = \
 refuse_post_example.c
refuse_post_example_LDADD = \
 $(top_builddir)/src/microhttpd/libmicrohttpd.la

querystring_example_SOURCES = \
 querystring_example.c
querystring_example_LDADD = \
 $(top_builddir)/src/microhttpd/libmicrohttpd.la

fileserver_example_SOURCES = \
 fileserver_example.c
fileserver_example_LDADD = \
 $(top_builddir)/src/microhttpd/libmicrohttpd.la

fileserver_example_dirs_SOURCES = \
 fileserver_example_dirs.c
fileserver_example_dirs_LDADD = \
 $(top_builddir)/src/microhttpd/libmicrohttpd.la

fileserver_example_external_select_SOURCES = \
 fileserver_example_external_select.c
fileserver_example_external_select_LDADD = \
 $(top_builddir)/src/microhttpd/libmicrohttpd.la

https_fileserver_example_SOURCES = \
https_fileserver_example.c
https_fileserver_example_CPPFLAGS = \
 $(AM_CPPFLAGS) $(GNUTLS_CPPFLAGS)
https_fileserver_example_LDADD = \
 $(top_builddir)/src/microhttpd/libmicrohttpd.la

http_compression_SOURCES = \
 http_compression.c
http_chunked_compression_SOURCES = \
 http_chunked_compression.c
http_compression_LDADD = \
 $(top_builddir)/src/microhttpd/libmicrohttpd.la
http_chunked_compression_LDADD = \
 $(top_builddir)/src/microhttpd/libmicrohttpd.la
if HAVE_ZLIB
 http_compression_LDADD += -lz
 http_chunked_compression_LDADD += -lz
endif