1 AM_CFLAGS = $(FAM_CFLAGS) $(LIBUNWIND_CFLAGS)
3 noinst_PROGRAMS=proc_open test_buffer test_base64 test_configfile
4 sbin_PROGRAMS=lighttpd lighttpd-angel
5 LEMON=$(top_builddir)/src/lemon$(BUILD_EXEEXT)
10 test_configfile$(EXEEXT)
12 lemon$(BUILD_EXEEXT): lemon.c
13 $(AM_V_CC)$(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ $(srcdir)/lemon.c
15 lighttpd_angel_SOURCES=lighttpd-angel.c
17 .PHONY: versionstamp parsers
20 @test -f versionstamp.h || touch versionstamp.h; \
22 if test -d "$(top_srcdir)/.svn" -a -x "`which svnversion`"; then \
23 REVISION="$$(LANG= LC_ALL=C svnversion "$(top_srcdir)" 2>/dev/null || echo exported)"; \
24 if test "$$REVISION" = "exported"; then \
28 if test -z "$$REVISION" -a -d "$(top_srcdir)/.git" -a -x "`which git`"; then \
29 REVISION="$$(cd "$(top_srcdir)"; LANG= LC_ALL=C git describe --always 2>/dev/null || echo)"; \
31 if test -n "$$REVISION"; then \
32 echo "#define REPO_VERSION \"-devel-$$REVISION\"" > versionstamp.h.tmp; \
34 echo "#define REPO_VERSION \"\"" > versionstamp.h.tmp; \
36 if ! diff versionstamp.h.tmp versionstamp.h >/dev/null 2>/dev/null; then \
37 mv versionstamp.h.tmp versionstamp.h; \
39 rm versionstamp.h.tmp; \
42 configparser.h: configparser.c
43 configparser.c: $(srcdir)/configparser.y $(srcdir)/lempar.c lemon$(BUILD_EXEEXT)
45 $(LEMON) -q $(srcdir)/configparser.y $(srcdir)/lempar.c
47 mod_ssi_exprparser.h: mod_ssi_exprparser.c
48 mod_ssi_exprparser.c: $(srcdir)/mod_ssi_exprparser.y $(srcdir)/lempar.c lemon$(BUILD_EXEEXT)
49 rm -f mod_ssi_exprparser.h
50 $(LEMON) -q $(srcdir)/mod_ssi_exprparser.y $(srcdir)/lempar.c
52 parsers: configparser.c mod_ssi_exprparser.c
54 BUILT_SOURCES = parsers versionstamp
55 MAINTAINERCLEANFILES = configparser.c configparser.h mod_ssi_exprparser.c mod_ssi_exprparser.h
56 CLEANFILES = versionstamp.h versionstamp.h.tmp lemon$(BUILD_EXEEXT)
58 common_src=base64.c buffer.c log.c \
60 http_chunk.c stream.c fdevent.c gw_backend.c \
61 stat_cache.c plugin.c joblist.c etag.c array.c \
62 data_string.c data_array.c \
63 data_integer.c algo_sha1.c md5.c \
65 fdevent_select.c fdevent_libev.c \
66 fdevent_poll.c fdevent_linux_sysepoll.c \
67 fdevent_solaris_devpoll.c fdevent_solaris_port.c \
68 fdevent_freebsd_kqueue.c \
79 splaytree.c status_counter.c \
82 src = server.c response.c connections.c \
86 configfile.c configparser.c proc_open.c
91 # if the linker doesn't allow referencing symbols of the binary
92 # we have to put everything into a shared-lib and link it into
94 common_ldflags = -avoid-version -no-undefined
95 lib_LTLIBRARIES += liblightcomp.la
96 liblightcomp_la_SOURCES=$(common_src)
97 liblightcomp_la_CFLAGS=$(AM_CFLAGS) $(LIBEV_CFLAGS)
98 liblightcomp_la_LDFLAGS = $(common_ldflags)
99 liblightcomp_la_LIBADD = $(PCRE_LIB) $(CRYPTO_LIB) $(FAM_LIBS) $(LIBEV_LIBS) $(ATTR_LIB)
100 common_libadd = liblightcomp.la
103 common_ldflags = -avoid-version
106 common_module_ldflags = -module -export-dynamic $(common_ldflags)
108 lib_LTLIBRARIES += mod_flv_streaming.la
109 mod_flv_streaming_la_SOURCES = mod_flv_streaming.c
110 mod_flv_streaming_la_LDFLAGS = $(common_module_ldflags)
111 mod_flv_streaming_la_LIBADD = $(common_libadd)
114 lib_LTLIBRARIES += mod_geoip.la
115 mod_geoip_la_SOURCES = mod_geoip.c
116 mod_geoip_la_LDFLAGS = $(common_module_ldflags)
117 mod_geoip_la_LIBADD = $(common_libadd) $(GEOIP_LIB)
120 lib_LTLIBRARIES += mod_evasive.la
121 mod_evasive_la_SOURCES = mod_evasive.c
122 mod_evasive_la_LDFLAGS = $(common_module_ldflags)
123 mod_evasive_la_LIBADD = $(common_libadd)
125 lib_LTLIBRARIES += mod_webdav.la
126 mod_webdav_la_SOURCES = mod_webdav.c
127 mod_webdav_la_CFLAGS = $(AM_CFLAGS) $(XML_CFLAGS) $(SQLITE_CFLAGS)
128 mod_webdav_la_LDFLAGS = $(common_module_ldflags)
129 mod_webdav_la_LIBADD = $(common_libadd) $(XML_LIBS) $(SQLITE_LIBS) $(UUID_LIBS)
132 lib_LTLIBRARIES += mod_magnet.la
133 mod_magnet_la_SOURCES = mod_magnet.c mod_magnet_cache.c
134 mod_magnet_la_CFLAGS = $(AM_CFLAGS) $(LUA_CFLAGS)
135 mod_magnet_la_LDFLAGS = $(common_module_ldflags)
136 mod_magnet_la_LIBADD = $(common_libadd) $(LUA_LIBS) -lm
140 lib_LTLIBRARIES += mod_cml.la
141 mod_cml_la_SOURCES = mod_cml.c mod_cml_lua.c mod_cml_funcs.c
142 mod_cml_la_CFLAGS = $(AM_CFLAGS) $(LUA_CFLAGS)
143 mod_cml_la_LDFLAGS = $(common_module_ldflags)
144 mod_cml_la_LIBADD = $(MEMCACHED_LIB) $(common_libadd) $(LUA_LIBS) -lm
147 if BUILD_MOD_TRIGGER_B4_DL
148 lib_LTLIBRARIES += mod_trigger_b4_dl.la
149 mod_trigger_b4_dl_la_SOURCES = mod_trigger_b4_dl.c
150 mod_trigger_b4_dl_la_LDFLAGS = $(common_module_ldflags)
151 mod_trigger_b4_dl_la_LIBADD = $(GDBM_LIB) $(MEMCACHED_LIB) $(PCRE_LIB) $(common_libadd)
154 lib_LTLIBRARIES += mod_vhostdb.la
155 mod_vhostdb_la_SOURCES = mod_vhostdb.c
156 mod_vhostdb_la_LDFLAGS = $(common_module_ldflags)
157 mod_vhostdb_la_LIBADD = $(common_libadd)
160 lib_LTLIBRARIES += mod_vhostdb_ldap.la
161 mod_vhostdb_ldap_la_SOURCES = mod_vhostdb_ldap.c
162 mod_vhostdb_ldap_la_LDFLAGS = $(common_module_ldflags)
163 mod_vhostdb_ldap_la_LIBADD = $(LDAP_LIB) $(LBER_LIB) $(common_libadd)
167 lib_LTLIBRARIES += mod_mysql_vhost.la
168 mod_mysql_vhost_la_SOURCES = mod_mysql_vhost.c
169 mod_mysql_vhost_la_LDFLAGS = $(common_module_ldflags)
170 mod_mysql_vhost_la_LIBADD = $(MYSQL_LIBS) $(common_libadd)
171 mod_mysql_vhost_la_CPPFLAGS = $(MYSQL_INCLUDE)
175 lib_LTLIBRARIES += mod_vhostdb_mysql.la
176 mod_vhostdb_mysql_la_SOURCES = mod_vhostdb_mysql.c
177 mod_vhostdb_mysql_la_LDFLAGS = $(common_module_ldflags)
178 mod_vhostdb_mysql_la_LIBADD = $(MYSQL_LIBS) $(common_libadd)
179 mod_vhostdb_mysql_la_CPPFLAGS = $(MYSQL_INCLUDE)
183 lib_LTLIBRARIES += mod_vhostdb_pgsql.la
184 mod_vhostdb_pgsql_la_SOURCES = mod_vhostdb_pgsql.c
185 mod_vhostdb_pgsql_la_LDFLAGS = $(common_module_ldflags)
186 mod_vhostdb_pgsql_la_LIBADD = $(PGSQL_LIBS) $(common_libadd)
187 mod_vhostdb_pgsql_la_CPPFLAGS = $(PGSQL_INCLUDE)
191 lib_LTLIBRARIES += mod_vhostdb_dbi.la
192 mod_vhostdb_dbi_la_SOURCES = mod_vhostdb_dbi.c
193 mod_vhostdb_dbi_la_LDFLAGS = $(common_module_ldflags)
194 mod_vhostdb_dbi_la_LIBADD = $(DBI_LIBS) $(common_libadd)
195 mod_vhostdb_dbi_la_CPPFLAGS = $(DBI_CFLAGS)
198 lib_LTLIBRARIES += mod_cgi.la
199 mod_cgi_la_SOURCES = mod_cgi.c
200 mod_cgi_la_LDFLAGS = $(common_module_ldflags)
201 mod_cgi_la_LIBADD = $(common_libadd)
203 lib_LTLIBRARIES += mod_scgi.la
204 mod_scgi_la_SOURCES = mod_scgi.c
205 mod_scgi_la_LDFLAGS = $(common_module_ldflags)
206 mod_scgi_la_LIBADD = $(common_libadd)
208 lib_LTLIBRARIES += mod_staticfile.la
209 mod_staticfile_la_SOURCES = mod_staticfile.c
210 mod_staticfile_la_LDFLAGS = $(common_module_ldflags)
211 mod_staticfile_la_LIBADD = $(common_libadd)
213 lib_LTLIBRARIES += mod_dirlisting.la
214 mod_dirlisting_la_SOURCES = mod_dirlisting.c
215 mod_dirlisting_la_LDFLAGS = $(common_module_ldflags)
216 mod_dirlisting_la_LIBADD = $(common_libadd) $(PCRE_LIB)
218 lib_LTLIBRARIES += mod_indexfile.la
219 mod_indexfile_la_SOURCES = mod_indexfile.c
220 mod_indexfile_la_LDFLAGS = $(common_module_ldflags)
221 mod_indexfile_la_LIBADD = $(common_libadd)
223 lib_LTLIBRARIES += mod_setenv.la
224 mod_setenv_la_SOURCES = mod_setenv.c
225 mod_setenv_la_LDFLAGS = $(common_module_ldflags)
226 mod_setenv_la_LIBADD = $(common_libadd)
228 lib_LTLIBRARIES += mod_alias.la
229 mod_alias_la_SOURCES = mod_alias.c
230 mod_alias_la_LDFLAGS = $(common_module_ldflags)
231 mod_alias_la_LIBADD = $(common_libadd)
233 lib_LTLIBRARIES += mod_userdir.la
234 mod_userdir_la_SOURCES = mod_userdir.c
235 mod_userdir_la_LDFLAGS = $(common_module_ldflags)
236 mod_userdir_la_LIBADD = $(common_libadd)
238 lib_LTLIBRARIES += mod_rrdtool.la
239 mod_rrdtool_la_SOURCES = mod_rrdtool.c
240 mod_rrdtool_la_LDFLAGS = $(common_module_ldflags)
241 mod_rrdtool_la_LIBADD = $(common_libadd)
243 lib_LTLIBRARIES += mod_usertrack.la
244 mod_usertrack_la_SOURCES = mod_usertrack.c
245 mod_usertrack_la_LDFLAGS = $(common_module_ldflags)
246 mod_usertrack_la_LIBADD = $(common_libadd)
248 lib_LTLIBRARIES += mod_proxy.la
249 mod_proxy_la_SOURCES = mod_proxy.c
250 mod_proxy_la_LDFLAGS = $(common_module_ldflags)
251 mod_proxy_la_LIBADD = $(common_libadd)
253 lib_LTLIBRARIES += mod_ssi.la
254 mod_ssi_la_SOURCES = mod_ssi_exprparser.c mod_ssi_expr.c mod_ssi.c
255 mod_ssi_la_LDFLAGS = $(common_module_ldflags)
256 mod_ssi_la_LIBADD = $(common_libadd)
258 lib_LTLIBRARIES += mod_secdownload.la
259 mod_secdownload_la_SOURCES = mod_secdownload.c
260 mod_secdownload_la_LDFLAGS = $(common_module_ldflags)
261 mod_secdownload_la_LIBADD = $(common_libadd) $(CRYPTO_LIB)
263 #lib_LTLIBRARIES += mod_httptls.la
264 #mod_httptls_la_SOURCES = mod_httptls.c
265 #mod_httptls_la_LDFLAGS = $(common_module_ldflags)
266 #mod_httptls_la_LIBADD = $(common_libadd)
268 lib_LTLIBRARIES += mod_expire.la
269 mod_expire_la_SOURCES = mod_expire.c
270 mod_expire_la_LDFLAGS = $(common_module_ldflags)
271 mod_expire_la_LIBADD = $(common_libadd)
273 lib_LTLIBRARIES += mod_evhost.la
274 mod_evhost_la_SOURCES = mod_evhost.c
275 mod_evhost_la_LDFLAGS = $(common_module_ldflags)
276 mod_evhost_la_LIBADD = $(common_libadd)
278 lib_LTLIBRARIES += mod_simple_vhost.la
279 mod_simple_vhost_la_SOURCES = mod_simple_vhost.c
280 mod_simple_vhost_la_LDFLAGS = $(common_module_ldflags)
281 mod_simple_vhost_la_LIBADD = $(common_libadd)
283 lib_LTLIBRARIES += mod_fastcgi.la
284 mod_fastcgi_la_SOURCES = mod_fastcgi.c
285 mod_fastcgi_la_LDFLAGS = $(common_module_ldflags)
286 mod_fastcgi_la_LIBADD = $(common_libadd)
288 lib_LTLIBRARIES += mod_extforward.la
289 mod_extforward_la_SOURCES = mod_extforward.c
290 mod_extforward_la_LDFLAGS = $(common_module_ldflags)
291 mod_extforward_la_LIBADD = $(common_libadd)
293 lib_LTLIBRARIES += mod_access.la
294 mod_access_la_SOURCES = mod_access.c
295 mod_access_la_LDFLAGS = $(common_module_ldflags)
296 mod_access_la_LIBADD = $(common_libadd)
298 lib_LTLIBRARIES += mod_compress.la
299 mod_compress_la_SOURCES = mod_compress.c
300 mod_compress_la_LDFLAGS = $(common_module_ldflags)
301 mod_compress_la_LIBADD = $(Z_LIB) $(BZ_LIB) $(common_libadd)
303 lib_LTLIBRARIES += mod_deflate.la
304 mod_deflate_la_SOURCES = mod_deflate.c
305 mod_deflate_la_LDFLAGS = $(common_module_ldflags)
306 mod_deflate_la_LIBADD = $(Z_LIB) $(BZ_LIB) $(common_libadd)
308 lib_LTLIBRARIES += mod_auth.la
309 mod_auth_la_SOURCES = mod_auth.c
310 mod_auth_la_LDFLAGS = $(common_module_ldflags)
311 mod_auth_la_LIBADD = $(common_libadd)
313 lib_LTLIBRARIES += mod_authn_file.la
314 mod_authn_file_la_SOURCES = mod_authn_file.c
315 mod_authn_file_la_LDFLAGS = $(common_module_ldflags)
316 mod_authn_file_la_LIBADD = $(CRYPT_LIB) $(CRYPTO_LIB) $(common_libadd)
319 lib_LTLIBRARIES += mod_authn_gssapi.la
320 mod_authn_gssapi_la_SOURCES = mod_authn_gssapi.c
321 mod_authn_gssapi_la_LDFLAGS = $(common_module_ldflags)
322 mod_authn_gssapi_la_LIBADD = $(KRB5_LIB) $(common_libadd)
326 lib_LTLIBRARIES += mod_authn_ldap.la
327 mod_authn_ldap_la_SOURCES = mod_authn_ldap.c
328 mod_authn_ldap_la_LDFLAGS = $(common_module_ldflags)
329 mod_authn_ldap_la_LIBADD = $(LDAP_LIB) $(LBER_LIB) $(common_libadd)
333 lib_LTLIBRARIES += mod_authn_mysql.la
334 mod_authn_mysql_la_SOURCES = mod_authn_mysql.c
335 mod_authn_mysql_la_LDFLAGS = $(common_module_ldflags)
336 mod_authn_mysql_la_LIBADD = $(CRYPT_LIB) $(MYSQL_LIBS) $(common_libadd)
337 mod_authn_mysql_la_CPPFLAGS = $(MYSQL_INCLUDE)
340 if BUILD_WITH_OPENSSL
341 lib_LTLIBRARIES += mod_openssl.la
342 mod_openssl_la_SOURCES = mod_openssl.c
343 mod_openssl_la_LDFLAGS = $(common_module_ldflags)
344 mod_openssl_la_LIBADD = $(SSL_LIB) $(common_libadd)
347 lib_LTLIBRARIES += mod_rewrite.la
348 mod_rewrite_la_SOURCES = mod_rewrite.c
349 mod_rewrite_la_LDFLAGS = $(common_module_ldflags)
350 mod_rewrite_la_LIBADD = $(PCRE_LIB) $(common_libadd)
352 lib_LTLIBRARIES += mod_redirect.la
353 mod_redirect_la_SOURCES = mod_redirect.c
354 mod_redirect_la_LDFLAGS = $(common_module_ldflags)
355 mod_redirect_la_LIBADD = $(PCRE_LIB) $(common_libadd)
357 lib_LTLIBRARIES += mod_status.la
358 mod_status_la_SOURCES = mod_status.c
359 mod_status_la_LDFLAGS = $(common_module_ldflags)
360 mod_status_la_LIBADD = $(common_libadd)
362 lib_LTLIBRARIES += mod_accesslog.la
363 mod_accesslog_la_SOURCES = mod_accesslog.c
364 mod_accesslog_la_LDFLAGS = $(common_module_ldflags)
365 mod_accesslog_la_LIBADD = $(common_libadd)
367 lib_LTLIBRARIES += mod_uploadprogress.la
368 mod_uploadprogress_la_SOURCES = mod_uploadprogress.c
369 mod_uploadprogress_la_LDFLAGS = $(common_module_ldflags)
370 mod_uploadprogress_la_LIBADD = $(common_libadd)
372 lib_LTLIBRARIES += mod_wstunnel.la
373 mod_wstunnel_la_SOURCES = mod_wstunnel.c
374 mod_wstunnel_la_LDFLAGS = $(common_module_ldflags)
375 mod_wstunnel_la_LIBADD = $(common_libadd) $(CRYPTO_LIB)
378 hdr = server.h base64.h buffer.h network.h log.h keyvalue.h \
379 response.h request.h fastcgi.h chunk.h \
380 first.h settings.h http_chunk.h \
381 algo_sha1.h md5.h http_auth.h http_vhostdb.h stream.h \
382 fdevent.h gw_backend.h connections.h base.h base_decls.h stat_cache.h \
384 etag.h joblist.h array.h vector.h crc32.h \
385 fdevent_impl.h network_write.h configfile.h \
386 mod_ssi.h mod_ssi_expr.h inet_ntop_cache.h \
387 configparser.h mod_ssi_exprparser.h \
389 sys-endian.h sys-mmap.h sys-socket.h sys-strings.h \
390 mod_cml.h mod_cml_funcs.h \
391 safe_memclear.h sock_addr.h splaytree.h proc_open.h status_counter.h \
395 DEFS= @DEFS@ -DHAVE_VERSIONSTAMP_H -DLIBRARY_DIR="\"$(libdir)\"" -DSBIN_DIR="\"$(sbindir)\""
400 ## static lighttpd server (used in conjunction with -DLIGHTTPD_STATIC)
401 ## (order is not important)
417 mod_flv_streaming.c \
427 mod_ssi_exprparser.c mod_ssi_expr.c mod_ssi.c \
430 mod_uploadprogress.c \
435 lighttpd_CPPFLAGS = \
437 $(XML_CFLAGS) $(SQLITE_CFLAGS) \
438 $(FAM_CFLAGS) $(LIBEV_CFLAGS) $(LIBUNWIND_CFLAGS)
441 $(CRYPT_LIB) $(CRYPTO_LIB) \
442 $(XML_LIBS) $(SQLITE_LIBS) $(UUID_LIBS) \
443 $(PCRE_LIB) $(Z_LIB) $(BZ_LIB) $(DL_LIB) $(SENDFILE_LIB) $(ATTR_LIB) \
444 $(FAM_LIBS) $(LIBEV_LIBS) $(LIBUNWIND_LIBS)
445 lighttpd_LDFLAGS = -export-dynamic
448 lighttpd_SOURCES += mod_geoip.c
449 lighttpd_LDADD += $(GEOIP_LIB)
452 lighttpd_SOURCES += mod_cml.c mod_cml_lua.c mod_cml_funcs.c \
453 mod_magnet.c mod_magnet_cache.c
454 lighttpd_CPPFLAGS += $(LUA_CFLAGS)
455 lighttpd_LDADD += $(LUA_LIBS) -lm
458 lighttpd_SOURCES += mod_authn_gssapi.c
459 lighttpd_LDADD += $(KRB5_LIB)
462 lighttpd_SOURCES += mod_authn_ldap.c mod_vhostdb_ldap.c
463 lighttpd_LDADD += $(LDAP_LIB) $(LBER_LIB)
466 lighttpd_SOURCES += mod_authn_mysql.c mod_mysql_vhost.c mod_vhostdb_mysql.c
467 lighttpd_CPPFLAGS += $(MYSQL_INCLUDE)
468 lighttpd_LDADD += $(MYSQL_LIBS)
471 lighttpd_SOURCES += mod_vhostdb_pgsql.c
472 lighttpd_CPPFLAGS += $(PGSQL_INCLUDE)
473 lighttpd_LDADD += $(PGSQL_LIBS)
476 lighttpd_SOURCES += mod_vhostdb_dbi.c
477 lighttpd_CPPFLAGS += $(DBI_CFLAGS)
478 lighttpd_LDADD += $(DBI_LIBS)
480 if BUILD_WITH_OPENSSL
481 lighttpd_SOURCES += mod_openssl.c
482 lighttpd_LDADD += $(SSL_LIB)
484 if BUILD_WITH_MEMCACHED
485 lighttpd_CPPFLAGS += $(MEMCACHED_CFLAGS)
486 lighttpd_LDADD += $(MEMCACHED_LIB)
489 lighttpd_LDADD += $(GDBM_LIB)
491 if BUILD_MOD_TRIGGER_B4_DL
492 lighttpd_SOURCES += mod_trigger_b4_dl.c
497 ## default lighttpd server
498 lighttpd_SOURCES = $(src)
499 lighttpd_CPPFLAGS = $(FAM_CFLAGS) $(LIBEV_CFLAGS)
500 lighttpd_LDADD = $(PCRE_LIB) $(DL_LIB) $(SENDFILE_LIB) $(ATTR_LIB) $(common_libadd) $(CRYPTO_LIB) $(FAM_LIBS) $(LIBEV_LIBS) $(LIBUNWIND_LIBS)
501 lighttpd_LDFLAGS = -export-dynamic
505 proc_open_SOURCES = proc_open.c buffer.c
506 proc_open_LDADD = $(LIBUNWIND_LIBS)
507 proc_open_CPPFLAGS= -DDEBUG_PROC_OPEN
509 test_buffer_SOURCES = test_buffer.c buffer.c
510 test_buffer_LDADD = $(LIBUNWIND_LIBS)
512 test_base64_SOURCES = test_base64.c base64.c buffer.c
513 test_base64_LDADD = $(LIBUNWIND_LIBS)
515 test_configfile_SOURCES = test_configfile.c buffer.c array.c data_string.c keyvalue.c vector.c log.c sock_addr.c
516 test_configfile_LDADD = $(PCRE_LIB) $(LIBUNWIND_LIBS)
518 noinst_HEADERS = $(hdr)
522 mod_ssi_exprparser.y \
526 CMakeLists.txt config.h.cmake \