aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-10-29 16:14:03 +0000
committerChristian Grothoff <christian@grothoff.org>2012-10-29 16:14:03 +0000
commitbcbcf005b4864ac5557c31da10521126d8880849 (patch)
tree444cafefb16e1c5a4ba13ce2db07d6ec1f37675e
parent119193d6350bbbd8c6ecbd60ccc8301223d6f6d6 (diff)
downloadgnunet-bcbcf005b4864ac5557c31da10521126d8880849.tar.gz
gnunet-bcbcf005b4864ac5557c31da10521126d8880849.zip
installing all service, daemon and helper binaries to lib/gnunet/libexec/; updating code to run binaries from new location, which is no longer in PATH
-rw-r--r--src/arm/Makefile.am6
-rw-r--r--src/arm/do_start_process.c28
-rw-r--r--src/ats/Makefile.am4
-rw-r--r--src/chat/Makefile.am6
-rw-r--r--src/chat/test_chat.c9
-rw-r--r--src/chat/test_chat_private.c18
-rw-r--r--src/core/Makefile.am6
-rw-r--r--src/core/test_core_api.c13
-rw-r--r--src/core/test_core_api_reliability.c6
-rw-r--r--src/core/test_core_api_start_only.c12
-rw-r--r--src/core/test_core_quota_compliance.c6
-rw-r--r--src/datastore/Makefile.am4
-rw-r--r--src/dht/Makefile.am8
-rw-r--r--src/dns/Makefile.am6
-rw-r--r--src/dv/Makefile.am4
-rw-r--r--src/exit/Makefile.am10
-rw-r--r--src/fs/Makefile.am8
-rw-r--r--src/gns/Makefile.am8
-rw-r--r--src/hostlist/Makefile.am4
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist.c6
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist_learning.c11
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist_reconnect.c9
-rw-r--r--src/include/gnunet_os_lib.h19
-rw-r--r--src/lockmanager/Makefile.am4
-rw-r--r--src/mesh/Makefile.am4
-rw-r--r--src/namestore/Makefile.am6
-rw-r--r--src/nat/Makefile.am8
-rw-r--r--src/nse/Makefile.am4
-rw-r--r--src/peerinfo/Makefile.am4
-rw-r--r--src/pt/Makefile.am6
-rw-r--r--src/statistics/Makefile.am7
-rw-r--r--src/statistics/test_statistics_api.c59
-rw-r--r--src/statistics/test_statistics_api_loop.c47
-rw-r--r--src/statistics/test_statistics_api_watch.c38
-rw-r--r--src/statistics/test_statistics_api_watch_zero_value.c50
-rw-r--r--src/template/Makefile.am6
-rw-r--r--src/testbed/Makefile.am6
-rw-r--r--src/testing/testing.c7
-rw-r--r--src/topology/Makefile.am4
-rw-r--r--src/transport/Makefile.am12
-rw-r--r--src/util/Makefile.am6
-rw-r--r--src/util/helper.c24
-rw-r--r--src/util/os_installation.c31
-rw-r--r--src/util/test_resolver_api.c16
-rw-r--r--src/vpn/Makefile.am10
45 files changed, 346 insertions, 224 deletions
diff --git a/src/arm/Makefile.am b/src/arm/Makefile.am
index 76aec40b6..f91e4210f 100644
--- a/src/arm/Makefile.am
+++ b/src/arm/Makefile.am
@@ -2,6 +2,8 @@ INCLUDES = -I$(top_srcdir)/src/include
2 2
3pkgcfgdir= $(pkgdatadir)/config.d/ 3pkgcfgdir= $(pkgdatadir)/config.d/
4 4
5libexecdir= $(pkglibdir)/libexec/
6
5pkgcfg_DATA = \ 7pkgcfg_DATA = \
6 arm.conf 8 arm.conf
7 9
@@ -27,7 +29,9 @@ libgnunetarm_la_LDFLAGS = \
27 29
28 30
29bin_PROGRAMS = \ 31bin_PROGRAMS = \
30 gnunet-arm \ 32 gnunet-arm
33
34libexec_PROGRAMS = \
31 gnunet-service-arm \ 35 gnunet-service-arm \
32 mockup-service 36 mockup-service
33 37
diff --git a/src/arm/do_start_process.c b/src/arm/do_start_process.c
index 1bc56d540..0687fa345 100644
--- a/src/arm/do_start_process.c
+++ b/src/arm/do_start_process.c
@@ -1,3 +1,23 @@
1/*
2 This file is part of GNUnet.
3 (C) 2011, 2012 Christian Grothoff (and other contributing authors)
4
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19*/
20
1/** 21/**
2 * Actually start a process. All of the arguments given to this 22 * Actually start a process. All of the arguments given to this
3 * function are strings that are used for the "argv" array. However, 23 * function are strings that are used for the "argv" array. However,
@@ -27,6 +47,7 @@ do_start_process (int pipe_control, unsigned int std_inheritance,
27 char *cp; 47 char *cp;
28 const char *last; 48 const char *last;
29 struct GNUNET_OS_Process *proc; 49 struct GNUNET_OS_Process *proc;
50 char *binary_path;
30 51
31 argv_size = 1; 52 argv_size = 1;
32 va_start (ap, first_arg); 53 va_start (ap, first_arg);
@@ -98,9 +119,14 @@ do_start_process (int pipe_control, unsigned int std_inheritance,
98/* *INDENT-ON* */ 119/* *INDENT-ON* */
99 va_end (ap); 120 va_end (ap);
100 argv[argv_size] = NULL; 121 argv[argv_size] = NULL;
101 proc = GNUNET_OS_start_process_v (pipe_control, std_inheritance, lsocks, argv[0], argv); 122 binary_path = GNUNET_OS_get_libexec_binary_path (argv[0]);
123 proc = GNUNET_OS_start_process_v (pipe_control, std_inheritance, lsocks,
124 binary_path, argv);
102 while (argv_size > 0) 125 while (argv_size > 0)
103 GNUNET_free (argv[--argv_size]); 126 GNUNET_free (argv[--argv_size]);
104 GNUNET_free (argv); 127 GNUNET_free (argv);
128 GNUNET_free (binary_path);
105 return proc; 129 return proc;
106} 130}
131
132/* end of do_start_process.c */
diff --git a/src/ats/Makefile.am b/src/ats/Makefile.am
index 73d5382ca..27ddc542a 100644
--- a/src/ats/Makefile.am
+++ b/src/ats/Makefile.am
@@ -2,6 +2,8 @@ INCLUDES = -I$(top_srcdir)/src/include
2 2
3pkgcfgdir= $(pkgdatadir)/config.d/ 3pkgcfgdir= $(pkgdatadir)/config.d/
4 4
5libexecdir= $(pkglibdir)/libexec/
6
5pkgcfg_DATA = \ 7pkgcfg_DATA = \
6 ats.conf 8 ats.conf
7 9
@@ -36,7 +38,7 @@ libgnunetats_la_LDFLAGS = \
36 -version-info 2:0:2 38 -version-info 2:0:2
37 39
38 40
39bin_PROGRAMS = \ 41libexec_PROGRAMS = \
40 gnunet-service-ats 42 gnunet-service-ats
41 43
42gnunet_service_ats_SOURCES = \ 44gnunet_service_ats_SOURCES = \
diff --git a/src/chat/Makefile.am b/src/chat/Makefile.am
index 213283684..af33a8bb0 100644
--- a/src/chat/Makefile.am
+++ b/src/chat/Makefile.am
@@ -2,6 +2,8 @@ INCLUDES = -I$(top_srcdir)/src/include
2 2
3pkgcfgdir= $(pkgdatadir)/config.d/ 3pkgcfgdir= $(pkgdatadir)/config.d/
4 4
5libexecdir= $(pkglibdir)/libexec/
6
5pkgcfg_DATA = \ 7pkgcfg_DATA = \
6 chat.conf 8 chat.conf
7 9
@@ -25,8 +27,10 @@ libgnunetchat_la_LDFLAGS = \
25 $(GN_LIB_LDFLAGS) $(WINFLAGS) \ 27 $(GN_LIB_LDFLAGS) $(WINFLAGS) \
26 -version-info 0:0:0 28 -version-info 0:0:0
27 29
30libexec_PROGRAMS = \
31 gnunet-service-chat
32
28bin_PROGRAMS = \ 33bin_PROGRAMS = \
29 gnunet-service-chat \
30 gnunet-chat 34 gnunet-chat
31 35
32gnunet_service_chat_SOURCES = \ 36gnunet_service_chat_SOURCES = \
diff --git a/src/chat/test_chat.c b/src/chat/test_chat.c
index 5dcb87966..24a1e38da 100644
--- a/src/chat/test_chat.c
+++ b/src/chat/test_chat.c
@@ -116,17 +116,18 @@ static int is_auth;
116static void 116static void
117setup_peer (struct PeerContext *p, const char *cfgname) 117setup_peer (struct PeerContext *p, const char *cfgname)
118{ 118{
119 char *binary;
120
121 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
119 p->cfg = GNUNET_CONFIGURATION_create (); 122 p->cfg = GNUNET_CONFIGURATION_create ();
120#if START_ARM 123#if START_ARM
121 p->arm_proc = 124 p->arm_proc =
122 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, "gnunet-service-arm", 125 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary,
123 "gnunet-service-arm", 126 "gnunet-service-arm",
124#if VERBOSE
125 "-L", "DEBUG",
126#endif
127 "-c", cfgname, NULL); 127 "-c", cfgname, NULL);
128#endif 128#endif
129 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); 129 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
130 GNUNET_free (binary);
130} 131}
131 132
132 133
diff --git a/src/chat/test_chat_private.c b/src/chat/test_chat_private.c
index ec170a1dd..64150c107 100644
--- a/src/chat/test_chat_private.c
+++ b/src/chat/test_chat_private.c
@@ -124,23 +124,24 @@ static int bob_ready;
124 124
125static int is_p2p; 125static int is_p2p;
126 126
127struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *bob_public_key = NULL; 127static struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *bob_public_key;
128 128
129 129
130static void 130static void
131setup_peer (struct PeerContext *p, const char *cfgname) 131setup_peer (struct PeerContext *p, const char *cfgname)
132{ 132{
133 char *binary;
134
135 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
133 p->cfg = GNUNET_CONFIGURATION_create (); 136 p->cfg = GNUNET_CONFIGURATION_create ();
134#if START_ARM 137#if START_ARM
135 p->arm_proc = 138 p->arm_proc =
136 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, "gnunet-service-arm", 139 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary,
137 "gnunet-service-arm", 140 "gnunet-service-arm",
138#if VERBOSE
139 "-L", "DEBUG",
140#endif
141 "-c", cfgname, NULL); 141 "-c", cfgname, NULL);
142#endif 142#endif
143 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); 143 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
144 GNUNET_free (binary);
144} 145}
145 146
146 147
@@ -614,9 +615,6 @@ main (int argc, char *argv[])
614 "test-chat", 615 "test-chat",
615 "-c", 616 "-c",
616 "test_chat_data.conf", 617 "test_chat_data.conf",
617#if VERBOSE
618 "-L", "DEBUG",
619#endif
620 NULL 618 NULL
621 }; 619 };
622 struct GNUNET_GETOPT_CommandLineOption options[] = { 620 struct GNUNET_GETOPT_CommandLineOption options[] = {
@@ -624,11 +622,7 @@ main (int argc, char *argv[])
624 }; 622 };
625 623
626 GNUNET_log_setup ("test_chat", 624 GNUNET_log_setup ("test_chat",
627#if VERBOSE
628 "DEBUG",
629#else
630 "WARNING", 625 "WARNING",
631#endif
632 NULL); 626 NULL);
633 if (strstr (argv[0], "p2p") != NULL) 627 if (strstr (argv[0], "p2p") != NULL)
634 { 628 {
diff --git a/src/core/Makefile.am b/src/core/Makefile.am
index 4aa7a7c73..3091249f8 100644
--- a/src/core/Makefile.am
+++ b/src/core/Makefile.am
@@ -2,6 +2,8 @@ INCLUDES = -I$(top_srcdir)/src/include
2 2
3pkgcfgdir= $(pkgdatadir)/config.d/ 3pkgcfgdir= $(pkgdatadir)/config.d/
4 4
5libexecdir= $(pkglibdir)/libexec/
6
5pkgcfg_DATA = \ 7pkgcfg_DATA = \
6 core.conf 8 core.conf
7 9
@@ -30,8 +32,10 @@ libgnunetcore_la_LDFLAGS = \
30 -version-info 0:0:0 32 -version-info 0:0:0
31 33
32 34
35libexec_PROGRAMS = \
36 gnunet-service-core
37
33bin_PROGRAMS = \ 38bin_PROGRAMS = \
34 gnunet-service-core \
35 gnunet-core 39 gnunet-core
36 40
37gnunet_service_core_SOURCES = \ 41gnunet_service_core_SOURCES = \
diff --git a/src/core/test_core_api.c b/src/core/test_core_api.c
index 0512c9617..11fd14504 100644
--- a/src/core/test_core_api.c
+++ b/src/core/test_core_api.c
@@ -316,20 +316,23 @@ init_notify (void *cls, struct GNUNET_CORE_Handle *server,
316static void 316static void
317setup_peer (struct PeerContext *p, const char *cfgname) 317setup_peer (struct PeerContext *p, const char *cfgname)
318{ 318{
319 char *binary;
320
321 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
319 p->cfg = GNUNET_CONFIGURATION_create (); 322 p->cfg = GNUNET_CONFIGURATION_create ();
320#if START_ARM 323#if START_ARM
321 p->arm_proc = 324 p->arm_proc =
322 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, "gnunet-service-arm", 325 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
323 "gnunet-service-arm", 326 NULL, NULL,
324#if VERBOSE 327 binary,
325 "-L", "DEBUG", 328 "gnunet-service-arm",
326#endif
327 "-c", cfgname, NULL); 329 "-c", cfgname, NULL);
328#endif 330#endif
329 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); 331 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
330 p->th = GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, NULL, NULL); 332 p->th = GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, NULL, NULL);
331 GNUNET_assert (p->th != NULL); 333 GNUNET_assert (p->th != NULL);
332 p->ghh = GNUNET_TRANSPORT_get_hello (p->th, &process_hello, p); 334 p->ghh = GNUNET_TRANSPORT_get_hello (p->th, &process_hello, p);
335 GNUNET_free (binary);
333} 336}
334 337
335 338
diff --git a/src/core/test_core_api_reliability.c b/src/core/test_core_api_reliability.c
index d4afbc27d..dd70d438a 100644
--- a/src/core/test_core_api_reliability.c
+++ b/src/core/test_core_api_reliability.c
@@ -426,10 +426,13 @@ process_hello (void *cls, const struct GNUNET_MessageHeader *message)
426static void 426static void
427setup_peer (struct PeerContext *p, const char *cfgname) 427setup_peer (struct PeerContext *p, const char *cfgname)
428{ 428{
429 char *binary;
430
431 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
429 p->cfg = GNUNET_CONFIGURATION_create (); 432 p->cfg = GNUNET_CONFIGURATION_create ();
430#if START_ARM 433#if START_ARM
431 p->arm_proc = 434 p->arm_proc =
432 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, "gnunet-service-arm", 435 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary,
433 "gnunet-service-arm", 436 "gnunet-service-arm",
434 "-c", cfgname, NULL); 437 "-c", cfgname, NULL);
435#endif 438#endif
@@ -437,6 +440,7 @@ setup_peer (struct PeerContext *p, const char *cfgname)
437 p->th = GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, NULL, NULL); 440 p->th = GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, NULL, NULL);
438 GNUNET_assert (p->th != NULL); 441 GNUNET_assert (p->th != NULL);
439 p->ghh = GNUNET_TRANSPORT_get_hello (p->th, &process_hello, p); 442 p->ghh = GNUNET_TRANSPORT_get_hello (p->th, &process_hello, p);
443 GNUNET_free (binary);
440} 444}
441 445
442 446
diff --git a/src/core/test_core_api_start_only.c b/src/core/test_core_api_start_only.c
index a502fce6d..d9cb4150d 100644
--- a/src/core/test_core_api_start_only.c
+++ b/src/core/test_core_api_start_only.c
@@ -137,12 +137,18 @@ init_notify (void *cls, struct GNUNET_CORE_Handle *server,
137static void 137static void
138setup_peer (struct PeerContext *p, const char *cfgname) 138setup_peer (struct PeerContext *p, const char *cfgname)
139{ 139{
140 char *binary;
141
142 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
140 p->cfg = GNUNET_CONFIGURATION_create (); 143 p->cfg = GNUNET_CONFIGURATION_create ();
141 p->arm_proc = 144 p->arm_proc =
142 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, "gnunet-service-arm", 145 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
143 "gnunet-service-arm", 146 NULL, NULL,
144 "-c", cfgname, NULL); 147 binary,
148 "gnunet-service-arm",
149 "-c", cfgname, NULL);
145 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); 150 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
151 GNUNET_free (binary);
146} 152}
147 153
148 154
diff --git a/src/core/test_core_quota_compliance.c b/src/core/test_core_quota_compliance.c
index 61fe21626..88a915095 100644
--- a/src/core/test_core_quota_compliance.c
+++ b/src/core/test_core_quota_compliance.c
@@ -570,10 +570,13 @@ process_hello (void *cls, const struct GNUNET_MessageHeader *message)
570static void 570static void
571setup_peer (struct PeerContext *p, const char *cfgname) 571setup_peer (struct PeerContext *p, const char *cfgname)
572{ 572{
573 char *binary;
574
575 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
573 p->cfg = GNUNET_CONFIGURATION_create (); 576 p->cfg = GNUNET_CONFIGURATION_create ();
574#if START_ARM 577#if START_ARM
575 p->arm_proc = 578 p->arm_proc =
576 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, "gnunet-service-arm", 579 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary,
577 "gnunet-service-arm", 580 "gnunet-service-arm",
578 "-c", cfgname, NULL); 581 "-c", cfgname, NULL);
579#endif 582#endif
@@ -583,6 +586,7 @@ setup_peer (struct PeerContext *p, const char *cfgname)
583 p->th = GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, NULL, NULL); 586 p->th = GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, NULL, NULL);
584 GNUNET_assert (p->th != NULL); 587 GNUNET_assert (p->th != NULL);
585 p->ghh = GNUNET_TRANSPORT_get_hello (p->th, &process_hello, p); 588 p->ghh = GNUNET_TRANSPORT_get_hello (p->th, &process_hello, p);
589 GNUNET_free (binary);
586} 590}
587 591
588 592
diff --git a/src/datastore/Makefile.am b/src/datastore/Makefile.am
index 4000e9981..1b17fd3ed 100644
--- a/src/datastore/Makefile.am
+++ b/src/datastore/Makefile.am
@@ -4,6 +4,8 @@ plugindir = $(libdir)/gnunet
4 4
5pkgcfgdir= $(pkgdatadir)/config.d/ 5pkgcfgdir= $(pkgdatadir)/config.d/
6 6
7libexecdir= $(pkglibdir)/libexec/
8
7pkgcfg_DATA = \ 9pkgcfg_DATA = \
8 datastore.conf 10 datastore.conf
9 11
@@ -31,7 +33,7 @@ libgnunetdatastore_la_LDFLAGS = \
31 -version-info 1:0:0 33 -version-info 1:0:0
32 34
33 35
34bin_PROGRAMS = \ 36libexec_PROGRAMS = \
35 gnunet-service-datastore 37 gnunet-service-datastore
36 38
37gnunet_service_datastore_SOURCES = \ 39gnunet_service_datastore_SOURCES = \
diff --git a/src/dht/Makefile.am b/src/dht/Makefile.am
index a7d22c0ed..a365c5e82 100644
--- a/src/dht/Makefile.am
+++ b/src/dht/Makefile.am
@@ -7,6 +7,8 @@ plugindir = $(libdir)/gnunet
7 7
8pkgcfgdir= $(pkgdatadir)/config.d/ 8pkgcfgdir= $(pkgdatadir)/config.d/
9 9
10libexecdir= $(pkglibdir)/libexec/
11
10pkgcfg_DATA = \ 12pkgcfg_DATA = \
11 dht.conf 13 dht.conf
12 14
@@ -50,8 +52,10 @@ libgnunet_plugin_block_dht_la_DEPENDENCIES = \
50 52
51 53
52 54
53bin_PROGRAMS = \ 55libexec_PROGRAMS = \
54 gnunet-service-dht \ 56 gnunet-service-dht
57
58noinst_PROGRAMS = \
55 gnunet-dht-monitor \ 59 gnunet-dht-monitor \
56 gnunet-dht-get \ 60 gnunet-dht-get \
57 gnunet-dht-put 61 gnunet-dht-put
diff --git a/src/dns/Makefile.am b/src/dns/Makefile.am
index 42d0c5bd1..b9f262270 100644
--- a/src/dns/Makefile.am
+++ b/src/dns/Makefile.am
@@ -10,6 +10,8 @@ endif
10 10
11pkgcfgdir= $(pkgdatadir)/config.d/ 11pkgcfgdir= $(pkgdatadir)/config.d/
12 12
13libexecdir= $(pkglibdir)/libexec/
14
13plugindir = $(libdir)/gnunet 15plugindir = $(libdir)/gnunet
14 16
15pkgcfg_DATA = \ 17pkgcfg_DATA = \
@@ -18,7 +20,7 @@ pkgcfg_DATA = \
18if LINUX 20if LINUX
19HIJACKBIN = gnunet-helper-dns 21HIJACKBIN = gnunet-helper-dns
20install-exec-hook: 22install-exec-hook:
21 $(top_srcdir)/src/dns/install-dns-helper.sh $(bindir) $(GNUNETDNS_GROUP) $(SUDO_BINARY) || true 23 $(top_srcdir)/src/dns/install-dns-helper.sh $(libexecdir) $(GNUNETDNS_GROUP) $(SUDO_BINARY) || true
22else 24else
23install-exec-hook: 25install-exec-hook:
24endif 26endif
@@ -28,7 +30,7 @@ lib_LTLIBRARIES = \
28 libgnunetdnsstub.la \ 30 libgnunetdnsstub.la \
29 libgnunetdns.la 31 libgnunetdns.la
30 32
31bin_PROGRAMS = \ 33libexec_PROGRAMS = \
32 gnunet-service-dns $(HIJACKBIN) 34 gnunet-service-dns $(HIJACKBIN)
33 35
34noinst_PROGRAMS = \ 36noinst_PROGRAMS = \
diff --git a/src/dv/Makefile.am b/src/dv/Makefile.am
index 3050f33cc..39e1d5833 100644
--- a/src/dv/Makefile.am
+++ b/src/dv/Makefile.am
@@ -11,6 +11,8 @@ endif
11 11
12plugindir = $(libdir)/gnunet 12plugindir = $(libdir)/gnunet
13 13
14libexecdir= $(pkglibdir)/libexec/
15
14pkgcfgdir= $(pkgdatadir)/config.d/ 16pkgcfgdir= $(pkgdatadir)/config.d/
15 17
16pkgcfg_DATA = \ 18pkgcfg_DATA = \
@@ -31,7 +33,7 @@ libgnunetdv_la_LDFLAGS = \
31 -version-info 0:0:0 33 -version-info 0:0:0
32 34
33 35
34bin_PROGRAMS = \ 36libexec_PROGRAMS = \
35 gnunet-service-dv 37 gnunet-service-dv
36 38
37gnunet_service_dv_SOURCES = \ 39gnunet_service_dv_SOURCES = \
diff --git a/src/exit/Makefile.am b/src/exit/Makefile.am
index bc41e5c2c..dd030e7a4 100644
--- a/src/exit/Makefile.am
+++ b/src/exit/Makefile.am
@@ -10,6 +10,8 @@ endif
10 10
11pkgcfgdir= $(pkgdatadir)/config.d/ 11pkgcfgdir= $(pkgdatadir)/config.d/
12 12
13libexecdir= $(pkglibdir)/libexec/
14
13plugindir = $(libdir)/gnunet 15plugindir = $(libdir)/gnunet
14 16
15dist_pkgcfg_DATA = \ 17dist_pkgcfg_DATA = \
@@ -18,15 +20,15 @@ dist_pkgcfg_DATA = \
18if LINUX 20if LINUX
19EXITBIN = gnunet-helper-exit 21EXITBIN = gnunet-helper-exit
20install-exec-hook: 22install-exec-hook:
21 $(top_srcdir)/src/exit/install-exit-helper.sh $(bindir) $(SUDO_BINARY) || true 23 $(top_srcdir)/src/exit/install-exit-helper.sh $(libexecdir) $(SUDO_BINARY) || true
22else 24else
23install-exec-hook: 25install-exec-hook:
24endif 26endif
25 27
26 28
27bin_PROGRAMS = \ 29libexec_PROGRAMS = \
28 gnunet-daemon-exit $(EXITBIN) 30 gnunet-daemon-exit \
29 31 $(EXITBIN)
30 32
31gnunet_helper_exit_SOURCES = \ 33gnunet_helper_exit_SOURCES = \
32 gnunet-helper-exit.c 34 gnunet-helper-exit.c
diff --git a/src/fs/Makefile.am b/src/fs/Makefile.am
index b4e493d2b..c5dba2d58 100644
--- a/src/fs/Makefile.am
+++ b/src/fs/Makefile.am
@@ -11,6 +11,8 @@ endif
11 11
12pkgcfgdir= $(pkgdatadir)/config.d/ 12pkgcfgdir= $(pkgdatadir)/config.d/
13 13
14libexecdir= $(pkglibdir)/libexec/
15
14pkgcfg_DATA = \ 16pkgcfg_DATA = \
15 fs.conf 17 fs.conf
16 18
@@ -60,15 +62,17 @@ libgnunetfstest_a_LIBADD = \
60 $(top_builddir)/src/testing/libgnunettesting.la \ 62 $(top_builddir)/src/testing/libgnunettesting.la \
61 $(top_builddir)/src/testbed/libgnunettestbed.la 63 $(top_builddir)/src/testbed/libgnunettestbed.la
62 64
65libexec_PROGRAMS = \
66 gnunet-helper-fs-publish \
67 gnunet-service-fs
68
63bin_PROGRAMS = \ 69bin_PROGRAMS = \
64 gnunet-auto-share \ 70 gnunet-auto-share \
65 gnunet-directory \ 71 gnunet-directory \
66 gnunet-download \ 72 gnunet-download \
67 gnunet-publish \ 73 gnunet-publish \
68 gnunet-helper-fs-publish \
69 gnunet-pseudonym \ 74 gnunet-pseudonym \
70 gnunet-search \ 75 gnunet-search \
71 gnunet-service-fs \
72 gnunet-fs \ 76 gnunet-fs \
73 gnunet-unindex 77 gnunet-unindex
74 78
diff --git a/src/gns/Makefile.am b/src/gns/Makefile.am
index 193d18f8f..038f9f4d3 100644
--- a/src/gns/Makefile.am
+++ b/src/gns/Makefile.am
@@ -28,6 +28,8 @@ endif
28 28
29pkgcfgdir = $(pkgdatadir)/config.d/ 29pkgcfgdir = $(pkgdatadir)/config.d/
30 30
31libexecdir= $(pkglibdir)/libexec/
32
31plugindir = $(libdir)/gnunet 33plugindir = $(libdir)/gnunet
32 34
33pkgcfg_DATA = \ 35pkgcfg_DATA = \
@@ -47,10 +49,12 @@ if HAVE_GNUTLS
47endif 49endif
48endif 50endif
49 51
52libexec_PROGRAMS = \
53 gnunet-service-gns
54
50bin_PROGRAMS = \ 55bin_PROGRAMS = \
51 gnunet-service-gns \
52 $(DO_FCFSD) \ 56 $(DO_FCFSD) \
53 $(DO_PROXY) \ 57 $(DO_PROXY) \
54 $(DO_W32_HELPER) \ 58 $(DO_W32_HELPER) \
55 $(DO_W32_NSPTOOLS) \ 59 $(DO_W32_NSPTOOLS) \
56 gnunet-gns \ 60 gnunet-gns \
diff --git a/src/hostlist/Makefile.am b/src/hostlist/Makefile.am
index 1df537276..726251aec 100644
--- a/src/hostlist/Makefile.am
+++ b/src/hostlist/Makefile.am
@@ -2,6 +2,8 @@ INCLUDES = -I$(top_srcdir)/src/include
2 2
3pkgcfgdir= $(pkgdatadir)/config.d/ 3pkgcfgdir= $(pkgdatadir)/config.d/
4 4
5libexecdir= $(pkglibdir)/libexec/
6
5dist_pkgcfg_DATA = \ 7dist_pkgcfg_DATA = \
6 hostlist.conf 8 hostlist.conf
7 9
@@ -15,7 +17,7 @@ if HAVE_MHD
15endif 17endif
16 18
17if HAVE_LIBCURL 19if HAVE_LIBCURL
18bin_PROGRAMS = \ 20libexec_PROGRAMS = \
19 gnunet-daemon-hostlist 21 gnunet-daemon-hostlist
20endif 22endif
21 23
diff --git a/src/hostlist/test_gnunet_daemon_hostlist.c b/src/hostlist/test_gnunet_daemon_hostlist.c
index 6e9f31a20..5602609ae 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist.c
+++ b/src/hostlist/test_gnunet_daemon_hostlist.c
@@ -131,9 +131,12 @@ process_hello (void *cls, const struct GNUNET_MessageHeader *message)
131static void 131static void
132setup_peer (struct PeerContext *p, const char *cfgname) 132setup_peer (struct PeerContext *p, const char *cfgname)
133{ 133{
134 char *binary;
135
136 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
134 p->cfg = GNUNET_CONFIGURATION_create (); 137 p->cfg = GNUNET_CONFIGURATION_create ();
135 p->arm_proc = 138 p->arm_proc =
136 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, "gnunet-service-arm", 139 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary,
137 "gnunet-service-arm", 140 "gnunet-service-arm",
138 "-c", cfgname, NULL); 141 "-c", cfgname, NULL);
139 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); 142 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
@@ -141,6 +144,7 @@ setup_peer (struct PeerContext *p, const char *cfgname)
141 GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, &notify_connect, NULL); 144 GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, &notify_connect, NULL);
142 GNUNET_assert (p->th != NULL); 145 GNUNET_assert (p->th != NULL);
143 p->ghh = GNUNET_TRANSPORT_get_hello (p->th, &process_hello, p); 146 p->ghh = GNUNET_TRANSPORT_get_hello (p->th, &process_hello, p);
147 GNUNET_free (binary);
144} 148}
145 149
146 150
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_learning.c b/src/hostlist/test_gnunet_daemon_hostlist_learning.c
index 8a0992dda..b7199637e 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist_learning.c
+++ b/src/hostlist/test_gnunet_daemon_hostlist_learning.c
@@ -382,10 +382,12 @@ setup_learn_peer (struct PeerContext *p, const char *cfgname)
382{ 382{
383 char *filename; 383 char *filename;
384 unsigned int result; 384 unsigned int result;
385 char *binary;
385 386
387 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
386 p->cfg = GNUNET_CONFIGURATION_create (); 388 p->cfg = GNUNET_CONFIGURATION_create ();
387 p->arm_proc = 389 p->arm_proc =
388 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, "gnunet-service-arm", 390 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary,
389 "gnunet-service-arm", 391 "gnunet-service-arm",
390 "-c", cfgname, NULL); 392 "-c", cfgname, NULL);
391 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); 393 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
@@ -408,20 +410,25 @@ setup_learn_peer (struct PeerContext *p, const char *cfgname)
408 GNUNET_assert (NULL != p->core); 410 GNUNET_assert (NULL != p->core);
409 p->stats = GNUNET_STATISTICS_create ("hostlist", p->cfg); 411 p->stats = GNUNET_STATISTICS_create ("hostlist", p->cfg);
410 GNUNET_assert (NULL != p->stats); 412 GNUNET_assert (NULL != p->stats);
413 GNUNET_free (binary);
411} 414}
412 415
413 416
414static void 417static void
415setup_adv_peer (struct PeerContext *p, const char *cfgname) 418setup_adv_peer (struct PeerContext *p, const char *cfgname)
416{ 419{
420 char *binary;
421
422 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
417 p->cfg = GNUNET_CONFIGURATION_create (); 423 p->cfg = GNUNET_CONFIGURATION_create ();
418 p->arm_proc = 424 p->arm_proc =
419 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, "gnunet-service-arm", 425 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary,
420 "gnunet-service-arm", 426 "gnunet-service-arm",
421 "-c", cfgname, NULL); 427 "-c", cfgname, NULL);
422 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); 428 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
423 p->stats = GNUNET_STATISTICS_create ("hostlist", p->cfg); 429 p->stats = GNUNET_STATISTICS_create ("hostlist", p->cfg);
424 GNUNET_assert (NULL != p->stats); 430 GNUNET_assert (NULL != p->stats);
431 GNUNET_free (binary);
425} 432}
426 433
427 434
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c
index 1b1df9a3a..63baced46 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c
+++ b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c
@@ -141,14 +141,14 @@ process_hello (void *cls, const struct GNUNET_MessageHeader *message)
141static void 141static void
142setup_peer (struct PeerContext *p, const char *cfgname) 142setup_peer (struct PeerContext *p, const char *cfgname)
143{ 143{
144 char *binary;
145
146 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
144 p->cfg = GNUNET_CONFIGURATION_create (); 147 p->cfg = GNUNET_CONFIGURATION_create ();
145#if START_ARM 148#if START_ARM
146 p->arm_proc = 149 p->arm_proc =
147 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, "gnunet-service-arm", 150 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary,
148 "gnunet-service-arm", 151 "gnunet-service-arm",
149#if VERBOSE
150 "-L", "DEBUG",
151#endif
152 "-c", cfgname, NULL); 152 "-c", cfgname, NULL);
153#endif 153#endif
154 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); 154 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
@@ -156,6 +156,7 @@ setup_peer (struct PeerContext *p, const char *cfgname)
156 GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, &notify_connect, NULL); 156 GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, &notify_connect, NULL);
157 GNUNET_assert (p->th != NULL); 157 GNUNET_assert (p->th != NULL);
158 p->ghh = GNUNET_TRANSPORT_get_hello (p->th, &process_hello, p); 158 p->ghh = GNUNET_TRANSPORT_get_hello (p->th, &process_hello, p);
159 GNUNET_free (binary);
159} 160}
160 161
161 162
diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h
index 1d4828f48..e4bbab8a9 100644
--- a/src/include/gnunet_os_lib.h
+++ b/src/include/gnunet_os_lib.h
@@ -151,7 +151,12 @@ enum GNUNET_OS_InstallationPathKind
151 * Return the prefix of the path with documentation files, including the 151 * Return the prefix of the path with documentation files, including the
152 * license (share/doc/gnunet/). 152 * license (share/doc/gnunet/).
153 */ 153 */
154 GNUNET_OS_IPK_DOCDIR 154 GNUNET_OS_IPK_DOCDIR,
155
156 /**
157 * Return the directory where helper binaries are installed (lib/gnunet/libexec/)
158 */
159 GNUNET_OS_IPK_LIBEXECDIR
155}; 160};
156 161
157 162
@@ -201,6 +206,18 @@ GNUNET_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind dirkind);
201 206
202 207
203/** 208/**
209 * Given the name of a gnunet-helper, gnunet-service or gnunet-daemon
210 * binary, try to prefix it with the libexec/-directory to get the
211 * full path.
212 *
213 * @param progname name of the binary
214 * @return full path to the binary, if possible, otherwise copy of 'progname'
215 */
216char *
217GNUNET_OS_get_libexec_binary_path (const char *progname);
218
219
220/**
204 * Callback function invoked for each interface found. 221 * Callback function invoked for each interface found.
205 * 222 *
206 * @param cls closure 223 * @param cls closure
diff --git a/src/lockmanager/Makefile.am b/src/lockmanager/Makefile.am
index b1743e308..6a41fe5c1 100644
--- a/src/lockmanager/Makefile.am
+++ b/src/lockmanager/Makefile.am
@@ -11,10 +11,12 @@ endif
11 11
12pkgcfgdir= $(pkgdatadir)/config.d/ 12pkgcfgdir= $(pkgdatadir)/config.d/
13 13
14libexecdir= $(pkglibdir)/libexec/
15
14pkgcfg_DATA = \ 16pkgcfg_DATA = \
15 lockmanager.conf 17 lockmanager.conf
16 18
17bin_PROGRAMS = \ 19libexec_PROGRAMS = \
18 gnunet-service-lockmanager 20 gnunet-service-lockmanager
19 21
20lib_LTLIBRARIES = \ 22lib_LTLIBRARIES = \
diff --git a/src/mesh/Makefile.am b/src/mesh/Makefile.am
index 786747518..8b45dd736 100644
--- a/src/mesh/Makefile.am
+++ b/src/mesh/Makefile.am
@@ -11,6 +11,8 @@ endif
11 11
12pkgcfgdir= $(pkgdatadir)/config.d/ 12pkgcfgdir= $(pkgdatadir)/config.d/
13 13
14libexecdir= $(pkglibdir)/libexec/
15
14pkgcfg_DATA = \ 16pkgcfg_DATA = \
15 mesh.conf 17 mesh.conf
16 18
@@ -18,7 +20,7 @@ plugindir = $(libdir)/gnunet
18 20
19AM_CLFAGS = -g 21AM_CLFAGS = -g
20 22
21bin_PROGRAMS = \ 23libexec_PROGRAMS = \
22 gnunet-service-mesh 24 gnunet-service-mesh
23 25
24lib_LTLIBRARIES = \ 26lib_LTLIBRARIES = \
diff --git a/src/namestore/Makefile.am b/src/namestore/Makefile.am
index 17b765707..04dd870b3 100644
--- a/src/namestore/Makefile.am
+++ b/src/namestore/Makefile.am
@@ -4,6 +4,8 @@ plugindir = $(libdir)/gnunet
4 4
5pkgcfgdir= $(pkgdatadir)/config.d/ 5pkgcfgdir= $(pkgdatadir)/config.d/
6 6
7libexecdir= $(pkglibdir)/libexec/
8
7pkgcfg_DATA = \ 9pkgcfg_DATA = \
8 namestore.conf 10 namestore.conf
9 11
@@ -63,8 +65,10 @@ libgnunetnamestore_la_LDFLAGS = \
63 $(GN_LIB_LDFLAGS) $(WINFLAGS) \ 65 $(GN_LIB_LDFLAGS) $(WINFLAGS) \
64 -version-info 0:0:0 66 -version-info 0:0:0
65 67
68libexec_PROGRAMS = \
69 gnunet-service-namestore
70
66bin_PROGRAMS = \ 71bin_PROGRAMS = \
67 gnunet-service-namestore \
68 gnunet-namestore 72 gnunet-namestore
69 73
70 74
diff --git a/src/nat/Makefile.am b/src/nat/Makefile.am
index e4b36caa2..0394569fe 100644
--- a/src/nat/Makefile.am
+++ b/src/nat/Makefile.am
@@ -7,6 +7,8 @@ if MINGW
7 NATCLIENT = gnunet-helper-nat-client-windows.c 7 NATCLIENT = gnunet-helper-nat-client-windows.c
8endif 8endif
9 9
10libexecdir= $(pkglibdir)/libexec/
11
10pkgcfgdir= $(pkgdatadir)/config.d/ 12pkgcfgdir= $(pkgdatadir)/config.d/
11 13
12dist_pkgcfg_DATA = \ 14dist_pkgcfg_DATA = \
@@ -17,13 +19,15 @@ NATBIN = gnunet-helper-nat-server gnunet-helper-nat-client
17NATSERVER = gnunet-helper-nat-server.c 19NATSERVER = gnunet-helper-nat-server.c
18NATCLIENT = gnunet-helper-nat-client.c 20NATCLIENT = gnunet-helper-nat-client.c
19install-exec-hook: 21install-exec-hook:
20 $(top_srcdir)/src/nat/install-nat-helper.sh $(bindir) $(SUDO_BINARY) || true 22 $(top_srcdir)/src/nat/install-nat-helper.sh $(libexecdir) $(SUDO_BINARY) || true
21else 23else
22install-exec-hook: 24install-exec-hook:
23endif 25endif
24 26
25bin_PROGRAMS = \ 27bin_PROGRAMS = \
26 gnunet-nat-server \ 28 gnunet-nat-server
29
30libexec_PROGRAMS = \
27 $(NATBIN) 31 $(NATBIN)
28 32
29gnunet_nat_server_SOURCES = \ 33gnunet_nat_server_SOURCES = \
diff --git a/src/nse/Makefile.am b/src/nse/Makefile.am
index 2c5ed855f..a67ffeaf8 100644
--- a/src/nse/Makefile.am
+++ b/src/nse/Makefile.am
@@ -11,6 +11,8 @@ endif
11 11
12pkgcfgdir= $(pkgdatadir)/config.d/ 12pkgcfgdir= $(pkgdatadir)/config.d/
13 13
14libexecdir= $(pkglibdir)/libexec/
15
14pkgcfg_DATA = \ 16pkgcfg_DATA = \
15 nse.conf 17 nse.conf
16 18
@@ -27,7 +29,7 @@ libgnunetnse_la_LDFLAGS = \
27 -version-info 0:0:0 29 -version-info 0:0:0
28 30
29 31
30bin_PROGRAMS = \ 32libexec_PROGRAMS = \
31 gnunet-service-nse 33 gnunet-service-nse
32 34
33noinst_PROGRAMS = \ 35noinst_PROGRAMS = \
diff --git a/src/peerinfo/Makefile.am b/src/peerinfo/Makefile.am
index 192391d88..8387c4fc4 100644
--- a/src/peerinfo/Makefile.am
+++ b/src/peerinfo/Makefile.am
@@ -2,6 +2,8 @@ INCLUDES = -I$(top_srcdir)/src/include
2 2
3pkgcfgdir= $(pkgdatadir)/config.d/ 3pkgcfgdir= $(pkgdatadir)/config.d/
4 4
5libexecdir= $(pkglibdir)/libexec/
6
5pkgcfg_DATA = \ 7pkgcfg_DATA = \
6 peerinfo.conf 8 peerinfo.conf
7 9
@@ -29,7 +31,7 @@ libgnunetpeerinfo_la_LDFLAGS = \
29 -version-info 0:0:0 31 -version-info 0:0:0
30 32
31 33
32bin_PROGRAMS = \ 34libexec_PROGRAMS = \
33 gnunet-service-peerinfo 35 gnunet-service-peerinfo
34 36
35gnunet_service_peerinfo_SOURCES = \ 37gnunet_service_peerinfo_SOURCES = \
diff --git a/src/pt/Makefile.am b/src/pt/Makefile.am
index 3c71d6d76..b9a8e497c 100644
--- a/src/pt/Makefile.am
+++ b/src/pt/Makefile.am
@@ -10,13 +10,15 @@ endif
10 10
11pkgcfgdir= $(pkgdatadir)/config.d/ 11pkgcfgdir= $(pkgdatadir)/config.d/
12 12
13libexecdir= $(pkglibdir)/libexec/
14
13plugindir = $(libdir)/gnunet 15plugindir = $(libdir)/gnunet
14 16
15dist_pkgcfg_DATA = \ 17dist_pkgcfg_DATA = \
16 pt.conf 18 pt.conf
17 19
18bin_PROGRAMS = \ 20libexec_PROGRAMS = \
19 gnunet-daemon-pt $(PTBIN) 21 gnunet-daemon-pt
20 22
21gnunet_daemon_pt_SOURCES = \ 23gnunet_daemon_pt_SOURCES = \
22 gnunet-daemon-pt.c 24 gnunet-daemon-pt.c
diff --git a/src/statistics/Makefile.am b/src/statistics/Makefile.am
index 5485a9c18..f4d0c3b99 100644
--- a/src/statistics/Makefile.am
+++ b/src/statistics/Makefile.am
@@ -11,6 +11,8 @@ endif
11 11
12pkgcfgdir= $(pkgdatadir)/config.d/ 12pkgcfgdir= $(pkgdatadir)/config.d/
13 13
14libexecdir= $(pkglibdir)/libexec/
15
14pkgcfg_DATA = \ 16pkgcfg_DATA = \
15 statistics.conf 17 statistics.conf
16 18
@@ -25,10 +27,11 @@ libgnunetstatistics_la_LDFLAGS = \
25 $(GN_LIB_LDFLAGS) $(WINFLAGS) \ 27 $(GN_LIB_LDFLAGS) $(WINFLAGS) \
26 -version-info 1:1:1 28 -version-info 1:1:1
27 29
30libexec_PROGRAMS = \
31 gnunet-service-statistics
28 32
29bin_PROGRAMS = \ 33bin_PROGRAMS = \
30 gnunet-statistics \ 34 gnunet-statistics
31 gnunet-service-statistics
32 35
33gnunet_statistics_SOURCES = \ 36gnunet_statistics_SOURCES = \
34 gnunet-statistics.c 37 gnunet-statistics.c
diff --git a/src/statistics/test_statistics_api.c b/src/statistics/test_statistics_api.c
index ddebfa356..5fb506ff7 100644
--- a/src/statistics/test_statistics_api.c
+++ b/src/statistics/test_statistics_api.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 (C) 2009 Christian Grothoff (and other contributing authors) 3 (C) 2009, 2012 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -20,17 +20,15 @@
20/** 20/**
21 * @file statistics/test_statistics_api.c 21 * @file statistics/test_statistics_api.c
22 * @brief testcase for statistics_api.c 22 * @brief testcase for statistics_api.c
23 * @author Christian Grothoff
23 */ 24 */
24#include "platform.h" 25#include "platform.h"
25#include "gnunet_common.h" 26#include "gnunet_util_lib.h"
26#include "gnunet_getopt_lib.h"
27#include "gnunet_os_lib.h"
28#include "gnunet_program_lib.h"
29#include "gnunet_scheduler_lib.h"
30#include "gnunet_statistics_service.h" 27#include "gnunet_statistics_service.h"
31 28
32 29
33#define START_SERVICE GNUNET_YES 30static struct GNUNET_STATISTICS_Handle *h;
31
34 32
35static int 33static int
36check_1 (void *cls, const char *subsystem, const char *name, uint64_t value, 34check_1 (void *cls, const char *subsystem, const char *name, uint64_t value,
@@ -45,6 +43,7 @@ check_1 (void *cls, const char *subsystem, const char *name, uint64_t value,
45 return GNUNET_OK; 43 return GNUNET_OK;
46} 44}
47 45
46
48static int 47static int
49check_2 (void *cls, const char *subsystem, const char *name, uint64_t value, 48check_2 (void *cls, const char *subsystem, const char *name, uint64_t value,
50 int is_persistent) 49 int is_persistent)
@@ -58,6 +57,7 @@ check_2 (void *cls, const char *subsystem, const char *name, uint64_t value,
58 return GNUNET_OK; 57 return GNUNET_OK;
59} 58}
60 59
60
61static int 61static int
62check_3 (void *cls, const char *subsystem, const char *name, uint64_t value, 62check_3 (void *cls, const char *subsystem, const char *name, uint64_t value,
63 int is_persistent) 63 int is_persistent)
@@ -71,7 +71,6 @@ check_3 (void *cls, const char *subsystem, const char *name, uint64_t value,
71 return GNUNET_OK; 71 return GNUNET_OK;
72} 72}
73 73
74static struct GNUNET_STATISTICS_Handle *h;
75 74
76static void 75static void
77next_fin (void *cls, int success) 76next_fin (void *cls, int success)
@@ -83,6 +82,7 @@ next_fin (void *cls, int success)
83 *ok = 0; 82 *ok = 0;
84} 83}
85 84
85
86static void 86static void
87next (void *cls, int success) 87next (void *cls, int success)
88{ 88{
@@ -94,6 +94,7 @@ next (void *cls, int success)
94 &check_2, cls)); 94 &check_2, cls));
95} 95}
96 96
97
97static void 98static void
98run (void *cls, char *const *args, const char *cfgfile, 99run (void *cls, char *const *args, const char *cfgfile,
99 const struct GNUNET_CONFIGURATION_Handle *cfg) 100 const struct GNUNET_CONFIGURATION_Handle *cfg)
@@ -110,6 +111,7 @@ run (void *cls, char *const *args, const char *cfgfile,
110 &check_1, cls)); 111 &check_1, cls));
111} 112}
112 113
114
113static void 115static void
114run_more (void *cls, char *const *args, const char *cfgfile, 116run_more (void *cls, char *const *args, const char *cfgfile,
115 const struct GNUNET_CONFIGURATION_Handle *cfg) 117 const struct GNUNET_CONFIGURATION_Handle *cfg)
@@ -121,8 +123,9 @@ run_more (void *cls, char *const *args, const char *cfgfile,
121 &check_3, cls)); 123 &check_3, cls));
122} 124}
123 125
124static int 126
125check () 127int
128main (int argc, char *argv_ign[])
126{ 129{
127 int ok = 1; 130 int ok = 1;
128 131
@@ -135,18 +138,21 @@ check ()
135 struct GNUNET_GETOPT_CommandLineOption options[] = { 138 struct GNUNET_GETOPT_CommandLineOption options[] = {
136 GNUNET_GETOPT_OPTION_END 139 GNUNET_GETOPT_OPTION_END
137 }; 140 };
138#if START_SERVICE
139 struct GNUNET_OS_Process *proc; 141 struct GNUNET_OS_Process *proc;
142 char *binary;
140 143
144 GNUNET_log_setup ("test_statistics_api",
145 "WARNING",
146 NULL);
147 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics");
141 proc = 148 proc =
142 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, "gnunet-service-statistics", 149 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL,
150 binary,
143 "gnunet-service-statistics", 151 "gnunet-service-statistics",
144 "-c", "test_statistics_api_data.conf", NULL); 152 "-c", "test_statistics_api_data.conf", NULL);
145#endif
146 GNUNET_assert (NULL != proc); 153 GNUNET_assert (NULL != proc);
147 GNUNET_PROGRAM_run (5, argv, "test-statistics-api", "nohelp", options, &run, 154 GNUNET_PROGRAM_run (5, argv, "test-statistics-api", "nohelp", options, &run,
148 &ok); 155 &ok);
149#if START_SERVICE
150 if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) 156 if (0 != GNUNET_OS_process_kill (proc, SIGTERM))
151 { 157 {
152 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); 158 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
@@ -155,20 +161,20 @@ check ()
155 GNUNET_OS_process_wait (proc); 161 GNUNET_OS_process_wait (proc);
156 GNUNET_OS_process_destroy (proc); 162 GNUNET_OS_process_destroy (proc);
157 proc = NULL; 163 proc = NULL;
158#endif
159 if (ok != 0) 164 if (ok != 0)
165 {
166 GNUNET_free (binary);
160 return ok; 167 return ok;
168 }
161 ok = 1; 169 ok = 1;
162#if START_SERVICE
163 /* restart to check persistence! */ 170 /* restart to check persistence! */
164 proc = 171 proc =
165 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, "gnunet-service-statistics", 172 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL,
173 binary,
166 "gnunet-service-statistics", 174 "gnunet-service-statistics",
167 "-c", "test_statistics_api_data.conf", NULL); 175 "-c", "test_statistics_api_data.conf", NULL);
168#endif
169 GNUNET_PROGRAM_run (5, argv, "test-statistics-api", "nohelp", options, 176 GNUNET_PROGRAM_run (5, argv, "test-statistics-api", "nohelp", options,
170 &run_more, &ok); 177 &run_more, &ok);
171#if START_SERVICE
172 if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) 178 if (0 != GNUNET_OS_process_kill (proc, SIGTERM))
173 { 179 {
174 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); 180 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
@@ -177,21 +183,8 @@ check ()
177 GNUNET_OS_process_wait (proc); 183 GNUNET_OS_process_wait (proc);
178 GNUNET_OS_process_destroy (proc); 184 GNUNET_OS_process_destroy (proc);
179 proc = NULL; 185 proc = NULL;
180#endif 186 GNUNET_free (binary);
181 return ok; 187 return ok;
182} 188}
183 189
184int
185main (int argc, char *argv[])
186{
187 int ret;
188
189 GNUNET_log_setup ("test_statistics_api",
190 "WARNING",
191 NULL);
192 ret = check ();
193
194 return ret;
195}
196
197/* end of test_statistics_api.c */ 190/* end of test_statistics_api.c */
diff --git a/src/statistics/test_statistics_api_loop.c b/src/statistics/test_statistics_api_loop.c
index ae798b830..f9a3a3ba6 100644
--- a/src/statistics/test_statistics_api_loop.c
+++ b/src/statistics/test_statistics_api_loop.c
@@ -22,18 +22,13 @@
22 * @brief testcase for statistics_api.c 22 * @brief testcase for statistics_api.c
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_common.h" 25#include "gnunet_util_lib.h"
26#include "gnunet_getopt_lib.h"
27#include "gnunet_os_lib.h"
28#include "gnunet_program_lib.h"
29#include "gnunet_scheduler_lib.h"
30#include "gnunet_statistics_service.h" 26#include "gnunet_statistics_service.h"
31 27
32#define VERBOSE GNUNET_NO 28#define ROUNDS (1024 * 1024)
33 29
34#define START_SERVICE GNUNET_YES 30static struct GNUNET_STATISTICS_Handle *h;
35 31
36#define ROUNDS (1024 * 1024)
37 32
38static int 33static int
39check_1 (void *cls, const char *subsystem, const char *name, uint64_t value, 34check_1 (void *cls, const char *subsystem, const char *name, uint64_t value,
@@ -45,7 +40,6 @@ check_1 (void *cls, const char *subsystem, const char *name, uint64_t value,
45 return GNUNET_OK; 40 return GNUNET_OK;
46} 41}
47 42
48static struct GNUNET_STATISTICS_Handle *h;
49 43
50static void 44static void
51next (void *cls, int success) 45next (void *cls, int success)
@@ -57,11 +51,12 @@ next (void *cls, int success)
57 *ok = 0; 51 *ok = 0;
58} 52}
59 53
54
60static void 55static void
61run (void *cls, char *const *args, const char *cfgfile, 56run (void *cls, char *const *args, const char *cfgfile,
62 const struct GNUNET_CONFIGURATION_Handle *cfg) 57 const struct GNUNET_CONFIGURATION_Handle *cfg)
63{ 58{
64 int i; 59 unsigned int i;
65 char name[128]; 60 char name[128];
66 61
67 h = GNUNET_STATISTICS_create ("test-statistics-api-loop", cfg); 62 h = GNUNET_STATISTICS_create ("test-statistics-api-loop", cfg);
@@ -80,8 +75,8 @@ run (void *cls, char *const *args, const char *cfgfile,
80} 75}
81 76
82 77
83static int 78int
84check () 79main (int argc, char *argv_ign[])
85{ 80{
86 int ok = 1; 81 int ok = 1;
87 82
@@ -93,21 +88,19 @@ check ()
93 struct GNUNET_GETOPT_CommandLineOption options[] = { 88 struct GNUNET_GETOPT_CommandLineOption options[] = {
94 GNUNET_GETOPT_OPTION_END 89 GNUNET_GETOPT_OPTION_END
95 }; 90 };
96#if START_SERVICE
97 struct GNUNET_OS_Process *proc; 91 struct GNUNET_OS_Process *proc;
92 char *binary;
98 93
94 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics");
99 proc = 95 proc =
100 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, "gnunet-service-statistics", 96 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
101 "gnunet-service-statistics", 97 NULL, NULL,
102#if DEBUG_STATISTICS 98 binary,
103 "-L", "DEBUG", 99 "gnunet-service-statistics",
104#endif 100 "-c", "test_statistics_api_data.conf", NULL);
105 "-c", "test_statistics_api_data.conf", NULL);
106#endif
107 GNUNET_assert (NULL != proc); 101 GNUNET_assert (NULL != proc);
108 GNUNET_PROGRAM_run (3, argv, "test-statistics-api", "nohelp", options, &run, 102 GNUNET_PROGRAM_run (3, argv, "test-statistics-api", "nohelp", options, &run,
109 &ok); 103 &ok);
110#if START_SERVICE
111 if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) 104 if (0 != GNUNET_OS_process_kill (proc, SIGTERM))
112 { 105 {
113 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); 106 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
@@ -116,18 +109,8 @@ check ()
116 GNUNET_OS_process_wait (proc); 109 GNUNET_OS_process_wait (proc);
117 GNUNET_OS_process_destroy (proc); 110 GNUNET_OS_process_destroy (proc);
118 proc = NULL; 111 proc = NULL;
119#endif 112 GNUNET_free (binary);
120 return ok; 113 return ok;
121} 114}
122 115
123int
124main (int argc, char *argv[])
125{
126 int ret;
127
128 ret = check ();
129
130 return ret;
131}
132
133/* end of test_statistics_api_loop.c */ 116/* end of test_statistics_api_loop.c */
diff --git a/src/statistics/test_statistics_api_watch.c b/src/statistics/test_statistics_api_watch.c
index f3524aa7c..1e7f27b3e 100644
--- a/src/statistics/test_statistics_api_watch.c
+++ b/src/statistics/test_statistics_api_watch.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 (C) 2009, 2011 Christian Grothoff (and other contributing authors) 3 (C) 2009, 2011, 2012 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -20,6 +20,7 @@
20/** 20/**
21 * @file statistics/test_statistics_api_watch.c 21 * @file statistics/test_statistics_api_watch.c
22 * @brief testcase for statistics_api.c watch functions 22 * @brief testcase for statistics_api.c watch functions
23 * @author Christian Grothoff
23 */ 24 */
24#include "platform.h" 25#include "platform.h"
25#include "gnunet_common.h" 26#include "gnunet_common.h"
@@ -29,9 +30,6 @@
29#include "gnunet_scheduler_lib.h" 30#include "gnunet_scheduler_lib.h"
30#include "gnunet_statistics_service.h" 31#include "gnunet_statistics_service.h"
31 32
32#define VERBOSE GNUNET_NO
33
34#define START_SERVICE GNUNET_YES
35 33
36static int ok; 34static int ok;
37 35
@@ -112,8 +110,8 @@ run (void *cls, char *const *args, const char *cfgfile,
112} 110}
113 111
114 112
115static int 113int
116check () 114main (int argc, char *argv_ign[])
117{ 115{
118 char *const argv[] = { "test-statistics-api", 116 char *const argv[] = { "test-statistics-api",
119 "-c", 117 "-c",
@@ -123,22 +121,19 @@ check ()
123 struct GNUNET_GETOPT_CommandLineOption options[] = { 121 struct GNUNET_GETOPT_CommandLineOption options[] = {
124 GNUNET_GETOPT_OPTION_END 122 GNUNET_GETOPT_OPTION_END
125 }; 123 };
126#if START_SERVICE
127 struct GNUNET_OS_Process *proc; 124 struct GNUNET_OS_Process *proc;
128 125 char *binary;
126
127 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics");
129 proc = 128 proc =
130 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, "gnunet-service-statistics", 129 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL,
131 "gnunet-service-statistics", 130 binary,
132#if VERBOSE 131 "gnunet-service-statistics",
133 "-L", "DEBUG", 132 "-c", "test_statistics_api_data.conf", NULL);
134#endif
135 "-c", "test_statistics_api_data.conf", NULL);
136#endif
137 GNUNET_assert (NULL != proc); 133 GNUNET_assert (NULL != proc);
138 ok = 3; 134 ok = 3;
139 GNUNET_PROGRAM_run (3, argv, "test-statistics-api", "nohelp", options, &run, 135 GNUNET_PROGRAM_run (3, argv, "test-statistics-api", "nohelp", options, &run,
140 NULL); 136 NULL);
141#if START_SERVICE
142 if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) 137 if (0 != GNUNET_OS_process_kill (proc, SIGTERM))
143 { 138 {
144 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); 139 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
@@ -147,18 +142,9 @@ check ()
147 GNUNET_OS_process_wait (proc); 142 GNUNET_OS_process_wait (proc);
148 GNUNET_OS_process_destroy (proc); 143 GNUNET_OS_process_destroy (proc);
149 proc = NULL; 144 proc = NULL;
150#endif 145 GNUNET_free (binary);
151 return ok; 146 return ok;
152} 147}
153 148
154int
155main (int argc, char *argv[])
156{
157 int ret;
158
159 ret = check ();
160
161 return ret;
162}
163 149
164/* end of test_statistics_api_watch.c */ 150/* end of test_statistics_api_watch.c */
diff --git a/src/statistics/test_statistics_api_watch_zero_value.c b/src/statistics/test_statistics_api_watch_zero_value.c
index fe3974fc9..d78de9a9e 100644
--- a/src/statistics/test_statistics_api_watch_zero_value.c
+++ b/src/statistics/test_statistics_api_watch_zero_value.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 (C) 2009, 2011 Christian Grothoff (and other contributing authors) 3 (C) 2009, 2011, 2012 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -22,21 +22,15 @@
22 * @brief testcase for statistics_api.c watch functions with initial 0 value 22 * @brief testcase for statistics_api.c watch functions with initial 0 value
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_common.h" 25#include "gnunet_util_lib.h"
26#include "gnunet_getopt_lib.h"
27#include "gnunet_os_lib.h"
28#include "gnunet_program_lib.h"
29#include "gnunet_scheduler_lib.h"
30#include "gnunet_statistics_service.h" 26#include "gnunet_statistics_service.h"
31 27
32#define VERBOSE GNUNET_NO
33
34#define START_SERVICE GNUNET_YES
35
36static int ok; 28static int ok;
29
37static int ok2; 30static int ok2;
38 31
39static struct GNUNET_STATISTICS_Handle *h; 32static struct GNUNET_STATISTICS_Handle *h;
33
40static struct GNUNET_STATISTICS_Handle *h2; 34static struct GNUNET_STATISTICS_Handle *h2;
41 35
42static GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 36static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
@@ -92,6 +86,7 @@ watch_1 (void *cls, const char *subsystem, const char *name, uint64_t value,
92 return GNUNET_OK; 86 return GNUNET_OK;
93} 87}
94 88
89
95static int 90static int
96watch_2 (void *cls, const char *subsystem, const char *name, uint64_t value, 91watch_2 (void *cls, const char *subsystem, const char *name, uint64_t value,
97 int is_persistent) 92 int is_persistent)
@@ -121,6 +116,7 @@ watch_2 (void *cls, const char *subsystem, const char *name, uint64_t value,
121 return GNUNET_OK; 116 return GNUNET_OK;
122} 117}
123 118
119
124static void 120static void
125run (void *cls, char *const *args, const char *cfgfile, 121run (void *cls, char *const *args, const char *cfgfile,
126 const struct GNUNET_CONFIGURATION_Handle *cfg) 122 const struct GNUNET_CONFIGURATION_Handle *cfg)
@@ -145,8 +141,8 @@ run (void *cls, char *const *args, const char *cfgfile,
145} 141}
146 142
147 143
148static int 144int
149check () 145main (int argc, char *argv_ign[])
150{ 146{
151 char *const argv[] = { "test-statistics-api", 147 char *const argv[] = { "test-statistics-api",
152 "-c", 148 "-c",
@@ -156,23 +152,20 @@ check ()
156 struct GNUNET_GETOPT_CommandLineOption options[] = { 152 struct GNUNET_GETOPT_CommandLineOption options[] = {
157 GNUNET_GETOPT_OPTION_END 153 GNUNET_GETOPT_OPTION_END
158 }; 154 };
159#if START_SERVICE
160 struct GNUNET_OS_Process *proc; 155 struct GNUNET_OS_Process *proc;
156 char *binary;
161 157
158 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics");
162 proc = 159 proc =
163 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, "gnunet-service-statistics", 160 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL,
164 "gnunet-service-statistics", 161 binary,
165#if VERBOSE 162 "gnunet-service-statistics",
166 "-L", "DEBUG", 163 "-c", "test_statistics_api_data.conf", NULL);
167#endif
168 "-c", "test_statistics_api_data.conf", NULL);
169#endif
170 GNUNET_assert (NULL != proc); 164 GNUNET_assert (NULL != proc);
171 ok = 3; 165 ok = 3;
172 ok2 = 1; 166 ok2 = 1;
173 GNUNET_PROGRAM_run (3, argv, "test-statistics-api", "nohelp", options, &run, 167 GNUNET_PROGRAM_run (3, argv, "test-statistics-api", "nohelp", options, &run,
174 NULL); 168 NULL);
175#if START_SERVICE
176 if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) 169 if (0 != GNUNET_OS_process_kill (proc, SIGTERM))
177 { 170 {
178 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); 171 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
@@ -181,21 +174,10 @@ check ()
181 GNUNET_OS_process_wait (proc); 174 GNUNET_OS_process_wait (proc);
182 GNUNET_OS_process_destroy (proc); 175 GNUNET_OS_process_destroy (proc);
183 proc = NULL; 176 proc = NULL;
184#endif 177 GNUNET_free (binary);
185 if ((0 == ok) && (0 == ok2)) 178 if ((0 == ok) && (0 == ok2))
186 return 0; 179 return 0;
187 else 180 return 1;
188 return 1;
189}
190
191int
192main (int argc, char *argv[])
193{
194 int ret;
195
196 ret = check ();
197
198 return ret;
199} 181}
200 182
201/* end of test_statistics_api_watch_zero_value.c */ 183/* end of test_statistics_api_watch_zero_value.c */
diff --git a/src/template/Makefile.am b/src/template/Makefile.am
index 1769191e7..d1f87c8d8 100644
--- a/src/template/Makefile.am
+++ b/src/template/Makefile.am
@@ -2,6 +2,8 @@ INCLUDES = -I$(top_srcdir)/src/include
2 2
3pkgcfgdir= $(pkgdatadir)/config.d/ 3pkgcfgdir= $(pkgdatadir)/config.d/
4 4
5libexecdir= $(pkglibdir)/libexec/
6
5dist_pkgcfg_DATA = \ 7dist_pkgcfg_DATA = \
6 template.conf 8 template.conf
7 9
@@ -14,7 +16,9 @@ if USE_COVERAGE
14endif 16endif
15 17
16bin_PROGRAMS = \ 18bin_PROGRAMS = \
17 gnunet-template \ 19 gnunet-template
20
21libexec_PROGRAMS = \
18 gnunet-service-template 22 gnunet-service-template
19 23
20gnunet_template_SOURCES = \ 24gnunet_template_SOURCES = \
diff --git a/src/testbed/Makefile.am b/src/testbed/Makefile.am
index e37d0ce11..c5f920b39 100644
--- a/src/testbed/Makefile.am
+++ b/src/testbed/Makefile.am
@@ -9,13 +9,17 @@ if USE_COVERAGE
9 XLIB = -lgcov 9 XLIB = -lgcov
10endif 10endif
11 11
12libexecdir= $(pkglibdir)/libexec/
13
12pkgcfgdir= $(pkgdatadir)/config.d/ 14pkgcfgdir= $(pkgdatadir)/config.d/
13 15
14pkgcfg_DATA = \ 16pkgcfg_DATA = \
15 testbed.conf 17 testbed.conf
16 18
19libexec_PROGRAMS = \
20 gnunet-service-testbed
21
17bin_PROGRAMS = \ 22bin_PROGRAMS = \
18 gnunet-service-testbed \
19 gnunet-helper-testbed 23 gnunet-helper-testbed
20 24
21noinst_PROGRAMS = \ 25noinst_PROGRAMS = \
diff --git a/src/testing/testing.c b/src/testing/testing.c
index e7c840ec9..577657897 100644
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@ -926,7 +926,7 @@ GNUNET_TESTING_peer_configure (struct GNUNET_TESTING_System *system,
926 } 926 }
927 peer = GNUNET_malloc (sizeof (struct GNUNET_TESTING_Peer)); 927 peer = GNUNET_malloc (sizeof (struct GNUNET_TESTING_Peer));
928 peer->cfgfile = config_filename; /* Free in peer_destroy */ 928 peer->cfgfile = config_filename; /* Free in peer_destroy */
929 peer->main_binary = GNUNET_strdup ("gnunet-service-arm"); 929 peer->main_binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
930 peer->system = system; 930 peer->system = system;
931 peer->key_number = key_number; 931 peer->key_number = key_number;
932 return peer; 932 return peer;
@@ -1127,6 +1127,7 @@ GNUNET_TESTING_service_run (const char *testdir,
1127 struct GNUNET_TESTING_System *system; 1127 struct GNUNET_TESTING_System *system;
1128 struct GNUNET_TESTING_Peer *peer; 1128 struct GNUNET_TESTING_Peer *peer;
1129 struct GNUNET_CONFIGURATION_Handle *cfg; 1129 struct GNUNET_CONFIGURATION_Handle *cfg;
1130 char *binary;
1130 1131
1131 GNUNET_log_setup (testdir, "WARNING", NULL); 1132 GNUNET_log_setup (testdir, "WARNING", NULL);
1132 system = GNUNET_TESTING_system_create (testdir, "127.0.0.1", NULL); 1133 system = GNUNET_TESTING_system_create (testdir, "127.0.0.1", NULL);
@@ -1150,7 +1151,9 @@ GNUNET_TESTING_service_run (const char *testdir,
1150 return 1; 1151 return 1;
1151 } 1152 }
1152 GNUNET_free (peer->main_binary); 1153 GNUNET_free (peer->main_binary);
1153 GNUNET_asprintf (&peer->main_binary, "gnunet-service-%s", service_name); 1154 GNUNET_asprintf (&binary, "gnunet-service-%s", service_name);
1155 peer->main_binary = GNUNET_OS_get_libexec_binary_path (binary);
1156 GNUNET_free (binary);
1154 if (GNUNET_OK != GNUNET_TESTING_peer_start (peer)) 1157 if (GNUNET_OK != GNUNET_TESTING_peer_start (peer))
1155 { 1158 {
1156 GNUNET_TESTING_peer_destroy (peer); 1159 GNUNET_TESTING_peer_destroy (peer);
diff --git a/src/topology/Makefile.am b/src/topology/Makefile.am
index 91c21da12..91a5384f7 100644
--- a/src/topology/Makefile.am
+++ b/src/topology/Makefile.am
@@ -6,11 +6,13 @@ endif
6 6
7pkgcfgdir= $(pkgdatadir)/config.d/ 7pkgcfgdir= $(pkgdatadir)/config.d/
8 8
9libexecdir= $(pkglibdir)/libexec/
10
9dist_pkgcfg_DATA = \ 11dist_pkgcfg_DATA = \
10 topology.conf 12 topology.conf
11 13
12 14
13bin_PROGRAMS = \ 15libexec_PROGRAMS = \
14 gnunet-daemon-topology 16 gnunet-daemon-topology
15 17
16gnunet_daemon_topology_SOURCES = \ 18gnunet_daemon_topology_SOURCES = \
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am
index b8d220e72..c89e6d42f 100644
--- a/src/transport/Makefile.am
+++ b/src/transport/Makefile.am
@@ -4,6 +4,8 @@ plugindir = $(libdir)/gnunet
4 4
5pkgcfgdir= $(pkgdatadir)/config.d/ 5pkgcfgdir= $(pkgdatadir)/config.d/
6 6
7libexecdir= $(pkglibdir)/libexec/
8
7pkgcfg_DATA = \ 9pkgcfg_DATA = \
8 transport.conf 10 transport.conf
9 11
@@ -59,7 +61,7 @@ endif
59 61
60if LINUX 62if LINUX
61install-exec-hook: 63install-exec-hook:
62 $(top_srcdir)/src/transport/install-wlan-helper.sh $(bindir) $(SUDO_BINARY) || true 64 $(top_srcdir)/src/transport/install-wlan-helper.sh $(libexecdir) $(SUDO_BINARY) || true
63else 65else
64install-exec-hook: 66install-exec-hook:
65endif 67endif
@@ -107,11 +109,13 @@ libgnunettransport_la_LDFLAGS = \
107 $(GN_LIB_LDFLAGS) $(WINFLAGS) \ 109 $(GN_LIB_LDFLAGS) $(WINFLAGS) \
108 -version-info 1:0:0 110 -version-info 1:0:0
109 111
110bin_PROGRAMS = \ 112libexec_PROGRAMS = \
111 gnunet-transport \
112 $(WLAN_BIN) \ 113 $(WLAN_BIN) \
113 $(WLAN_BIN_DUMMY) \ 114 $(WLAN_BIN_DUMMY) \
114 gnunet-service-transport \ 115 gnunet-service-transport
116
117bin_PROGRAMS = \
118 gnunet-transport \
115 gnunet-transport-certificate-creation 119 gnunet-transport-certificate-creation
116 120
117#bin_SCRIPTS = \ 121#bin_SCRIPTS = \
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index 7983d61db..6da3b8d27 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -2,6 +2,8 @@ INCLUDES = -I$(top_srcdir)/src/include -I$(top_builddir)/src/include
2 2
3plugindir = $(libdir)/gnunet 3plugindir = $(libdir)/gnunet
4 4
5libexecdir= $(pkglibdir)/libexec/
6
5pkgcfgdir= $(pkgdatadir)/config.d/ 7pkgcfgdir= $(pkgdatadir)/config.d/
6 8
7dist_pkgcfg_DATA = \ 9dist_pkgcfg_DATA = \
@@ -120,8 +122,10 @@ libgnunetutil_la_LDFLAGS = \
120 -version-info 8:0:0 122 -version-info 8:0:0
121 123
122 124
125libexec_PROGRAMS = \
126 gnunet-service-resolver
127
123bin_PROGRAMS = \ 128bin_PROGRAMS = \
124 gnunet-service-resolver \
125 gnunet-resolver \ 129 gnunet-resolver \
126 gnunet-config \ 130 gnunet-config \
127 gnunet-ecc \ 131 gnunet-ecc \
diff --git a/src/util/helper.c b/src/util/helper.c
index 03e71585c..c0681c804 100644
--- a/src/util/helper.c
+++ b/src/util/helper.c
@@ -131,7 +131,7 @@ struct GNUNET_HELPER_Handle
131 /** 131 /**
132 * Binary to run. 132 * Binary to run.
133 */ 133 */
134 const char *binary_name; 134 char *binary_name;
135 135
136 /** 136 /**
137 * NULL-terminated list of command-line arguments. 137 * NULL-terminated list of command-line arguments.
@@ -411,18 +411,17 @@ GNUNET_HELPER_start (int with_control_pipe,
411 void *cb_cls) 411 void *cb_cls)
412{ 412{
413 struct GNUNET_HELPER_Handle*h; 413 struct GNUNET_HELPER_Handle*h;
414 int c = 0; 414 unsigned int c;
415 h = GNUNET_malloc (sizeof (struct GNUNET_HELPER_Handle));
416 h->with_control_pipe = with_control_pipe;
417 h->binary_name = GNUNET_strdup (binary_name);
418 415
419 for (c = 0; binary_argv[c] != NULL; c++) 416 h = GNUNET_malloc (sizeof (struct GNUNET_HELPER_Handle));
420 c ++; 417 h->with_control_pipe = with_control_pipe;
421 h->binary_argv = GNUNET_malloc (sizeof (char *[c + 1])); 418 h->binary_name = GNUNET_OS_get_libexec_binary_path (binary_name);
422 for (c = 0; binary_argv[c] != NULL; c++) 419 for (c = 0; NULL != binary_argv[c]; c++)
420 c++;
421 h->binary_argv = GNUNET_malloc (sizeof (char *) * (c + 1));
422 for (c = 0; NULL != binary_argv[c]; c++)
423 h->binary_argv[c] = GNUNET_strdup (binary_argv[c]); 423 h->binary_argv[c] = GNUNET_strdup (binary_argv[c]);
424 h->binary_argv[c] = NULL; 424 h->binary_argv[c] = NULL;
425
426 h->cb_cls = cb_cls; 425 h->cb_cls = cb_cls;
427 h->mst = GNUNET_SERVER_mst_create (cb, h->cb_cls); 426 h->mst = GNUNET_SERVER_mst_create (cb, h->cb_cls);
428 h->exp_cb = exp_cb; 427 h->exp_cb = exp_cb;
@@ -440,7 +439,8 @@ void
440GNUNET_HELPER_stop (struct GNUNET_HELPER_Handle *h) 439GNUNET_HELPER_stop (struct GNUNET_HELPER_Handle *h)
441{ 440{
442 struct GNUNET_HELPER_SendHandle *sh; 441 struct GNUNET_HELPER_SendHandle *sh;
443 int c; 442 unsigned int c;
443
444 h->exp_cb = NULL; 444 h->exp_cb = NULL;
445 /* signal pending writes that we were stopped */ 445 /* signal pending writes that we were stopped */
446 while (NULL != (sh = h->sh_head)) 446 while (NULL != (sh = h->sh_head))
@@ -454,7 +454,7 @@ GNUNET_HELPER_stop (struct GNUNET_HELPER_Handle *h)
454 } 454 }
455 stop_helper (h); 455 stop_helper (h);
456 GNUNET_SERVER_mst_destroy (h->mst); 456 GNUNET_SERVER_mst_destroy (h->mst);
457 GNUNET_free ((char *) h->binary_name); 457 GNUNET_free (h->binary_name);
458 for (c = 0; h->binary_argv[c] != NULL; c++) 458 for (c = 0; h->binary_argv[c] != NULL; c++)
459 GNUNET_free (h->binary_argv[c]); 459 GNUNET_free (h->binary_argv[c]);
460 GNUNET_free (h->binary_argv); 460 GNUNET_free (h->binary_argv);
diff --git a/src/util/os_installation.c b/src/util/os_installation.c
index 1e51c1327..43feba87b 100644
--- a/src/util/os_installation.c
+++ b/src/util/os_installation.c
@@ -452,6 +452,11 @@ GNUNET_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind dirkind)
452 DIR_SEPARATOR_STR "share" DIR_SEPARATOR_STR "doc" DIR_SEPARATOR_STR \ 452 DIR_SEPARATOR_STR "share" DIR_SEPARATOR_STR "doc" DIR_SEPARATOR_STR \
453 "gnunet" DIR_SEPARATOR_STR; 453 "gnunet" DIR_SEPARATOR_STR;
454 break; 454 break;
455 case GNUNET_OS_IPK_LIBEXECDIR:
456 dirname =
457 DIR_SEPARATOR_STR "lib" DIR_SEPARATOR_STR "gnunet" DIR_SEPARATOR_STR \
458 "libexec" DIR_SEPARATOR_STR;
459 break;
455 default: 460 default:
456 GNUNET_free (execpath); 461 GNUNET_free (execpath);
457 return NULL; 462 return NULL;
@@ -464,6 +469,32 @@ GNUNET_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind dirkind)
464 469
465 470
466/** 471/**
472 * Given the name of a gnunet-helper, gnunet-service or gnunet-daemon
473 * binary, try to prefix it with the libexec/-directory to get the
474 * full path.
475 *
476 * @param progname name of the binary
477 * @return full path to the binary, if possible, otherwise copy of 'progname'
478 */
479char *
480GNUNET_OS_get_libexec_binary_path (const char *progname)
481{
482 char *libexecdir;
483 char *binary;
484
485 libexecdir = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_LIBEXECDIR);
486 if (NULL == libexecdir)
487 return GNUNET_strdup (progname);
488 GNUNET_asprintf (&binary,
489 "%s%s",
490 libexecdir,
491 progname);
492 GNUNET_free (libexecdir);
493 return binary;
494}
495
496
497/**
467 * Check whether an executable exists and possibly 498 * Check whether an executable exists and possibly
468 * if the suid bit is set on the file. 499 * if the suid bit is set on the file.
469 * Attempts to find the file using the current 500 * Attempts to find the file using the current
diff --git a/src/util/test_resolver_api.c b/src/util/test_resolver_api.c
index b9ca81b0f..ea18629f4 100644
--- a/src/util/test_resolver_api.c
+++ b/src/util/test_resolver_api.c
@@ -22,11 +22,7 @@
22 * @brief testcase for resolver_api.c 22 * @brief testcase for resolver_api.c
23 */ 23 */
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_common.h" 25#include "gnunet_util_lib.h"
26#include "gnunet_getopt_lib.h"
27#include "gnunet_os_lib.h"
28#include "gnunet_program_lib.h"
29#include "gnunet_scheduler_lib.h"
30#include "gnunet_resolver_service.h" 26#include "gnunet_resolver_service.h"
31#include "resolver.h" 27#include "resolver.h"
32 28
@@ -356,7 +352,6 @@ main (int argc, char *argv[])
356{ 352{
357 int ok = 1 + 2 + 4 + 8; 353 int ok = 1 + 2 + 4 + 8;
358 char *fn; 354 char *fn;
359 char *pfx;
360 struct GNUNET_OS_Process *proc; 355 struct GNUNET_OS_Process *proc;
361 char *const argvx[] = { 356 char *const argvx[] = {
362 "test-resolver-api", "-c", "test_resolver_api_data.conf", NULL 357 "test-resolver-api", "-c", "test_resolver_api_data.conf", NULL
@@ -367,10 +362,11 @@ main (int argc, char *argv[])
367 GNUNET_log_setup ("test-resolver-api", 362 GNUNET_log_setup ("test-resolver-api",
368 "WARNING", 363 "WARNING",
369 NULL); 364 NULL);
370 pfx = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_BINDIR); 365 fn = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver");
371 GNUNET_asprintf (&fn, "%s%cgnunet-service-resolver", pfx, DIR_SEPARATOR); 366 proc = GNUNET_OS_start_process (GNUNET_YES,
372 GNUNET_free (pfx); 367 GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
373 proc = GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, fn, "gnunet-service-resolver", 368 NULL, NULL, fn,
369 "gnunet-service-resolver",
374 "-c", "test_resolver_api_data.conf", NULL); 370 "-c", "test_resolver_api_data.conf", NULL);
375 GNUNET_assert (NULL != proc); 371 GNUNET_assert (NULL != proc);
376 GNUNET_free (fn); 372 GNUNET_free (fn);
diff --git a/src/vpn/Makefile.am b/src/vpn/Makefile.am
index e7802bc9a..453b3b908 100644
--- a/src/vpn/Makefile.am
+++ b/src/vpn/Makefile.am
@@ -10,6 +10,8 @@ endif
10 10
11pkgcfgdir= $(pkgdatadir)/config.d/ 11pkgcfgdir= $(pkgdatadir)/config.d/
12 12
13libexecdir= $(pkglibdir)/libexec/
14
13plugindir = $(libdir)/gnunet 15plugindir = $(libdir)/gnunet
14 16
15pkgcfg_DATA = \ 17pkgcfg_DATA = \
@@ -18,7 +20,7 @@ pkgcfg_DATA = \
18if LINUX 20if LINUX
19VPNBIN = gnunet-helper-vpn 21VPNBIN = gnunet-helper-vpn
20install-exec-hook: 22install-exec-hook:
21 $(top_srcdir)/src/vpn/install-vpn-helper.sh $(bindir) $(SUDO_BINARY) || true 23 $(top_srcdir)/src/vpn/install-vpn-helper.sh $(libexecdir) $(SUDO_BINARY) || true
22else 24else
23install-exec-hook: 25install-exec-hook:
24endif 26endif
@@ -28,8 +30,12 @@ lib_LTLIBRARIES = \
28 libgnunetvpn.la 30 libgnunetvpn.la
29 31
30 32
33libexec_PROGRAMS = \
34 $(VPNBIN) \
35 gnunet-service-vpn
36
31bin_PROGRAMS = \ 37bin_PROGRAMS = \
32 $(VPNBIN) gnunet-service-vpn gnunet-vpn 38 gnunet-vpn
33 39
34gnunet_helper_vpn_SOURCES = \ 40gnunet_helper_vpn_SOURCES = \
35 gnunet-helper-vpn.c 41 gnunet-helper-vpn.c