1 AM_CFLAGS = $(FAM_CFLAGS) $(LIBUNWIND_CFLAGS)
3 noinst_PROGRAMS=lemon proc_open test_buffer test_base64 test_configfile
4 sbin_PROGRAMS=lighttpd lighttpd-angel
5 LEMON=$(top_builddir)/src/lemon$(EXEEXT)
10 test_configfile$(EXEEXT)
14 lighttpd_angel_SOURCES=lighttpd-angel.c
16 .PHONY: versionstamp parsers
19 @test -f versionstamp.h || touch versionstamp.h; \
21 if test -d "$(top_srcdir)/.svn" -a -x "`which svnversion`"; then \
22 REVISION="$$(LANG= LC_ALL=C svnversion "$(top_srcdir)" 2>/dev/null || echo exported)"; \
23 if test "$$REVISION" = "exported"; then \
27 if test -z "$$REVISION" -a -d "$(top_srcdir)/.git" -a -x "`which git`"; then \
28 REVISION="$$(cd "$(top_srcdir)"; LANG= LC_ALL=C git describe --always 2>/dev/null || echo)"; \
30 if test -n "$$REVISION"; then \
31 echo "#define REPO_VERSION \"-devel-$$REVISION\"" > versionstamp.h.tmp; \
33 echo "#define REPO_VERSION \"\"" > versionstamp.h.tmp; \
35 if ! diff versionstamp.h.tmp versionstamp.h >/dev/null 2>/dev/null; then \
36 mv versionstamp.h.tmp versionstamp.h; \
38 rm versionstamp.h.tmp; \
42 configparser.c configparser.h:
43 mod_ssi_exprparser.c mod_ssi_exprparser.h:
47 configparser.h: configparser.c
48 configparser.c: $(srcdir)/configparser.y $(srcdir)/lempar.c lemon$(EXEEXT)
50 $(LEMON) -q $(srcdir)/configparser.y $(srcdir)/lempar.c
52 mod_ssi_exprparser.h: mod_ssi_exprparser.c
53 mod_ssi_exprparser.c: $(srcdir)/mod_ssi_exprparser.y $(srcdir)/lempar.c lemon$(EXEEXT)
54 rm -f mod_ssi_exprparser.h
55 $(LEMON) -q $(srcdir)/mod_ssi_exprparser.y $(srcdir)/lempar.c
57 parsers: configparser.c mod_ssi_exprparser.c
60 BUILT_SOURCES = parsers versionstamp
61 MAINTAINERCLEANFILES = configparser.c configparser.h mod_ssi_exprparser.c mod_ssi_exprparser.h
62 CLEANFILES = versionstamp.h versionstamp.h.tmp
64 common_src=base64.c buffer.c log.c \
66 http_chunk.c stream.c fdevent.c \
67 stat_cache.c plugin.c joblist.c etag.c array.c \
68 data_string.c data_array.c \
69 data_integer.c md5.c data_fastcgi.c \
71 fdevent_select.c fdevent_libev.c \
72 fdevent_poll.c fdevent_linux_sysepoll.c \
73 fdevent_solaris_devpoll.c fdevent_solaris_port.c \
74 fdevent_freebsd_kqueue.c \
76 inet_ntop_cache.c crc32.c \
81 network_write.c network_linux_sendfile.c \
82 network_write_mmap.c network_write_no_mmap.c \
83 network_freebsd_sendfile.c network_writev.c \
84 network_solaris_sendfilev.c network_openssl.c \
86 splaytree.c status_counter.c \
87 safe_memclear.c network_darwin_sendfile.c
89 src = server.c response.c connections.c network.c \
90 configfile.c configparser.c request.c proc_open.c
95 # if the linker doesn't allow referencing symbols of the binary
96 # we have to put everything into a shared-lib and link it into
98 common_ldflags = -avoid-version -no-undefined
99 lib_LTLIBRARIES += liblightcomp.la
100 liblightcomp_la_SOURCES=$(common_src)
101 liblightcomp_la_CFLAGS=$(AM_CFLAGS) $(LIBEV_CFLAGS)
102 liblightcomp_la_LDFLAGS = $(common_ldflags)
103 liblightcomp_la_LIBADD = $(PCRE_LIB) $(SSL_LIB) $(FAM_LIBS) $(LIBEV_LIBS) $(ATTR_LIB)
104 common_libadd = liblightcomp.la
107 common_ldflags = -avoid-version
110 common_module_ldflags = -module -export-dynamic $(common_ldflags)
112 lib_LTLIBRARIES += mod_flv_streaming.la
113 mod_flv_streaming_la_SOURCES = mod_flv_streaming.c
114 mod_flv_streaming_la_LDFLAGS = $(common_module_ldflags)
115 mod_flv_streaming_la_LIBADD = $(common_libadd)
118 lib_LTLIBRARIES += mod_geoip.la
119 mod_geoip_la_SOURCES = mod_geoip.c
120 mod_geoip_la_LDFLAGS = $(common_module_ldflags)
121 mod_geoip_la_LIBADD = $(common_libadd) $(GEOIP_LIB)
124 lib_LTLIBRARIES += mod_evasive.la
125 mod_evasive_la_SOURCES = mod_evasive.c
126 mod_evasive_la_LDFLAGS = $(common_module_ldflags)
127 mod_evasive_la_LIBADD = $(common_libadd)
129 lib_LTLIBRARIES += mod_webdav.la
130 mod_webdav_la_SOURCES = mod_webdav.c
131 mod_webdav_la_CFLAGS = $(AM_CFLAGS) $(XML_CFLAGS) $(SQLITE_CFLAGS)
132 mod_webdav_la_LDFLAGS = $(common_module_ldflags)
133 mod_webdav_la_LIBADD = $(common_libadd) $(XML_LIBS) $(SQLITE_LIBS) $(UUID_LIBS)
136 lib_LTLIBRARIES += mod_magnet.la
137 mod_magnet_la_SOURCES = mod_magnet.c mod_magnet_cache.c
138 mod_magnet_la_CFLAGS = $(AM_CFLAGS) $(LUA_CFLAGS)
139 mod_magnet_la_LDFLAGS = $(common_module_ldflags)
140 mod_magnet_la_LIBADD = $(common_libadd) $(LUA_LIBS) -lm
144 lib_LTLIBRARIES += mod_cml.la
145 mod_cml_la_SOURCES = mod_cml.c mod_cml_lua.c mod_cml_funcs.c
146 mod_cml_la_CFLAGS = $(AM_CFLAGS) $(LUA_CFLAGS)
147 mod_cml_la_LDFLAGS = $(common_module_ldflags)
148 mod_cml_la_LIBADD = $(MEMCACHED_LIB) $(common_libadd) $(LUA_LIBS) -lm
151 if BUILD_MOD_TRIGGER_B4_DL
152 lib_LTLIBRARIES += mod_trigger_b4_dl.la
153 mod_trigger_b4_dl_la_SOURCES = mod_trigger_b4_dl.c
154 mod_trigger_b4_dl_la_LDFLAGS = $(common_module_ldflags)
155 mod_trigger_b4_dl_la_LIBADD = $(GDBM_LIB) $(MEMCACHED_LIB) $(PCRE_LIB) $(common_libadd)
159 lib_LTLIBRARIES += mod_mysql_vhost.la
160 mod_mysql_vhost_la_SOURCES = mod_mysql_vhost.c
161 mod_mysql_vhost_la_LDFLAGS = $(common_module_ldflags)
162 mod_mysql_vhost_la_LIBADD = $(MYSQL_LIBS) $(common_libadd)
163 mod_mysql_vhost_la_CPPFLAGS = $(MYSQL_INCLUDE)
166 lib_LTLIBRARIES += mod_cgi.la
167 mod_cgi_la_SOURCES = mod_cgi.c
168 mod_cgi_la_LDFLAGS = $(common_module_ldflags)
169 mod_cgi_la_LIBADD = $(common_libadd)
171 lib_LTLIBRARIES += mod_scgi.la
172 mod_scgi_la_SOURCES = mod_scgi.c
173 mod_scgi_la_LDFLAGS = $(common_module_ldflags)
174 mod_scgi_la_LIBADD = $(common_libadd)
176 lib_LTLIBRARIES += mod_staticfile.la
177 mod_staticfile_la_SOURCES = mod_staticfile.c
178 mod_staticfile_la_LDFLAGS = $(common_module_ldflags)
179 mod_staticfile_la_LIBADD = $(common_libadd)
181 lib_LTLIBRARIES += mod_dirlisting.la
182 mod_dirlisting_la_SOURCES = mod_dirlisting.c
183 mod_dirlisting_la_LDFLAGS = $(common_module_ldflags)
184 mod_dirlisting_la_LIBADD = $(common_libadd) $(PCRE_LIB)
186 lib_LTLIBRARIES += mod_indexfile.la
187 mod_indexfile_la_SOURCES = mod_indexfile.c
188 mod_indexfile_la_LDFLAGS = $(common_module_ldflags)
189 mod_indexfile_la_LIBADD = $(common_libadd)
191 lib_LTLIBRARIES += mod_setenv.la
192 mod_setenv_la_SOURCES = mod_setenv.c
193 mod_setenv_la_LDFLAGS = $(common_module_ldflags)
194 mod_setenv_la_LIBADD = $(common_libadd)
196 lib_LTLIBRARIES += mod_alias.la
197 mod_alias_la_SOURCES = mod_alias.c
198 mod_alias_la_LDFLAGS = $(common_module_ldflags)
199 mod_alias_la_LIBADD = $(common_libadd)
201 lib_LTLIBRARIES += mod_userdir.la
202 mod_userdir_la_SOURCES = mod_userdir.c
203 mod_userdir_la_LDFLAGS = $(common_module_ldflags)
204 mod_userdir_la_LIBADD = $(common_libadd)
206 lib_LTLIBRARIES += mod_rrdtool.la
207 mod_rrdtool_la_SOURCES = mod_rrdtool.c
208 mod_rrdtool_la_LDFLAGS = $(common_module_ldflags)
209 mod_rrdtool_la_LIBADD = $(common_libadd)
211 lib_LTLIBRARIES += mod_usertrack.la
212 mod_usertrack_la_SOURCES = mod_usertrack.c
213 mod_usertrack_la_LDFLAGS = $(common_module_ldflags)
214 mod_usertrack_la_LIBADD = $(common_libadd)
216 lib_LTLIBRARIES += mod_proxy.la
217 mod_proxy_la_SOURCES = mod_proxy.c
218 mod_proxy_la_LDFLAGS = $(common_module_ldflags)
219 mod_proxy_la_LIBADD = $(common_libadd)
221 lib_LTLIBRARIES += mod_ssi.la
222 mod_ssi_la_SOURCES = mod_ssi_exprparser.c mod_ssi_expr.c mod_ssi.c
223 mod_ssi_la_LDFLAGS = $(common_module_ldflags)
224 mod_ssi_la_LIBADD = $(common_libadd)
226 lib_LTLIBRARIES += mod_secdownload.la
227 mod_secdownload_la_SOURCES = mod_secdownload.c
228 mod_secdownload_la_LDFLAGS = $(common_module_ldflags)
229 mod_secdownload_la_LIBADD = $(common_libadd)
231 #lib_LTLIBRARIES += mod_httptls.la
232 #mod_httptls_la_SOURCES = mod_httptls.c
233 #mod_httptls_la_LDFLAGS = $(common_module_ldflags)
234 #mod_httptls_la_LIBADD = $(common_libadd)
236 lib_LTLIBRARIES += mod_expire.la
237 mod_expire_la_SOURCES = mod_expire.c
238 mod_expire_la_LDFLAGS = $(common_module_ldflags)
239 mod_expire_la_LIBADD = $(common_libadd)
241 lib_LTLIBRARIES += mod_evhost.la
242 mod_evhost_la_SOURCES = mod_evhost.c
243 mod_evhost_la_LDFLAGS = $(common_module_ldflags)
244 mod_evhost_la_LIBADD = $(common_libadd)
246 lib_LTLIBRARIES += mod_simple_vhost.la
247 mod_simple_vhost_la_SOURCES = mod_simple_vhost.c
248 mod_simple_vhost_la_LDFLAGS = $(common_module_ldflags)
249 mod_simple_vhost_la_LIBADD = $(common_libadd)
251 lib_LTLIBRARIES += mod_fastcgi.la
252 mod_fastcgi_la_SOURCES = mod_fastcgi.c
253 mod_fastcgi_la_LDFLAGS = $(common_module_ldflags)
254 mod_fastcgi_la_LIBADD = $(common_libadd)
256 lib_LTLIBRARIES += mod_extforward.la
257 mod_extforward_la_SOURCES = mod_extforward.c
258 mod_extforward_la_LDFLAGS = $(common_module_ldflags)
259 mod_extforward_la_LIBADD = $(common_libadd)
261 lib_LTLIBRARIES += mod_access.la
262 mod_access_la_SOURCES = mod_access.c
263 mod_access_la_LDFLAGS = $(common_module_ldflags)
264 mod_access_la_LIBADD = $(common_libadd)
266 lib_LTLIBRARIES += mod_compress.la
267 mod_compress_la_SOURCES = mod_compress.c
268 mod_compress_la_LDFLAGS = $(common_module_ldflags)
269 mod_compress_la_LIBADD = $(Z_LIB) $(BZ_LIB) $(common_libadd)
271 lib_LTLIBRARIES += mod_deflate.la
272 mod_deflate_la_SOURCES = mod_deflate.c
273 mod_deflate_la_LDFLAGS = $(common_module_ldflags)
274 mod_deflate_la_LIBADD = $(Z_LIB) $(BZ_LIB) $(common_libadd)
276 lib_LTLIBRARIES += mod_auth.la
277 mod_auth_la_SOURCES = mod_auth.c
278 mod_auth_la_LDFLAGS = $(common_module_ldflags)
279 mod_auth_la_LIBADD = $(common_libadd)
281 lib_LTLIBRARIES += mod_authn_file.la
282 mod_authn_file_la_SOURCES = mod_authn_file.c
283 mod_authn_file_la_LDFLAGS = $(common_module_ldflags)
284 mod_authn_file_la_LIBADD = $(CRYPT_LIB) $(SSL_LIB) $(common_libadd)
287 lib_LTLIBRARIES += mod_authn_gssapi.la
288 mod_authn_gssapi_la_SOURCES = mod_authn_gssapi.c
289 mod_authn_gssapi_la_LDFLAGS = $(common_module_ldflags)
290 mod_authn_gssapi_la_LIBADD = $(KRB5_LIB) $(common_libadd)
294 lib_LTLIBRARIES += mod_authn_ldap.la
295 mod_authn_ldap_la_SOURCES = mod_authn_ldap.c
296 mod_authn_ldap_la_LDFLAGS = $(common_module_ldflags)
297 mod_authn_ldap_la_LIBADD = $(LDAP_LIB) $(LBER_LIB) $(common_libadd)
301 lib_LTLIBRARIES += mod_authn_mysql.la
302 mod_authn_mysql_la_SOURCES = mod_authn_mysql.c
303 mod_authn_mysql_la_LDFLAGS = $(common_module_ldflags)
304 mod_authn_mysql_la_LIBADD = $(CRYPT_LIB) $(MYSQL_LIBS) $(common_libadd)
305 mod_authn_mysql_la_CPPFLAGS = $(MYSQL_INCLUDE)
308 lib_LTLIBRARIES += mod_rewrite.la
309 mod_rewrite_la_SOURCES = mod_rewrite.c
310 mod_rewrite_la_LDFLAGS = $(common_module_ldflags)
311 mod_rewrite_la_LIBADD = $(PCRE_LIB) $(common_libadd)
313 lib_LTLIBRARIES += mod_redirect.la
314 mod_redirect_la_SOURCES = mod_redirect.c
315 mod_redirect_la_LDFLAGS = $(common_module_ldflags)
316 mod_redirect_la_LIBADD = $(PCRE_LIB) $(common_libadd)
318 lib_LTLIBRARIES += mod_status.la
319 mod_status_la_SOURCES = mod_status.c
320 mod_status_la_LDFLAGS = $(common_module_ldflags)
321 mod_status_la_LIBADD = $(common_libadd)
323 lib_LTLIBRARIES += mod_accesslog.la
324 mod_accesslog_la_SOURCES = mod_accesslog.c
325 mod_accesslog_la_LDFLAGS = $(common_module_ldflags)
326 mod_accesslog_la_LIBADD = $(common_libadd)
328 lib_LTLIBRARIES += mod_uploadprogress.la
329 mod_uploadprogress_la_SOURCES = mod_uploadprogress.c
330 mod_uploadprogress_la_LDFLAGS = $(common_module_ldflags)
331 mod_uploadprogress_la_LIBADD = $(common_libadd)
334 hdr = server.h base64.h buffer.h network.h log.h keyvalue.h \
335 response.h request.h fastcgi.h chunk.h \
336 first.h settings.h http_chunk.h \
337 md5.h http_auth.h stream.h \
338 fdevent.h connections.h base.h stat_cache.h \
340 etag.h joblist.h array.h vector.h crc32.h \
341 network_backends.h configfile.h \
342 mod_ssi.h mod_ssi_expr.h inet_ntop_cache.h \
343 configparser.h mod_ssi_exprparser.h \
345 sys-endian.h sys-mmap.h sys-socket.h mod_cml.h mod_cml_funcs.h \
346 safe_memclear.h splaytree.h proc_open.h status_counter.h \
350 DEFS= @DEFS@ -DHAVE_VERSION_H -DLIBRARY_DIR="\"$(libdir)\"" -DSBIN_DIR="\"$(sbindir)\""
355 ## static lighttpd server (used in conjunction with -DLIGHTTPD_STATIC)
356 ## (order is not important)
372 mod_flv_streaming.c \
382 mod_ssi_exprparser.c mod_ssi_expr.c mod_ssi.c \
385 mod_uploadprogress.c \
389 lighttpd_CPPFLAGS = \
391 $(XML_CFLAGS) $(SQLITE_CFLAGS) \
392 $(FAM_CFLAGS) $(LIBEV_CFLAGS) $(LIBUNWIND_CFLAGS)
395 $(CRYPT_LIB) $(SSL_LIB) \
396 $(XML_LIBS) $(SQLITE_LIBS) $(UUID_LIBS) \
397 $(PCRE_LIB) $(Z_LIB) $(BZ_LIB) $(DL_LIB) $(SENDFILE_LIB) $(ATTR_LIB) \
398 $(FAM_LIBS) $(LIBEV_LIBS) $(LIBUNWIND_LIBS)
399 lighttpd_LDFLAGS = -export-dynamic
402 lighttpd_SOURCES += mod_geoip.c
403 lighttpd_LDADD += $(GEOIP_LIB)
406 lighttpd_SOURCES += mod_cml.c mod_cml_lua.c mod_cml_funcs.c \
407 mod_magnet.c mod_magnet_cache.c
408 lighttpd_CPPFLAGS += $(LUA_CFLAGS)
409 lighttpd_LDADD += $(LUA_LIBS) -lm
412 lighttpd_SOURCES += mod_authn_gssapi.c
413 lighttpd_LDADD += $(KRB5_LIB)
416 lighttpd_SOURCES += mod_authn_ldap.c
417 lighttpd_LDADD += $(LDAP_LIB) $(LBER_LIB)
420 lighttpd_SOURCES += mod_authn_mysql.c mod_mysql_vhost.c
421 lighttpd_CPPFLAGS += $(MYSQL_INCLUDE)
422 lighttpd_LDADD += $(MYSQL_LIBS)
424 if BUILD_WITH_MEMCACHED
425 lighttpd_CPPFLAGS += $(MEMCACHED_CFLAGS)
426 lighttpd_LDADD += $(MEMCACHED_LIB)
429 lighttpd_LDADD += $(GDBM_LIB)
431 if BUILD_MOD_TRIGGER_B4_DL
432 lighttpd_SOURCES += mod_trigger_b4_dl.c
437 ## default lighttpd server
438 lighttpd_SOURCES = $(src)
439 lighttpd_CPPFLAGS = $(FAM_CFLAGS) $(LIBEV_CFLAGS)
440 lighttpd_LDADD = $(PCRE_LIB) $(DL_LIB) $(SENDFILE_LIB) $(ATTR_LIB) $(common_libadd) $(SSL_LIB) $(FAM_LIBS) $(LIBEV_LIBS) $(LIBUNWIND_LIBS)
441 lighttpd_LDFLAGS = -export-dynamic
445 proc_open_SOURCES = proc_open.c buffer.c
446 proc_open_LDADD = $(LIBUNWIND_LIBS)
447 proc_open_CPPFLAGS= -DDEBUG_PROC_OPEN
449 test_buffer_SOURCES = test_buffer.c buffer.c
450 test_buffer_LDADD = $(LIBUNWIND_LIBS)
452 test_base64_SOURCES = test_base64.c base64.c buffer.c
453 test_base64_LDADD = $(LIBUNWIND_LIBS)
455 test_configfile_SOURCES = test_configfile.c buffer.c array.c data_string.c keyvalue.c vector.c log.c
456 test_configfile_LDADD = $(PCRE_LIB) $(LIBUNWIND_LIBS)
458 noinst_HEADERS = $(hdr)
462 mod_ssi_exprparser.y \
465 CMakeLists.txt config.h.cmake