From 91fed2c7037acf3f154ab0a4a536bc1579c1ccfa Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 6 Sep 2012 09:56:48 -0400 Subject: [PATCH 1/3] Fix a build-warning when building out-of-tree We were trying to incorporate all headers in common_sha1.i, not just the src/common ones. This is part of bug 6778; fix on 0.2.4.1-alpha --- changes/bug6778 | 3 +++ src/common/include.am | 10 ++++++---- src/or/include.am | 13 +++++++------ 3 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 changes/bug6778 diff --git a/changes/bug6778 b/changes/bug6778 new file mode 100644 index 0000000000..3585140b3b --- /dev/null +++ b/changes/bug6778 @@ -0,0 +1,3 @@ + o Minor bugfixes: + - Avoid a warning when building common_sha1.i out of tree. Fixes bug + 6778; bugfix on 0.2.4.1-alpha. diff --git a/src/common/include.am b/src/common/include.am index 0ab4769847..c6fde42781 100644 --- a/src/common/include.am +++ b/src/common/include.am @@ -36,7 +36,7 @@ src_common_libor_crypto_a_SOURCES = \ src_common_libor_event_a_SOURCES = src/common/compat_libevent.c -noinst_HEADERS+= \ +COMMONHEADERS = \ src/common/address.h \ src/common/aes.h \ src/common/ciphers.inc \ @@ -57,13 +57,15 @@ noinst_HEADERS+= \ src/common/tortls.h \ src/common/util.h +noinst_HEADERS+= $(COMMONHEADERS) + DISTCLEANFILES+= src/common/common_sha1.i -src/common/common_sha1.i: $(libor_SOURCES) $(libor_crypto_a_SOURCES) $(noinst_HEADERS) +src/common/common_sha1.i: $(libor_SOURCES) $(libor_crypto_a_SOURCES) $(COMMONHEADERS) $(AM_V_GEN)if test "@SHA1SUM@" != none; then \ - (cd "$(srcdir)" && "@SHA1SUM@" $(src_common_libor_SOURCES) $(src_common_libor_crypto_a_SOURCES) $(noinst_HEADERS)) | "@SED@" -n 's/^\(.*\)$$/"\1\\n"/p' > $@; \ + (cd "$(srcdir)" && "@SHA1SUM@" $(src_common_libor_SOURCES) $(src_common_libor_crypto_a_SOURCES) $(COMMONHEADERS)) | "@SED@" -n 's/^\(.*\)$$/"\1\\n"/p' > $@; \ elif test "@OPENSSL@" != none; then \ - (cd "$(srcdir)" && "@OPENSSL@" sha1 $(src_common_libor_SOURCES) $(src_Common_libor_crypto_a_SOURCES) $(noinst_HEADERS)) | "@SED@" -n 's/SHA1(\(.*\))= \(.*\)/"\2 \1\\n"/p' > $@; \ + (cd "$(srcdir)" && "@OPENSSL@" sha1 $(src_common_libor_SOURCES) $(src_Common_libor_crypto_a_SOURCES) $(COMMONHEADERS)) | "@SED@" -n 's/SHA1(\(.*\))= \(.*\)/"\2 \1\\n"/p' > $@; \ else \ rm $@; \ touch $@; \ diff --git a/src/or/include.am b/src/or/include.am index 65ff684925..34cd307b49 100644 --- a/src/or/include.am +++ b/src/or/include.am @@ -81,7 +81,7 @@ src_or_tor_LDADD = src/or/libtor.a src/common/libor.a src/common/libor-crypto.a @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ @TOR_OPENSSL_LIBS@ \ @TOR_LIB_WS32@ @TOR_LIB_GDI@ -noinst_HEADERS+= \ +ORHEADERS = \ src/or/buffers.h \ src/or/circuitbuild.h \ src/or/circuitlist.h \ @@ -122,8 +122,9 @@ noinst_HEADERS+= \ src/or/router.h \ src/or/routerlist.h \ src/or/routerparse.h \ - src/or/status.h \ - micro-revision.i + src/or/status.h + +noinst_HEADERS+= $(ORHEADERS) micro-revision.i src/or/config_codedigest.o: src/or/or_sha1.i @@ -143,12 +144,12 @@ micro-revision.i: FORCE mv micro-revision.tmp micro-revision.i; \ fi; true -src/or/or_sha1.i: $(src_or_tor_SOURCES) $(src_or_libtor_a_SOURCES) +src/or/or_sha1.i: $(src_or_tor_SOURCES) $(src_or_libtor_a_SOURCES) $(ORHEADERS) $(AM_V_GEN)if test "@SHA1SUM@" != none; then \ - (cd "$(srcdir)" && "@SHA1SUM@" $(src_or_tor_SOURCES) $(src_or_libtor_a_SOURCES)) | \ + (cd "$(srcdir)" && "@SHA1SUM@" $(src_or_tor_SOURCES) $(src_or_libtor_a_SOURCES) $(ORHEADERS) ) | \ "@SED@" -n 's/^\(.*\)$$/"\1\\n"/p' > src/or/or_sha1.i; \ elif test "@OPENSSL@" != none; then \ - (cd "$(srcdir)" && "@OPENSSL@" sha1 $(src_or_tor_SOURCES) $(src_or_libtor_a_SOURCES)) | \ + (cd "$(srcdir)" && "@OPENSSL@" sha1 $(src_or_tor_SOURCES) $(src_or_libtor_a_SOURCES) $(ORHEADERS)) | \ "@SED@" -n 's/SHA1(\(.*\))= \(.*\)/"\2 \1\\n"/p' > src/or/or_sha1.i; \ else \ rm src/or/or_sha1.i; \ From 5d162d5a7b6b8ce9075cd6987cc6cda119b433ff Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 6 Sep 2012 10:03:06 -0400 Subject: [PATCH 2/3] Fix a dependency: sha256.c influences crypto.o, not crypto.c --- changes/bug6778 | 1 + src/common/include.am | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changes/bug6778 b/changes/bug6778 index 3585140b3b..4448d15089 100644 --- a/changes/bug6778 +++ b/changes/bug6778 @@ -1,3 +1,4 @@ o Minor bugfixes: - Avoid a warning when building common_sha1.i out of tree. Fixes bug 6778; bugfix on 0.2.4.1-alpha. + - Fix a mis-declared dependency on src/common/crypto.c. diff --git a/src/common/include.am b/src/common/include.am index c6fde42781..299c92e065 100644 --- a/src/common/include.am +++ b/src/common/include.am @@ -72,4 +72,4 @@ src/common/common_sha1.i: $(libor_SOURCES) $(libor_crypto_a_SOURCES) $(COMMONHEA fi src/common/util_codedigest.o: src/common/common_sha1.i -src/common/crypto.c: src/common/sha256.c +src/common/crypto.o: src/common/sha256.c From 30fe9080e70aa2ebdf1c2bf86e98fe46b1ad27e1 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 6 Sep 2012 11:00:32 -0400 Subject: [PATCH 3/3] Fix a dependency: micro-revision.i influences tor_main.o, not tor_main.c --- changes/bug6778 | 4 +++- src/or/include.am | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/changes/bug6778 b/changes/bug6778 index 4448d15089..9149f70ea1 100644 --- a/changes/bug6778 +++ b/changes/bug6778 @@ -1,4 +1,6 @@ o Minor bugfixes: - Avoid a warning when building common_sha1.i out of tree. Fixes bug 6778; bugfix on 0.2.4.1-alpha. - - Fix a mis-declared dependency on src/common/crypto.c. + - Fix mis-declared dependencies on src/common/crypto.c and + src/or/tor_main.c that could break out-of-tree builds under some + circumstances. Fixes bug 6778; bugfix on 0.2.4.1-alpha. diff --git a/src/or/include.am b/src/or/include.am index 34cd307b49..97072dce2f 100644 --- a/src/or/include.am +++ b/src/or/include.am @@ -64,7 +64,7 @@ src_or_libtor_a_SOURCES = \ src_or_tor_SOURCES = src/or/tor_main.c AM_CPPFLAGS += -I$(srcdir)/src/or -Isrc/or -src/or/tor_main.c: micro-revision.i +src/or/tor_main.o: micro-revision.i AM_CPPFLAGS += -DSHARE_DATADIR="\"$(datadir)\"" \ -DLOCALSTATEDIR="\"$(localstatedir)\"" \