diff options
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/Makefile.am | 16 | ||||
-rw-r--r-- | src/or/config.c | 8 |
2 files changed, 23 insertions, 1 deletions
diff --git a/src/or/Makefile.am b/src/or/Makefile.am index 28d7e736dc..03e7900944 100644 --- a/src/or/Makefile.am +++ b/src/or/Makefile.am @@ -10,7 +10,7 @@ else tor_platform_source= endif -EXTRA_DIST=ntmain.c +EXTRA_DIST=ntmain.c or_sha1.i tor_SOURCES = buffers.c circuitbuild.c circuitlist.c \ circuituse.c command.c config.c \ @@ -52,6 +52,8 @@ test_LDADD = ../common/libor.a ../common/libor-crypto.a \ noinst_HEADERS = or.h eventdns.h eventdns_tor.h micro-revision.i +config.o: or_sha1.i + tor_main.o: micro-revision.i micro-revision.i: FORCE @@ -103,5 +105,17 @@ micro-revision.i: FORCE mv micro-revision.tmp micro-revision.i; \ fi; true +or_sha1.i: $(tor_SOURCES) test_data.c test.c + if test "@SHA1SUM@" != none; then \ + @SHA1SUM@ $(tor_SOURCES) test_data.c test.c | @SED@ -n 's/^\(.*\)$$/"\1\\n"/p' > or_sha1.i; \ + elif test "@OPENSSL@" != none; then \ + @OPENSSL@ sha1 $(tor_SOURCES) test_data.c test.c | @SED@ -n 's/SHA1(\(.*\))= \(.*\)/"\2 \1\\n"/p' > or_sha1.i; \ + else \ + rm or_sha1.i; \ + touch or_sha1.i; \ + fi + + + #Dummy target to ensure that micro-revision.i _always_ gets built. FORCE: diff --git a/src/or/config.c b/src/or/config.c index aa61ecf9a5..14418d2beb 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -3927,6 +3927,14 @@ options_init_from_torrc(int argc, char **argv) printf("Tor version %s.\n",get_version()); exit(0); } + if (argc > 1 && (!strcmp(argv[1],"--digests"))) { + printf("Tor version %s.\n",get_version()); + printf("%s", libor_get_digests()); + printf("%s", "" +#include "or_sha1.i" + ); + exit(0); + } /* Go through command-line variables */ if (!global_cmdline_options) { |