summaryrefslogtreecommitdiff
path: root/src/nat/Makefile.am
blob: 2c04741da1c00637d0ae35818966e1374e79ee22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# This Makefile.am is in the public domain
AM_CPPFLAGS = -I$(top_srcdir)/src/include

libexecdir= $(pkglibdir)/libexec/

pkgcfgdir= $(pkgdatadir)/config.d/

pkgcfg_DATA = \
  nat.conf

if HAVE_SUDO
SUDO_OR_DOAS_BINARY= $(SUDO_BINARY)
else
if HAVE_DOAS_BINARY
SUDO_OR_DOAS_BINARY= $(DOAS_BINARY)
endif
endif

if LINUX
  NATBIN = gnunet-helper-nat-server gnunet-helper-nat-client
  NATSERVER = gnunet-helper-nat-server.c
  NATCLIENT = gnunet-helper-nat-client.c
install-exec-hook:
	chown root:root $(DESTDIR)$(libexecdir)/gnunet-helper-nat-server
	chown root:root $(DESTDIR)$(libexecdir)/gnunet-helper-nat-client
	chmod u+s $(DESTDIR)$(libexecdir)/gnunet-helper-nat-server
	chmod u+s $(DESTDIR)$(libexecdir)/gnunet-helper-nat-client
else
if XFREEBSD
  NATBIN = gnunet-helper-nat-server gnunet-helper-nat-client
  NATSERVER = gnunet-helper-nat-server.c
  NATCLIENT = gnunet-helper-nat-client.c
install-exec-hook:
	chown root:root $(DESTDIR)$(libexecdir)/gnunet-helper-nat-server
	chown root:root $(DESTDIR)$(libexecdir)/gnunet-helper-nat-client
	chmod u+s $(DESTDIR)$(libexecdir)/gnunet-helper-nat-server
	chmod u+s $(DESTDIR)$(libexecdir)/gnunet-helper-nat-client
endif
else
install-exec-hook:
endif

bin_PROGRAMS = \
 gnunet-nat

libexec_PROGRAMS = \
 $(NATBIN) \
 gnunet-service-nat


gnunet_helper_nat_server_SOURCES = \
 $(NATSERVER)

gnunet_helper_nat_client_SOURCES = \
 $(NATCLIENT)


gnunet_nat_SOURCES = \
  gnunet-nat.c nat.h
gnunet_nat_LDADD = \
  libgnunetnatnew.la \
  $(top_builddir)/src/util/libgnunetutil.la


if USE_COVERAGE
  AM_CFLAGS = -fprofile-arcs -ftest-coverage
endif

lib_LTLIBRARIES = \
  libgnunetnatnew.la

libgnunetnatnew_la_SOURCES = \
  nat_api.c \
  nat_api_stun.c nat_stun.h \
  nat.h
libgnunetnatnew_la_LIBADD = \
  $(top_builddir)/src/util/libgnunetutil.la \
  $(GN_LIBINTL) @EXT_LIBS@
libgnunetnatnew_la_LDFLAGS = \
  $(GN_LIB_LDFLAGS) $(WINFLAGS) \
  -version-info 2:0:0

gnunet_service_nat_SOURCES = \
 gnunet-service-nat.c gnunet-service-nat.h \
 gnunet-service-nat_externalip.c gnunet-service-nat_externalip.h \
 gnunet-service-nat_stun.c gnunet-service-nat_stun.h \
 gnunet-service-nat_mini.c gnunet-service-nat_mini.h \
 gnunet-service-nat_helper.c gnunet-service-nat_helper.h
gnunet_service_nat_LDADD = \
  $(top_builddir)/src/util/libgnunetutil.la \
  $(top_builddir)/src/statistics/libgnunetstatistics.la \
  $(LIBGCRYPT_LIBS) \
  -lgcrypt \
  $(GN_LIBINTL)

#check_PROGRAMS = \
#  test_nat \
#  test_nat_mini \
#  test_nat_test \
#  test_stun

if ENABLE_TEST_RUN
 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
 TESTS = $(check_PROGRAMS)
endif

#test_nat_SOURCES = \
#  test_nat.c
#test_nat_LDADD = \
# libgnunetnat.la \
# $(top_builddir)/src/util/libgnunetutil.la

#test_nat_mini_SOURCES = \
#  test_nat_mini.c
#test_nat_mini_LDADD = \
# libgnunetnat.la \
# $(top_builddir)/src/util/libgnunetutil.la

#test_nat_test_SOURCES = \
#  test_nat_test.c
#test_nat_test_LDADD = \
# libgnunetnat.la \
# $(top_builddir)/src/util/libgnunetutil.la

#test_stun_SOURCES = \
#  test_stun.c
#test_stun_LDADD = \
# libgnunetnat.la \
# $(top_builddir)/src/util/libgnunetutil.la

EXTRA_DIST = \
 test_nat_data.conf \
 test_nat_test_data.conf \
 test_stun.conf