In routerlist_assert_ok(), check r2 before taking &(r2->cache_info)
[tor.git] / src / or / include.am
blob47bdd09901029c73dd7ae79bf1a3aceafd35fa08
1 bin_PROGRAMS+= src/or/tor
2 noinst_LIBRARIES += \
3         src/or/libtor.a
4 if UNITTESTS_ENABLED
5 noinst_LIBRARIES += \
6         src/or/libtor-testing.a
7 endif
8 if COVERAGE_ENABLED
9 noinst_PROGRAMS+= src/or/tor-cov
10 endif
12 if BUILD_NT_SERVICES
13 tor_platform_source=src/or/ntmain.c
14 else
15 tor_platform_source=
16 endif
18 EXTRA_DIST+= src/or/ntmain.c src/or/or_sha1.i src/or/Makefile.nmake
20 if USE_EXTERNAL_EVDNS
21 evdns_source=
22 else
23 evdns_source=src/ext/eventdns.c
24 endif
26 if CURVE25519_ENABLED
27 onion_ntor_source=src/or/onion_ntor.c
28 else
29 onion_ntor_source=
30 endif
32 LIBTOR_A_SOURCES = \
33         src/or/addressmap.c                             \
34         src/or/buffers.c                                \
35         src/or/channel.c                                \
36         src/or/channeltls.c                             \
37         src/or/circpathbias.c                           \
38         src/or/circuitbuild.c                           \
39         src/or/circuitlist.c                            \
40         src/or/circuitmux.c                             \
41         src/or/circuitmux_ewma.c                        \
42         src/or/circuitstats.c                           \
43         src/or/circuituse.c                             \
44         src/or/command.c                                \
45         src/or/config.c                                 \
46         src/or/confparse.c                              \
47         src/or/connection.c                             \
48         src/or/connection_edge.c                        \
49         src/or/connection_or.c                          \
50         src/or/control.c                                \
51         src/or/cpuworker.c                              \
52         src/or/directory.c                              \
53         src/or/dirserv.c                                \
54         src/or/dirvote.c                                \
55         src/or/dns.c                                    \
56         src/or/dnsserv.c                                \
57         src/or/fp_pair.c                                \
58         src/or/geoip.c                                  \
59         src/or/entrynodes.c                             \
60         src/or/ext_orport.c                             \
61         src/or/hibernate.c                              \
62         src/or/main.c                                   \
63         src/or/microdesc.c                              \
64         src/or/networkstatus.c                          \
65         src/or/nodelist.c                               \
66         src/or/onion.c                                  \
67         src/or/onion_fast.c                             \
68         src/or/onion_tap.c                              \
69         src/or/transports.c                             \
70         src/or/policies.c                               \
71         src/or/reasons.c                                \
72         src/or/relay.c                                  \
73         src/or/rendclient.c                             \
74         src/or/rendcommon.c                             \
75         src/or/rendmid.c                                \
76         src/or/rendservice.c                            \
77         src/or/rephist.c                                \
78         src/or/replaycache.c                            \
79         src/or/router.c                                 \
80         src/or/routerlist.c                             \
81         src/or/routerparse.c                            \
82         src/or/routerset.c                              \
83         src/or/statefile.c                              \
84         src/or/status.c                                 \
85         $(evdns_source)                                 \
86         $(tor_platform_source)                          \
87         $(onion_ntor_source)                            \
88         src/or/config_codedigest.c
90 src_or_libtor_a_SOURCES = $(LIBTOR_A_SOURCES)
91 src_or_libtor_testing_a_SOURCES = $(LIBTOR_A_SOURCES)
93 #libtor_a_LIBADD = ../common/libor.a ../common/libor-crypto.a \
94 #       ../common/libor-event.a
97 src_or_tor_SOURCES = src/or/tor_main.c
98 AM_CPPFLAGS += -I$(srcdir)/src/or -Isrc/or
100 src/or/tor_main.o: micro-revision.i
102 AM_CPPFLAGS += -DSHARE_DATADIR="\"$(datadir)\"" \
103         -DLOCALSTATEDIR="\"$(localstatedir)\"" \
104         -DBINDIR="\"$(bindir)\""
106 src_or_libtor_testing_a_CPPFLAGS = -DTOR_UNIT_TESTS $(AM_CPPFLAGS)
107 src_or_libtor_testing_a_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
109 # -L flags need to go in LDFLAGS. -l flags need to go in LDADD.
110 # This seems to matter nowhere but on windows, but I assure you that it
111 # matters a lot there, and is quite hard to debug if you forget to do it.
114 src_or_tor_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ @TOR_LDFLAGS_libevent@
115 src_or_tor_LDADD = src/or/libtor.a src/common/libor.a \
116         src/common/libor-crypto.a $(LIBDONNA) \
117         src/common/libor-event.a \
118         @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ @TOR_OPENSSL_LIBS@ \
119         @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@
121 if COVERAGE_ENABLED
122 src_or_tor_cov_SOURCES = src/or/tor_main.c
123 src_or_tor_cov_CPPFLAGS = -DTOR_UNIT_TESTS $(AM_CPPFLAGS)
124 src_or_tor_cov_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
125 src_or_tor_cov_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ @TOR_LDFLAGS_libevent@
126 src_or_tor_cov_LDADD = src/or/libtor-testing.a src/common/libor-testing.a \
127         src/common/libor-crypto-testing.a $(LIBDONNA) \
128         src/common/libor-event-testing.a \
129         @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ @TOR_OPENSSL_LIBS@ \
130         @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@
131 endif
133 ORHEADERS = \
134         src/or/addressmap.h                             \
135         src/or/buffers.h                                \
136         src/or/channel.h                                \
137         src/or/channeltls.h                             \
138         src/or/circpathbias.h                           \
139         src/or/circuitbuild.h                           \
140         src/or/circuitlist.h                            \
141         src/or/circuitmux.h                             \
142         src/or/circuitmux_ewma.h                        \
143         src/or/circuitstats.h                           \
144         src/or/circuituse.h                             \
145         src/or/command.h                                \
146         src/or/config.h                                 \
147         src/or/confparse.h                              \
148         src/or/connection.h                             \
149         src/or/connection_edge.h                        \
150         src/or/connection_or.h                          \
151         src/or/control.h                                \
152         src/or/cpuworker.h                              \
153         src/or/directory.h                              \
154         src/or/dirserv.h                                \
155         src/or/dirvote.h                                \
156         src/or/dns.h                                    \
157         src/or/dnsserv.h                                \
158         src/or/eventdns_tor.h                           \
159         src/or/ext_orport.h                             \
160         src/or/fp_pair.h                                \
161         src/or/geoip.h                                  \
162         src/or/entrynodes.h                             \
163         src/or/hibernate.h                              \
164         src/or/main.h                                   \
165         src/or/microdesc.h                              \
166         src/or/networkstatus.h                          \
167         src/or/nodelist.h                               \
168         src/or/ntmain.h                                 \
169         src/or/onion.h                                  \
170         src/or/onion_fast.h                             \
171         src/or/onion_ntor.h                             \
172         src/or/onion_tap.h                              \
173         src/or/or.h                                     \
174         src/or/transports.h                             \
175         src/or/policies.h                               \
176         src/or/reasons.h                                \
177         src/or/relay.h                                  \
178         src/or/rendclient.h                             \
179         src/or/rendcommon.h                             \
180         src/or/rendmid.h                                \
181         src/or/rendservice.h                            \
182         src/or/rephist.h                                \
183         src/or/replaycache.h                            \
184         src/or/router.h                                 \
185         src/or/routerlist.h                             \
186         src/or/routerset.h                              \
187         src/or/routerparse.h                            \
188         src/or/statefile.h                              \
189         src/or/status.h
191 noinst_HEADERS+= $(ORHEADERS) micro-revision.i
193 src/or/config_codedigest.o: src/or/or_sha1.i
195 micro-revision.i: FORCE
196         @rm -f micro-revision.tmp;                              \
197         if test -d "$(top_srcdir)/.git" &&                              \
198           test -x "`which git 2>&1;true`"; then                         \
199           HASH="`cd "$(top_srcdir)" && git rev-parse --short=16 HEAD`"; \
200           echo \"$$HASH\" > micro-revision.tmp;                         \
201         fi;                                                             \
202         if test ! -f micro-revision.tmp ; then                  \
203           if test ! -f micro-revision.i ; then                  \
204             echo '""' > micro-revision.i;                       \
205           fi;                                                           \
206         elif test ! -f micro-revision.i ||                      \
207           test x"`cat micro-revision.tmp`" != x"`cat micro-revision.i`"; then \
208           mv micro-revision.tmp micro-revision.i;               \
209         fi; true
211 src/or/or_sha1.i: $(src_or_tor_SOURCES) $(src_or_libtor_a_SOURCES) $(ORHEADERS)
212         $(AM_V_GEN)if test "@SHA1SUM@" != none; then \
213           (cd "$(srcdir)" && "@SHA1SUM@" $(src_or_tor_SOURCES) $(src_or_libtor_a_SOURCES) $(ORHEADERS) ) | \
214           "@SED@" -n 's/^\(.*\)$$/"\1\\n"/p' > src/or/or_sha1.i; \
215         elif test "@OPENSSL@" != none; then \
216           (cd "$(srcdir)" && "@OPENSSL@" sha1 $(src_or_tor_SOURCES) $(src_or_libtor_a_SOURCES) $(ORHEADERS)) | \
217           "@SED@" -n 's/SHA1(\(.*\))= \(.*\)/"\2  \1\\n"/p' > src/or/or_sha1.i; \
218         else \
219           rm src/or/or_sha1.i; \
220           touch src/or/or_sha1.i; \
221         fi
223 CLEANFILES+= micro-revision.i src/or/micro-revision.i
225 FORCE: