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