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