diff --git a/configure.ac b/configure.ac index 878f5a88bb..b423ea95e5 100644 --- a/configure.ac +++ b/configure.ac @@ -230,6 +230,19 @@ if test "x$enable_android" = "xyes"; then fi +dnl --- +dnl Tor modules options. These options are namespaced with --disable-module-XXX +dnl --- + +dnl Directory Authority module. +AC_ARG_ENABLE([module-dirauth], + AS_HELP_STRING([--disable-module-dirauth], + [Do not build tor with the dirauth module]), + [], dnl Action if-given + AC_DEFINE([HAVE_MODULE_DIRAUTH], [1], + [Compile with Directory Authority feature support])) +AM_CONDITIONAL(BUILD_MODULE_DIRAUTH, [test "x$enable_module_dirauth" != "xno"]) + dnl check for the correct "ar" when cross-compiling. dnl (AM_PROG_AR was new in automake 1.11.2, which we do not yet require, dnl so kludge up a replacement for the case where it isn't there yet.) diff --git a/src/or/include.am b/src/or/include.am index 9a68df5c3e..56d41e47dd 100644 --- a/src/or/include.am +++ b/src/or/include.am @@ -114,6 +114,16 @@ LIBTOR_A_SOURCES = \ src/or/onion_ntor.c \ $(tor_platform_source) +# +# Modules are conditionnally compiled in tor starting here. We add the C files +# only if the modules has been enabled at configure time. +# + +# The Directory Authority module. +if BUILD_MODULE_DIRAUTH +#LIBTOR_A_SOURCES += +endif + src_or_libtor_a_SOURCES = $(LIBTOR_A_SOURCES) src_or_libtor_testing_a_SOURCES = $(LIBTOR_A_SOURCES) @@ -259,6 +269,12 @@ ORHEADERS = \ src/or/torcert.h \ src/or/tor_api_internal.h +# We add the headers of the modules even though they are disabled so we can +# properly compiled the entry points stub. + +# The Directory Authority module headers. +#ORHEADERS += + # This may someday want to be an installed file? noinst_HEADERS += src/or/tor_api.h