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