aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--Makefile.am21
-rw-r--r--changes/nonrecursive_make16
-rw-r--r--configure.in19
-rw-r--r--contrib/Makefile.am23
-rw-r--r--contrib/include.am20
-rw-r--r--contrib/suse/Makefile.am3
-rw-r--r--contrib/suse/include.am1
-rwxr-xr-xcontrib/updateVersions.pl2
-rw-r--r--doc/Makefile.am89
-rw-r--r--doc/include.am69
-rw-r--r--doc/tor-fw-helper.1.txt2
-rw-r--r--doc/tor-gencert.1.txt2
-rw-r--r--doc/tor-resolve.1.txt2
-rw-r--r--doc/tor.1.txt2
-rw-r--r--doc/torify.1.txt8
-rw-r--r--src/Makefile.am5
-rw-r--r--src/common/Makefile.am67
-rw-r--r--src/common/include.am73
-rw-r--r--src/config/Makefile.am16
-rw-r--r--src/config/include.am16
-rw-r--r--src/include.am6
-rw-r--r--src/or/Makefile.am160
-rw-r--r--src/or/include.am160
-rw-r--r--src/test/Makefile.am51
-rw-r--r--src/test/include.am55
-rw-r--r--src/tools/Makefile.am22
-rw-r--r--src/tools/include.am22
-rw-r--r--src/tools/tor-fw-helper/Makefile.am38
-rw-r--r--src/tools/tor-fw-helper/include.am36
-rw-r--r--src/win32/Makefile.am3
-rw-r--r--src/win32/include.am3
32 files changed, 514 insertions, 501 deletions
diff --git a/.gitignore b/.gitignore
index 3a28ecfd4..8034ae661 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,6 +21,7 @@
*.log
# Autotools stuff
.deps
+.dirstamp
# Stuff made by our makefiles
*.bak
@@ -41,6 +42,7 @@
/config.guess
/config.sub
/conftest*
+/micro-revision.*
/patch-stamp
/stamp-h
/stamp-h.in
@@ -140,7 +142,6 @@
/src/or/Makefile
/src/or/Makefile.in
/src/or/or_sha1.i
-/src/or/micro-revision.*
/src/or/tor
/src/or/tor.exe
/src/or/libtor.a
diff --git a/Makefile.am b/Makefile.am
index 29bba715b..466eaf84f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,14 +4,25 @@
# See LICENSE for licensing information
# "foreign" means we don't follow GNU package layout standards
-# 1.7 means we require automake vesion 1.7
-AUTOMAKE_OPTIONS = foreign 1.7
+# 1.9 means we require automake vesion 1.9
+AUTOMAKE_OPTIONS = foreign 1.9 subdir-objects
-SUBDIRS = src doc contrib
+noinst_LIBRARIES=
+EXTRA_DIST=
+noinst_HEADERS=
+bin_PROGRAMS=
+CLEANFILES=
+TESTS=
+noinst_PROGRAMS=
+DISTCLEANFILES=
+bin_SCRIPTS=
+AM_CPPFLAGS=
+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/changes/nonrecursive_make b/changes/nonrecursive_make
new file mode 100644
index 000000000..71120a545
--- /dev/null
+++ b/changes/nonrecursive_make
@@ -0,0 +1,16 @@
+ o Major features (build):
+ - Switch to a nonrecursive Makefile structure. Now instead of each
+ Makefile.am invoking other Makefile.ams, there is a master
+ Makefile.am that includes the others. This makes our build process
+ slightly more maintainable, and improves parallelism for building
+ with make -j. Original patch by Stewart Smith; various fixes by
+ Jim Meyering.
+
+ o Minor bugfixes (documentation):
+ - We no longer warn so much when generating manpages from their
+ asciidoc source.
+
+ o New requirements:
+ - Tor maintainers now require Automake version 1.9 or later to build
+ Tor from the Git repository. (Automake is not required when building
+ from a source distribution.)
diff --git a/configure.in b/configure.in
index 1c342c5bf..dba2fec1d 100644
--- a/configure.in
+++ b/configure.in
@@ -3,10 +3,11 @@ 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)
+AC_CONFIG_HEADERS([orconfig.h])
AC_CANONICAL_HOST
@@ -1309,23 +1310,12 @@ CPPFLAGS="$CPPFLAGS $TOR_CPPFLAGS_libevent $TOR_CPPFLAGS_openssl $TOR_CPPFLAGS_z
AC_CONFIG_FILES([
Doxyfile
Makefile
- contrib/Makefile
- contrib/suse/Makefile
contrib/suse/tor.sh
contrib/tor.logrotate
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
])
@@ -1334,4 +1324,3 @@ AC_OUTPUT
if test -x /usr/bin/perl && test -x ./contrib/updateVersions.pl ; then
./contrib/updateVersions.pl
fi
-
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
deleted file mode 100644
index 795c351f3..000000000
--- 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 000000000..4a995a37d
--- /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 06511c042..000000000
--- 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 000000000..4aed0e123
--- /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 76b6fe567..9c24134f4 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 51a3b57be..000000000
--- 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 000000000..bb01038d4
--- /dev/null
+++ b/doc/include.am
@@ -0,0 +1,69 @@
+# 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_man1_MANS = $(all_mans:=.1)
+doc_DATA = $(all_mans:=.html)
+else
+nodist_man1_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_man1_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_man1_MANS) $(doc_DATA)
+
+# Generate the html documentation from asciidoc, but don't do
+# machine-specific replacements yet
+$(html_in) : $(txt_in)
+ $(AM_V_GEN)$(top_srcdir)/doc/asciidoc-helper.sh html @ASCIIDOC@ $(top_srcdir)/$@
+
+# Generate the manpage from asciidoc, but don't do
+# machine-specific replacements yet
+$(man_in) : $(txt_in)
+ $(AM_V_GEN)$(top_srcdir)/doc/asciidoc-helper.sh man @A2X@ $(top_srcdir)/$@
+
+# use ../config.status to swap all machine-specific magic strings
+# in the asciidoc with their replacements.
+$(asciidoc_product) : $(txt_in) $(man_in)
+ $(AM_V_GEN)$(MKDIR_P) $(@D)
+ $(AM_V_at)if test -e $(top_srcdir)/$@.in && ! test -e $@.in ; then \
+ cp $(top_srcdir)/$@.in $@; \
+ fi
+ $(AM_V_at)./config.status -q --file=$@;
+
+$(doc_DATA) : $(html_in)
+
+CLEANFILES+= $(asciidoc_product) config.log
+DISTCLEANFILES+= $(html_in) $(man_in)
diff --git a/doc/tor-fw-helper.1.txt b/doc/tor-fw-helper.1.txt
index 49b091038..4caf16ced 100644
--- a/doc/tor-fw-helper.1.txt
+++ b/doc/tor-fw-helper.1.txt
@@ -2,6 +2,8 @@
// See LICENSE for licensing information
// This is an asciidoc file used to generate the manpage/html reference.
// Learn asciidoc on http://www.methods.co.nz/asciidoc/userguide.html
+:man source: Tor
+:man manual: Tor Manual
tor-fw-helper(1)
================
Jacob Appelbaum
diff --git a/doc/tor-gencert.1.txt b/doc/tor-gencert.1.txt
index 2a2d1179c..aa61ec3ec 100644
--- a/doc/tor-gencert.1.txt
+++ b/doc/tor-gencert.1.txt
@@ -2,6 +2,8 @@
// See LICENSE for licensing information
// This is an asciidoc file used to generate the manpage/html reference.
// Learn asciidoc on http://www.methods.co.nz/asciidoc/userguide.html
+:man source: Tor
+:man manual: Tor Manual
tor-gencert(1)
==============
Nick Mathewson
diff --git a/doc/tor-resolve.1.txt b/doc/tor-resolve.1.txt
index bdc636b08..341d30224 100644
--- a/doc/tor-resolve.1.txt
+++ b/doc/tor-resolve.1.txt
@@ -2,6 +2,8 @@
// See LICENSE for licensing information
// This is an asciidoc file used to generate the manpage/html reference.
// Learn asciidoc on http://www.methods.co.nz/asciidoc/userguide.html
+:man source: Tor
+:man manual: Tor Manual
tor-resolve(1)
==============
Peter Palfrader
diff --git a/doc/tor.1.txt b/doc/tor.1.txt
index f1ae7bb4f..d55baa05c 100644
--- a/doc/tor.1.txt
+++ b/doc/tor.1.txt
@@ -2,6 +2,8 @@
// See LICENSE for licensing information
// This is an asciidoc file used to generate the manpage/html reference.
// Learn asciidoc on http://www.methods.co.nz/asciidoc/userguide.html
+:man source: Tor
+:man manual: Tor Manual
TOR(1)
======
diff --git a/doc/torify.1.txt b/doc/torify.1.txt
index 4a4be1250..22b3fe537 100644
--- a/doc/torify.1.txt
+++ b/doc/torify.1.txt
@@ -2,10 +2,10 @@
// See LICENSE for licensing information
// This is an asciidoc file used to generate the manpage/html reference.
// Learn asciidoc on http://www.methods.co.nz/asciidoc/userguide.html
+:man source: Tor
+:man manual: Tor Manual
torify(1)
=========
-Peter Palfrader
-Jacob Appelbaum
NAME
----
@@ -48,3 +48,7 @@ SEE ALSO
--------
**tor**(1), **tor-resolve**(1), **torsocks**(1), **tsocks**(1),
**tsocks.conf**(5).
+
+AUTHORS
+-------
+Peter Palfrader and Jacob Appelbaum wrote this manual.
diff --git a/src/Makefile.am b/src/Makefile.am
deleted file mode 100644
index fa2dd560a..000000000
--- 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 5e7684259..000000000
--- 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 000000000..0ab476984
--- /dev/null
+++ b/src/common/include.am
@@ -0,0 +1,73 @@
+
+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
+AM_CPPFLAGS += -I$(srcdir)/src/common -Isrc/common
+
+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
+
+DISTCLEANFILES+= src/common/common_sha1.i
+
+src/common/common_sha1.i: $(libor_SOURCES) $(libor_crypto_a_SOURCES) $(noinst_HEADERS)
+ $(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' > $@; \
+ 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' > $@; \
+ else \
+ rm $@; \
+ touch $@; \
+ fi
+
+src/common/util_codedigest.o: src/common/common_sha1.i
+src/common/crypto.c: src/common/sha256.c
diff --git a/src/config/Makefile.am b/src/config/Makefile.am
deleted file mode 100644
index 90dd218b4..000000000
--- 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 000000000..e6e1fe044
--- /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 000000000..965a49404
--- /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 27eb607cf..000000000
--- 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 000000000..65ff68492
--- /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
+AM_CPPFLAGS += -I$(srcdir)/src/or -Isrc/or
+
+src/or/tor_main.c: 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 \
+ micro-revision.i
+
+src/or/config_codedigest.o: src/or/or_sha1.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
+
+src/or/or_sha1.i: $(src_or_tor_SOURCES) $(src_or_libtor_a_SOURCES)
+ $(AM_V_GEN)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+= micro-revision.i
+
+FORCE:
diff --git a/src/test/Makefile.am b/src/test/Makefile.am
deleted file mode 100644
index f3efdcc24..000000000
--- 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 000000000..03fef2337
--- /dev/null
+++ b/src/test/include.am
@@ -0,0 +1,55 @@
+TESTS+= src/test/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 35b0a41f5..000000000
--- 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 000000000..7337eff16
--- /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 393562db0..000000000
--- 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 000000000..cb6c9cd56
--- /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 7f5d74248..000000000
--- 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 000000000..dad59af3a
--- /dev/null
+++ b/src/win32/include.am
@@ -0,0 +1,3 @@
+
+EXTRA_DIST+= src/win32/orconfig.h
+