]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Handle build-trees better.
authorPeter Palfrader <peter@palfrader.org>
Wed, 7 Sep 2011 16:04:45 +0000 (18:04 +0200)
committerNick Mathewson <nickm@torproject.org>
Fri, 25 Nov 2011 04:56:01 +0000 (23:56 -0500)
Properly create git revision and source file sha1sums include files when
building tor not in its source tree but in a dedicated build tree.

src/common/Makefile.am
src/or/Makefile.am

index 2244fe58d32dbf86f08888518225f3dccc12219c..2920e73d2e1c8212651c0f3710bb58c08e048ec4 100644 (file)
@@ -56,9 +56,9 @@ noinst_HEADERS =                              \
 
 common_sha1.i: $(libor_SOURCES) $(libor_crypto_a_SOURCES) $(noinst_HEADERS)
        if test "@SHA1SUM@" != none; then \
-         @SHA1SUM@ $(libor_SOURCES) $(libor_crypto_a_SOURCES) $(noinst_HEADERS) | @SED@ -n 's/^\(.*\)$$/"\1\\n"/p' > common_sha1.i; \
+         (cd "$(srcdir)" && @SHA1SUM@ $(libor_SOURCES) $(libor_crypto_a_SOURCES) $(noinst_HEADERS)) | @SED@ -n 's/^\(.*\)$$/"\1\\n"/p' > common_sha1.i; \
        elif test "@OPENSSL@" != none; then \
-         @OPENSSL@ sha1 $(libor_SOURCES) $(libor_crypto_a_SOURCES) $(noinst_HEADERS) | @SED@ -n 's/SHA1(\(.*\))= \(.*\)/"\2  \1\\n"/p' > common_sha1.i; \
+         (cd "$(srcdir)" && @OPENSSL@ sha1 $(libor_SOURCES) $(libor_crypto_a_SOURCES) $(noinst_HEADERS)) | @SED@ -n 's/SHA1(\(.*\))= \(.*\)/"\2  \1\\n"/p' > common_sha1.i; \
        else \
          rm common_sha1.i; \
          touch common_sha1.i; \
index 67adf504dfc8c9e1e7c9c00d96db2f5b90627cea..a5682081ae1fe4e6e85991dc6c8d949764dc1253 100644 (file)
@@ -126,8 +126,9 @@ tor_main.o: micro-revision.i
 
 micro-revision.i: FORCE
        @rm -f micro-revision.tmp;                                      \
-       if test -d ../../.git && test -x "`which git 2>&1;true`"; then  \
-         HASH="`git rev-parse --short=16 HEAD`";                       \
+       if test -d "$(top_srcdir)/.git" &&                              \
+         test -x "`which git 2>&1;true`"; then                         \
+         HASH="`cd "$(top_srcdir)" && git rev-parse --short=16 HEAD`";         \
          echo \"$$HASH\" > micro-revision.tmp;                         \
         fi;                                                            \
        if test ! -f micro-revision.tmp ; then                          \
@@ -141,10 +142,10 @@ micro-revision.i: FORCE
 
 or_sha1.i: $(tor_SOURCES) $(libtor_a_SOURCES)
        if test "@SHA1SUM@" != none; then \
-         @SHA1SUM@ $(tor_SOURCES) $(libtor_a_SOURCES) | \
+         (cd "$(srcdir)" && @SHA1SUM@ $(tor_SOURCES) $(libtor_a_SOURCES)) | \
          @SED@ -n 's/^\(.*\)$$/"\1\\n"/p' > or_sha1.i; \
        elif test "@OPENSSL@" != none; then \
-         @OPENSSL@ sha1 $(tor_SOURCES) $(libtor_a_SOURCES) | \
+         (cd "$(srcdir)" && @OPENSSL@ sha1 $(tor_SOURCES) $(libtor_a_SOURCES)) | \
          @SED@ -n 's/SHA1(\(.*\))= \(.*\)/"\2  \1\\n"/p' > or_sha1.i; \
        else \
          rm or_sha1.i; \