]> granicus.if.org Git - apache/blobdiff - Makefile.in
Added Spanish translation for manual/misc/password_encryptions.xml.es
[apache] / Makefile.in
index 8ecee717da6846fd389793fbe3c2cc386f60839c..85f174a3ddd2dbab2aa26c20a84840a06d0ef30b 100644 (file)
@@ -20,7 +20,8 @@ INSTALL_TARGETS = install-conf install-htdocs install-error install-icons \
 
 CLEAN_TARGETS      = check/apxs check/build/config_vars.mk \
        check/conf/$(PROGRAM_NAME).conf check/conf/magic check/conf/mime.types \
-       check/conf/extra/* check/include/*
+       check/conf/extra/* check/include/* $(testcase_OBJECTS) $(testcase_STUBS) \
+       test/httpdunit.cases test/unit/*.o
 DISTCLEAN_TARGETS  = include/ap_config_auto.h include/ap_config_layout.h \
        include/apache_probes.h \
        modules.c config.cache config.log config.status build/config_vars.mk \
@@ -28,7 +29,7 @@ DISTCLEAN_TARGETS  = include/ap_config_auto.h include/ap_config_layout.h \
        build/pkg/pkginfo build/config_vars.sh bsd_converted
 EXTRACLEAN_TARGETS = configure include/ap_config_auto.h.in generated_lists \
        httpd.spec
-PHONY_TARGETS := check check-conf check-include
+PHONY_TARGETS := check check-conf check-dirs check-include unittest-objdir
 
 include $(top_builddir)/build/rules.mk
 include $(top_srcdir)/build/program.mk
@@ -49,7 +50,7 @@ install-conf:
                if [ -f $$i ] ; then \
                ( \
                        n_lm=`awk 'BEGIN {n=0} /@@LoadModule@@/ {n+=1} END {print n}' < $$i`; \
-                       if test $$n_lm -eq 0 -o "x$(MPM_MODULE)$(DSO_MODULES)" = "x"; then \
+                       if test $$n_lm -eq 0 -o "x$(MPM_MODULES)$(DSO_MODULES)" = "x"; then \
                                sed -e 's#@@ServerRoot@@#$(prefix)#g' \
                                        -e 's#@@Port@@#$(PORT)#g' \
                                        -e 's#@@SSLPort@@#$(SSLPORT)#g' \
@@ -327,17 +328,21 @@ check-conf:
                if [ -f $$i ] ; then \
                ( \
                    n_lm=`awk 'BEGIN {n=0} /@@LoadModule@@/ {n+=1} END {print n}' < $$i`; \
-                   if test $$n_lm -eq 0 -o "x$(MPM_MODULE)$(DSO_MODULES)" = "x"; then \
-                       sed -e 's#@@ServerRoot@@#$(prefix)#g' \
+                   if test $$n_lm -eq 0 -o "x$(MPM_MODULES)$(DSO_MODULES)" = "x"; then \
+                       sed -e 's#@@ServerRoot@@#$(top_builddir)/check#g' \
                            -e 's#@@Port@@#$(PORT)#g' \
                            -e 's#@@SSLPort@@#$(SSLPORT)#g' \
+                           -e 's#$(prefix)#$(top_builddir)/check#g' \
+                           -e 's/^#ServerName /ServerName /' \
                            -e '/@@LoadModule@@/d' \
                            < $$i; \
                    else \
                        sed -n -e '/@@LoadModule@@/q' \
-                           -e 's#@@ServerRoot@@#$(prefix)#g' \
+                           -e 's#@@ServerRoot@@#$(top_builddir)/check#g' \
                            -e 's#@@Port@@#$(PORT)#g' \
                            -e 's#@@SSLPort@@#$(SSLPORT)#g' \
+                           -e 's#$(prefix)#$(top_builddir)/check#g' \
+                           -e 's/^#ServerName /ServerName /' \
                            -e 'p' \
                            < $$i; \
                        if echo " $(DSO_MODULES) "|$(EGREP) " cgi " > /dev/null ; then \
@@ -351,7 +356,7 @@ check-conf:
                            have_cgid="0"; \
                        fi; \
                        for j in $(MPM_MODULES) "^EOL^"; do \
-                           path=$$(find "$(top_builddir)/modules" -name "mod_$$j.so"); \
+                           path=$$(find "$(top_builddir)/server" -name "mod_$$j.so"); \
                            if test $$j != "^EOL^"; then \
                                if echo ",$(ENABLED_MPM_MODULE),"|$(EGREP) ",$$j," > /dev/null ; then \
                                    loading_disabled=""; \
@@ -364,32 +369,26 @@ check-conf:
                        for j in $(DSO_MODULES) "^EOL^"; do \
                            path=$$(find "$(top_builddir)/modules" -name "mod_$$j.so"); \
                            if test $$j != "^EOL^"; then \
-                               if echo ",$(ENABLED_DSO_MODULES),"|$(EGREP) ",$$j," > /dev/null ; then \
-                                   loading_disabled=""; \
+                               if test $$j = "cgid" -a "$$have_cgi" = "1"; then \
+                                   echo "<IfModule !mpm_prefork_module>"; \
+                                   echo "      LoadModule $${j}_module $${path}"; \
+                                   echo "</IfModule>"; \
+                               elif test $$j = "cgi" -a "$$have_cgid" = "1"; then \
+                                   echo "<IfModule mpm_prefork_module>"; \
+                                   echo "      LoadModule $${j}_module $${path}"; \
+                                   echo "</IfModule>"; \
                                else \
-                                   loading_disabled="#"; \
-                                   if test "$(LOAD_ALL_MODULES)" = "yes"; then \
-                                       loading_disabled=""; \
-                                   fi; \
+                                   echo "LoadModule $${j}_module $${path}"; \
                                fi; \
-                           if test $$j = "cgid" -a "$$have_cgi" = "1"; then \
-                               echo "<IfModule !mpm_prefork_module>"; \
-                               echo "  $${loading_disabled}LoadModule $${j}_module $${path}"; \
-                               echo "</IfModule>"; \
-                           elif test $$j = "cgi" -a "$$have_cgid" = "1"; then \
-                               echo "<IfModule mpm_prefork_module>"; \
-                               echo "  $${loading_disabled}LoadModule $${j}_module $${path}"; \
-                               echo "</IfModule>"; \
-                           else \
-                               echo "$${loading_disabled}LoadModule $${j}_module $${path}"; \
                            fi; \
-                       fi; \
                        done; \
                        sed -e '1,/@@LoadModule@@/d' \
                            -e '/@@LoadModule@@/d' \
-                           -e 's#@@ServerRoot@@#$(prefix)#g' \
+                           -e 's#@@ServerRoot@@#$(top_builddir)/check#g' \
                            -e 's#@@Port@@#$(PORT)#g' \
                            -e 's#@@SSLPort@@#$(SSLPORT)#g' \
+                           -e 's#$(prefix)#$(top_builddir)/check#g' \
+                           -e 's/^#ServerName /ServerName /' \
                            < $$i; \
                    fi \
                ) > $(top_builddir)/check/conf/$$i; \
@@ -401,6 +400,13 @@ check-conf:
            done ; \
        done ;
 
+# Sometimes (e.g. when MPM DSOs are enabled) the test suite runs a full
+# configuration check on our in-tree build. To pass, we have to have all of the
+# correct directories, even though they won't be used.
+check-dirs:
+       @mkdir -p check/htdocs
+       @mkdir -p check/logs
+
 # A version of apxs with the PREFIX overridden to point inside the build tree.
 check/apxs:
        mkdir -p check
@@ -416,7 +422,7 @@ check/build/config_vars.mk: build/config_vars.out
        echo "sbindir = $(top_builddir)" >> $@
 
 # Run the Apache::Test suite if it has been configured with --with-test-suite.
-check: check-include check-conf check/build/config_vars.mk check/apxs
+check: check-include check-dirs check-conf check/build/config_vars.mk check/apxs
        @if test "x$(TEST_SUITE_LOCATION)" = "xno"; then \
            echo 'Re-run configure with the --with-test-suite option to enable in-tree tests.'; \
            false; \
@@ -426,3 +432,38 @@ check: check-include check-conf check/build/config_vars.mk check/apxs
            ./t/TEST -clean && \
            ./t/TEST -config && \
            ./t/TEST
+
+#
+# Unit Test Suite
+#
+
+# Make sure the object subdirectories we use exist in the build directory during
+# VPATH builds.
+unittest-objdir:
+       @mkdir -p test/unit
+
+# Normally I don't like wildcard sources, but for tests, autodiscovery is the
+# way to go.
+testcase_SOURCES := $(patsubst $(top_srcdir)/%,%,$(wildcard $(top_srcdir)/test/unit/*.c))
+testcase_OBJECTS := $(testcase_SOURCES:%.c=%.lo)
+testcase_STUBS   := $(testcase_SOURCES:%.c=%.tests)
+
+# Each testcase depends on the source file as well as the autogenerated .tests
+# stub.
+$(testcase_OBJECTS): %.lo: %.c %.tests | unittest-objdir
+
+$(testcase_STUBS): %.tests: %.c
+       $(top_srcdir)/build/httpdunit_gen_stubs.pl < "$<" > "$@"
+
+test/httpdunit.cases: $(testcase_SOURCES) | unittest-objdir
+       cat $^ | $(top_srcdir)/build/httpdunit_gen_cases.pl --declaration > $@
+       cat $^ | $(top_srcdir)/build/httpdunit_gen_cases.pl >> $@
+
+test/httpdunit.lo: test/httpdunit.c test/httpdunit.cases | unittest-objdir
+
+# httpdunit is only added to $(other_targets) if configure detects a working
+# libcheck on the system.
+httpdunit_OBJECTS := test/httpdunit.lo $(testcase_OBJECTS)
+$(httpdunit_OBJECTS): override LTCFLAGS += $(UNITTEST_CFLAGS)
+test/httpdunit: $(httpdunit_OBJECTS) $(PROGRAM_DEPENDENCIES) $(PROGRAM_OBJECTS)
+       $(LINK) $(httpdunit_OBJECTS) $(PROGRAM_OBJECTS) $(UNITTEST_LIBS) $(PROGRAM_LDADD)