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