commit 2a4a1496241d6c4183763f90600be4775ccb5470 Author: Stewart Smith <stew...@flamingspork.com> Date: Thu Aug 2 23:31:43 2012 +1000
Move to non-recursive make This gives us a few benefits: 1) make -j clean all this will start working, as it should. It currently doesn't. 2) increased parallel build recursive make will max out at number of files in a directory, non-recursive make doesn't have such a limitation 3) Removal of duplicate information in make files, less error prone I've also slightly updated how we call AM_INIT_AUTOMAKE, as the way that was used was not only deprecated but will be *removed* in the next major automake release (1.13).... so probably best that we can continue to bulid tor without requiring old automake. (see http://www.gnu.org/software/automake/manual/html_node/Public-Macros.html ) For more reasons why, see resources such as: http://miller.emu.id.au/pmiller/books/rmch/ --- Makefile.am | 16 +++- configure.in | 14 +--- contrib/Makefile.am | 23 ----- contrib/include.am | 20 +++++ contrib/suse/Makefile.am | 3 - contrib/suse/include.am | 1 + contrib/updateVersions.pl | 2 +- doc/Makefile.am | 89 ------------------- doc/include.am | 89 +++++++++++++++++++ src/Makefile.am | 5 - src/common/Makefile.am | 67 --------------- src/common/include.am | 70 +++++++++++++++ src/config/Makefile.am | 16 ---- src/config/include.am | 16 ++++ src/include.am | 6 ++ src/or/Makefile.am | 160 ----------------------------------- src/or/include.am | 160 +++++++++++++++++++++++++++++++++++ src/test/Makefile.am | 51 ----------- src/test/include.am | 55 ++++++++++++ src/tools/Makefile.am | 22 ----- src/tools/include.am | 22 +++++ src/tools/tor-fw-helper/Makefile.am | 38 -------- src/tools/tor-fw-helper/include.am | 36 ++++++++ src/win32/Makefile.am | 3 - src/win32/include.am | 3 + 25 files changed, 495 insertions(+), 492 deletions(-) diff --git a/Makefile.am b/Makefile.am index 29bba71..819795c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,11 +7,21 @@ # 1.7 means we require automake vesion 1.7 AUTOMAKE_OPTIONS = foreign 1.7 -SUBDIRS = src doc contrib +noinst_LIBRARIES= +EXTRA_DIST= +noinst_HEADERS= +bin_PROGRAMS= +CLEANFILES= +TESTS= +noinst_PROGRAMS= +DISTCLEANFILES= +bin_SCRIPTS= +include src/include.am +include doc/include.am +include contrib/include.am -DIST_SUBDIRS = src doc contrib -EXTRA_DIST = \ +EXTRA_DIST+= \ ChangeLog \ INSTALL \ LICENSE \ diff --git a/configure.in b/configure.in index c107148..7b7d5fb 100644 --- a/configure.in +++ b/configure.in @@ -3,8 +3,9 @@ dnl Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson dnl Copyright (c) 2007-2012, The Tor Project, Inc. dnl See LICENSE for licensing information -AC_INIT -AM_INIT_AUTOMAKE(tor, 0.2.4.0-alpha-dev) +AC_INIT([tor],[0.2.4.0-alpha-dev]) +AC_CONFIG_SRCDIR([src/or/main.c]) +AM_INIT_AUTOMAKE m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AM_CONFIG_HEADER(orconfig.h) @@ -1324,16 +1325,7 @@ AC_CONFIG_FILES([ contrib/tor.sh contrib/torctl contrib/torify - doc/Makefile - src/Makefile - src/common/Makefile - src/config/Makefile src/config/torrc.sample - src/or/Makefile - src/test/Makefile - src/tools/Makefile - src/tools/tor-fw-helper/Makefile - src/win32/Makefile tor.spec ]) diff --git a/contrib/Makefile.am b/contrib/Makefile.am deleted file mode 100644 index 795c351..0000000 --- a/contrib/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -SUBDIRS = suse -DIST_SUBDIRS = suse - -confdir = $(sysconfdir)/tor - -EXTRA_DIST = \ - cross.sh \ - exitlist \ - linux-tor-prio.sh \ - package_nsis-mingw.sh \ - rc.subr \ - tor-ctrl.sh \ - tor-exit-notice.html \ - tor-mingw.nsi.in \ - tor-tsocks.conf \ - tor.ico \ - tor.nsi.in \ - tor.sh \ - torctl - -conf_DATA = tor-tsocks.conf - -bin_SCRIPTS = torify diff --git a/contrib/include.am b/contrib/include.am new file mode 100644 index 0000000..4a995a3 --- /dev/null +++ b/contrib/include.am @@ -0,0 +1,20 @@ +include contrib/suse/include.am + +EXTRA_DIST+= \ + contrib/cross.sh \ + contrib/exitlist \ + contrib/linux-tor-prio.sh \ + contrib/package_nsis-mingw.sh \ + contrib/rc.subr \ + contrib/tor-ctrl.sh \ + contrib/tor-exit-notice.html \ + contrib/tor-mingw.nsi.in \ + contrib/tor-tsocks.conf \ + contrib/tor.ico \ + contrib/tor.nsi.in \ + contrib/tor.sh \ + contrib/torctl + +conf_DATA+= contrib/tor-tsocks.conf + +bin_SCRIPTS+= contrib/torify diff --git a/contrib/suse/Makefile.am b/contrib/suse/Makefile.am deleted file mode 100644 index 06511c0..0000000 --- a/contrib/suse/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -confdir = $(sysconfdir)/tor - -EXTRA_DIST = tor.sh diff --git a/contrib/suse/include.am b/contrib/suse/include.am new file mode 100644 index 0000000..4aed0e1 --- /dev/null +++ b/contrib/suse/include.am @@ -0,0 +1 @@ +EXTRA_DIST+= contrib/suse/tor.sh diff --git a/contrib/updateVersions.pl b/contrib/updateVersions.pl index 76b6fe5..9c24134 100755 --- a/contrib/updateVersions.pl +++ b/contrib/updateVersions.pl @@ -18,7 +18,7 @@ demand($TOR_NSI); open(F, $CONFIGURE_IN) or die "$!"; $version = undef; while (<F>) { - if (/AM_INIT_AUTOMAKE\(tor,\s*([^\)]*)\)/) { + if (/AC_INIT\(\[tor\],\s*\[([^\]]*)\]\)/) { $version = $1; last; } diff --git a/doc/Makefile.am b/doc/Makefile.am deleted file mode 100644 index 51a3b57..0000000 --- a/doc/Makefile.am +++ /dev/null @@ -1,89 +0,0 @@ -# We use a two-step process to generate documentation from asciidoc files. -# -# First, we use asciidoc/a2x to process the asciidoc files into .1.in and -# .html.in files (see the asciidoc-helper.sh script). These are the same as -# the regular .1 and .html files, except that they still have some autoconf -# variables set in them. -# -# Second, we use config.status to turn .1.in files into .1 files and -# .html.in files into .html files. -# -# We do the steps in this order so that we can ship the .*.in files as -# part of the source distribution, so that people without asciidoc can -# just use the .1 and .html files. - -regular_mans = tor tor-gencert tor-resolve torify -all_mans = $(regular_mans) tor-fw-helper - -if USE_ASCIIDOC -if USE_FW_HELPER -nodist_man_MANS = $(all_mans:=.1) -doc_DATA = $(all_mans:=.html) -else -nodist_man_MANS = $(regular_mans:=.1) -doc_DATA = $(regular_mans:=.html) -endif -html_in = $(all_mans:=.html.in) -man_in = $(all_mans:=.1.in) -txt_in = $(all_mans:=.1.txt) -else -html_in = -man_in = -txt_in = -nodist_man_MANS = -doc_DATA = -endif - -EXTRA_DIST = HACKING asciidoc-helper.sh \ - $(html_in) $(man_in) $(txt_in) \ - tor-rpm-creation.txt \ - tor-win32-mingw-creation.txt spec/README \ - state-contents.txt - -docdir = @docdir@ - -asciidoc_product = $(nodist_man_MANS) $(doc_DATA) - -# Generate the html documentation from asciidoc, but don't do -# machine-specific replacements yet -$(html_in) : - $(AM_V_GEN)$(top_srcdir)/doc/asciidoc-helper.sh html @ASCIIDOC@ $(top_srcdir)/doc/$@ - -tor.html.in : tor.1.txt -torify.html.in : torify.1.txt -tor-gencert.html.in : tor-gencert.1.txt -tor-resolve.html.in : tor-resolve.1.txt -tor-fw-helper.html.in : tor-fw-helper.1.txt - -# Generate the manpage from asciidoc, but don't do -# machine-specific replacements yet -$(man_in) : - $(AM_V_GEN)$(top_srcdir)/doc/asciidoc-helper.sh man @A2X@ $(top_srcdir)/doc/$@ - -tor.1.in : tor.1.txt -torify.1.in : torify.1.txt -tor-gencert.1.in : tor-gencert.1.txt -tor-resolve.1.in : tor-resolve.1.txt -tor-fw-helper.1.in : tor-fw-helper.1.txt - -# use ../config.status to swap all machine-specific magic strings -# in the asciidoc with their replacements. -$(asciidoc_product) : - $(AM_V_GEN)if test -e $(top_srcdir)/doc/$@.in && ! test -e ./$@.in ; then \ - cp $(top_srcdir)/doc/$@.in .; \ - fi - $(AM_V_GEN)../config.status --file=$@; - -tor.1 : tor.1.in -torify.1 : torify.1.in -tor-gencert.1 : tor-gencert.1.in -tor-resolve.1 : tor-resolve.1.in -tor-fw-helper.1 : tor-fw-helper.1.in -tor.html : tor.html.in -torify.html : torify.html.in -tor-gencert.html : tor-gencert.html.in -tor-resolve.html : tor-resolve.html.in -tor-fw-helper.html : tor-fw-helper.html.in - -CLEANFILES = $(asciidoc_product) config.log -DISTCLEANFILES = $(html_in) $(man_in) diff --git a/doc/include.am b/doc/include.am new file mode 100644 index 0000000..fca46f2 --- /dev/null +++ b/doc/include.am @@ -0,0 +1,89 @@ +# We use a two-step process to generate documentation from asciidoc files. +# +# First, we use asciidoc/a2x to process the asciidoc files into .1.in and +# .html.in files (see the asciidoc-helper.sh script). These are the same as +# the regular .1 and .html files, except that they still have some autoconf +# variables set in them. +# +# Second, we use config.status to turn .1.in files into .1 files and +# .html.in files into .html files. +# +# We do the steps in this order so that we can ship the .*.in files as +# part of the source distribution, so that people without asciidoc can +# just use the .1 and .html files. + +regular_mans = doc/tor doc/tor-gencert doc/tor-resolve doc/torify +all_mans = $(regular_mans) doc/tor-fw-helper + +if USE_ASCIIDOC +if USE_FW_HELPER +nodist_man_MANS = $(all_mans:=.1) +doc_DATA = $(all_mans:=.html) +else +nodist_man_MANS = $(regular_mans:=.1) +doc_DATA = $(regular_mans:=.html) +endif +html_in = $(all_mans:=.html.in) +man_in = $(all_mans:=.1.in) +txt_in = $(all_mans:=.1.txt) +else +html_in = +man_in = +txt_in = +nodist_man_MANS = +doc_DATA = +endif + +EXTRA_DIST+= doc/HACKING doc/asciidoc-helper.sh \ + $(html_in) $(man_in) $(txt_in) \ + doc/tor-rpm-creation.txt \ + doc/tor-win32-mingw-creation.txt doc/spec/README \ + doc/state-contents.txt + +docdir = @docdir@ + +asciidoc_product = $(nodist_man_MANS) $(doc_DATA) + +# Generate the html documentation from asciidoc, but don't do +# machine-specific replacements yet +$(html_in) : + $(AM_V_GEN)$(top_srcdir)/doc/asciidoc-helper.sh html @ASCIIDOC@ $(top_srcdir)/$@ + +doc/tor.html.in : doc/tor.1.txt +doc/torify.html.in : doc/torify.1.txt +doc/tor-gencert.html.in : doc/tor-gencert.1.txt +doc/tor-resolve.html.in : doc/tor-resolve.1.txt +doc/tor-fw-helper.html.in : doc/tor-fw-helper.1.txt + +# Generate the manpage from asciidoc, but don't do +# machine-specific replacements yet +$(man_in) : + $(AM_V_GEN)$(top_srcdir)/doc/asciidoc-helper.sh man @A2X@ $(top_srcdir)/$@ + +doc/tor.1.in : doc/tor.1.txt +doc/torify.1.in : doc/torify.1.txt +doc/tor-gencert.1.in : doc/tor-gencert.1.txt +doc/tor-resolve.1.in : doc/tor-resolve.1.txt +doc/tor-fw-helper.1.in : doc/tor-fw-helper.1.txt + +# use ../config.status to swap all machine-specific magic strings +# in the asciidoc with their replacements. +$(asciidoc_product) : + $(AM_V_GEN)if test -e $(top_srcdir)/$@.in && ! test -e $@.in ; then \ + cp $(top_srcdir)/$@.in doc/.; \ + fi + $(AM_V_GEN)$(top_srcdir)/config.status --file=$@; + +doc/tor.1 : doc/tor.1.in +doc/torify.1 : doc/torify.1.in +doc/tor-gencert.1 : doc/tor-gencert.1.in +doc/tor-resolve.1 : doc/tor-resolve.1.in +doc/tor-fw-helper.1 : doc/tor-fw-helper.1.in +doc/tor.html : doc/tor.html.in +doc/torify.html : doc/torify.html.in +doc/tor-gencert.html : doc/tor-gencert.html.in +doc/tor-resolve.html : doc/tor-resolve.html.in +doc/tor-fw-helper.html : doc/tor-fw-helper.html.in + +CLEANFILES+= $(asciidoc_product) config.log +DISTCLEANFILES+= $(html_in) $(man_in) diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index fa2dd56..0000000 --- a/src/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ - -# leave in dependency order, since common must be built first -SUBDIRS = common or test tools win32 config -DIST_SUBDIRS = common or test tools win32 config - diff --git a/src/common/Makefile.am b/src/common/Makefile.am deleted file mode 100644 index 5e76842..0000000 --- a/src/common/Makefile.am +++ /dev/null @@ -1,67 +0,0 @@ - -noinst_LIBRARIES = libor.a libor-crypto.a libor-event.a - -EXTRA_DIST = common_sha1.i sha256.c Makefile.nmake - -#CFLAGS = -Wall -Wpointer-arith -O2 - -if USE_OPENBSD_MALLOC -libor_extra_source=OpenBSD_malloc_Linux.c -else -libor_extra_source= -endif - -libor_a_SOURCES = \ - address.c \ - compat.c \ - container.c \ - di_ops.c \ - log.c \ - memarea.c \ - mempool.c \ - procmon.c \ - util.c \ - util_codedigest.c \ - $(libor_extra_source) - -libor_crypto_a_SOURCES = \ - aes.c \ - crypto.c \ - torgzip.c \ - tortls.c - -libor_event_a_SOURCES = compat_libevent.c - -noinst_HEADERS = \ - address.h \ - aes.h \ - ciphers.inc \ - compat.h \ - compat_libevent.h \ - container.h \ - crypto.h \ - di_ops.h \ - ht.h \ - memarea.h \ - mempool.h \ - procmon.h \ - strlcat.c \ - strlcpy.c \ - torgzip.h \ - torint.h \ - torlog.h \ - tortls.h \ - util.h - -common_sha1.i: $(libor_SOURCES) $(libor_crypto_a_SOURCES) $(noinst_HEADERS) - if test "@SHA1SUM@" != none; then \ - (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 \ - (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; \ - fi - -util_codedigest.o: common_sha1.i -crypto.o: sha256.c diff --git a/src/common/include.am b/src/common/include.am new file mode 100644 index 0000000..0b175df --- /dev/null +++ b/src/common/include.am @@ -0,0 +1,70 @@ + +noinst_LIBRARIES+= src/common/libor.a src/common/libor-crypto.a src/common/libor-event.a + +EXTRA_DIST+= \ + src/common/common_sha1.i \ + src/common/sha256.c \ + src/common/Makefile.nmake + +#CFLAGS = -Wall -Wpointer-arith -O2 + +if USE_OPENBSD_MALLOC +libor_extra_source=src/common/OpenBSD_malloc_Linux.c +else +libor_extra_source= +endif + +src_common_libor_a_SOURCES = \ + src/common/address.c \ + src/common/compat.c \ + src/common/container.c \ + src/common/di_ops.c \ + src/common/log.c \ + src/common/memarea.c \ + src/common/mempool.c \ + src/common/procmon.c \ + src/common/util.c \ + src/common/util_codedigest.c \ + $(libor_extra_source) + +src_common_libor_crypto_a_SOURCES = \ + src/common/aes.c \ + src/common/crypto.c \ + src/common/torgzip.c \ + src/common/tortls.c + +src_common_libor_event_a_SOURCES = src/common/compat_libevent.c + +noinst_HEADERS+= \ + src/common/address.h \ + src/common/aes.h \ + src/common/ciphers.inc \ + src/common/compat.h \ + src/common/compat_libevent.h \ + src/common/container.h \ + src/common/crypto.h \ + src/common/di_ops.h \ + src/common/ht.h \ + src/common/memarea.h \ + src/common/mempool.h \ + src/common/procmon.h \ + src/common/strlcat.c \ + src/common/strlcpy.c \ + src/common/torgzip.h \ + src/common/torint.h \ + src/common/torlog.h \ + src/common/tortls.h \ + src/common/util.h + +src_common_common_sha1.i: $(libor_SOURCES) $(libor_crypto_a_SOURCES) $(noinst_HEADERS) + 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' > src/common/common_sha1.i; \ + 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' > src/common/common_sha1.i; \ + else \ + rm src/common/common_sha1.i; \ + touch src/common/common_sha1.i; \ + fi + +src_common_util_codedigest.o: src/common/common_sha1.i +src_common_crypto.o: src/common/sha256.c diff --git a/src/config/Makefile.am b/src/config/Makefile.am deleted file mode 100644 index 90dd218..0000000 --- a/src/config/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -confdir = $(sysconfdir)/tor - -tordatadir = $(datadir)/tor - -EXTRA_DIST = geoip -# fallback-consensus - -conf_DATA = torrc.sample - -tordata_DATA = geoip -# fallback_consensus - -# If we don't have it, fake it. -fallback-consensus: - touch fallback-consensus - diff --git a/src/config/include.am b/src/config/include.am new file mode 100644 index 0000000..e6e1fe0 --- /dev/null +++ b/src/config/include.am @@ -0,0 +1,16 @@ +confdir = $(sysconfdir)/tor + +tordatadir = $(datadir)/tor + +EXTRA_DIST+= src/config/geoip +# fallback-consensus + +conf_DATA = src/config/torrc.sample + +tordata_DATA = src/config/geoip +# fallback_consensus + +# If we don't have it, fake it. +src_config_fallback-consensus: + touch src/config/fallback-consensus + diff --git a/src/include.am b/src/include.am new file mode 100644 index 0000000..965a494 --- /dev/null +++ b/src/include.am @@ -0,0 +1,6 @@ +include src/common/include.am +include src/or/include.am +include src/test/include.am +include src/tools/include.am +include src/win32/include.am +include src/config/include.am \ No newline at end of file diff --git a/src/or/Makefile.am b/src/or/Makefile.am deleted file mode 100644 index 27eb607..0000000 --- a/src/or/Makefile.am +++ /dev/null @@ -1,160 +0,0 @@ -bin_PROGRAMS = tor -noinst_LIBRARIES = libtor.a - -if BUILD_NT_SERVICES -tor_platform_source=ntmain.c -else -tor_platform_source= -endif - -EXTRA_DIST=ntmain.c or_sha1.i Makefile.nmake - -if USE_EXTERNAL_EVDNS -evdns_source= -else -evdns_source=eventdns.c -endif - -libtor_a_SOURCES = \ - buffers.c \ - circuitbuild.c \ - circuitlist.c \ - circuituse.c \ - command.c \ - config.c \ - connection.c \ - connection_edge.c \ - connection_or.c \ - control.c \ - cpuworker.c \ - directory.c \ - dirserv.c \ - dirvote.c \ - dns.c \ - dnsserv.c \ - geoip.c \ - hibernate.c \ - main.c \ - microdesc.c \ - networkstatus.c \ - nodelist.c \ - onion.c \ - transports.c \ - policies.c \ - reasons.c \ - relay.c \ - rendclient.c \ - rendcommon.c \ - rendmid.c \ - rendservice.c \ - rephist.c \ - replaycache.c \ - router.c \ - routerlist.c \ - routerparse.c \ - status.c \ - $(evdns_source) \ - $(tor_platform_source) \ - config_codedigest.c - -#libtor_a_LIBADD = ../common/libor.a ../common/libor-crypto.a \ -# ../common/libor-event.a - - -tor_SOURCES = tor_main.c - -AM_CPPFLAGS = -DSHARE_DATADIR="\"$(datadir)\"" \ - -DLOCALSTATEDIR="\"$(localstatedir)\"" \ - -DBINDIR="\"$(bindir)\"" - -# -L flags need to go in LDFLAGS. -l flags need to go in LDADD. -# This seems to matter nowhere but on windows, but I assure you that it -# matters a lot there, and is quite hard to debug if you forget to do it. - - -tor_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ @TOR_LDFLAGS_libevent@ -tor_LDADD = ./libtor.a ../common/libor.a ../common/libor-crypto.a \ - ../common/libor-event.a \ - @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ @TOR_OPENSSL_LIBS@ \ - @TOR_LIB_WS32@ @TOR_LIB_GDI@ - -noinst_HEADERS = \ - buffers.h \ - circuitbuild.h \ - circuitlist.h \ - circuituse.h \ - command.h \ - config.h \ - connection.h \ - connection_edge.h \ - connection_or.h \ - control.h \ - cpuworker.h \ - directory.h \ - dirserv.h \ - dirvote.h \ - dns.h \ - dnsserv.h \ - eventdns.h \ - eventdns_tor.h \ - geoip.h \ - hibernate.h \ - main.h \ - microdesc.h \ - networkstatus.h \ - nodelist.h \ - ntmain.h \ - onion.h \ - or.h \ - transports.h \ - policies.h \ - reasons.h \ - relay.h \ - rendclient.h \ - rendcommon.h \ - rendmid.h \ - rendservice.h \ - rephist.h \ - replaycache.h \ - router.h \ - routerlist.h \ - routerparse.h \ - status.h \ - micro-revision.i - -config_codedigest.o: or_sha1.i - -tor_main.o: micro-revision.i - -micro-revision.i: FORCE - @rm -f micro-revision.tmp; \ - 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 \ - if test ! -f micro-revision.i ; then \ - echo '""' > micro-revision.i; \ - fi; \ - elif test ! -f micro-revision.i || \ - test x"`cat micro-revision.tmp`" != x"`cat micro-revision.i`"; then \ - mv micro-revision.tmp micro-revision.i; \ - fi; true - -or_sha1.i: $(tor_SOURCES) $(libtor_a_SOURCES) - if test "@SHA1SUM@" != none; then \ - (cd "$(srcdir)" && "@SHA1SUM@" $(tor_SOURCES) $(libtor_a_SOURCES)) | \ - "@SED@" -n 's/^\(.*\)$$/"\1\\n"/p' > or_sha1.i; \ - elif test "@OPENSSL@" != none; then \ - (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; \ - touch or_sha1.i; \ - fi - -CLEANFILES = micro-revision.i - -#Dummy target to ensure that micro-revision.i _always_ gets built. -FORCE: diff --git a/src/or/include.am b/src/or/include.am new file mode 100644 index 0000000..3afc9bb --- /dev/null +++ b/src/or/include.am @@ -0,0 +1,160 @@ +bin_PROGRAMS+= src/or/tor +noinst_LIBRARIES+= src/or/libtor.a + +if BUILD_NT_SERVICES +tor_platform_source=src/or/ntmain.c +else +tor_platform_source= +endif + +EXTRA_DIST+= src/or/ntmain.c src/or/or_sha1.i src/or/Makefile.nmake + +if USE_EXTERNAL_EVDNS +evdns_source= +else +evdns_source=src/or/eventdns.c +endif + +src_or_libtor_a_SOURCES = \ + src/or/buffers.c \ + src/or/circuitbuild.c \ + src/or/circuitlist.c \ + src/or/circuituse.c \ + src/or/command.c \ + src/or/config.c \ + src/or/connection.c \ + src/or/connection_edge.c \ + src/or/connection_or.c \ + src/or/control.c \ + src/or/cpuworker.c \ + src/or/directory.c \ + src/or/dirserv.c \ + src/or/dirvote.c \ + src/or/dns.c \ + src/or/dnsserv.c \ + src/or/geoip.c \ + src/or/hibernate.c \ + src/or/main.c \ + src/or/microdesc.c \ + src/or/networkstatus.c \ + src/or/nodelist.c \ + src/or/onion.c \ + src/or/transports.c \ + src/or/policies.c \ + src/or/reasons.c \ + src/or/relay.c \ + src/or/rendclient.c \ + src/or/rendcommon.c \ + src/or/rendmid.c \ + src/or/rendservice.c \ + src/or/rephist.c \ + src/or/replaycache.c \ + src/or/router.c \ + src/or/routerlist.c \ + src/or/routerparse.c \ + src/or/status.c \ + $(evdns_source) \ + $(tor_platform_source) \ + src/or/config_codedigest.c + +#libtor_a_LIBADD = ../common/libor.a ../common/libor-crypto.a \ +# ../common/libor-event.a + + +src_or_tor_SOURCES = src/or/tor_main.c +src_or_tor_INCLUDES= -Isrc/or/ + +src/or/tor_main.c: src/or/micro-revision.i + +AM_CPPFLAGS = -DSHARE_DATADIR="\"$(datadir)\"" \ + -DLOCALSTATEDIR="\"$(localstatedir)\"" \ + -DBINDIR="\"$(bindir)\"" + +# -L flags need to go in LDFLAGS. -l flags need to go in LDADD. +# This seems to matter nowhere but on windows, but I assure you that it +# matters a lot there, and is quite hard to debug if you forget to do it. + + +src_or_tor_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ @TOR_LDFLAGS_libevent@ +src_or_tor_LDADD = src/or/libtor.a src/common/libor.a src/common/libor-crypto.a \ + src/common/libor-event.a \ + @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ @TOR_OPENSSL_LIBS@ \ + @TOR_LIB_WS32@ @TOR_LIB_GDI@ + +noinst_HEADERS+= \ + src/or/buffers.h \ + src/or/circuitbuild.h \ + src/or/circuitlist.h \ + src/or/circuituse.h \ + src/or/command.h \ + src/or/config.h \ + src/or/connection.h \ + src/or/connection_edge.h \ + src/or/connection_or.h \ + src/or/control.h \ + src/or/cpuworker.h \ + src/or/directory.h \ + src/or/dirserv.h \ + src/or/dirvote.h \ + src/or/dns.h \ + src/or/dnsserv.h \ + src/or/eventdns.h \ + src/or/eventdns_tor.h \ + src/or/geoip.h \ + src/or/hibernate.h \ + src/or/main.h \ + src/or/microdesc.h \ + src/or/networkstatus.h \ + src/or/nodelist.h \ + src/or/ntmain.h \ + src/or/onion.h \ + src/or/or.h \ + src/or/transports.h \ + src/or/policies.h \ + src/or/reasons.h \ + src/or/relay.h \ + src/or/rendclient.h \ + src/or/rendcommon.h \ + src/or/rendmid.h \ + src/or/rendservice.h \ + src/or/rephist.h \ + src/or/replaycache.h \ + src/or/router.h \ + src/or/routerlist.h \ + src/or/routerparse.h \ + src/or/status.h \ + src/or/micro-revision.i + +src_or_config_codedigest.o: src/or/or_sha1.i + +src/or/micro-revision.i: FORCE + @rm -f src/or/micro-revision.tmp; \ + 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\" > src/or/micro-revision.tmp; \ + fi; \ + if test ! -f src/or/micro-revision.tmp ; then \ + if test ! -f src/or/micro-revision.i ; then \ + echo '""' > src/or/micro-revision.i; \ + fi; \ + elif test ! -f src/or/micro-revision.i || \ + test x"`cat src/or/micro-revision.tmp`" != x"`cat src/or/micro-revision.i`"; then \ + mv src/or/micro-revision.tmp src/or/micro-revision.i; \ + fi; true + +src_or_or_sha1.i: $(src_or_tor_SOURCES) $(src_or_libtor_a_SOURCES) + if test "@SHA1SUM@" != none; then \ + (cd "$(srcdir)" && "@SHA1SUM@" $(src_or_tor_SOURCES) $(src_or_libtor_a_SOURCES)) | \ + "@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)) | \ + "@SED@" -n 's/SHA1(\(.*\))= \(.*\)/"\2 \1\\n"/p' > src/or/or_sha1.i; \ + else \ + rm src/or/or_sha1.i; \ + touch src/or/or_sha1.i; \ + fi + +CLEANFILES+= src/or/micro-revision.i + +FORCE: \ No newline at end of file diff --git a/src/test/Makefile.am b/src/test/Makefile.am deleted file mode 100644 index f3efdcc..0000000 --- a/src/test/Makefile.am +++ /dev/null @@ -1,51 +0,0 @@ -TESTS = test - -noinst_PROGRAMS = test test-child bench - -AM_CPPFLAGS = -DSHARE_DATADIR="\"$(datadir)\"" \ - -DLOCALSTATEDIR="\"$(localstatedir)\"" \ - -DBINDIR="\"$(bindir)\"" \ - -I"$(top_srcdir)/src/or" - -# -L flags need to go in LDFLAGS. -l flags need to go in LDADD. -# This seems to matter nowhere but on Windows, but I assure you that it -# matters a lot there, and is quite hard to debug if you forget to do it. - -test_SOURCES = \ - test.c \ - test_addr.c \ - test_containers.c \ - test_crypto.c \ - test_data.c \ - test_dir.c \ - test_introduce.c \ - test_microdesc.c \ - test_pt.c \ - test_replay.c \ - test_util.c \ - test_config.c \ - tinytest.c - -bench_SOURCES = \ - bench.c - -test_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ \ - @TOR_LDFLAGS_libevent@ -test_LDADD = ../or/libtor.a ../common/libor.a ../common/libor-crypto.a \ - ../common/libor-event.a \ - @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ \ - @TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ - -bench_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ \ - @TOR_LDFLAGS_libevent@ -bench_LDADD = ../or/libtor.a ../common/libor.a ../common/libor-crypto.a \ - ../common/libor-event.a \ - @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ \ - @TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ - -noinst_HEADERS = \ - tinytest.h \ - tinytest_macros.h \ - test.h - - diff --git a/src/test/include.am b/src/test/include.am new file mode 100644 index 0000000..fad6caf --- /dev/null +++ b/src/test/include.am @@ -0,0 +1,55 @@ +TESTS+= test + +noinst_PROGRAMS+= src/test/test src/test/test-child src/test/bench + +src_test_AM_CPPFLAGS = -DSHARE_DATADIR="\"$(datadir)\"" \ + -DLOCALSTATEDIR="\"$(localstatedir)\"" \ + -DBINDIR="\"$(bindir)\"" \ + -I"$(top_srcdir)/src/or" + +# -L flags need to go in LDFLAGS. -l flags need to go in LDADD. +# This seems to matter nowhere but on Windows, but I assure you that it +# matters a lot there, and is quite hard to debug if you forget to do it. + +src_test_test_SOURCES = \ + src/test/test.c \ + src/test/test_addr.c \ + src/test/test_containers.c \ + src/test/test_crypto.c \ + src/test/test_data.c \ + src/test/test_dir.c \ + src/test/test_introduce.c \ + src/test/test_microdesc.c \ + src/test/test_pt.c \ + src/test/test_replay.c \ + src/test/test_util.c \ + src/test/test_config.c \ + src/test/tinytest.c + +src_test_test_CPPFLAGS= $(src_test_AM_CPPFLAGS) + +src_test_bench_SOURCES = \ + src/test/bench.c + +src_test_bench_CPPFLAGS= $(src_test_AM_CPPFLAGS) + +src_test_test_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ \ + @TOR_LDFLAGS_libevent@ +src_test_test_LDADD = src/or/libtor.a src/common/libor.a src/common/libor-crypto.a \ + src/common/libor-event.a \ + @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ \ + @TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ + +src_test_bench_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ \ + @TOR_LDFLAGS_libevent@ +src_test_bench_LDADD = src/or/libtor.a src/common/libor.a src/common/libor-crypto.a \ + src/common/libor-event.a \ + @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ \ + @TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ + +noinst_HEADERS+= \ + src/test/tinytest.h \ + src/test/tinytest_macros.h \ + src/test/test.h + + diff --git a/src/tools/Makefile.am b/src/tools/Makefile.am deleted file mode 100644 index 35b0a41..0000000 --- a/src/tools/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -bin_PROGRAMS = tor-resolve tor-gencert -noinst_PROGRAMS = tor-checkkey - -tor_resolve_SOURCES = tor-resolve.c -tor_resolve_LDFLAGS = -tor_resolve_LDADD = ../common/libor.a @TOR_LIB_MATH@ @TOR_LIB_WS32@ - -tor_gencert_SOURCES = tor-gencert.c -tor_gencert_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ -tor_gencert_LDADD = ../common/libor.a ../common/libor-crypto.a \ - @TOR_LIB_MATH@ @TOR_ZLIB_LIBS@ @TOR_OPENSSL_LIBS@ \ - @TOR_LIB_WS32@ @TOR_LIB_GDI@ - -tor_checkkey_SOURCES = tor-checkkey.c -tor_checkkey_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ -tor_checkkey_LDADD = ../common/libor.a ../common/libor-crypto.a \ - @TOR_LIB_MATH@ @TOR_ZLIB_LIBS@ @TOR_OPENSSL_LIBS@ \ - @TOR_LIB_WS32@ @TOR_LIB_GDI@ - -SUBDIRS = tor-fw-helper -DIST_SUBDIRS = tor-fw-helper - diff --git a/src/tools/include.am b/src/tools/include.am new file mode 100644 index 0000000..7337eff --- /dev/null +++ b/src/tools/include.am @@ -0,0 +1,22 @@ +bin_PROGRAMS+= src/tools/tor-resolve src/tools/tor-gencert +noinst_PROGRAMS+= src/tools/tor-checkkey + +src_tools_tor_resolve_SOURCES = src/tools/tor-resolve.c +src_tools_tor_resolve_LDFLAGS = +src_tools_tor_resolve_LDADD = src/common/libor.a @TOR_LIB_MATH@ @TOR_LIB_WS32@ + +src_tools_tor_gencert_SOURCES = src/tools/tor-gencert.c +src_tools_tor_gencert_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ +src_tools_tor_gencert_LDADD = src/common/libor.a src/common/libor-crypto.a \ + @TOR_LIB_MATH@ @TOR_ZLIB_LIBS@ @TOR_OPENSSL_LIBS@ \ + @TOR_LIB_WS32@ @TOR_LIB_GDI@ + +src_tools_tor_checkkey_SOURCES = src/tools/tor-checkkey.c +src_tools_tor_checkkey_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ +src_tools_tor_checkkey_LDADD = src/common/libor.a src/common/libor-crypto.a \ + @TOR_LIB_MATH@ @TOR_ZLIB_LIBS@ @TOR_OPENSSL_LIBS@ \ + @TOR_LIB_WS32@ @TOR_LIB_GDI@ + +include src/tools/tor-fw-helper/include.am + + diff --git a/src/tools/tor-fw-helper/Makefile.am b/src/tools/tor-fw-helper/Makefile.am deleted file mode 100644 index 393562d..0000000 --- a/src/tools/tor-fw-helper/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -if USE_FW_HELPER -bin_PROGRAMS = tor-fw-helper -else -bin_PROGRAMS = -endif - -tor_fw_helper_SOURCES = \ - tor-fw-helper.c \ - tor-fw-helper-natpmp.c \ - tor-fw-helper-upnp.c -noinst_HEADERS = \ - tor-fw-helper.h \ - tor-fw-helper-natpmp.h \ - tor-fw-helper-upnp.h - -if NAT_PMP -nat_pmp_ldflags = @TOR_LDFLAGS_libnatpmp@ -nat_pmp_ldadd = -lnatpmp @TOR_LIB_IPHLPAPI@ -nat_pmp_cppflags = @TOR_CPPFLAGS_libnatpmp@ -else -nat_pmp_ldflags = -nat_pmp_ldadd = -nat_pmp_cppflags = -endif - -if MINIUPNPC -miniupnpc_ldflags = @TOR_LDFLAGS_libminiupnpc@ -miniupnpc_ldadd = -lminiupnpc -lm @TOR_LIB_IPHLPAPI@ -miniupnpc_cppflags = @TOR_CPPFLAGS_libminiupnpc@ -else -miniupnpc_ldflags = -miniupnpc_ldadd = -miniupnpc_cppflags = -endif - -tor_fw_helper_LDFLAGS = $(nat_pmp_ldflags) $(miniupnpc_ldflags) -tor_fw_helper_LDADD = ../../common/libor.a $(nat_pmp_ldadd) $(miniupnpc_ldadd) @TOR_LIB_WS32@ -tor_fw_helper_CPPFLAGS = $(nat_pmp_cppflags) $(miniupnpc_cppflags) diff --git a/src/tools/tor-fw-helper/include.am b/src/tools/tor-fw-helper/include.am new file mode 100644 index 0000000..cb6c9cd --- /dev/null +++ b/src/tools/tor-fw-helper/include.am @@ -0,0 +1,36 @@ +if USE_FW_HELPER +bin_PROGRAMS+= src/tools/tor-fw-helper/tor-fw-helper +endif + +src_tools_tor_fw_helper_tor_fw_helper_SOURCES = \ + src/tools/tor-fw-helper/tor-fw-helper.c \ + src/tools/tor-fw-helper/tor-fw-helper-natpmp.c \ + src/tools/tor-fw-helper/tor-fw-helper-upnp.c +noinst_HEADERS+= \ + src/tools/tor-fw-helper/tor-fw-helper.h \ + src/tools/tor-fw-helper/tor-fw-helper-natpmp.h \ + src/tools/tor-fw-helper/tor-fw-helper-upnp.h + +if NAT_PMP +nat_pmp_ldflags = @TOR_LDFLAGS_libnatpmp@ +nat_pmp_ldadd = -lnatpmp @TOR_LIB_IPHLPAPI@ +nat_pmp_cppflags = @TOR_CPPFLAGS_libnatpmp@ +else +nat_pmp_ldflags = +nat_pmp_ldadd = +nat_pmp_cppflags = +endif + +if MINIUPNPC +miniupnpc_ldflags = @TOR_LDFLAGS_libminiupnpc@ +miniupnpc_ldadd = -lminiupnpc -lm @TOR_LIB_IPHLPAPI@ +miniupnpc_cppflags = @TOR_CPPFLAGS_libminiupnpc@ +else +miniupnpc_ldflags = +miniupnpc_ldadd = +miniupnpc_cppflags = +endif + +src_tools_tor_fw_helper_tor_fw_helper_LDFLAGS = $(nat_pmp_ldflags) $(miniupnpc_ldflags) +src_tools_tor_fw_helper_tor_fw_helper_LDADD = src/common/libor.a $(nat_pmp_ldadd) $(miniupnpc_ldadd) @TOR_LIB_WS32@ +src_tools_tor_fw_helper_tor_fw_helper_CPPFLAGS = $(nat_pmp_cppflags) $(miniupnpc_cppflags) diff --git a/src/win32/Makefile.am b/src/win32/Makefile.am deleted file mode 100644 index 7f5d742..0000000 --- a/src/win32/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ - -EXTRA_DIST = orconfig.h - diff --git a/src/win32/include.am b/src/win32/include.am new file mode 100644 index 0000000..dad59af --- /dev/null +++ b/src/win32/include.am @@ -0,0 +1,3 @@ + +EXTRA_DIST+= src/win32/orconfig.h + _______________________________________________ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits