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