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