Commit fdbdb4dc authored by Nick Mathewson's avatar Nick Mathewson 🦀
Browse files

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.
parent b9b16ef9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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
+0 −8
Original line number Diff line number Diff line
@@ -2562,11 +2562,3 @@ write_pidfile(char *filename)
  }
}
const char *
libor_get_digests(void)
{
  return ""
#include "common_sha1.i"
    ;
}
+11 −0
Original line number Diff line number Diff line

#include "util.h"

const char *
libor_get_digests(void)
{
  return ""
#include "common_sha1.i"
    ;
}
+3 −3
Original line number Diff line number Diff line
@@ -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

+1 −3
Original line number Diff line number Diff line
@@ -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);
  }

Loading