adding a GNUNET_memcmp_priv for constant-time comparing of data; fixes #6152 (modulo...
[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   tweetnacl-gnunet.c \
100   tweetnacl-gnunet.h \
101   speedup.c speedup.h \
102   proc_compat.c
103
104 if HAVE_LIBATOMIC
105 if DARWIN
106         LIBATOMIC=
107 else
108   LIBATOMIC= -latomic
109 endif
110 else
111   LIBATOMIC=
112 endif
113
114 if HAVE_LIBIDN
115   LIBIDN= -lidn
116 else
117   LIBIDN=
118 endif
119
120 if HAVE_LIBIDN2
121   LIBIDN2= -lidn2
122 else
123   LIBIDN2=
124 endif
125
126 libgnunetutil_la_LIBADD = \
127   $(GCLIBADD) $(WINLIB) \
128   $(LIBATOMIC) \
129   $(LIBGCRYPT_LIBS) \
130   $(LTLIBICONV) \
131   $(LTLIBINTL) \
132   -lltdl \
133   $(LIBIDN) $(LIBIDN2) \
134   $(Z_LIBS) \
135   -lunistring \
136   $(XLIB) \
137   $(PTHREAD)
138
139 libgnunetutil_la_LDFLAGS = \
140   $(GN_LIB_LDFLAGS) \
141   -version-info 13:2:0
142
143 if HAVE_TESTING
144   GNUNET_ECC = gnunet-ecc
145   GNUNET_SCRYPT = gnunet-scrypt
146 endif
147
148 lib_LTLIBRARIES = libgnunetutil.la
149
150 libexec_PROGRAMS = \
151  gnunet-service-resolver \
152  gnunet-timeout
153
154 bin_PROGRAMS = \
155  gnunet-resolver \
156  gnunet-config \
157  gnunet-crypto-tvg \
158  $(GNUNET_ECC) \
159  $(GNUNET_SCRYPT) \
160  gnunet-uri
161 if HAVE_ZBAR
162 bin_PROGRAMS += gnunet-qr
163 endif
164
165 noinst_PROGRAMS = \
166  gnunet-config-diff \
167  test_common_logging_dummy
168
169
170 if ENABLE_TEST_RUN
171 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
172 TESTS = $(check_PROGRAMS)
173 endif
174
175 gnunet_timeout_SOURCES = \
176  gnunet-timeout.c
177
178 gnunet_service_resolver_SOURCES = \
179  gnunet-service-resolver.c
180 gnunet_service_resolver_LDADD = \
181   libgnunetutil.la \
182   $(GN_LIBINTL)
183 if HAVE_GETADDRINFO_A
184 gnunet_service_resolver_LDADD += -lanl
185 endif
186
187
188 gnunet_resolver_SOURCES = \
189  gnunet-resolver.c
190 gnunet_resolver_LDADD = \
191   libgnunetutil.la \
192   $(GN_LIBINTL)
193
194 gnunet_crypto_tvg_SOURCES = \
195  gnunet-crypto-tvg.c
196 gnunet_crypto_tvg_LDADD = \
197   libgnunetutil.la \
198   $(GN_LIBINTL) -lgcrypt
199
200 gnunet_ecc_SOURCES = \
201  gnunet-ecc.c
202 gnunet_ecc_LDADD = \
203   libgnunetutil.la \
204   $(GN_LIBINTL) -lgcrypt
205
206 gnunet_scrypt_SOURCES = \
207  gnunet-scrypt.c
208 gnunet_scrypt_LDADD = \
209   libgnunetutil.la \
210   $(GN_LIBINTL) -lgcrypt
211
212
213 gnunet_config_SOURCES = \
214  gnunet-config.c
215 gnunet_config_LDADD = \
216   libgnunetutil.la \
217   $(GN_LIBINTL)
218
219 gnunet_uri_SOURCES = \
220  gnunet-uri.c
221 gnunet_uri_LDADD = \
222   libgnunetutil.la \
223   $(GN_LIBINTL)
224
225
226 gnunet_qr_SOURCES = \
227   gnunet-qr.c
228 gnunet_qr_LDADD = \
229   libgnunetutil.la \
230   $(GN_LIBINTL)
231 gnunet_qr_LDFLAGS= -lzbar
232
233 plugin_LTLIBRARIES = \
234   libgnunet_plugin_test.la
235
236 libgnunet_plugin_test_la_SOURCES = \
237   test_plugin_plug.c
238 libgnunet_plugin_test_la_LDFLAGS = \
239  $(GN_PLUGIN_LDFLAGS)
240
241 if HAVE_BENCHMARKS
242  BENCHMARKS = \
243   perf_crypto_hash \
244   perf_crypto_ecc_dlog \
245   perf_crypto_rsa \
246   perf_crypto_paillier \
247   perf_crypto_symmetric \
248   perf_crypto_asymmetric \
249   perf_malloc \
250   perf_mq \
251   perf_scheduler
252 endif
253
254 if HAVE_SSH_KEY
255 # SSH_USING_TESTS = test_socks.nc
256 endif
257
258 check_PROGRAMS = \
259  test_bio \
260  test_client.nc \
261  $(TEST_CLIENT_UNIX_NC) \
262  test_common_allocation \
263  test_common_endian \
264  test_common_logging \
265  test_configuration \
266  test_container_bloomfilter \
267  test_container_dll \
268  test_container_meta_data \
269  test_container_multihashmap \
270  test_container_multihashmap32 \
271  test_container_multipeermap \
272  test_container_heap \
273  test_crypto_symmetric \
274  test_crypto_crc \
275  test_crypto_ecdsa \
276  test_crypto_eddsa \
277  test_crypto_ecdhe \
278  test_crypto_ecdh_eddsa \
279  test_crypto_ecdh_ecdsa \
280  test_crypto_ecc_dlog \
281  test_crypto_hash \
282  test_crypto_hash_context \
283  test_crypto_hkdf \
284  test_crypto_kdf \
285  test_crypto_paillier \
286  test_crypto_random \
287  test_crypto_rsa \
288  test_disk \
289  test_getopt \
290  test_hexcoder \
291  test_mq \
292  test_os_network \
293  test_peer \
294  test_plugin \
295  test_program \
296  test_regex \
297  test_resolver_api.nc \
298  test_scheduler \
299  test_scheduler_delay \
300  test_service \
301  test_strings \
302  test_strings_to_data \
303  test_speedup \
304  test_time \
305  test_tun \
306  $(BENCHMARKS) \
307  test_os_start_process \
308  test_common_logging_runtime_loglevels
309
310
311 # Declare .nc (NO-CONCURRENCY) as a test extension so that we can impart
312 # sequential execution order for them
313 TEST_EXTENSIONS = .nc
314 test_test_client_unix.log: test_client.log
315
316 test_bio_SOURCES = \
317  test_bio.c
318 test_bio_LDADD = \
319  libgnunetutil.la
320
321 test_hexcoder_SOURCES = \
322  test_hexcoder.c
323 test_hexcoder_LDADD = \
324  libgnunetutil.la
325
326 test_tun_SOURCES = \
327  test_tun.c
328 test_tun_LDADD = \
329  libgnunetutil.la
330
331 test_regex_SOURCES = \
332  test_regex.c
333 test_regex_LDADD = \
334  libgnunetutil.la
335
336 test_os_start_process_SOURCES = \
337  test_os_start_process.c
338 test_os_start_process_LDADD = \
339  libgnunetutil.la
340 test_os_start_process_DEPENDENCIES = \
341  libgnunetutil.la
342
343 test_client_nc_SOURCES = \
344  test_client.c
345 test_client_nc_LDADD = \
346  libgnunetutil.la
347
348 test_client_unix_nc_SOURCES = \
349  test_client.c
350 test_client_unix_nc_LDADD = \
351  libgnunetutil.la
352
353 #test_socks_nc_SOURCES = \
354 # test_socks.c
355 #test_socks_nc_LDADD = \
356 # libgnunetutil.la
357
358 test_common_allocation_SOURCES = \
359  test_common_allocation.c
360 test_common_allocation_LDADD = \
361  libgnunetutil.la
362
363 test_common_endian_SOURCES = \
364  test_common_endian.c
365 test_common_endian_LDADD = \
366  libgnunetutil.la
367
368 test_common_logging_SOURCES = \
369  test_common_logging.c
370 test_common_logging_LDADD = \
371  libgnunetutil.la
372
373 test_common_logging_runtime_loglevels_SOURCES = \
374  test_common_logging_runtime_loglevels.c
375 test_common_logging_runtime_loglevels_LDADD = \
376  libgnunetutil.la
377
378 test_configuration_SOURCES = \
379  test_configuration.c
380 test_configuration_LDADD = \
381  libgnunetutil.la
382
383 test_container_bloomfilter_SOURCES = \
384  test_container_bloomfilter.c
385 test_container_bloomfilter_LDADD = \
386  libgnunetutil.la
387
388 test_container_dll_SOURCES = \
389  test_container_dll.c
390 test_container_dll_LDADD = \
391  libgnunetutil.la
392
393 test_container_meta_data_SOURCES = \
394  test_container_meta_data.c
395 test_container_meta_data_LDADD = \
396  libgnunetutil.la
397
398 test_container_multihashmap_SOURCES = \
399  test_container_multihashmap.c
400 test_container_multihashmap_LDADD = \
401  libgnunetutil.la
402
403 test_container_multihashmap32_SOURCES = \
404  test_container_multihashmap32.c
405 test_container_multihashmap32_LDADD = \
406  libgnunetutil.la
407
408 test_container_multipeermap_SOURCES = \
409  test_container_multipeermap.c
410 test_container_multipeermap_LDADD = \
411  libgnunetutil.la
412
413 test_container_heap_SOURCES = \
414  test_container_heap.c
415 test_container_heap_LDADD = \
416  libgnunetutil.la
417
418 test_crypto_symmetric_SOURCES = \
419  test_crypto_symmetric.c
420 test_crypto_symmetric_LDADD = \
421  libgnunetutil.la
422
423 test_crypto_crc_SOURCES = \
424  test_crypto_crc.c
425 test_crypto_crc_LDADD = \
426  libgnunetutil.la
427
428 test_crypto_ecdsa_SOURCES = \
429  test_crypto_ecdsa.c
430 test_crypto_ecdsa_LDADD = \
431  libgnunetutil.la \
432  $(LIBGCRYPT_LIBS)
433
434 test_crypto_eddsa_SOURCES = \
435  test_crypto_eddsa.c
436 test_crypto_eddsa_LDADD = \
437  libgnunetutil.la \
438  $(LIBGCRYPT_LIBS)
439
440 test_crypto_ecc_dlog_SOURCES = \
441  test_crypto_ecc_dlog.c
442 test_crypto_ecc_dlog_LDADD = \
443  libgnunetutil.la \
444  $(LIBGCRYPT_LIBS)
445
446 test_crypto_ecdhe_SOURCES = \
447  test_crypto_ecdhe.c
448 test_crypto_ecdhe_LDADD = \
449  libgnunetutil.la \
450  $(LIBGCRYPT_LIBS)
451
452 test_crypto_ecdh_eddsa_SOURCES = \
453  test_crypto_ecdh_eddsa.c
454 test_crypto_ecdh_eddsa_LDADD = \
455  libgnunetutil.la \
456  $(LIBGCRYPT_LIBS)
457
458 test_crypto_ecdh_ecdsa_SOURCES = \
459  test_crypto_ecdh_ecdsa.c
460 test_crypto_ecdh_ecdsa_LDADD = \
461  libgnunetutil.la \
462  $(LIBGCRYPT_LIBS)
463
464
465 test_crypto_hash_SOURCES = \
466  test_crypto_hash.c
467 test_crypto_hash_LDADD = \
468  libgnunetutil.la
469
470 test_crypto_hash_context_SOURCES = \
471  test_crypto_hash_context.c
472 test_crypto_hash_context_LDADD = \
473  libgnunetutil.la
474
475 test_crypto_hkdf_SOURCES = \
476  test_crypto_hkdf.c
477 test_crypto_hkdf_LDADD = \
478  libgnunetutil.la
479
480 test_crypto_kdf_SOURCES = \
481  test_crypto_kdf.c
482 test_crypto_kdf_LDADD = \
483  libgnunetutil.la -lgcrypt
484
485 test_crypto_paillier_SOURCES = \
486  test_crypto_paillier.c
487 test_crypto_paillier_LDADD = \
488  $(LIBGCRYPT_LIBS) \
489  libgnunetutil.la
490
491 test_crypto_random_SOURCES = \
492  test_crypto_random.c
493 test_crypto_random_LDADD = \
494  libgnunetutil.la
495
496 test_crypto_rsa_SOURCES = \
497  test_crypto_rsa.c
498 test_crypto_rsa_LDADD = \
499  libgnunetutil.la -lgcrypt
500
501 test_disk_SOURCES = \
502  test_disk.c
503 test_disk_LDADD = \
504  libgnunetutil.la
505
506 test_getopt_SOURCES = \
507  test_getopt.c
508 test_getopt_LDADD = \
509  libgnunetutil.la
510
511 test_mq_SOURCES = \
512  test_mq.c
513 test_mq_LDADD = \
514  libgnunetutil.la
515
516 test_os_network_SOURCES = \
517  test_os_network.c
518 test_os_network_LDADD = \
519  libgnunetutil.la
520
521 test_peer_SOURCES = \
522  test_peer.c
523 test_peer_LDADD = \
524  libgnunetutil.la -lgcrypt
525
526 test_plugin_SOURCES = \
527  test_plugin.c
528 test_plugin_LDADD = \
529  libgnunetutil.la
530
531 test_program_SOURCES = \
532  test_program.c
533 test_program_LDADD = \
534  libgnunetutil.la
535
536 test_resolver_api_nc_SOURCES = \
537  test_resolver_api.c
538 test_resolver_api_nc_LDADD = \
539  libgnunetutil.la
540
541 test_scheduler_SOURCES = \
542  test_scheduler.c
543 test_scheduler_LDADD = \
544  libgnunetutil.la
545
546 test_scheduler_delay_SOURCES = \
547  test_scheduler_delay.c
548 test_scheduler_delay_LDADD = \
549  libgnunetutil.la
550
551 test_service_SOURCES = \
552  test_service.c
553 test_service_LDADD = \
554  libgnunetutil.la
555
556 test_strings_SOURCES = \
557  test_strings.c
558 test_strings_LDADD = \
559  libgnunetutil.la
560
561 test_strings_to_data_SOURCES = \
562  test_strings_to_data.c
563 test_strings_to_data_LDADD = \
564  libgnunetutil.la
565
566
567 test_time_SOURCES = \
568  test_time.c
569 test_time_LDADD = \
570  libgnunetutil.la
571
572 test_speedup_SOURCES = \
573  test_speedup.c
574 test_speedup_LDADD = \
575  libgnunetutil.la
576
577 perf_crypto_hash_SOURCES = \
578  perf_crypto_hash.c
579 perf_crypto_hash_LDADD = \
580  libgnunetutil.la
581
582 perf_crypto_ecc_dlog_SOURCES = \
583  perf_crypto_ecc_dlog.c
584 perf_crypto_ecc_dlog_LDADD = \
585  libgnunetutil.la \
586  -lgcrypt
587
588 perf_crypto_rsa_SOURCES = \
589  perf_crypto_rsa.c
590 perf_crypto_rsa_LDADD = \
591  libgnunetutil.la
592
593 perf_crypto_symmetric_SOURCES = \
594  perf_crypto_symmetric.c
595 perf_crypto_symmetric_LDADD = \
596  libgnunetutil.la
597
598 perf_crypto_asymmetric_SOURCES = \
599  perf_crypto_asymmetric.c
600 perf_crypto_asymmetric_LDADD = \
601  libgnunetutil.la
602
603 perf_crypto_paillier_SOURCES = \
604  perf_crypto_paillier.c
605 perf_crypto_paillier_LDADD = \
606  libgnunetutil.la \
607  -lgcrypt
608
609 perf_malloc_SOURCES = \
610  perf_malloc.c
611 perf_malloc_LDADD = \
612  libgnunetutil.la
613
614 perf_mq_SOURCES = \
615  perf_mq.c
616 perf_mq_LDADD = \
617  libgnunetutil.la
618
619 perf_scheduler_SOURCES = \
620  perf_scheduler.c
621 perf_scheduler_LDADD = \
622  libgnunetutil.la
623
624
625 EXTRA_DIST = \
626   test_client_data.conf \
627   test_client_unix.conf \
628   test_configuration_data.conf \
629   test_program_data.conf \
630   test_resolver_api_data.conf \
631   test_service_data.conf \
632   test_speedup_data.conf