auto-provide OS_IPK paths in [paths] of config
[oweals/gnunet.git] / src / util / Makefile.am
1 # This Makefile.am is in the public domain
2 AM_CPPFLAGS = -I$(top_srcdir)/src/include
3
4 plugindir = $(libdir)/gnunet
5
6 libexecdir= $(pkglibdir)/libexec/
7
8 pkgcfgdir= $(pkgdatadir)/config.d/
9
10 dist_pkgcfg_DATA = \
11   util.conf
12
13 pkgcfg_DATA = \
14   resolver.conf
15
16 TEST_CLIENT_UNIX_NC = test_client_unix.nc
17
18 if USE_COVERAGE
19   AM_CFLAGS = --coverage -O0
20   XLIB = -lgcov
21 endif
22
23 if ENABLE_BENCHMARK
24   BENCHMARK = benchmark.c benchmark.h
25   PTHREAD = -lpthread
26 endif
27
28 gnunet_config_diff_SOURCES = \
29  gnunet-config-diff.c
30 gnunet_config_diff_LDADD = \
31  libgnunetutil.la
32
33 test_common_logging_dummy_SOURCES = \
34  test_common_logging_dummy.c
35 test_common_logging_dummy_LDADD = \
36  libgnunetutil.la
37
38 libgnunetutil_la_SOURCES = \
39   bandwidth.c \
40   $(BENCHMARK) \
41   bio.c \
42   buffer.c \
43   client.c \
44   common_allocation.c \
45   common_endian.c \
46   common_logging.c \
47   configuration.c \
48   configuration_loader.c \
49   container_bloomfilter.c \
50   container_heap.c \
51   container_meta_data.c \
52   container_multihashmap.c \
53   container_multishortmap.c \
54   container_multiuuidmap.c \
55   container_multipeermap.c \
56   container_multihashmap32.c \
57   crypto_symmetric.c \
58   crypto_crc.c \
59   crypto_ecc.c \
60   crypto_ecc_dlog.c \
61   crypto_ecc_setup.c \
62   crypto_hash.c \
63   crypto_hash_file.c \
64   crypto_hkdf.c \
65   crypto_kdf.c \
66   crypto_mpi.c \
67   crypto_paillier.c \
68   crypto_pow.c \
69   crypto_random.c \
70   crypto_rsa.c \
71   disk.c \
72   disk.h \
73   dnsparser.c \
74   dnsstub.c \
75   getopt.c \
76   getopt_helpers.c \
77   helper.c \
78   load.c \
79   mst.c \
80   mq.c \
81   nc.c \
82   network.c \
83   op.c \
84   os_installation.c \
85   os_network.c \
86   os_priority.c \
87   peer.c \
88   plugin.c \
89   program.c \
90   regex.c \
91   resolver_api.c resolver.h \
92   scheduler.c \
93   service.c \
94   signal.c \
95   strings.c \
96   time.c \
97   tun.c \
98   tweetnacl-gnunet.c \
99   tweetnacl-gnunet.h \
100   speedup.c speedup.h \
101   proc_compat.c
102
103 if HAVE_LIBATOMIC
104 if DARWIN
105         LIBATOMIC=
106 else
107   LIBATOMIC= -latomic
108 endif
109 else
110   LIBATOMIC=
111 endif
112
113 if HAVE_LIBIDN
114   LIBIDN= -lidn
115 else
116   LIBIDN=
117 endif
118
119 if HAVE_LIBIDN2
120   LIBIDN2= -lidn2
121 else
122   LIBIDN2=
123 endif
124
125 libgnunetutil_la_LIBADD = \
126   $(GCLIBADD) $(WINLIB) \
127   $(LIBATOMIC) \
128   $(LIBGCRYPT_LIBS) \
129   $(LTLIBICONV) \
130   $(LTLIBINTL) \
131   -lltdl \
132   $(LIBIDN) $(LIBIDN2) \
133   $(Z_LIBS) \
134   -lunistring \
135   $(XLIB) \
136   $(PTHREAD)
137
138 libgnunetutil_la_LDFLAGS = \
139   $(GN_LIB_LDFLAGS) \
140   -version-info 13:2:0
141
142 if HAVE_TESTING
143   GNUNET_ECC = gnunet-ecc
144   GNUNET_SCRYPT = gnunet-scrypt
145 endif
146
147 lib_LTLIBRARIES = libgnunetutil.la
148
149 libexec_PROGRAMS = \
150  gnunet-service-resolver \
151  gnunet-timeout
152
153 bin_PROGRAMS = \
154  gnunet-resolver \
155  gnunet-config \
156  gnunet-crypto-tvg \
157  $(GNUNET_ECC) \
158  $(GNUNET_SCRYPT) \
159  gnunet-uri
160 if HAVE_ZBAR
161 bin_PROGRAMS += gnunet-qr
162 endif
163
164 noinst_PROGRAMS = \
165  gnunet-config-diff \
166  test_common_logging_dummy
167
168
169 if ENABLE_TEST_RUN
170 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
171 TESTS = $(check_PROGRAMS)
172 endif
173
174 gnunet_timeout_SOURCES = \
175  gnunet-timeout.c
176
177 gnunet_service_resolver_SOURCES = \
178  gnunet-service-resolver.c
179 gnunet_service_resolver_LDADD = \
180   libgnunetutil.la \
181   $(GN_LIBINTL)
182 if HAVE_GETADDRINFO_A
183 gnunet_service_resolver_LDADD += -lanl
184 endif
185
186
187 gnunet_resolver_SOURCES = \
188  gnunet-resolver.c
189 gnunet_resolver_LDADD = \
190   libgnunetutil.la \
191   $(GN_LIBINTL)
192
193 gnunet_crypto_tvg_SOURCES = \
194  gnunet-crypto-tvg.c
195 gnunet_crypto_tvg_LDADD = \
196   libgnunetutil.la \
197   $(GN_LIBINTL) -lgcrypt
198
199 gnunet_ecc_SOURCES = \
200  gnunet-ecc.c
201 gnunet_ecc_LDADD = \
202   libgnunetutil.la \
203   $(GN_LIBINTL) -lgcrypt
204
205 gnunet_scrypt_SOURCES = \
206  gnunet-scrypt.c
207 gnunet_scrypt_LDADD = \
208   libgnunetutil.la \
209   $(GN_LIBINTL) -lgcrypt
210
211
212 gnunet_config_SOURCES = \
213  gnunet-config.c
214 gnunet_config_LDADD = \
215   libgnunetutil.la \
216   $(GN_LIBINTL)
217
218 gnunet_uri_SOURCES = \
219  gnunet-uri.c
220 gnunet_uri_LDADD = \
221   libgnunetutil.la \
222   $(GN_LIBINTL)
223
224
225 gnunet_qr_SOURCES = \
226   gnunet-qr.c
227 gnunet_qr_LDADD = \
228   libgnunetutil.la \
229   $(GN_LIBINTL)
230 gnunet_qr_LDFLAGS= -lzbar
231
232 plugin_LTLIBRARIES = \
233   libgnunet_plugin_test.la
234
235 libgnunet_plugin_test_la_SOURCES = \
236   test_plugin_plug.c
237 libgnunet_plugin_test_la_LDFLAGS = \
238  $(GN_PLUGIN_LDFLAGS)
239
240 if HAVE_BENCHMARKS
241  BENCHMARKS = \
242   perf_crypto_hash \
243   perf_crypto_ecc_dlog \
244   perf_crypto_rsa \
245   perf_crypto_paillier \
246   perf_crypto_symmetric \
247   perf_crypto_asymmetric \
248   perf_malloc
249 endif
250
251 if HAVE_SSH_KEY
252 # SSH_USING_TESTS = test_socks.nc
253 endif
254
255 check_PROGRAMS = \
256  test_bio \
257  test_client.nc \
258  $(TEST_CLIENT_UNIX_NC) \
259  test_common_allocation \
260  test_common_endian \
261  test_common_logging \
262  test_configuration \
263  test_container_bloomfilter \
264  test_container_dll \
265  test_container_meta_data \
266  test_container_multihashmap \
267  test_container_multihashmap32 \
268  test_container_multipeermap \
269  test_container_heap \
270  test_crypto_symmetric \
271  test_crypto_crc \
272  test_crypto_ecdsa \
273  test_crypto_eddsa \
274  test_crypto_ecdhe \
275  test_crypto_ecdh_eddsa \
276  test_crypto_ecdh_ecdsa \
277  test_crypto_ecc_dlog \
278  test_crypto_hash \
279  test_crypto_hash_context \
280  test_crypto_hkdf \
281  test_crypto_kdf \
282  test_crypto_paillier \
283  test_crypto_random \
284  test_crypto_rsa \
285  test_disk \
286  test_getopt \
287  test_hexcoder \
288  test_mq \
289  test_os_network \
290  test_peer \
291  test_plugin \
292  test_program \
293  test_regex \
294  test_resolver_api.nc \
295  test_scheduler \
296  test_scheduler_delay \
297  test_service \
298  test_strings \
299  test_strings_to_data \
300  test_speedup \
301  test_time \
302  test_tun \
303  $(BENCHMARKS) \
304  test_os_start_process \
305  test_common_logging_runtime_loglevels
306
307
308 # Declare .nc (NO-CONCURRENCY) as a test extension so that we can impart
309 # sequential execution order for them
310 TEST_EXTENSIONS = .nc
311 test_test_client_unix.log: test_client.log
312
313 test_bio_SOURCES = \
314  test_bio.c
315 test_bio_LDADD = \
316  libgnunetutil.la
317
318 test_hexcoder_SOURCES = \
319  test_hexcoder.c
320 test_hexcoder_LDADD = \
321  libgnunetutil.la
322
323 test_tun_SOURCES = \
324  test_tun.c
325 test_tun_LDADD = \
326  libgnunetutil.la
327
328 test_regex_SOURCES = \
329  test_regex.c
330 test_regex_LDADD = \
331  libgnunetutil.la
332
333 test_os_start_process_SOURCES = \
334  test_os_start_process.c
335 test_os_start_process_LDADD = \
336  libgnunetutil.la
337 test_os_start_process_DEPENDENCIES = \
338  libgnunetutil.la
339
340 test_client_nc_SOURCES = \
341  test_client.c
342 test_client_nc_LDADD = \
343  libgnunetutil.la
344
345 test_client_unix_nc_SOURCES = \
346  test_client.c
347 test_client_unix_nc_LDADD = \
348  libgnunetutil.la
349
350 #test_socks_nc_SOURCES = \
351 # test_socks.c
352 #test_socks_nc_LDADD = \
353 # libgnunetutil.la
354
355 test_common_allocation_SOURCES = \
356  test_common_allocation.c
357 test_common_allocation_LDADD = \
358  libgnunetutil.la
359
360 test_common_endian_SOURCES = \
361  test_common_endian.c
362 test_common_endian_LDADD = \
363  libgnunetutil.la
364
365 test_common_logging_SOURCES = \
366  test_common_logging.c
367 test_common_logging_LDADD = \
368  libgnunetutil.la
369
370 test_common_logging_runtime_loglevels_SOURCES = \
371  test_common_logging_runtime_loglevels.c
372 test_common_logging_runtime_loglevels_LDADD = \
373  libgnunetutil.la
374
375 test_configuration_SOURCES = \
376  test_configuration.c
377 test_configuration_LDADD = \
378  libgnunetutil.la
379
380 test_container_bloomfilter_SOURCES = \
381  test_container_bloomfilter.c
382 test_container_bloomfilter_LDADD = \
383  libgnunetutil.la
384
385 test_container_dll_SOURCES = \
386  test_container_dll.c
387 test_container_dll_LDADD = \
388  libgnunetutil.la
389
390 test_container_meta_data_SOURCES = \
391  test_container_meta_data.c
392 test_container_meta_data_LDADD = \
393  libgnunetutil.la
394
395 test_container_multihashmap_SOURCES = \
396  test_container_multihashmap.c
397 test_container_multihashmap_LDADD = \
398  libgnunetutil.la
399
400 test_container_multihashmap32_SOURCES = \
401  test_container_multihashmap32.c
402 test_container_multihashmap32_LDADD = \
403  libgnunetutil.la
404
405 test_container_multipeermap_SOURCES = \
406  test_container_multipeermap.c
407 test_container_multipeermap_LDADD = \
408  libgnunetutil.la
409
410 test_container_heap_SOURCES = \
411  test_container_heap.c
412 test_container_heap_LDADD = \
413  libgnunetutil.la
414
415 test_crypto_symmetric_SOURCES = \
416  test_crypto_symmetric.c
417 test_crypto_symmetric_LDADD = \
418  libgnunetutil.la
419
420 test_crypto_crc_SOURCES = \
421  test_crypto_crc.c
422 test_crypto_crc_LDADD = \
423  libgnunetutil.la
424
425 test_crypto_ecdsa_SOURCES = \
426  test_crypto_ecdsa.c
427 test_crypto_ecdsa_LDADD = \
428  libgnunetutil.la \
429  $(LIBGCRYPT_LIBS)
430
431 test_crypto_eddsa_SOURCES = \
432  test_crypto_eddsa.c
433 test_crypto_eddsa_LDADD = \
434  libgnunetutil.la \
435  $(LIBGCRYPT_LIBS)
436
437 test_crypto_ecc_dlog_SOURCES = \
438  test_crypto_ecc_dlog.c
439 test_crypto_ecc_dlog_LDADD = \
440  libgnunetutil.la \
441  $(LIBGCRYPT_LIBS)
442
443 test_crypto_ecdhe_SOURCES = \
444  test_crypto_ecdhe.c
445 test_crypto_ecdhe_LDADD = \
446  libgnunetutil.la \
447  $(LIBGCRYPT_LIBS)
448
449 test_crypto_ecdh_eddsa_SOURCES = \
450  test_crypto_ecdh_eddsa.c
451 test_crypto_ecdh_eddsa_LDADD = \
452  libgnunetutil.la \
453  $(LIBGCRYPT_LIBS)
454
455 test_crypto_ecdh_ecdsa_SOURCES = \
456  test_crypto_ecdh_ecdsa.c
457 test_crypto_ecdh_ecdsa_LDADD = \
458  libgnunetutil.la \
459  $(LIBGCRYPT_LIBS)
460
461
462 test_crypto_hash_SOURCES = \
463  test_crypto_hash.c
464 test_crypto_hash_LDADD = \
465  libgnunetutil.la
466
467 test_crypto_hash_context_SOURCES = \
468  test_crypto_hash_context.c
469 test_crypto_hash_context_LDADD = \
470  libgnunetutil.la
471
472 test_crypto_hkdf_SOURCES = \
473  test_crypto_hkdf.c
474 test_crypto_hkdf_LDADD = \
475  libgnunetutil.la
476
477 test_crypto_kdf_SOURCES = \
478  test_crypto_kdf.c
479 test_crypto_kdf_LDADD = \
480  libgnunetutil.la -lgcrypt
481
482 test_crypto_paillier_SOURCES = \
483  test_crypto_paillier.c
484 test_crypto_paillier_LDADD = \
485  $(LIBGCRYPT_LIBS) \
486  libgnunetutil.la
487
488 test_crypto_random_SOURCES = \
489  test_crypto_random.c
490 test_crypto_random_LDADD = \
491  libgnunetutil.la
492
493 test_crypto_rsa_SOURCES = \
494  test_crypto_rsa.c
495 test_crypto_rsa_LDADD = \
496  libgnunetutil.la -lgcrypt
497
498 test_disk_SOURCES = \
499  test_disk.c
500 test_disk_LDADD = \
501  libgnunetutil.la
502
503 test_getopt_SOURCES = \
504  test_getopt.c
505 test_getopt_LDADD = \
506  libgnunetutil.la
507
508 test_mq_SOURCES = \
509  test_mq.c
510 test_mq_LDADD = \
511  libgnunetutil.la
512
513 test_os_network_SOURCES = \
514  test_os_network.c
515 test_os_network_LDADD = \
516  libgnunetutil.la
517
518 test_peer_SOURCES = \
519  test_peer.c
520 test_peer_LDADD = \
521  libgnunetutil.la -lgcrypt
522
523 test_plugin_SOURCES = \
524  test_plugin.c
525 test_plugin_LDADD = \
526  libgnunetutil.la
527
528 test_program_SOURCES = \
529  test_program.c
530 test_program_LDADD = \
531  libgnunetutil.la
532
533 test_resolver_api_nc_SOURCES = \
534  test_resolver_api.c
535 test_resolver_api_nc_LDADD = \
536  libgnunetutil.la
537
538 test_scheduler_SOURCES = \
539  test_scheduler.c
540 test_scheduler_LDADD = \
541  libgnunetutil.la
542
543 test_scheduler_delay_SOURCES = \
544  test_scheduler_delay.c
545 test_scheduler_delay_LDADD = \
546  libgnunetutil.la
547
548 test_service_SOURCES = \
549  test_service.c
550 test_service_LDADD = \
551  libgnunetutil.la
552
553 test_strings_SOURCES = \
554  test_strings.c
555 test_strings_LDADD = \
556  libgnunetutil.la
557
558 test_strings_to_data_SOURCES = \
559  test_strings_to_data.c
560 test_strings_to_data_LDADD = \
561  libgnunetutil.la
562
563
564 test_time_SOURCES = \
565  test_time.c
566 test_time_LDADD = \
567  libgnunetutil.la
568
569 test_speedup_SOURCES = \
570  test_speedup.c
571 test_speedup_LDADD = \
572  libgnunetutil.la
573
574 perf_crypto_hash_SOURCES = \
575  perf_crypto_hash.c
576 perf_crypto_hash_LDADD = \
577  libgnunetutil.la
578
579 perf_crypto_ecc_dlog_SOURCES = \
580  perf_crypto_ecc_dlog.c
581 perf_crypto_ecc_dlog_LDADD = \
582  libgnunetutil.la \
583  -lgcrypt
584
585 perf_crypto_rsa_SOURCES = \
586  perf_crypto_rsa.c
587 perf_crypto_rsa_LDADD = \
588  libgnunetutil.la
589
590 perf_crypto_symmetric_SOURCES = \
591  perf_crypto_symmetric.c
592 perf_crypto_symmetric_LDADD = \
593  libgnunetutil.la
594
595 perf_crypto_asymmetric_SOURCES = \
596  perf_crypto_asymmetric.c
597 perf_crypto_asymmetric_LDADD = \
598  libgnunetutil.la
599
600 perf_crypto_paillier_SOURCES = \
601  perf_crypto_paillier.c
602 perf_crypto_paillier_LDADD = \
603  libgnunetutil.la \
604  -lgcrypt
605
606 perf_malloc_SOURCES = \
607  perf_malloc.c
608 perf_malloc_LDADD = \
609  libgnunetutil.la
610
611
612 EXTRA_DIST = \
613   test_client_data.conf \
614   test_client_unix.conf \
615   test_configuration_data.conf \
616   test_program_data.conf \
617   test_resolver_api_data.conf \
618   test_service_data.conf \
619   test_speedup_data.conf