remove argon2 dependency. Use limited libsodium argon2id function for GNS and NSE
[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   consttime_memcmp.c \
50   container_bloomfilter.c \
51   container_heap.c \
52   container_meta_data.c \
53   container_multihashmap.c \
54   container_multishortmap.c \
55   container_multiuuidmap.c \
56   container_multipeermap.c \
57   container_multihashmap32.c \
58   crypto_symmetric.c \
59   crypto_crc.c \
60   crypto_ecc.c \
61   crypto_ecc_dlog.c \
62   crypto_ecc_setup.c \
63   crypto_hash.c \
64   crypto_hash_file.c \
65   crypto_hkdf.c \
66   crypto_kdf.c \
67   crypto_mpi.c \
68   crypto_paillier.c \
69   crypto_pow.c \
70   crypto_random.c \
71   crypto_rsa.c \
72   disk.c \
73   disk.h \
74   dnsparser.c \
75   dnsstub.c \
76   getopt.c \
77   getopt_helpers.c \
78   helper.c \
79   load.c \
80   mst.c \
81   mq.c \
82   nc.c \
83   network.c \
84   op.c \
85   os_installation.c \
86   os_network.c \
87   os_priority.c \
88   peer.c \
89   plugin.c \
90   program.c \
91   regex.c \
92   resolver_api.c resolver.h \
93   scheduler.c \
94   service.c \
95   signal.c \
96   strings.c \
97   time.c \
98   tun.c \
99   speedup.c speedup.h \
100   proc_compat.c
101
102 if HAVE_LIBATOMIC
103 if DARWIN
104         LIBATOMIC=
105 else
106   LIBATOMIC= -latomic
107 endif
108 else
109   LIBATOMIC=
110 endif
111
112 if HAVE_LIBIDN
113   LIBIDN= -lidn
114 else
115   LIBIDN=
116 endif
117
118 if HAVE_LIBIDN2
119   LIBIDN2= -lidn2
120 else
121   LIBIDN2=
122 endif
123
124 libgnunetutil_la_LIBADD = \
125   $(GCLIBADD) $(WINLIB) \
126   $(LIBATOMIC) \
127   $(LIBGCRYPT_LIBS) \
128   $(LTLIBICONV) \
129   $(LTLIBINTL) \
130   -lltdl \
131   $(LIBIDN) $(LIBIDN2) \
132   $(Z_LIBS) \
133   -lunistring \
134   -lsodium \
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   perf_mq \
250   perf_scheduler
251 endif
252
253 if HAVE_SSH_KEY
254 # SSH_USING_TESTS = test_socks.nc
255 endif
256
257 check_PROGRAMS = \
258  test_bio \
259  test_client.nc \
260  $(TEST_CLIENT_UNIX_NC) \
261  test_common_allocation \
262  test_common_endian \
263  test_common_logging \
264  test_configuration \
265  test_container_bloomfilter \
266  test_container_dll \
267  test_container_meta_data \
268  test_container_multihashmap \
269  test_container_multihashmap32 \
270  test_container_multipeermap \
271  test_container_heap \
272  test_crypto_symmetric \
273  test_crypto_crc \
274  test_crypto_ecdsa \
275  test_crypto_eddsa \
276  test_crypto_ecdhe \
277  test_crypto_ecdh_eddsa \
278  test_crypto_ecdh_ecdsa \
279  test_crypto_ecc_dlog \
280  test_crypto_hash \
281  test_crypto_hash_context \
282  test_crypto_hkdf \
283  test_crypto_kdf \
284  test_crypto_paillier \
285  test_crypto_random \
286  test_crypto_rsa \
287  test_disk \
288  test_getopt \
289  test_hexcoder \
290  test_mq \
291  test_os_network \
292  test_peer \
293  test_plugin \
294  test_program \
295  test_regex \
296  test_resolver_api.nc \
297  test_scheduler \
298  test_scheduler_delay \
299  test_service \
300  test_strings \
301  test_strings_to_data \
302  test_speedup \
303  test_time \
304  test_tun \
305  $(BENCHMARKS) \
306  test_os_start_process \
307  test_common_logging_runtime_loglevels
308
309
310 # Declare .nc (NO-CONCURRENCY) as a test extension so that we can impart
311 # sequential execution order for them
312 TEST_EXTENSIONS = .nc
313 test_test_client_unix.log: test_client.log
314
315 test_bio_SOURCES = \
316  test_bio.c
317 test_bio_LDADD = \
318  libgnunetutil.la
319
320 test_hexcoder_SOURCES = \
321  test_hexcoder.c
322 test_hexcoder_LDADD = \
323  libgnunetutil.la
324
325 test_tun_SOURCES = \
326  test_tun.c
327 test_tun_LDADD = \
328  libgnunetutil.la
329
330 test_regex_SOURCES = \
331  test_regex.c
332 test_regex_LDADD = \
333  libgnunetutil.la
334
335 test_os_start_process_SOURCES = \
336  test_os_start_process.c
337 test_os_start_process_LDADD = \
338  libgnunetutil.la
339 test_os_start_process_DEPENDENCIES = \
340  libgnunetutil.la
341
342 test_client_nc_SOURCES = \
343  test_client.c
344 test_client_nc_LDADD = \
345  libgnunetutil.la
346
347 test_client_unix_nc_SOURCES = \
348  test_client.c
349 test_client_unix_nc_LDADD = \
350  libgnunetutil.la
351
352 #test_socks_nc_SOURCES = \
353 # test_socks.c
354 #test_socks_nc_LDADD = \
355 # libgnunetutil.la
356
357 test_common_allocation_SOURCES = \
358  test_common_allocation.c
359 test_common_allocation_LDADD = \
360  libgnunetutil.la
361
362 test_common_endian_SOURCES = \
363  test_common_endian.c
364 test_common_endian_LDADD = \
365  libgnunetutil.la
366
367 test_common_logging_SOURCES = \
368  test_common_logging.c
369 test_common_logging_LDADD = \
370  libgnunetutil.la
371
372 test_common_logging_runtime_loglevels_SOURCES = \
373  test_common_logging_runtime_loglevels.c
374 test_common_logging_runtime_loglevels_LDADD = \
375  libgnunetutil.la
376
377 test_configuration_SOURCES = \
378  test_configuration.c
379 test_configuration_LDADD = \
380  libgnunetutil.la
381
382 test_container_bloomfilter_SOURCES = \
383  test_container_bloomfilter.c
384 test_container_bloomfilter_LDADD = \
385  libgnunetutil.la
386
387 test_container_dll_SOURCES = \
388  test_container_dll.c
389 test_container_dll_LDADD = \
390  libgnunetutil.la
391
392 test_container_meta_data_SOURCES = \
393  test_container_meta_data.c
394 test_container_meta_data_LDADD = \
395  libgnunetutil.la
396
397 test_container_multihashmap_SOURCES = \
398  test_container_multihashmap.c
399 test_container_multihashmap_LDADD = \
400  libgnunetutil.la
401
402 test_container_multihashmap32_SOURCES = \
403  test_container_multihashmap32.c
404 test_container_multihashmap32_LDADD = \
405  libgnunetutil.la
406
407 test_container_multipeermap_SOURCES = \
408  test_container_multipeermap.c
409 test_container_multipeermap_LDADD = \
410  libgnunetutil.la
411
412 test_container_heap_SOURCES = \
413  test_container_heap.c
414 test_container_heap_LDADD = \
415  libgnunetutil.la
416
417 test_crypto_symmetric_SOURCES = \
418  test_crypto_symmetric.c
419 test_crypto_symmetric_LDADD = \
420  libgnunetutil.la
421
422 test_crypto_crc_SOURCES = \
423  test_crypto_crc.c
424 test_crypto_crc_LDADD = \
425  libgnunetutil.la
426
427 test_crypto_ecdsa_SOURCES = \
428  test_crypto_ecdsa.c
429 test_crypto_ecdsa_LDADD = \
430  libgnunetutil.la \
431  $(LIBGCRYPT_LIBS)
432
433 test_crypto_eddsa_SOURCES = \
434  test_crypto_eddsa.c
435 test_crypto_eddsa_LDADD = \
436  libgnunetutil.la \
437  $(LIBGCRYPT_LIBS)
438
439 test_crypto_ecc_dlog_SOURCES = \
440  test_crypto_ecc_dlog.c
441 test_crypto_ecc_dlog_LDADD = \
442  libgnunetutil.la \
443  $(LIBGCRYPT_LIBS)
444
445 test_crypto_ecdhe_SOURCES = \
446  test_crypto_ecdhe.c
447 test_crypto_ecdhe_LDADD = \
448  libgnunetutil.la \
449  $(LIBGCRYPT_LIBS)
450
451 test_crypto_ecdh_eddsa_SOURCES = \
452  test_crypto_ecdh_eddsa.c
453 test_crypto_ecdh_eddsa_LDADD = \
454  libgnunetutil.la \
455  $(LIBGCRYPT_LIBS)
456
457 test_crypto_ecdh_ecdsa_SOURCES = \
458  test_crypto_ecdh_ecdsa.c
459 test_crypto_ecdh_ecdsa_LDADD = \
460  libgnunetutil.la \
461  $(LIBGCRYPT_LIBS)
462
463
464 test_crypto_hash_SOURCES = \
465  test_crypto_hash.c
466 test_crypto_hash_LDADD = \
467  libgnunetutil.la
468
469 test_crypto_hash_context_SOURCES = \
470  test_crypto_hash_context.c
471 test_crypto_hash_context_LDADD = \
472  libgnunetutil.la
473
474 test_crypto_hkdf_SOURCES = \
475  test_crypto_hkdf.c
476 test_crypto_hkdf_LDADD = \
477  libgnunetutil.la
478
479 test_crypto_kdf_SOURCES = \
480  test_crypto_kdf.c
481 test_crypto_kdf_LDADD = \
482  libgnunetutil.la -lgcrypt
483
484 test_crypto_paillier_SOURCES = \
485  test_crypto_paillier.c
486 test_crypto_paillier_LDADD = \
487  $(LIBGCRYPT_LIBS) \
488  libgnunetutil.la
489
490 test_crypto_random_SOURCES = \
491  test_crypto_random.c
492 test_crypto_random_LDADD = \
493  libgnunetutil.la
494
495 test_crypto_rsa_SOURCES = \
496  test_crypto_rsa.c
497 test_crypto_rsa_LDADD = \
498  libgnunetutil.la -lgcrypt
499
500 test_disk_SOURCES = \
501  test_disk.c
502 test_disk_LDADD = \
503  libgnunetutil.la
504
505 test_getopt_SOURCES = \
506  test_getopt.c
507 test_getopt_LDADD = \
508  libgnunetutil.la
509
510 test_mq_SOURCES = \
511  test_mq.c
512 test_mq_LDADD = \
513  libgnunetutil.la
514
515 test_os_network_SOURCES = \
516  test_os_network.c
517 test_os_network_LDADD = \
518  libgnunetutil.la
519
520 test_peer_SOURCES = \
521  test_peer.c
522 test_peer_LDADD = \
523  libgnunetutil.la -lgcrypt
524
525 test_plugin_SOURCES = \
526  test_plugin.c
527 test_plugin_LDADD = \
528  libgnunetutil.la
529
530 test_program_SOURCES = \
531  test_program.c
532 test_program_LDADD = \
533  libgnunetutil.la
534
535 test_resolver_api_nc_SOURCES = \
536  test_resolver_api.c
537 test_resolver_api_nc_LDADD = \
538  libgnunetutil.la
539
540 test_scheduler_SOURCES = \
541  test_scheduler.c
542 test_scheduler_LDADD = \
543  libgnunetutil.la
544
545 test_scheduler_delay_SOURCES = \
546  test_scheduler_delay.c
547 test_scheduler_delay_LDADD = \
548  libgnunetutil.la
549
550 test_service_SOURCES = \
551  test_service.c
552 test_service_LDADD = \
553  libgnunetutil.la
554
555 test_strings_SOURCES = \
556  test_strings.c
557 test_strings_LDADD = \
558  libgnunetutil.la
559
560 test_strings_to_data_SOURCES = \
561  test_strings_to_data.c
562 test_strings_to_data_LDADD = \
563  libgnunetutil.la
564
565
566 test_time_SOURCES = \
567  test_time.c
568 test_time_LDADD = \
569  libgnunetutil.la
570
571 test_speedup_SOURCES = \
572  test_speedup.c
573 test_speedup_LDADD = \
574  libgnunetutil.la
575
576 perf_crypto_hash_SOURCES = \
577  perf_crypto_hash.c
578 perf_crypto_hash_LDADD = \
579  libgnunetutil.la
580
581 perf_crypto_ecc_dlog_SOURCES = \
582  perf_crypto_ecc_dlog.c
583 perf_crypto_ecc_dlog_LDADD = \
584  libgnunetutil.la \
585  -lgcrypt
586
587 perf_crypto_rsa_SOURCES = \
588  perf_crypto_rsa.c
589 perf_crypto_rsa_LDADD = \
590  libgnunetutil.la
591
592 perf_crypto_symmetric_SOURCES = \
593  perf_crypto_symmetric.c
594 perf_crypto_symmetric_LDADD = \
595  libgnunetutil.la
596
597 perf_crypto_asymmetric_SOURCES = \
598  perf_crypto_asymmetric.c
599 perf_crypto_asymmetric_LDADD = \
600  libgnunetutil.la
601
602 perf_crypto_paillier_SOURCES = \
603  perf_crypto_paillier.c
604 perf_crypto_paillier_LDADD = \
605  libgnunetutil.la \
606  -lgcrypt
607
608 perf_malloc_SOURCES = \
609  perf_malloc.c
610 perf_malloc_LDADD = \
611  libgnunetutil.la
612
613 perf_mq_SOURCES = \
614  perf_mq.c
615 perf_mq_LDADD = \
616  libgnunetutil.la
617
618 perf_scheduler_SOURCES = \
619  perf_scheduler.c
620 perf_scheduler_LDADD = \
621  libgnunetutil.la
622
623
624 EXTRA_DIST = \
625   test_client_data.conf \
626   test_client_unix.conf \
627   test_configuration_data.conf \
628   test_program_data.conf \
629   test_resolver_api_data.conf \
630   test_service_data.conf \
631   test_speedup_data.conf