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