]> granicus.if.org Git - apache/blob - Makefile.in
Exclude MPM modules from automatic LoadModule
[apache] / Makefile.in
1
2 SUBDIRS = srclib os server modules support
3 CLEAN_SUBDIRS = test
4
5 PROGRAM_NAME         = $(progname)
6 PROGRAM_SOURCES      = modules.c
7 PROGRAM_LDADD        = buildmark.o $(HTTPD_LDFLAGS) $(PROGRAM_DEPENDENCIES) $(HTTPD_LIBS) $(EXTRA_LIBS) $(AP_LIBS) $(LIBS)
8 PROGRAM_PRELINK      = $(COMPILE) -c $(top_srcdir)/server/buildmark.c
9 PROGRAM_DEPENDENCIES = \
10   server/libmain.la \
11   $(BUILTIN_LIBS) \
12   $(MPM_LIB) \
13   os/$(OS_DIR)/libos.la
14
15 sbin_PROGRAMS   = $(PROGRAM_NAME)
16 TARGETS         = $(sbin_PROGRAMS) $(shared_build) $(other_targets)
17 INSTALL_TARGETS = install-conf install-htdocs install-error install-icons \
18         install-other install-cgi install-include install-suexec install-build \
19         install-man
20
21 DISTCLEAN_TARGETS  = include/ap_config_auto.h include/ap_config_layout.h \
22         include/apache_probes.h \
23         modules.c config.cache config.log config.status build/config_vars.mk \
24         build/rules.mk docs/conf/httpd.conf docs/conf/extra/*.conf shlibtool \
25         build/pkg/pkginfo build/config_vars.sh bsd_converted
26 EXTRACLEAN_TARGETS = configure include/ap_config_auto.h.in generated_lists \
27         httpd.spec
28
29 include $(top_builddir)/build/rules.mk
30 include $(top_srcdir)/build/program.mk
31
32 install-conf:
33         @echo Installing configuration files
34         @$(MKINSTALLDIRS) $(DESTDIR)$(sysconfdir) $(DESTDIR)$(sysconfdir)/extra
35         @$(MKINSTALLDIRS) $(DESTDIR)$(sysconfdir)/original/extra
36         @cd $(top_srcdir)/docs/conf; \
37         for i in mime.types magic; do \
38             if test ! -f $(DESTDIR)$(sysconfdir)/$$i; then \
39                 $(INSTALL_DATA) $$i $(DESTDIR)$(sysconfdir); \
40             fi; \
41         done; \
42         for j in $(top_srcdir)/docs/conf $(top_builddir)/docs/conf ; do \
43             cd $$j ; \
44             for i in httpd.conf extra/*.conf; do \
45                 if [ -f $$i ] ; then \
46                 ( \
47                         n_lm=`awk 'BEGIN {n=0} /@@LoadModule@@/ {n+=1} END {print n}' < $$i`; \
48                         if test $$n_lm -eq 0 -o "x$(DSO_MODULES)" = "x"; then \
49                                 sed -e 's#@@ServerRoot@@#$(prefix)#g' \
50                                         -e 's#@@Port@@#$(PORT)#g' \
51                                         -e 's#@@SSLPort@@#$(SSLPORT)#g' \
52                                         -e '/@@LoadModule@@/d' \
53                                         < $$i; \
54                         else \
55                                 sed -n -e '/@@LoadModule@@/q' \
56                                         -e 's#@@ServerRoot@@#$(prefix)#g' \
57                                         -e 's#@@Port@@#$(PORT)#g' \
58                                         -e 's#@@SSLPort@@#$(SSLPORT)#g' \
59                                         -e 'p' \
60                                         < $$i; \
61                                 if echo " $(DSO_MODULES) "|$(EGREP) " cgi " > /dev/null ; then \
62                                         have_cgi="1"; \
63                                 else \
64                                         have_cgi="0"; \
65                                 fi; \
66                                 if echo " $(DSO_MODULES) "|$(EGREP) " cgid " > /dev/null ; then \
67                                         have_cgid="1"; \
68                                 else \
69                                         have_cgid="0"; \
70                                 fi; \
71                                 for j in $(DSO_MODULES) "^EOL^"; do \
72                                         if test $$j != "^EOL^"; then \
73                                                 if echo ",$(ENABLED_DSO_MODULES),"|$(EGREP) ",$$j," > /dev/null ; then \
74                                                         loading_disabled=""; \
75                                                 else \
76                                                         loading_disabled="#"; \
77                                                         mpm=`echo $$j|sed s/_.*//`; \
78                                                         if test "$(LOAD_ALL_MODULES)" = "yes" -a "$$mpm" != "mpm"; then \
79                                                                 loading_disabled=""; \
80                                                         fi; \
81                                                 fi; \
82                                                         if test $$j = "cgid" -a "$$have_cgi" = "1"; then \
83                                                                 echo "<IfModule !mpm_prefork_module>"; \
84                                                                 echo "  $${loading_disabled}LoadModule $${j}_module $(rel_libexecdir)/mod_$${j}.so"; \
85                                                                 echo "</IfModule>"; \
86                                                         elif test $$j = "cgi" -a "$$have_cgid" = "1"; then \
87                                                                 echo "<IfModule mpm_prefork_module>"; \
88                                                                 echo "  $${loading_disabled}LoadModule $${j}_module $(rel_libexecdir)/mod_$${j}.so"; \
89                                                                 echo "</IfModule>"; \
90                                                         else \
91                                                                 echo "$${loading_disabled}LoadModule $${j}_module $(rel_libexecdir)/mod_$${j}.so"; \
92                                                         fi; \
93                                                 fi; \
94                                 done; \
95                                 sed -e '1,/@@LoadModule@@/d' \
96                                         -e '/@@LoadModule@@/d' \
97                                         -e 's#@@ServerRoot@@#$(prefix)#g' \
98                                         -e 's#@@Port@@#$(PORT)#g' \
99                                         -e 's#@@SSLPort@@#$(SSLPORT)#g' \
100                                         < $$i; \
101                         fi \
102                 ) > $(DESTDIR)$(sysconfdir)/original/$$i; \
103                 chmod 0644 $(DESTDIR)$(sysconfdir)/original/$$i; \
104                 file=$$i; \
105                 if [ "$$i" = "httpd.conf" ]; then \
106                         file=`echo $$i|sed s/.*.conf/$(PROGRAM_NAME).conf/`; \
107                 fi; \
108                 if test ! -f $(DESTDIR)$(sysconfdir)/$$file; then \
109                         $(INSTALL_DATA) $(DESTDIR)$(sysconfdir)/original/$$i $(DESTDIR)$(sysconfdir)/$$file; \
110                 fi; \
111                 fi; \
112             done ; \
113         done ; \
114         if test -f "$(builddir)/envvars-std"; then \
115             cp -p envvars-std $(DESTDIR)$(sbindir); \
116             if test ! -f $(DESTDIR)$(sbindir)/envvars; then \
117                 cp -p envvars-std $(DESTDIR)$(sbindir)/envvars ; \
118             fi ; \
119         fi
120
121 # Create a sanitized config_vars.mk
122 build/config_vars.out: build/config_vars.mk
123         @$(SHELL) build/config_vars.sh < build/config_vars.mk > build/config_vars.out
124
125 install-build: build/config_vars.out
126         @echo Installing build system files
127         @$(MKINSTALLDIRS) $(DESTDIR)$(installbuilddir)
128         @$(INSTALL_DATA) $(top_srcdir)/build/*.mk build/*.mk \
129                 $(DESTDIR)$(installbuilddir)
130         @$(INSTALL_PROGRAM) $(top_builddir)/config.nice \
131                 $(top_srcdir)/build/mkdir.sh \
132                 $(top_srcdir)/build/instdso.sh \
133                 $(DESTDIR)$(installbuilddir)
134         @$(INSTALL_DATA) build/config_vars.out $(DESTDIR)$(installbuilddir)/config_vars.mk
135         @rm build/config_vars.out
136
137 htdocs-srcdir = $(top_srcdir)/docs/docroot
138
139 docs:
140         @if test -d $(top_srcdir)/docs/manual/build; then \
141             cd $(top_srcdir)/docs/manual/build && ./build.sh all; \
142         else \
143             echo 'For details on generating the docs, please read:'; \
144             echo '  http://httpd.apache.org/docs-project/docsformat.html'; \
145         fi
146
147 validate-xml:
148         @if test -d $(top_srcdir)/docs/manual/build; then \
149             cd $(top_srcdir)/docs/manual/build && ./build.sh validate-xml; \
150         else \
151             echo 'For details on generating the docs, please read:'; \
152             echo '  http://httpd.apache.org/docs-project/docsformat.html'; \
153         fi
154
155 dox:
156         doxygen $(top_srcdir)/docs/doxygen.conf
157
158 install-htdocs:
159         -@if [ -d $(DESTDIR)$(htdocsdir) ]; then \
160            echo "[PRESERVING EXISTING HTDOCS SUBDIR: $(DESTDIR)$(htdocsdir)]"; \
161         else \
162             echo Installing HTML documents ; \
163             $(MKINSTALLDIRS) $(DESTDIR)$(htdocsdir) ; \
164             if test -d $(htdocs-srcdir) && test "x$(RSYNC)" != "x" && test -x $(RSYNC) ; then \
165                 $(RSYNC) --exclude .svn -rlpt --numeric-ids $(htdocs-srcdir)/ $(DESTDIR)$(htdocsdir)/; \
166             else \
167                 test -d $(htdocs-srcdir) && (cd $(htdocs-srcdir) && cp -rp * $(DESTDIR)$(htdocsdir)) ; \
168                 cd $(DESTDIR)$(htdocsdir) && find . -name ".svn" -type d -print | xargs rm -rf 2>/dev/null || true; \
169             fi; \
170         fi
171
172 install-error:
173         -@if [ -d $(DESTDIR)$(errordir) ]; then \
174            echo "[PRESERVING EXISTING ERROR SUBDIR: $(DESTDIR)$(errordir)]"; \
175         else \
176             echo Installing error documents ; \
177             $(MKINSTALLDIRS) $(DESTDIR)$(errordir) ; \
178             cd $(top_srcdir)/docs/error && cp -rp * $(DESTDIR)$(errordir) ; \
179             test "x$(errordir)" != "x" && cd $(DESTDIR)$(errordir) && find . -name ".svn" -type d -print | xargs rm -rf 2>/dev/null || true; \
180         fi
181
182 install-icons:
183         -@if [ -d $(DESTDIR)$(iconsdir) ]; then \
184            echo "[PRESERVING EXISTING ICONS SUBDIR: $(DESTDIR)$(iconsdir)]"; \
185         else \
186             echo Installing icons ; \
187             $(MKINSTALLDIRS) $(DESTDIR)$(iconsdir) ; \
188             cd $(top_srcdir)/docs/icons && cp -rp * $(DESTDIR)$(iconsdir) ; \
189             test "x$(iconsdir)" != "x" && cd $(DESTDIR)$(iconsdir) && find . -name ".svn" -type d -print | xargs rm -rf 2>/dev/null || true; \
190         fi
191
192 install-cgi:
193         -@if [ -d $(DESTDIR)$(cgidir) ];then \
194             echo "[PRESERVING EXISTING CGI SUBDIR: $(DESTDIR)$(cgidir)]"; \
195         else \
196            echo Installing CGIs ; \
197            $(MKINSTALLDIRS) $(DESTDIR)$(cgidir) ; \
198            cd $(top_srcdir)/docs/cgi-examples && cp -rp * $(DESTDIR)$(cgidir) ; \
199            test "x$(cgidir)" != "x" && cd $(DESTDIR)$(cgidir) && find . -name ".svn" -type d -print | xargs rm -rf 2>/dev/null || true; \
200         fi
201
202 install-other:
203         @test -d $(DESTDIR)$(logfiledir) || $(MKINSTALLDIRS) $(DESTDIR)$(logfiledir)
204         @test -d $(DESTDIR)$(runtimedir) || $(MKINSTALLDIRS) $(DESTDIR)$(runtimedir)
205         @for ext in dll x; do \
206                 file=apachecore.$$ext; \
207                 if test -f $$file; then \
208                         cp -p $$file $(DESTDIR)$(libdir); \
209                 fi; \
210         done; \
211         file=httpd.dll; \
212         if test -f $$file; then \
213                 cp -p $$file $(DESTDIR)$(bindir); \
214         fi;
215
216 INSTALL_HEADERS = \
217         include/*.h \
218         $(srcdir)/include/*.h \
219         $(srcdir)/os/$(OS_DIR)/os.h \
220         $(srcdir)/modules/arch/unix/mod_unixd.h \
221         $(srcdir)/modules/core/mod_so.h \
222         $(srcdir)/modules/core/mod_watchdog.h \
223         $(srcdir)/modules/cache/mod_cache.h \
224         $(srcdir)/modules/cache/cache_common.h \
225         $(srcdir)/modules/database/mod_dbd.h \
226         $(srcdir)/modules/dav/main/mod_dav.h \
227         $(srcdir)/modules/http2/mod_http2.h \
228         $(srcdir)/modules/filters/mod_include.h \
229         $(srcdir)/modules/filters/mod_xml2enc.h \
230         $(srcdir)/modules/generators/mod_cgi.h \
231         $(srcdir)/modules/generators/mod_status.h \
232         $(srcdir)/modules/loggers/mod_log_config.h \
233         $(srcdir)/modules/mappers/mod_rewrite.h \
234         $(srcdir)/modules/proxy/mod_proxy.h \
235         $(srcdir)/modules/proxy/mod_serf.h \
236         $(srcdir)/modules/session/mod_session.h \
237         $(srcdir)/modules/ssl/mod_ssl.h \
238         $(srcdir)/modules/ssl/mod_ssl_openssl.h \
239         $(srcdir)/os/$(OS_DIR)/*.h
240
241 install-include:
242         @echo Installing header files
243         @$(MKINSTALLDIRS) $(DESTDIR)$(includedir)
244         @$(INSTALL_DATA) $(INSTALL_HEADERS) $(DESTDIR)$(includedir)
245
246 install-man:
247         @echo Installing man pages and online manual
248         @test -d $(DESTDIR)$(mandir)      || $(MKINSTALLDIRS) $(DESTDIR)$(mandir)
249         @test -d $(DESTDIR)$(mandir)/man1 || $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man1
250         @test -d $(DESTDIR)$(mandir)/man8 || $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man8
251         @test -d $(DESTDIR)$(manualdir)   || $(MKINSTALLDIRS) $(DESTDIR)$(manualdir)
252         @cp -p $(top_srcdir)/docs/man/*.1 $(DESTDIR)$(mandir)/man1
253         @cp -p $(top_srcdir)/docs/man/*.8 $(DESTDIR)$(mandir)/man8
254         @if test "x$(RSYNC)" != "x" && test -x $(RSYNC) ; then \
255           $(RSYNC) --exclude .svn -rlpt --numeric-ids $(top_srcdir)/docs/manual/ $(DESTDIR)$(manualdir)/; \
256         else \
257           cd $(top_srcdir)/docs/manual && cp -rp * $(DESTDIR)$(manualdir); \
258           cd $(DESTDIR)$(manualdir) && find . -name ".svn" -type d -print | xargs rm -rf 2>/dev/null || true; \
259         fi
260
261 install-suexec: install-suexec-binary install-suexec-$(INSTALL_SUEXEC)
262
263 install-suexec-binary:
264         @if test -f $(builddir)/support/suexec; then \
265             test -d $(DESTDIR)$(sbindir) || $(MKINSTALLDIRS) $(DESTDIR)$(sbindir); \
266             $(INSTALL_PROGRAM) $(top_builddir)/support/suexec $(DESTDIR)$(sbindir); \
267         fi
268
269 install-suexec-setuid:
270         @if test -f $(builddir)/support/suexec; then \
271             chmod 4755 $(DESTDIR)$(sbindir)/suexec; \
272         fi
273
274 install-suexec-caps:
275         @if test -f $(builddir)/support/suexec; then \
276             setcap 'cap_setuid,cap_setgid+pe' $(DESTDIR)$(sbindir)/suexec; \
277         fi
278
279 suexec:
280         cd support && $(MAKE) suexec
281
282 x-local-distclean:
283         @rm -rf autom4te.cache
284
285 update-log-tags update-log-msg-tags:
286         find server modules os -name \*.c|xargs perl \
287                 docs/log-message-tags/update-log-msg-tags
288
289 # XXX: This looks awfully platform-specific [read: bad form and style]
290 include $(top_srcdir)/os/os2/core.mk