separate service for autoconfiguration from NAT traversal
[oweals/gnunet.git] / src / nat / Makefile.am
1 # This Makefile.am is in the public domain
2 AM_CPPFLAGS = -I$(top_srcdir)/src/include
3
4 if MINGW
5   WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
6   NATBIN = gnunet-helper-nat-server gnunet-helper-nat-client
7   NATSERVER = gnunet-helper-nat-server-windows.c
8   NATCLIENT = gnunet-helper-nat-client-windows.c
9 endif
10
11 libexecdir= $(pkglibdir)/libexec/
12
13 pkgcfgdir= $(pkgdatadir)/config.d/
14
15 pkgcfg_DATA = \
16   nat.conf
17
18 if LINUX
19   NATBIN = gnunet-helper-nat-server gnunet-helper-nat-client
20   NATSERVER = gnunet-helper-nat-server.c
21   NATCLIENT = gnunet-helper-nat-client.c
22 install-exec-hook:
23         $(top_srcdir)/src/nat/install-nat-helper.sh $(DESTDIR)$(libexecdir) $(SUDO_BINARY) || true
24 else
25 if XFREEBSD
26   NATBIN = gnunet-helper-nat-server gnunet-helper-nat-client
27   NATSERVER = gnunet-helper-nat-server.c
28   NATCLIENT = gnunet-helper-nat-client.c
29 install-exec-hook:
30         $(top_srcdir)/src/nat/install-nat-helper.sh $(DESTDIR)$(libexecdir) $(SUDO_BINARY) || true
31 endif
32 else
33 install-exec-hook:
34 endif
35
36 bin_PROGRAMS = \
37  gnunet-nat
38
39 libexec_PROGRAMS = \
40  $(NATBIN) \
41  gnunet-service-nat
42
43
44 gnunet_helper_nat_server_SOURCES = \
45  $(NATSERVER)
46
47 gnunet_helper_nat_client_SOURCES = \
48  $(NATCLIENT)         
49
50
51 gnunet_nat_SOURCES = \
52   gnunet-nat.c nat.h
53 gnunet_nat_LDADD = \
54   libgnunetnatnew.la \
55   $(top_builddir)/src/util/libgnunetutil.la
56
57
58 if USE_COVERAGE
59   AM_CFLAGS = -fprofile-arcs -ftest-coverage
60 endif
61
62 lib_LTLIBRARIES = \
63   libgnunetnat.la \
64   libgnunetnatnew.la 
65
66 libgnunetnat_la_SOURCES = \
67   nat.c nat.h \
68   nat_auto.c \
69   nat_test.c \
70   nat_mini.c \
71   nat_stun.c
72 libgnunetnat_la_LIBADD = \
73   $(top_builddir)/src/util/libgnunetutil.la \
74   $(GN_LIBINTL) @EXT_LIBS@ 
75 libgnunetnat_la_LDFLAGS = \
76   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
77   -version-info 1:1:1
78
79 libgnunetnatnew_la_SOURCES = \
80   nat_api.c \
81   nat_api_stun.c nat_stun.h \
82   nat.h
83 libgnunetnatnew_la_LIBADD = \
84   $(top_builddir)/src/util/libgnunetutil.la \
85   $(GN_LIBINTL) @EXT_LIBS@ 
86 libgnunetnatnew_la_LDFLAGS = \
87   $(GN_LIB_LDFLAGS) $(WINFLAGS) \
88   -version-info 2:0:0
89
90 gnunet_service_nat_SOURCES = \
91  gnunet-service-nat.c gnunet-service-nat.h \
92  gnunet-service-nat_externalip.c gnunet-service-nat_externalip.h \
93  gnunet-service-nat_stun.c gnunet-service-nat_stun.h \
94  gnunet-service-nat_mini.c gnunet-service-nat_mini.h \
95  gnunet-service-nat_helper.c gnunet-service-nat_helper.h
96 gnunet_service_nat_LDADD = \
97   $(top_builddir)/src/util/libgnunetutil.la \
98   $(top_builddir)/src/statistics/libgnunetstatistics.la \
99   $(LIBGCRYPT_LIBS) \
100   -lgcrypt \
101   $(GN_LIBINTL)
102
103 check_PROGRAMS = \
104   test_nat \
105   test_nat_mini \
106   test_nat_test \
107   test_stun
108
109 if ENABLE_TEST_RUN
110  AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;
111  TESTS = $(check_PROGRAMS)
112 endif
113
114 test_nat_SOURCES = \
115   test_nat.c
116 test_nat_LDADD = \
117  libgnunetnat.la \
118  $(top_builddir)/src/util/libgnunetutil.la 
119
120 test_nat_mini_SOURCES = \
121   test_nat_mini.c
122 test_nat_mini_LDADD = \
123  libgnunetnat.la \
124  $(top_builddir)/src/util/libgnunetutil.la 
125
126 test_nat_test_SOURCES = \
127   test_nat_test.c
128 test_nat_test_LDADD = \
129  libgnunetnat.la \
130  $(top_builddir)/src/util/libgnunetutil.la 
131
132 test_stun_SOURCES = \
133   test_stun.c
134 test_stun_LDADD = \
135  libgnunetnat.la \
136  $(top_builddir)/src/util/libgnunetutil.la 
137
138 EXTRA_DIST = \
139  test_nat_data.conf \
140  test_nat_test_data.conf \
141  test_stun.conf