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