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