gnunet-qr: Use the `gnunet-uri` binary installed into PREFIX.
[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-utils.h
285 gnunet_qr_LDFLAGS= $(libzbar_LIBS)
286 gnunet_qr_CFLAGS = $(libzbar_CFLAGS) -DBINDIR=\"@bindir@/\"
287
288 plugin_LTLIBRARIES = \
289   libgnunet_plugin_test.la
290
291 libgnunet_plugin_test_la_SOURCES = \
292   test_plugin_plug.c
293 libgnunet_plugin_test_la_LDFLAGS = \
294  $(GN_PLUGIN_LDFLAGS)
295
296 if HAVE_BENCHMARKS
297  BENCHMARKS = \
298   perf_crypto_hash \
299   perf_crypto_ecc_dlog \
300   perf_crypto_rsa \
301   perf_crypto_paillier \
302   perf_crypto_symmetric \
303   perf_crypto_asymmetric \
304   perf_malloc
305 endif
306
307 if HAVE_SSH_KEY
308 # SSH_USING_TESTS = test_socks.nc
309 endif
310
311 check_PROGRAMS = \
312  test_bio \
313  test_client.nc \
314  $(TEST_CLIENT_UNIX_NC) \
315  test_common_allocation \
316  test_common_endian \
317  test_common_logging \
318  test_configuration \
319  test_container_bloomfilter \
320  test_container_dll \
321  test_container_meta_data \
322  test_container_multihashmap \
323  test_container_multihashmap32 \
324  test_container_multipeermap \
325  test_container_heap \
326  test_crypto_symmetric \
327  test_crypto_crc \
328  test_crypto_ecdsa \
329  test_crypto_eddsa \
330  test_crypto_ecdhe \
331  test_crypto_ecdh_eddsa \
332  test_crypto_ecc_dlog \
333  test_crypto_hash \
334  test_crypto_hash_context \
335  test_crypto_hkdf \
336  test_crypto_kdf \
337  test_crypto_paillier \
338  test_crypto_random \
339  test_crypto_rsa \
340  test_disk \
341  test_getopt \
342  test_hexcoder \
343  test_mq \
344  test_os_network \
345  test_peer \
346  test_plugin \
347  test_program \
348  test_regex \
349  test_resolver_api.nc \
350  test_scheduler \
351  test_scheduler_delay \
352  test_service \
353  test_strings \
354  test_strings_to_data \
355  test_speedup \
356  test_time \
357  test_tun \
358  $(BENCHMARKS) \
359  test_os_start_process \
360  test_common_logging_runtime_loglevels
361
362
363 # Declare .nc (NO-CONCURRENCY) as a test extension so that we can impart
364 # sequential execution order for them
365 TEST_EXTENSIONS = .nc
366 test_test_client_unix.log: test_client.log
367
368 test_bio_SOURCES = \
369  test_bio.c
370 test_bio_LDADD = \
371  libgnunetutil.la
372
373 test_hexcoder_SOURCES = \
374  test_hexcoder.c
375 test_hexcoder_LDADD = \
376  libgnunetutil.la
377
378 test_tun_SOURCES = \
379  test_tun.c
380 test_tun_LDADD = \
381  libgnunetutil.la
382
383 test_regex_SOURCES = \
384  test_regex.c
385 test_regex_LDADD = \
386  libgnunetutil.la
387
388 test_os_start_process_SOURCES = \
389  test_os_start_process.c
390 test_os_start_process_LDADD = \
391  libgnunetutil.la
392 test_os_start_process_DEPENDENCIES = \
393  libgnunetutil.la \
394  $(WINCAT)
395
396 test_client_nc_SOURCES = \
397  test_client.c
398 test_client_nc_LDADD = \
399  libgnunetutil.la
400
401 test_client_unix_nc_SOURCES = \
402  test_client.c
403 test_client_unix_nc_LDADD = \
404  libgnunetutil.la
405
406 #test_socks_nc_SOURCES = \
407 # test_socks.c
408 #test_socks_nc_LDADD = \
409 # libgnunetutil.la
410
411 test_common_allocation_SOURCES = \
412  test_common_allocation.c
413 test_common_allocation_LDADD = \
414  libgnunetutil.la
415
416 test_common_endian_SOURCES = \
417  test_common_endian.c
418 test_common_endian_LDADD = \
419  libgnunetutil.la
420
421 test_common_logging_SOURCES = \
422  test_common_logging.c
423 test_common_logging_LDADD = \
424  libgnunetutil.la
425
426 test_common_logging_runtime_loglevels_SOURCES = \
427  test_common_logging_runtime_loglevels.c
428 test_common_logging_runtime_loglevels_LDADD = \
429  libgnunetutil.la
430
431 test_configuration_SOURCES = \
432  test_configuration.c
433 test_configuration_LDADD = \
434  libgnunetutil.la
435
436 test_container_bloomfilter_SOURCES = \
437  test_container_bloomfilter.c
438 test_container_bloomfilter_LDADD = \
439  libgnunetutil.la
440
441 test_container_dll_SOURCES = \
442  test_container_dll.c
443 test_container_dll_LDADD = \
444  libgnunetutil.la
445
446 test_container_meta_data_SOURCES = \
447  test_container_meta_data.c
448 test_container_meta_data_LDADD = \
449  libgnunetutil.la
450
451 test_container_multihashmap_SOURCES = \
452  test_container_multihashmap.c
453 test_container_multihashmap_LDADD = \
454  libgnunetutil.la
455
456 test_container_multihashmap32_SOURCES = \
457  test_container_multihashmap32.c
458 test_container_multihashmap32_LDADD = \
459  libgnunetutil.la
460
461 test_container_multipeermap_SOURCES = \
462  test_container_multipeermap.c
463 test_container_multipeermap_LDADD = \
464  libgnunetutil.la
465
466 test_container_heap_SOURCES = \
467  test_container_heap.c
468 test_container_heap_LDADD = \
469  libgnunetutil.la
470
471 test_crypto_symmetric_SOURCES = \
472  test_crypto_symmetric.c
473 test_crypto_symmetric_LDADD = \
474  libgnunetutil.la
475
476 test_crypto_crc_SOURCES = \
477  test_crypto_crc.c
478 test_crypto_crc_LDADD = \
479  libgnunetutil.la
480
481 test_crypto_ecdsa_SOURCES = \
482  test_crypto_ecdsa.c
483 test_crypto_ecdsa_LDADD = \
484  libgnunetutil.la \
485  $(LIBGCRYPT_LIBS)
486
487 test_crypto_eddsa_SOURCES = \
488  test_crypto_eddsa.c
489 test_crypto_eddsa_LDADD = \
490  libgnunetutil.la \
491  $(LIBGCRYPT_LIBS)
492
493 test_crypto_ecc_dlog_SOURCES = \
494  test_crypto_ecc_dlog.c
495 test_crypto_ecc_dlog_LDADD = \
496  libgnunetutil.la \
497  $(LIBGCRYPT_LIBS)
498
499 test_crypto_ecdhe_SOURCES = \
500  test_crypto_ecdhe.c
501 test_crypto_ecdhe_LDADD = \
502  libgnunetutil.la \
503  $(LIBGCRYPT_LIBS)
504
505 test_crypto_ecdh_eddsa_SOURCES = \
506  test_crypto_ecdh_eddsa.c
507 test_crypto_ecdh_eddsa_LDADD = \
508  libgnunetutil.la \
509  $(LIBGCRYPT_LIBS)
510
511 test_crypto_hash_SOURCES = \
512  test_crypto_hash.c
513 test_crypto_hash_LDADD = \
514  libgnunetutil.la
515
516 test_crypto_hash_context_SOURCES = \
517  test_crypto_hash_context.c
518 test_crypto_hash_context_LDADD = \
519  libgnunetutil.la
520
521 test_crypto_hkdf_SOURCES = \
522  test_crypto_hkdf.c
523 test_crypto_hkdf_LDADD = \
524  libgnunetutil.la
525
526 test_crypto_kdf_SOURCES = \
527  test_crypto_kdf.c
528 test_crypto_kdf_LDADD = \
529  libgnunetutil.la -lgcrypt
530
531 test_crypto_paillier_SOURCES = \
532  test_crypto_paillier.c
533 test_crypto_paillier_LDADD = \
534  $(LIBGCRYPT_LIBS) \
535  libgnunetutil.la
536
537 test_crypto_random_SOURCES = \
538  test_crypto_random.c
539 test_crypto_random_LDADD = \
540  libgnunetutil.la
541
542 test_crypto_rsa_SOURCES = \
543  test_crypto_rsa.c
544 test_crypto_rsa_LDADD = \
545  libgnunetutil.la -lgcrypt
546
547 test_disk_SOURCES = \
548  test_disk.c
549 test_disk_LDADD = \
550  libgnunetutil.la
551
552 test_getopt_SOURCES = \
553  test_getopt.c
554 test_getopt_LDADD = \
555  libgnunetutil.la
556
557 test_mq_SOURCES = \
558  test_mq.c
559 test_mq_LDADD = \
560  libgnunetutil.la
561
562 test_os_network_SOURCES = \
563  test_os_network.c
564 test_os_network_LDADD = \
565  libgnunetutil.la
566
567 test_peer_SOURCES = \
568  test_peer.c
569 test_peer_LDADD = \
570  libgnunetutil.la -lgcrypt
571
572 test_plugin_SOURCES = \
573  test_plugin.c
574 test_plugin_LDADD = \
575  libgnunetutil.la
576
577 test_program_SOURCES = \
578  test_program.c
579 test_program_LDADD = \
580  libgnunetutil.la
581
582 test_resolver_api_nc_SOURCES = \
583  test_resolver_api.c
584 test_resolver_api_nc_LDADD = \
585  libgnunetutil.la
586
587 test_scheduler_SOURCES = \
588  test_scheduler.c
589 test_scheduler_LDADD = \
590  libgnunetutil.la
591
592 test_scheduler_delay_SOURCES = \
593  test_scheduler_delay.c
594 test_scheduler_delay_LDADD = \
595  libgnunetutil.la
596
597 test_service_SOURCES = \
598  test_service.c
599 test_service_LDADD = \
600  libgnunetutil.la
601
602 test_strings_SOURCES = \
603  test_strings.c
604 test_strings_LDADD = \
605  libgnunetutil.la
606
607 test_strings_to_data_SOURCES = \
608  test_strings_to_data.c
609 test_strings_to_data_LDADD = \
610  libgnunetutil.la
611
612
613 test_time_SOURCES = \
614  test_time.c
615 test_time_LDADD = \
616  libgnunetutil.la
617
618 test_speedup_SOURCES = \
619  test_speedup.c
620 test_speedup_LDADD = \
621  libgnunetutil.la
622
623 perf_crypto_hash_SOURCES = \
624  perf_crypto_hash.c
625 perf_crypto_hash_LDADD = \
626  libgnunetutil.la
627
628 perf_crypto_ecc_dlog_SOURCES = \
629  perf_crypto_ecc_dlog.c
630 perf_crypto_ecc_dlog_LDADD = \
631  libgnunetutil.la \
632  -lgcrypt
633
634 perf_crypto_rsa_SOURCES = \
635  perf_crypto_rsa.c
636 perf_crypto_rsa_LDADD = \
637  libgnunetutil.la
638
639 perf_crypto_symmetric_SOURCES = \
640  perf_crypto_symmetric.c
641 perf_crypto_symmetric_LDADD = \
642  libgnunetutil.la
643
644 perf_crypto_asymmetric_SOURCES = \
645  perf_crypto_asymmetric.c
646 perf_crypto_asymmetric_LDADD = \
647  libgnunetutil.la
648
649 perf_crypto_paillier_SOURCES = \
650  perf_crypto_paillier.c
651 perf_crypto_paillier_LDADD = \
652  libgnunetutil.la \
653  -lgcrypt
654
655 perf_malloc_SOURCES = \
656  perf_malloc.c
657 perf_malloc_LDADD = \
658  libgnunetutil.la
659
660
661 EXTRA_DIST = \
662   test_client_data.conf \
663   test_client_unix.conf \
664   test_configuration_data.conf \
665   test_program_data.conf \
666   test_resolver_api_data.conf \
667   test_service_data.conf \
668 <<<<<<< HEAD
669   test_speedup_data.conf \
670   gnunet-qr.in \
671   gnunet-qr.py
672 =======
673   test_speedup_data.conf
674 >>>>>>> gnunet-qr: Add into Makefile.am and pofiles,