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