summaryrefslogtreecommitdiff
path: root/src/Makefile.am
blob: 9e4e050d4e9ae1e3f730ce0f863ff06a966ae6c4 (plain)
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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
AM_CFLAGS = $(FAM_CFLAGS) $(LIBUNWIND_CFLAGS)

noinst_PROGRAMS=proc_open test_buffer test_base64 test_configfile
sbin_PROGRAMS=lighttpd lighttpd-angel
LEMON=$(top_builddir)/src/lemon$(BUILD_EXEEXT)

TESTS=\
	test_buffer$(EXEEXT) \
	test_base64$(EXEEXT) \
	test_configfile$(EXEEXT)

lemon$(BUILD_EXEEXT): lemon.c
	$(AM_V_CC)$(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ $(srcdir)/lemon.c

lighttpd_angel_SOURCES=lighttpd-angel.c

.PHONY: versionstamp parsers

versionstamp:
	@test -f versionstamp.h || touch versionstamp.h; \
	REVISION=""; \
	if test -d "$(top_srcdir)/.svn" -a -x "`which svnversion`"; then \
		REVISION="$$(LANG= LC_ALL=C svnversion "$(top_srcdir)" 2>/dev/null || echo exported)"; \
		if test "$$REVISION" = "exported"; then \
			REVISION=""; \
		fi; \
	fi; \
	if test -z "$$REVISION" -a -d "$(top_srcdir)/.git" -a -x "`which git`"; then \
		REVISION="$$(cd "$(top_srcdir)"; LANG= LC_ALL=C git describe --always 2>/dev/null || echo)"; \
	fi; \
	if test -n "$$REVISION"; then \
		echo "#define REPO_VERSION \"-devel-$$REVISION\"" > versionstamp.h.tmp; \
	else \
		echo "#define REPO_VERSION \"\"" > versionstamp.h.tmp; \
	fi; \
	if ! diff versionstamp.h.tmp versionstamp.h >/dev/null 2>/dev/null; then \
		mv versionstamp.h.tmp versionstamp.h; \
	else \
		rm versionstamp.h.tmp; \
	fi

configparser.h: configparser.c
configparser.c: $(srcdir)/configparser.y $(srcdir)/lempar.c lemon$(BUILD_EXEEXT)
	rm -f configparser.h
	$(LEMON) -q $(srcdir)/configparser.y $(srcdir)/lempar.c

mod_ssi_exprparser.h: mod_ssi_exprparser.c
mod_ssi_exprparser.c: $(srcdir)/mod_ssi_exprparser.y $(srcdir)/lempar.c lemon$(BUILD_EXEEXT)
	rm -f mod_ssi_exprparser.h
	$(LEMON) -q $(srcdir)/mod_ssi_exprparser.y $(srcdir)/lempar.c

parsers: configparser.c mod_ssi_exprparser.c

BUILT_SOURCES = parsers versionstamp
MAINTAINERCLEANFILES = configparser.c configparser.h mod_ssi_exprparser.c mod_ssi_exprparser.h
CLEANFILES = versionstamp.h versionstamp.h.tmp lemon$(BUILD_EXEEXT)

common_src=base64.c buffer.c log.c \
	keyvalue.c chunk.c  \
	http_chunk.c stream.c fdevent.c \
	stat_cache.c plugin.c joblist.c etag.c array.c \
	data_string.c data_array.c \
	data_integer.c md5.c data_fastcgi.c \
	vector.c \
	fdevent_select.c fdevent_libev.c \
	fdevent_poll.c fdevent_linux_sysepoll.c \
	fdevent_solaris_devpoll.c fdevent_solaris_port.c \
	fdevent_freebsd_kqueue.c \
	data_config.c \
	inet_ntop_cache.c crc32.c \
	connections-glue.c \
	configfile-glue.c \
	http-header-glue.c \
	http_auth.c \
	http_vhostdb.c \
	rand.c \
	splaytree.c status_counter.c \
	safe_memclear.c

src = server.c response.c connections.c network.c \
	network_write.c network_linux_sendfile.c \
	network_write_mmap.c network_write_no_mmap.c \
	network_freebsd_sendfile.c network_writev.c \
	network_solaris_sendfilev.c \
	network_darwin_sendfile.c \
	configfile.c configparser.c request.c proc_open.c

lib_LTLIBRARIES =

if NO_RDYNAMIC
# if the linker doesn't allow referencing symbols of the binary
# we have to put everything into a shared-lib and link it into
# everything
common_ldflags = -avoid-version -no-undefined
lib_LTLIBRARIES += liblightcomp.la
liblightcomp_la_SOURCES=$(common_src)
liblightcomp_la_CFLAGS=$(AM_CFLAGS) $(LIBEV_CFLAGS)
liblightcomp_la_LDFLAGS = $(common_ldflags)
liblightcomp_la_LIBADD = $(PCRE_LIB) $(CRYPTO_LIB) $(FAM_LIBS) $(LIBEV_LIBS) $(ATTR_LIB)
common_libadd = liblightcomp.la
else
src += $(common_src)
common_ldflags = -avoid-version
common_libadd =
endif
common_module_ldflags = -module -export-dynamic $(common_ldflags)

lib_LTLIBRARIES += mod_flv_streaming.la
mod_flv_streaming_la_SOURCES = mod_flv_streaming.c
mod_flv_streaming_la_LDFLAGS = $(common_module_ldflags)
mod_flv_streaming_la_LIBADD = $(common_libadd)

if BUILD_WITH_GEOIP
lib_LTLIBRARIES += mod_geoip.la
mod_geoip_la_SOURCES = mod_geoip.c
mod_geoip_la_LDFLAGS = $(common_module_ldflags)
mod_geoip_la_LIBADD = $(common_libadd) $(GEOIP_LIB)
endif

lib_LTLIBRARIES += mod_evasive.la
mod_evasive_la_SOURCES = mod_evasive.c
mod_evasive_la_LDFLAGS = $(common_module_ldflags)
mod_evasive_la_LIBADD = $(common_libadd)

lib_LTLIBRARIES += mod_webdav.la
mod_webdav_la_SOURCES = mod_webdav.c
mod_webdav_la_CFLAGS = $(AM_CFLAGS) $(XML_CFLAGS) $(SQLITE_CFLAGS) 
mod_webdav_la_LDFLAGS = $(common_module_ldflags)
mod_webdav_la_LIBADD = $(common_libadd) $(XML_LIBS) $(SQLITE_LIBS) $(UUID_LIBS)

if BUILD_WITH_LUA
lib_LTLIBRARIES += mod_magnet.la
mod_magnet_la_SOURCES = mod_magnet.c mod_magnet_cache.c
mod_magnet_la_CFLAGS = $(AM_CFLAGS) $(LUA_CFLAGS)
mod_magnet_la_LDFLAGS = $(common_module_ldflags)
mod_magnet_la_LIBADD = $(common_libadd) $(LUA_LIBS) -lm
endif

if BUILD_WITH_LUA
lib_LTLIBRARIES += mod_cml.la
mod_cml_la_SOURCES = mod_cml.c mod_cml_lua.c mod_cml_funcs.c
mod_cml_la_CFLAGS = $(AM_CFLAGS) $(LUA_CFLAGS)
mod_cml_la_LDFLAGS = $(common_module_ldflags)
mod_cml_la_LIBADD = $(MEMCACHED_LIB) $(common_libadd) $(LUA_LIBS) -lm
endif

if BUILD_MOD_TRIGGER_B4_DL
lib_LTLIBRARIES += mod_trigger_b4_dl.la
mod_trigger_b4_dl_la_SOURCES = mod_trigger_b4_dl.c
mod_trigger_b4_dl_la_LDFLAGS = $(common_module_ldflags)
mod_trigger_b4_dl_la_LIBADD = $(GDBM_LIB) $(MEMCACHED_LIB) $(PCRE_LIB) $(common_libadd)
endif

lib_LTLIBRARIES += mod_vhostdb.la
mod_vhostdb_la_SOURCES = mod_vhostdb.c
mod_vhostdb_la_LDFLAGS = $(common_module_ldflags)
mod_vhostdb_la_LIBADD = $(common_libadd)

if BUILD_WITH_LDAP
lib_LTLIBRARIES += mod_vhostdb_ldap.la
mod_vhostdb_ldap_la_SOURCES = mod_vhostdb_ldap.c
mod_vhostdb_ldap_la_LDFLAGS = $(common_module_ldflags)
mod_vhostdb_ldap_la_LIBADD = $(LDAP_LIB) $(LBER_LIB) $(common_libadd)
endif

if BUILD_WITH_MYSQL
lib_LTLIBRARIES += mod_mysql_vhost.la
mod_mysql_vhost_la_SOURCES = mod_mysql_vhost.c
mod_mysql_vhost_la_LDFLAGS = $(common_module_ldflags)
mod_mysql_vhost_la_LIBADD = $(MYSQL_LIBS) $(common_libadd)
mod_mysql_vhost_la_CPPFLAGS = $(MYSQL_INCLUDE)
endif

if BUILD_WITH_MYSQL
lib_LTLIBRARIES += mod_vhostdb_mysql.la
mod_vhostdb_mysql_la_SOURCES = mod_vhostdb_mysql.c
mod_vhostdb_mysql_la_LDFLAGS = $(common_module_ldflags)
mod_vhostdb_mysql_la_LIBADD = $(MYSQL_LIBS) $(common_libadd)
mod_vhostdb_mysql_la_CPPFLAGS = $(MYSQL_INCLUDE)
endif

if BUILD_WITH_PGSQL
lib_LTLIBRARIES += mod_vhostdb_pgsql.la
mod_vhostdb_pgsql_la_SOURCES = mod_vhostdb_pgsql.c
mod_vhostdb_pgsql_la_LDFLAGS = $(common_module_ldflags)
mod_vhostdb_pgsql_la_LIBADD = $(PGSQL_LIBS) $(common_libadd)
mod_vhostdb_pgsql_la_CPPFLAGS = $(PGSQL_INCLUDE)
endif

if BUILD_WITH_DBI
lib_LTLIBRARIES += mod_vhostdb_dbi.la
mod_vhostdb_dbi_la_SOURCES = mod_vhostdb_dbi.c
mod_vhostdb_dbi_la_LDFLAGS = $(common_module_ldflags)
mod_vhostdb_dbi_la_LIBADD = $(DBI_LIBS) $(common_libadd)
mod_vhostdb_dbi_la_CPPFLAGS = $(DBI_CFLAGS)
endif

lib_LTLIBRARIES += mod_cgi.la
mod_cgi_la_SOURCES = mod_cgi.c
mod_cgi_la_LDFLAGS = $(common_module_ldflags)
mod_cgi_la_LIBADD = $(common_libadd)

lib_LTLIBRARIES += mod_scgi.la
mod_scgi_la_SOURCES = mod_scgi.c
mod_scgi_la_LDFLAGS = $(common_module_ldflags)
mod_scgi_la_LIBADD = $(common_libadd)

lib_LTLIBRARIES += mod_staticfile.la
mod_staticfile_la_SOURCES = mod_staticfile.c
mod_staticfile_la_LDFLAGS = $(common_module_ldflags)
mod_staticfile_la_LIBADD = $(common_libadd)

lib_LTLIBRARIES += mod_dirlisting.la
mod_dirlisting_la_SOURCES = mod_dirlisting.c
mod_dirlisting_la_LDFLAGS = $(common_module_ldflags)
mod_dirlisting_la_LIBADD = $(common_libadd) $(PCRE_LIB)

lib_LTLIBRARIES += mod_indexfile.la
mod_indexfile_la_SOURCES = mod_indexfile.c
mod_indexfile_la_LDFLAGS = $(common_module_ldflags)
mod_indexfile_la_LIBADD = $(common_libadd)

lib_LTLIBRARIES += mod_setenv.la
mod_setenv_la_SOURCES = mod_setenv.c
mod_setenv_la_LDFLAGS = $(common_module_ldflags)
mod_setenv_la_LIBADD = $(common_libadd)

lib_LTLIBRARIES += mod_alias.la
mod_alias_la_SOURCES = mod_alias.c
mod_alias_la_LDFLAGS = $(common_module_ldflags)
mod_alias_la_LIBADD = $(common_libadd)

lib_LTLIBRARIES += mod_userdir.la
mod_userdir_la_SOURCES = mod_userdir.c
mod_userdir_la_LDFLAGS = $(common_module_ldflags)
mod_userdir_la_LIBADD = $(common_libadd)

lib_LTLIBRARIES += mod_rrdtool.la
mod_rrdtool_la_SOURCES = mod_rrdtool.c
mod_rrdtool_la_LDFLAGS = $(common_module_ldflags)
mod_rrdtool_la_LIBADD = $(common_libadd)

lib_LTLIBRARIES += mod_usertrack.la
mod_usertrack_la_SOURCES = mod_usertrack.c
mod_usertrack_la_LDFLAGS = $(common_module_ldflags)
mod_usertrack_la_LIBADD = $(common_libadd)

lib_LTLIBRARIES += mod_proxy.la
mod_proxy_la_SOURCES = mod_proxy.c
mod_proxy_la_LDFLAGS = $(common_module_ldflags)
mod_proxy_la_LIBADD = $(common_libadd)

lib_LTLIBRARIES += mod_ssi.la
mod_ssi_la_SOURCES = mod_ssi_exprparser.c mod_ssi_expr.c mod_ssi.c
mod_ssi_la_LDFLAGS = $(common_module_ldflags)
mod_ssi_la_LIBADD = $(common_libadd)

lib_LTLIBRARIES += mod_secdownload.la
mod_secdownload_la_SOURCES = mod_secdownload.c
mod_secdownload_la_LDFLAGS = $(common_module_ldflags)
mod_secdownload_la_LIBADD = $(common_libadd) $(CRYPTO_LIB)

#lib_LTLIBRARIES += mod_httptls.la
#mod_httptls_la_SOURCES = mod_httptls.c
#mod_httptls_la_LDFLAGS = $(common_module_ldflags)
#mod_httptls_la_LIBADD = $(common_libadd)

lib_LTLIBRARIES += mod_expire.la
mod_expire_la_SOURCES = mod_expire.c
mod_expire_la_LDFLAGS = $(common_module_ldflags)
mod_expire_la_LIBADD = $(common_libadd)

lib_LTLIBRARIES += mod_evhost.la
mod_evhost_la_SOURCES = mod_evhost.c
mod_evhost_la_LDFLAGS = $(common_module_ldflags)
mod_evhost_la_LIBADD = $(common_libadd)

lib_LTLIBRARIES += mod_simple_vhost.la
mod_simple_vhost_la_SOURCES = mod_simple_vhost.c
mod_simple_vhost_la_LDFLAGS = $(common_module_ldflags)
mod_simple_vhost_la_LIBADD = $(common_libadd)

lib_LTLIBRARIES += mod_fastcgi.la
mod_fastcgi_la_SOURCES = mod_fastcgi.c
mod_fastcgi_la_LDFLAGS = $(common_module_ldflags)
mod_fastcgi_la_LIBADD = $(common_libadd)

lib_LTLIBRARIES += mod_extforward.la
mod_extforward_la_SOURCES = mod_extforward.c
mod_extforward_la_LDFLAGS = $(common_module_ldflags)
mod_extforward_la_LIBADD = $(common_libadd)

lib_LTLIBRARIES += mod_access.la
mod_access_la_SOURCES = mod_access.c
mod_access_la_LDFLAGS = $(common_module_ldflags)
mod_access_la_LIBADD = $(common_libadd)

lib_LTLIBRARIES += mod_compress.la
mod_compress_la_SOURCES = mod_compress.c
mod_compress_la_LDFLAGS = $(common_module_ldflags)
mod_compress_la_LIBADD = $(Z_LIB) $(BZ_LIB) $(common_libadd)

lib_LTLIBRARIES += mod_deflate.la
mod_deflate_la_SOURCES = mod_deflate.c
mod_deflate_la_LDFLAGS = $(common_module_ldflags)
mod_deflate_la_LIBADD = $(Z_LIB) $(BZ_LIB) $(common_libadd)

lib_LTLIBRARIES += mod_auth.la
mod_auth_la_SOURCES = mod_auth.c
mod_auth_la_LDFLAGS = $(common_module_ldflags)
mod_auth_la_LIBADD = $(common_libadd)

lib_LTLIBRARIES += mod_authn_file.la
mod_authn_file_la_SOURCES = mod_authn_file.c
mod_authn_file_la_LDFLAGS = $(common_module_ldflags)
mod_authn_file_la_LIBADD = $(CRYPT_LIB) $(CRYPTO_LIB) $(common_libadd)

if BUILD_WITH_KRB5
lib_LTLIBRARIES += mod_authn_gssapi.la
mod_authn_gssapi_la_SOURCES = mod_authn_gssapi.c
mod_authn_gssapi_la_LDFLAGS = $(common_module_ldflags)
mod_authn_gssapi_la_LIBADD = $(KRB5_LIB) $(common_libadd)
endif

if BUILD_WITH_LDAP
lib_LTLIBRARIES += mod_authn_ldap.la
mod_authn_ldap_la_SOURCES = mod_authn_ldap.c
mod_authn_ldap_la_LDFLAGS = $(common_module_ldflags)
mod_authn_ldap_la_LIBADD = $(LDAP_LIB) $(LBER_LIB) $(common_libadd)
endif

if BUILD_WITH_MYSQL
lib_LTLIBRARIES += mod_authn_mysql.la
mod_authn_mysql_la_SOURCES = mod_authn_mysql.c
mod_authn_mysql_la_LDFLAGS = $(common_module_ldflags)
mod_authn_mysql_la_LIBADD = $(CRYPT_LIB) $(MYSQL_LIBS) $(common_libadd)
mod_authn_mysql_la_CPPFLAGS = $(MYSQL_INCLUDE)
endif

if BUILD_WITH_OPENSSL
lib_LTLIBRARIES += mod_openssl.la
mod_openssl_la_SOURCES = mod_openssl.c
mod_openssl_la_LDFLAGS = $(common_module_ldflags)
mod_openssl_la_LIBADD = $(SSL_LIB) $(common_libadd)
endif

lib_LTLIBRARIES += mod_rewrite.la
mod_rewrite_la_SOURCES = mod_rewrite.c
mod_rewrite_la_LDFLAGS = $(common_module_ldflags)
mod_rewrite_la_LIBADD = $(PCRE_LIB) $(common_libadd)

lib_LTLIBRARIES += mod_redirect.la
mod_redirect_la_SOURCES = mod_redirect.c
mod_redirect_la_LDFLAGS = $(common_module_ldflags)
mod_redirect_la_LIBADD = $(PCRE_LIB) $(common_libadd)

lib_LTLIBRARIES += mod_status.la
mod_status_la_SOURCES = mod_status.c
mod_status_la_LDFLAGS = $(common_module_ldflags)
mod_status_la_LIBADD = $(common_libadd)

lib_LTLIBRARIES += mod_accesslog.la
mod_accesslog_la_SOURCES = mod_accesslog.c
mod_accesslog_la_LDFLAGS = $(common_module_ldflags)
mod_accesslog_la_LIBADD = $(common_libadd)

lib_LTLIBRARIES += mod_uploadprogress.la
mod_uploadprogress_la_SOURCES = mod_uploadprogress.c
mod_uploadprogress_la_LDFLAGS = $(common_module_ldflags)
mod_uploadprogress_la_LIBADD = $(common_libadd)


hdr = server.h base64.h buffer.h network.h log.h keyvalue.h \
	response.h request.h fastcgi.h chunk.h \
	first.h settings.h http_chunk.h \
	md5.h http_auth.h http_vhostdb.h stream.h \
	fdevent.h connections.h base.h stat_cache.h \
	plugin.h \
	etag.h joblist.h array.h vector.h crc32.h \
	network_backends.h configfile.h \
	mod_ssi.h mod_ssi_expr.h inet_ntop_cache.h \
	configparser.h mod_ssi_exprparser.h \
	rand.h \
	sys-endian.h sys-mmap.h sys-socket.h mod_cml.h mod_cml_funcs.h \
	safe_memclear.h splaytree.h proc_open.h status_counter.h \
	mod_magnet_cache.h


DEFS= @DEFS@ -DHAVE_VERSIONSTAMP_H -DLIBRARY_DIR="\"$(libdir)\"" -DSBIN_DIR="\"$(sbindir)\""


if LIGHTTPD_STATIC

## static lighttpd server (used in conjunction with -DLIGHTTPD_STATIC)
## (order is not important)
lighttpd_SOURCES = \
  $(src) \
  mod_access.c \
  mod_accesslog.c \
  mod_alias.c \
  mod_auth.c \
  mod_authn_file.c \
  mod_cgi.c \
  mod_compress.c \
  mod_deflate.c \
  mod_dirlisting.c \
  mod_evasive.c \
  mod_expire.c \
  mod_extforward.c \
  mod_fastcgi.c \
  mod_flv_streaming.c \
  mod_indexfile.c \
  mod_proxy.c \
  mod_redirect.c \
  mod_rewrite.c \
  mod_rrdtool.c \
  mod_scgi.c \
  mod_secdownload.c \
  mod_setenv.c \
  mod_simple_vhost.c \
  mod_ssi_exprparser.c mod_ssi_expr.c mod_ssi.c \
  mod_staticfile.c \
  mod_status.c \
  mod_uploadprogress.c \
  mod_userdir.c \
  mod_usertrack.c \
  mod_vhostdb.c \
  mod_webdav.c
lighttpd_CPPFLAGS = \
  -DLIGHTTPD_STATIC \
  $(XML_CFLAGS) $(SQLITE_CFLAGS) \
  $(FAM_CFLAGS) $(LIBEV_CFLAGS) $(LIBUNWIND_CFLAGS)
lighttpd_LDADD = \
  $(common_libadd) \
  $(CRYPT_LIB) $(CRYPTO_LIB) \
  $(XML_LIBS) $(SQLITE_LIBS) $(UUID_LIBS) \
  $(PCRE_LIB) $(Z_LIB) $(BZ_LIB) $(DL_LIB) $(SENDFILE_LIB) $(ATTR_LIB) \
  $(FAM_LIBS) $(LIBEV_LIBS) $(LIBUNWIND_LIBS)
lighttpd_LDFLAGS = -export-dynamic

if BUILD_WITH_GEOIP
lighttpd_SOURCES += mod_geoip.c
lighttpd_LDADD += $(GEOIP_LIB)
endif
if BUILD_WITH_LUA
lighttpd_SOURCES += mod_cml.c mod_cml_lua.c mod_cml_funcs.c \
                    mod_magnet.c mod_magnet_cache.c
lighttpd_CPPFLAGS += $(LUA_CFLAGS)
lighttpd_LDADD += $(LUA_LIBS) -lm
endif
if BUILD_WITH_KRB5
lighttpd_SOURCES += mod_authn_gssapi.c
lighttpd_LDADD += $(KRB5_LIB)
endif
if BUILD_WITH_LDAP
lighttpd_SOURCES += mod_authn_ldap.c mod_vhostdb_ldap.c
lighttpd_LDADD += $(LDAP_LIB) $(LBER_LIB)
endif
if BUILD_WITH_MYSQL
lighttpd_SOURCES += mod_authn_mysql.c mod_mysql_vhost.c mod_vhostdb_mysql.c
lighttpd_CPPFLAGS += $(MYSQL_INCLUDE)
lighttpd_LDADD += $(MYSQL_LIBS)
endif
if BUILD_WITH_PGSQL
lighttpd_SOURCES += mod_vhostdb_pgsql.c
lighttpd_CPPFLAGS += $(PGSQL_INCLUDE)
lighttpd_LDADD += $(PGSQL_LIBS)
endif
if BUILD_WITH_DBI
lighttpd_SOURCES += mod_vhostdb_dbi.c
lighttpd_CPPFLAGS += $(DBI_CFLAGS)
lighttpd_LDADD += $(DBI_LIBS)
endif
if BUILD_WITH_OPENSSL
lighttpd_SOURCES += mod_openssl.c
lighttpd_LDADD += $(SSL_LIB)
endif
if BUILD_WITH_MEMCACHED
lighttpd_CPPFLAGS += $(MEMCACHED_CFLAGS)
lighttpd_LDADD += $(MEMCACHED_LIB)
endif
if BUILD_WITH_GDBM
lighttpd_LDADD += $(GDBM_LIB)
endif
if BUILD_MOD_TRIGGER_B4_DL
lighttpd_SOURCES += mod_trigger_b4_dl.c
endif

else

## default lighttpd server
lighttpd_SOURCES = $(src)
lighttpd_CPPFLAGS = $(FAM_CFLAGS) $(LIBEV_CFLAGS)
lighttpd_LDADD = $(PCRE_LIB) $(DL_LIB) $(SENDFILE_LIB) $(ATTR_LIB) $(common_libadd) $(CRYPTO_LIB) $(FAM_LIBS) $(LIBEV_LIBS) $(LIBUNWIND_LIBS)
lighttpd_LDFLAGS = -export-dynamic

endif

proc_open_SOURCES = proc_open.c buffer.c
proc_open_LDADD = $(LIBUNWIND_LIBS)
proc_open_CPPFLAGS= -DDEBUG_PROC_OPEN

test_buffer_SOURCES = test_buffer.c buffer.c
test_buffer_LDADD = $(LIBUNWIND_LIBS)

test_base64_SOURCES = test_base64.c base64.c buffer.c
test_base64_LDADD = $(LIBUNWIND_LIBS)

test_configfile_SOURCES = test_configfile.c buffer.c array.c data_string.c keyvalue.c vector.c log.c
test_configfile_LDADD = $(PCRE_LIB) $(LIBUNWIND_LIBS)

noinst_HEADERS   = $(hdr)
EXTRA_DIST = \
	mod_skeleton.c \
	configparser.y \
	mod_ssi_exprparser.y \
	lemon.c \
	lempar.c \
	SConscript \
	CMakeLists.txt config.h.cmake