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