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