Detect and disallow compression bombs
[tor/rransom.git] / src / or / Makefile.am
blobad2476ff15d7a78caaeaef7a88d8a6cddc4dc1b0
1 TESTS = test
3 noinst_PROGRAMS = test
5 bin_PROGRAMS = tor
7 if BUILD_NT_SERVICES
8 tor_platform_source=ntmain.c
9 else
10 tor_platform_source=
11 endif
13 EXTRA_DIST=ntmain.c
15 tor_SOURCES = buffers.c circuitbuild.c circuitlist.c \
16         circuituse.c command.c config.c \
17         connection.c connection_edge.c connection_or.c control.c \
18         cpuworker.c directory.c dirserv.c dirvote.c \
19         dns.c dnsserv.c geoip.c hibernate.c main.c $(tor_platform_source) \
20         networkstatus.c onion.c policies.c \
21         reasons.c relay.c rendcommon.c rendclient.c rendmid.c \
22         rendservice.c rephist.c router.c routerlist.c routerparse.c \
23         eventdns.c \
24         tor_main.c
26 AM_CPPFLAGS = -DSHARE_DATADIR="\"$(datadir)\"" \
27         -DLOCALSTATEDIR="\"$(localstatedir)\"" \
28         -DBINDIR="\"$(bindir)\""
30 # -L flags need to go in LDFLAGS. -l flags need to go in LDADD.
31 # This seems to matter nowhere but on windows, but I assure you that it
32 # matters a lot there, and is quite hard to debug if you forget to do it.
34 tor_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ @TOR_LDFLAGS_libevent@
35 tor_LDADD = ../common/libor.a ../common/libor-crypto.a \
36   -lz @TOR_LIBEVENT_LIBS@ @TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@
37 test_SOURCES = buffers.c circuitbuild.c circuitlist.c \
38         circuituse.c command.c config.c \
39         connection.c connection_edge.c connection_or.c control.c \
40         cpuworker.c directory.c dirserv.c dirvote.c \
41         dns.c dnsserv.c geoip.c hibernate.c main.c $(tor_platform_source) \
42         networkstatus.c onion.c policies.c \
43         reasons.c relay.c rendcommon.c rendclient.c rendmid.c \
44         rendservice.c rephist.c router.c routerlist.c routerparse.c \
45         eventdns.c \
46         test_data.c test.c
48 test_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ \
49         @TOR_LDFLAGS_libevent@
50 test_LDADD = ../common/libor.a ../common/libor-crypto.a \
51         -lz @TOR_LIBEVENT_LIBS@ @TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@
53 noinst_HEADERS = or.h eventdns.h eventdns_tor.h micro-revision.i
55 tor_main.o: micro-revision.i
57 micro-revision.i: FORCE
58         @svkdir=$$SVKROOT;                                      \
59         if test "x$$svkdir" = x ; then                          \
60           svkdir=$$HOME/.svk;                                   \
61         fi;                                                     \
62         if test -d ../../.git && test -x "`which git 2>&1;true`" ; then \
63           if test -d ../../.git/svn && test -x "`which git-svn 2>&1;true`" ; then \
64             git-svn info ../../README |                         \
65             sed -n 's/^Revision: \([0-9][0-9]*\).*/"\1"/p'      \
66                                            > micro-revision.tmp \
67                 || true;                                        \
68           fi;                                                   \
69         elif test -d ../../.svn && test -x "`which svn 2>&1;true`" ; then \
70           svn info ../.. |                                      \
71           sed -n 's/^Revision: \([0-9][0-9]*\).*/"\1"/p' > micro-revision.tmp \
72              || true;                                           \
73         elif test -x "`which svk 2>&1;true`" && test -d $$svkdir/local; then \
74           location=../..;                                       \
75           rev=x;                                                \
76           while test x$$rev = xx; do                            \
77             x=`svk info $$location |                            \
78               sed -n 's/^Mirrored From:.*, Rev\. \([0-9][0-9]*\)/\1/p'`; \
79             if test x$$x != x; then                             \
80               rev=$$x;                                          \
81               break;                                            \
82             else                                                \
83               loc=`svk info $$location |                        \
84                 sed -n 's/^Copied From: \(.*\), Rev\. [0-9][0-9]*/\1/p' | \
85                 head -1`;                                       \
86               if test x$$loc = x; then                          \
87                 break;                                          \
88               else                                              \
89                 location=/$$loc;                                \
90               fi;                                               \
91             fi;                                                 \
92           done;                                                 \
93           if test x$$rev != xx; then                            \
94             echo \"$$rev\" > micro-revision.tmp;                \
95           fi;                                                   \
96         fi;                                                     \
97         if test ! -f micro-revision.tmp ; then                  \
98           if test ! -f micro-revision.i ; then                  \
99             echo '""' > micro-revision.i;                       \
100           fi;                                                   \
101         elif test ! -f micro-revision.i ||                      \
102           test x"`cat micro-revision.tmp`" != x"`cat micro-revision.i`"; then \
103           mv micro-revision.tmp micro-revision.i;               \
104         fi; true
106 #Dummy target to ensure that micro-revision.i _always_ gets built.
107 FORCE: