aboutsummaryrefslogtreecommitdiff
path: root/src/core/include.am
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-01-08 21:13:29 -0500
committerNick Mathewson <nickm@torproject.org>2020-01-16 07:48:17 -0500
commit8a0c739467c87c6d7358d112bd1400250ad6e5c4 (patch)
tree573712476bafa3d8bda112b1c084fa0696343a88 /src/core/include.am
parent6e12a8f04714aa56308b06c691066cc3d4b0090b (diff)
downloadtor-8a0c739467c87c6d7358d112bd1400250ad6e5c4.tar.gz
tor-8a0c739467c87c6d7358d112bd1400250ad6e5c4.zip
Disable feature/dircache files when dircache module is disabled.
To make Tor still work, we define a minimal dircache_stub.c file that defines the entry points to the module that can actually be seen by the compiler when we're building with dircache and relay disabled.
Diffstat (limited to 'src/core/include.am')
-rw-r--r--src/core/include.am18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/core/include.am b/src/core/include.am
index bd36d01f21..1861f6cd41 100644
--- a/src/core/include.am
+++ b/src/core/include.am
@@ -91,10 +91,6 @@ LIBTOR_APP_A_SOURCES = \
src/feature/control/control_proto.c \
src/feature/control/fmt_serverstatus.c \
src/feature/control/getinfo_geoip.c \
- src/feature/dircache/conscache.c \
- src/feature/dircache/consdiffmgr.c \
- src/feature/dircache/dircache.c \
- src/feature/dircache/dirserv.c \
src/feature/dirclient/dirclient.c \
src/feature/dirclient/dlstatus.c \
src/feature/dircommon/consdiff.c \
@@ -183,6 +179,13 @@ MODULE_RELAY_SOURCES = \
src/feature/relay/relay_sys.c \
src/feature/relay/transport_config.c
+# The Directory Cache module.
+MODULE_DIRCACHE_SOURCES = \
+ src/feature/dircache/conscache.c \
+ src/feature/dircache/consdiffmgr.c \
+ src/feature/dircache/dircache.c \
+ src/feature/dircache/dirserv.c
+
# The Directory Authority module.
MODULE_DIRAUTH_SOURCES = \
src/feature/dirauth/authmode.c \
@@ -209,6 +212,12 @@ else
LIBTOR_APP_A_STUB_SOURCES += src/feature/relay/relay_stub.c
endif
+if BUILD_MODULE_DIRCACHE
+LIBTOR_APP_A_SOURCES += $(MODULE_DIRCACHE_SOURCES)
+else
+LIBTOR_APP_A_STUB_SOURCES += src/feature/dircache/dircache_stub.c
+endif
+
if BUILD_MODULE_DIRAUTH
LIBTOR_APP_A_SOURCES += $(MODULE_DIRAUTH_SOURCES)
else
@@ -222,6 +231,7 @@ if UNITTESTS_ENABLED
# Add the sources of the modules that are needed for tests to work here.
LIBTOR_APP_TESTING_A_SOURCES += $(MODULE_RELAY_SOURCES)
+LIBTOR_APP_TESTING_A_SOURCES += $(MODULE_DIRCACHE_SOURCES)
LIBTOR_APP_TESTING_A_SOURCES += $(MODULE_DIRAUTH_SOURCES)
src_core_libtor_app_testing_a_SOURCES = $(LIBTOR_APP_TESTING_A_SOURCES)