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