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