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 \
61 stat_cache.c plugin.c joblist.c etag.c array.c \
62 data_string.c data_array.c \
63 data_integer.c md5.c data_fastcgi.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 \
70 inet_ntop_cache.c crc32.c \
76 splaytree.c status_counter.c \
79 src = server.c response.c connections.c network.c \
80 network_write.c network_linux_sendfile.c \
81 network_write_mmap.c network_write_no_mmap.c \
82 network_freebsd_sendfile.c network_writev.c \
83 network_solaris_sendfilev.c network_openssl.c \
84 network_darwin_sendfile.c \
85 configfile.c configparser.c request.c proc_open.c
90 # if the linker doesn't allow referencing symbols of the binary
91 # we have to put everything into a shared-lib and link it into
93 common_ldflags = -avoid-version -no-undefined
94 lib_LTLIBRARIES += liblightcomp.la
95 liblightcomp_la_SOURCES=$(common_src)
96 liblightcomp_la_CFLAGS=$(AM_CFLAGS) $(LIBEV_CFLAGS)
97 liblightcomp_la_LDFLAGS = $(common_ldflags)
98 liblightcomp_la_LIBADD = $(PCRE_LIB) $(SSL_LIB) $(FAM_LIBS) $(LIBEV_LIBS) $(ATTR_LIB)
99 common_libadd = liblightcomp.la
102 common_ldflags = -avoid-version
105 common_module_ldflags = -module -export-dynamic $(common_ldflags)
107 lib_LTLIBRARIES += mod_flv_streaming.la
108 mod_flv_streaming_la_SOURCES = mod_flv_streaming.c
109 mod_flv_streaming_la_LDFLAGS = $(common_module_ldflags)
110 mod_flv_streaming_la_LIBADD = $(common_libadd)
113 lib_LTLIBRARIES += mod_geoip.la
114 mod_geoip_la_SOURCES = mod_geoip.c
115 mod_geoip_la_LDFLAGS = $(common_module_ldflags)
116 mod_geoip_la_LIBADD = $(common_libadd) $(GEOIP_LIB)
119 lib_LTLIBRARIES += mod_evasive.la
120 mod_evasive_la_SOURCES = mod_evasive.c
121 mod_evasive_la_LDFLAGS = $(common_module_ldflags)
122 mod_evasive_la_LIBADD = $(common_libadd)
124 lib_LTLIBRARIES += mod_webdav.la
125 mod_webdav_la_SOURCES = mod_webdav.c
126 mod_webdav_la_CFLAGS = $(AM_CFLAGS) $(XML_CFLAGS) $(SQLITE_CFLAGS)
127 mod_webdav_la_LDFLAGS = $(common_module_ldflags)
128 mod_webdav_la_LIBADD = $(common_libadd) $(XML_LIBS) $(SQLITE_LIBS) $(UUID_LIBS)
131 lib_LTLIBRARIES += mod_magnet.la
132 mod_magnet_la_SOURCES = mod_magnet.c mod_magnet_cache.c
133 mod_magnet_la_CFLAGS = $(AM_CFLAGS) $(LUA_CFLAGS)
134 mod_magnet_la_LDFLAGS = $(common_module_ldflags)
135 mod_magnet_la_LIBADD = $(common_libadd) $(LUA_LIBS) -lm
139 lib_LTLIBRARIES += mod_cml.la
140 mod_cml_la_SOURCES = mod_cml.c mod_cml_lua.c mod_cml_funcs.c
141 mod_cml_la_CFLAGS = $(AM_CFLAGS) $(LUA_CFLAGS)
142 mod_cml_la_LDFLAGS = $(common_module_ldflags)
143 mod_cml_la_LIBADD = $(MEMCACHED_LIB) $(common_libadd) $(LUA_LIBS) -lm
146 if BUILD_MOD_TRIGGER_B4_DL
147 lib_LTLIBRARIES += mod_trigger_b4_dl.la
148 mod_trigger_b4_dl_la_SOURCES = mod_trigger_b4_dl.c
149 mod_trigger_b4_dl_la_LDFLAGS = $(common_module_ldflags)
150 mod_trigger_b4_dl_la_LIBADD = $(GDBM_LIB) $(MEMCACHED_LIB) $(PCRE_LIB) $(common_libadd)
154 lib_LTLIBRARIES += mod_mysql_vhost.la
155 mod_mysql_vhost_la_SOURCES = mod_mysql_vhost.c
156 mod_mysql_vhost_la_LDFLAGS = $(common_module_ldflags)
157 mod_mysql_vhost_la_LIBADD = $(MYSQL_LIBS) $(common_libadd)
158 mod_mysql_vhost_la_CPPFLAGS = $(MYSQL_INCLUDE)
161 lib_LTLIBRARIES += mod_cgi.la
162 mod_cgi_la_SOURCES = mod_cgi.c
163 mod_cgi_la_LDFLAGS = $(common_module_ldflags)
164 mod_cgi_la_LIBADD = $(common_libadd)
166 lib_LTLIBRARIES += mod_scgi.la
167 mod_scgi_la_SOURCES = mod_scgi.c
168 mod_scgi_la_LDFLAGS = $(common_module_ldflags)
169 mod_scgi_la_LIBADD = $(common_libadd)
171 lib_LTLIBRARIES += mod_staticfile.la
172 mod_staticfile_la_SOURCES = mod_staticfile.c
173 mod_staticfile_la_LDFLAGS = $(common_module_ldflags)
174 mod_staticfile_la_LIBADD = $(common_libadd)
176 lib_LTLIBRARIES += mod_dirlisting.la
177 mod_dirlisting_la_SOURCES = mod_dirlisting.c
178 mod_dirlisting_la_LDFLAGS = $(common_module_ldflags)
179 mod_dirlisting_la_LIBADD = $(common_libadd) $(PCRE_LIB)
181 lib_LTLIBRARIES += mod_indexfile.la
182 mod_indexfile_la_SOURCES = mod_indexfile.c
183 mod_indexfile_la_LDFLAGS = $(common_module_ldflags)
184 mod_indexfile_la_LIBADD = $(common_libadd)
186 lib_LTLIBRARIES += mod_setenv.la
187 mod_setenv_la_SOURCES = mod_setenv.c
188 mod_setenv_la_LDFLAGS = $(common_module_ldflags)
189 mod_setenv_la_LIBADD = $(common_libadd)
191 lib_LTLIBRARIES += mod_alias.la
192 mod_alias_la_SOURCES = mod_alias.c
193 mod_alias_la_LDFLAGS = $(common_module_ldflags)
194 mod_alias_la_LIBADD = $(common_libadd)
196 lib_LTLIBRARIES += mod_userdir.la
197 mod_userdir_la_SOURCES = mod_userdir.c
198 mod_userdir_la_LDFLAGS = $(common_module_ldflags)
199 mod_userdir_la_LIBADD = $(common_libadd)
201 lib_LTLIBRARIES += mod_rrdtool.la
202 mod_rrdtool_la_SOURCES = mod_rrdtool.c
203 mod_rrdtool_la_LDFLAGS = $(common_module_ldflags)
204 mod_rrdtool_la_LIBADD = $(common_libadd)
206 lib_LTLIBRARIES += mod_usertrack.la
207 mod_usertrack_la_SOURCES = mod_usertrack.c
208 mod_usertrack_la_LDFLAGS = $(common_module_ldflags)
209 mod_usertrack_la_LIBADD = $(common_libadd)
211 lib_LTLIBRARIES += mod_proxy.la
212 mod_proxy_la_SOURCES = mod_proxy.c
213 mod_proxy_la_LDFLAGS = $(common_module_ldflags)
214 mod_proxy_la_LIBADD = $(common_libadd)
216 lib_LTLIBRARIES += mod_ssi.la
217 mod_ssi_la_SOURCES = mod_ssi_exprparser.c mod_ssi_expr.c mod_ssi.c
218 mod_ssi_la_LDFLAGS = $(common_module_ldflags)
219 mod_ssi_la_LIBADD = $(common_libadd)
221 lib_LTLIBRARIES += mod_secdownload.la
222 mod_secdownload_la_SOURCES = mod_secdownload.c
223 mod_secdownload_la_LDFLAGS = $(common_module_ldflags)
224 mod_secdownload_la_LIBADD = $(common_libadd)
226 #lib_LTLIBRARIES += mod_httptls.la
227 #mod_httptls_la_SOURCES = mod_httptls.c
228 #mod_httptls_la_LDFLAGS = $(common_module_ldflags)
229 #mod_httptls_la_LIBADD = $(common_libadd)
231 lib_LTLIBRARIES += mod_expire.la
232 mod_expire_la_SOURCES = mod_expire.c
233 mod_expire_la_LDFLAGS = $(common_module_ldflags)
234 mod_expire_la_LIBADD = $(common_libadd)
236 lib_LTLIBRARIES += mod_evhost.la
237 mod_evhost_la_SOURCES = mod_evhost.c
238 mod_evhost_la_LDFLAGS = $(common_module_ldflags)
239 mod_evhost_la_LIBADD = $(common_libadd)
241 lib_LTLIBRARIES += mod_simple_vhost.la
242 mod_simple_vhost_la_SOURCES = mod_simple_vhost.c
243 mod_simple_vhost_la_LDFLAGS = $(common_module_ldflags)
244 mod_simple_vhost_la_LIBADD = $(common_libadd)
246 lib_LTLIBRARIES += mod_fastcgi.la
247 mod_fastcgi_la_SOURCES = mod_fastcgi.c
248 mod_fastcgi_la_LDFLAGS = $(common_module_ldflags)
249 mod_fastcgi_la_LIBADD = $(common_libadd)
251 lib_LTLIBRARIES += mod_extforward.la
252 mod_extforward_la_SOURCES = mod_extforward.c
253 mod_extforward_la_LDFLAGS = $(common_module_ldflags)
254 mod_extforward_la_LIBADD = $(common_libadd)
256 lib_LTLIBRARIES += mod_access.la
257 mod_access_la_SOURCES = mod_access.c
258 mod_access_la_LDFLAGS = $(common_module_ldflags)
259 mod_access_la_LIBADD = $(common_libadd)
261 lib_LTLIBRARIES += mod_compress.la
262 mod_compress_la_SOURCES = mod_compress.c
263 mod_compress_la_LDFLAGS = $(common_module_ldflags)
264 mod_compress_la_LIBADD = $(Z_LIB) $(BZ_LIB) $(common_libadd)
266 lib_LTLIBRARIES += mod_deflate.la
267 mod_deflate_la_SOURCES = mod_deflate.c
268 mod_deflate_la_LDFLAGS = $(common_module_ldflags)
269 mod_deflate_la_LIBADD = $(Z_LIB) $(BZ_LIB) $(common_libadd)
271 lib_LTLIBRARIES += mod_auth.la
272 mod_auth_la_SOURCES = mod_auth.c
273 mod_auth_la_LDFLAGS = $(common_module_ldflags)
274 mod_auth_la_LIBADD = $(common_libadd)
276 lib_LTLIBRARIES += mod_authn_file.la
277 mod_authn_file_la_SOURCES = mod_authn_file.c
278 mod_authn_file_la_LDFLAGS = $(common_module_ldflags)
279 mod_authn_file_la_LIBADD = $(CRYPT_LIB) $(SSL_LIB) $(common_libadd)
282 lib_LTLIBRARIES += mod_authn_gssapi.la
283 mod_authn_gssapi_la_SOURCES = mod_authn_gssapi.c
284 mod_authn_gssapi_la_LDFLAGS = $(common_module_ldflags)
285 mod_authn_gssapi_la_LIBADD = $(KRB5_LIB) $(common_libadd)
289 lib_LTLIBRARIES += mod_authn_ldap.la
290 mod_authn_ldap_la_SOURCES = mod_authn_ldap.c
291 mod_authn_ldap_la_LDFLAGS = $(common_module_ldflags)
292 mod_authn_ldap_la_LIBADD = $(LDAP_LIB) $(LBER_LIB) $(common_libadd)
296 lib_LTLIBRARIES += mod_authn_mysql.la
297 mod_authn_mysql_la_SOURCES = mod_authn_mysql.c
298 mod_authn_mysql_la_LDFLAGS = $(common_module_ldflags)
299 mod_authn_mysql_la_LIBADD = $(CRYPT_LIB) $(MYSQL_LIBS) $(common_libadd)
300 mod_authn_mysql_la_CPPFLAGS = $(MYSQL_INCLUDE)
303 lib_LTLIBRARIES += mod_rewrite.la
304 mod_rewrite_la_SOURCES = mod_rewrite.c
305 mod_rewrite_la_LDFLAGS = $(common_module_ldflags)
306 mod_rewrite_la_LIBADD = $(PCRE_LIB) $(common_libadd)
308 lib_LTLIBRARIES += mod_redirect.la
309 mod_redirect_la_SOURCES = mod_redirect.c
310 mod_redirect_la_LDFLAGS = $(common_module_ldflags)
311 mod_redirect_la_LIBADD = $(PCRE_LIB) $(common_libadd)
313 lib_LTLIBRARIES += mod_status.la
314 mod_status_la_SOURCES = mod_status.c
315 mod_status_la_LDFLAGS = $(common_module_ldflags)
316 mod_status_la_LIBADD = $(common_libadd)
318 lib_LTLIBRARIES += mod_accesslog.la
319 mod_accesslog_la_SOURCES = mod_accesslog.c
320 mod_accesslog_la_LDFLAGS = $(common_module_ldflags)
321 mod_accesslog_la_LIBADD = $(common_libadd)
323 lib_LTLIBRARIES += mod_uploadprogress.la
324 mod_uploadprogress_la_SOURCES = mod_uploadprogress.c
325 mod_uploadprogress_la_LDFLAGS = $(common_module_ldflags)
326 mod_uploadprogress_la_LIBADD = $(common_libadd)
329 hdr = server.h base64.h buffer.h network.h log.h keyvalue.h \
330 response.h request.h fastcgi.h chunk.h \
331 first.h settings.h http_chunk.h \
332 md5.h http_auth.h stream.h \
333 fdevent.h connections.h base.h stat_cache.h \
335 etag.h joblist.h array.h vector.h crc32.h \
336 network_backends.h configfile.h \
337 mod_ssi.h mod_ssi_expr.h inet_ntop_cache.h \
338 configparser.h mod_ssi_exprparser.h \
340 sys-endian.h sys-mmap.h sys-socket.h mod_cml.h mod_cml_funcs.h \
341 safe_memclear.h splaytree.h proc_open.h status_counter.h \
345 DEFS= @DEFS@ -DHAVE_VERSION_H -DLIBRARY_DIR="\"$(libdir)\"" -DSBIN_DIR="\"$(sbindir)\""
350 ## static lighttpd server (used in conjunction with -DLIGHTTPD_STATIC)
351 ## (order is not important)
367 mod_flv_streaming.c \
377 mod_ssi_exprparser.c mod_ssi_expr.c mod_ssi.c \
380 mod_uploadprogress.c \
384 lighttpd_CPPFLAGS = \
386 $(XML_CFLAGS) $(SQLITE_CFLAGS) \
387 $(FAM_CFLAGS) $(LIBEV_CFLAGS) $(LIBUNWIND_CFLAGS)
390 $(CRYPT_LIB) $(SSL_LIB) \
391 $(XML_LIBS) $(SQLITE_LIBS) $(UUID_LIBS) \
392 $(PCRE_LIB) $(Z_LIB) $(BZ_LIB) $(DL_LIB) $(SENDFILE_LIB) $(ATTR_LIB) \
393 $(FAM_LIBS) $(LIBEV_LIBS) $(LIBUNWIND_LIBS)
394 lighttpd_LDFLAGS = -export-dynamic
397 lighttpd_SOURCES += mod_geoip.c
398 lighttpd_LDADD += $(GEOIP_LIB)
401 lighttpd_SOURCES += mod_cml.c mod_cml_lua.c mod_cml_funcs.c \
402 mod_magnet.c mod_magnet_cache.c
403 lighttpd_CPPFLAGS += $(LUA_CFLAGS)
404 lighttpd_LDADD += $(LUA_LIBS) -lm
407 lighttpd_SOURCES += mod_authn_gssapi.c
408 lighttpd_LDADD += $(KRB5_LIB)
411 lighttpd_SOURCES += mod_authn_ldap.c
412 lighttpd_LDADD += $(LDAP_LIB) $(LBER_LIB)
415 lighttpd_SOURCES += mod_authn_mysql.c mod_mysql_vhost.c
416 lighttpd_CPPFLAGS += $(MYSQL_INCLUDE)
417 lighttpd_LDADD += $(MYSQL_LIBS)
419 if BUILD_WITH_MEMCACHED
420 lighttpd_CPPFLAGS += $(MEMCACHED_CFLAGS)
421 lighttpd_LDADD += $(MEMCACHED_LIB)
424 lighttpd_LDADD += $(GDBM_LIB)
426 if BUILD_MOD_TRIGGER_B4_DL
427 lighttpd_SOURCES += mod_trigger_b4_dl.c
432 ## default lighttpd server
433 lighttpd_SOURCES = $(src)
434 lighttpd_CPPFLAGS = $(FAM_CFLAGS) $(LIBEV_CFLAGS)
435 lighttpd_LDADD = $(PCRE_LIB) $(DL_LIB) $(SENDFILE_LIB) $(ATTR_LIB) $(common_libadd) $(SSL_LIB) $(FAM_LIBS) $(LIBEV_LIBS) $(LIBUNWIND_LIBS)
436 lighttpd_LDFLAGS = -export-dynamic
440 proc_open_SOURCES = proc_open.c buffer.c
441 proc_open_LDADD = $(LIBUNWIND_LIBS)
442 proc_open_CPPFLAGS= -DDEBUG_PROC_OPEN
444 test_buffer_SOURCES = test_buffer.c buffer.c
445 test_buffer_LDADD = $(LIBUNWIND_LIBS)
447 test_base64_SOURCES = test_base64.c base64.c buffer.c
448 test_base64_LDADD = $(LIBUNWIND_LIBS)
450 test_configfile_SOURCES = test_configfile.c buffer.c array.c data_string.c keyvalue.c vector.c log.c
451 test_configfile_LDADD = $(PCRE_LIB) $(LIBUNWIND_LIBS)
453 noinst_HEADERS = $(hdr)
457 mod_ssi_exprparser.y \
461 CMakeLists.txt config.h.cmake