diff options
author | Nick Mathewson <nickm@torproject.org> | 2009-05-08 12:35:36 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-05-08 12:35:36 -0400 |
commit | fdbdb4dc15004fdb74c57b9bc67cbfca24c6e7ea (patch) | |
tree | ff07070534ccab65e0cda66bb29f009b1d110685 /src | |
parent | b9b16ef9a5c7c84f41f95e0e2c8266f4c1e2dce2 (diff) | |
download | tor-fdbdb4dc15004fdb74c57b9bc67cbfca24c6e7ea.tar.gz tor-fdbdb4dc15004fdb74c57b9bc67cbfca24c6e7ea.zip |
Include the *_sha1.i files in their own *_codedigest.c files.
This way we do not need to rebuild util.c and/or config.c whenever
any unrelated source file in src/common or src/or has changed.
Diffstat (limited to 'src')
-rw-r--r-- | src/common/Makefile.am | 4 | ||||
-rw-r--r-- | src/common/util.c | 8 | ||||
-rw-r--r-- | src/common/util_codedigest.c | 11 | ||||
-rw-r--r-- | src/or/Makefile.am | 6 | ||||
-rw-r--r-- | src/or/config.c | 4 | ||||
-rw-r--r-- | src/or/config_codedigest.c | 10 | ||||
-rw-r--r-- | src/or/or.h | 2 |
7 files changed, 29 insertions, 16 deletions
diff --git a/src/common/Makefile.am b/src/common/Makefile.am index 78c8ab5516..ad54e1aaaa 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -12,7 +12,7 @@ libor_extra_source= endif libor_a_SOURCES = address.c log.c util.c compat.c container.c mempool.c \ - memarea.c $(libor_extra_source) + memarea.c util_codedigest.c $(libor_extra_source) libor_crypto_a_SOURCES = crypto.c aes.c tortls.c torgzip.c noinst_HEADERS = address.h log.h crypto.h test.h util.h compat.h aes.h torint.h tortls.h strlcpy.c strlcat.c torgzip.h container.h ht.h mempool.h memarea.h ciphers.inc @@ -27,4 +27,4 @@ common_sha1.i: $(libor_SOURCES) $(libor_crypto_a_SOURCES) $(noinst_HEADERS) touch common_sha1.i; \ fi -util.o: common_sha1.i +util_codedigest.o: common_sha1.i diff --git a/src/common/util.c b/src/common/util.c index c1b3ea5507..d153df8cf1 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -2562,11 +2562,3 @@ write_pidfile(char *filename) } } -const char * -libor_get_digests(void) -{ - return "" -#include "common_sha1.i" - ; -} - diff --git a/src/common/util_codedigest.c b/src/common/util_codedigest.c new file mode 100644 index 0000000000..88fe508b92 --- /dev/null +++ b/src/common/util_codedigest.c @@ -0,0 +1,11 @@ + +#include "util.h" + +const char * +libor_get_digests(void) +{ + return "" +#include "common_sha1.i" + ; +} + diff --git a/src/or/Makefile.am b/src/or/Makefile.am index 03e7900944..11923fbd35 100644 --- a/src/or/Makefile.am +++ b/src/or/Makefile.am @@ -20,7 +20,7 @@ tor_SOURCES = buffers.c circuitbuild.c circuitlist.c \ networkstatus.c onion.c policies.c \ reasons.c relay.c rendcommon.c rendclient.c rendmid.c \ rendservice.c rephist.c router.c routerlist.c routerparse.c \ - eventdns.c \ + eventdns.c config_codedigest.c \ tor_main.c AM_CPPFLAGS = -DSHARE_DATADIR="\"$(datadir)\"" \ @@ -42,7 +42,7 @@ test_SOURCES = buffers.c circuitbuild.c circuitlist.c \ networkstatus.c onion.c policies.c \ reasons.c relay.c rendcommon.c rendclient.c rendmid.c \ rendservice.c rephist.c router.c routerlist.c routerparse.c \ - eventdns.c \ + eventdns.c config_codedigest.c \ test_data.c test.c test_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ \ @@ -52,7 +52,7 @@ 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 +config_codedigest.o: or_sha1.i tor_main.o: micro-revision.i diff --git a/src/or/config.c b/src/or/config.c index 76de52748c..93177a166c 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -3930,9 +3930,7 @@ options_init_from_torrc(int argc, char **argv) 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" - ); + printf("%s", tor_get_digests()); exit(0); } diff --git a/src/or/config_codedigest.c b/src/or/config_codedigest.c new file mode 100644 index 0000000000..67fd9847c2 --- /dev/null +++ b/src/or/config_codedigest.c @@ -0,0 +1,10 @@ + +const char *tor_get_digests(void); + +const char * +tor_get_digests(void) +{ + return "" +#include "or_sha1.i" + ; +} diff --git a/src/or/or.h b/src/or/or.h index 854b541d3d..fd75229649 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -2911,6 +2911,8 @@ int options_need_geoip_info(or_options_t *options, const char **reason_out); int getinfo_helper_config(control_connection_t *conn, const char *question, char **answer); +const char *tor_get_digests(void); + #ifdef CONFIG_PRIVATE /* Used only by config.c and test.c */ or_options_t *options_new(void); |