- Allocate buffer large enough to contain UNIX_PATH_MAX size pathnames in case of...
[oweals/gnunet.git] / src / util / Makefile.am
1 AM_CPPFLAGS = -I$(top_srcdir)/src/include -I$(top_builddir)/src/include
2
3 plugindir = $(libdir)/gnunet
4
5 libexecdir= $(pkglibdir)/libexec/
6
7 pkgcfgdir= $(pkgdatadir)/config.d/
8
9 dist_pkgcfg_DATA = \
10   util.conf
11
12 pkgcfg_DATA = \
13   resolver.conf
14
15 if MINGW
16 noinst_LTLIBRARIES = \
17   libgnunetutilwin.la
18 libgnunetutilwin_la_SOURCES = \
19   win.c \
20   winproc.c
21 libgnunetutilwin_la_LDFLAGS = \
22   -no-undefined -Wl,--export-all-symbols
23 libgnunetutilwin_la_LIBADD = \
24   -lshell32 -liconv -lstdc++ \
25   -lcomdlg32 -lgdi32 -liphlpapi
26 WINLIB = libgnunetutilwin.la
27 W32CAT = w32cat
28 W32CONSOLEHELPER = gnunet-helper-w32-console
29 endif
30
31 if !MINGW
32  SERVER_CLIENT_UNIX = test_server_with_client_unix
33 endif
34
35 if USE_COVERAGE
36   AM_CFLAGS = --coverage -O0
37   XLIB = -lgcov
38 endif
39
40 w32cat_SOURCES = w32cat.c
41
42 gnunet_helper_w32_console_SOURCES = \
43   gnunet-helper-w32-console.c \
44   gnunet-helper-w32-console.h
45 gnunet_helper_w32_console_LDADD = \
46  $(top_builddir)/src/util/libgnunetutil.la
47 gnunet_helper_w32_console_DEPENDENCIES = \
48  libgnunetutil.la
49
50 noinst_PROGRAMS = \
51  gnunet-config-diff \
52  $(W32CAT) \
53  test_common_logging_dummy
54
55
56 gnunet_config_diff_SOURCES = \
57  gnunet-config-diff.c
58 gnunet_config_diff_LDADD = \
59  $(top_builddir)/src/util/libgnunetutil.la
60 gnunet_config_diff_DEPENDENCIES = \
61  libgnunetutil.la
62
63 test_common_logging_dummy_SOURCES = \
64  test_common_logging_dummy.c
65 test_common_logging_dummy_LDADD = \
66  $(top_builddir)/src/util/libgnunetutil.la
67 test_common_logging_dummy_DEPENDENCIES = \
68  libgnunetutil.la
69
70 lib_LTLIBRARIES = libgnunetutil.la
71
72 libgnunetutil_la_SOURCES = \
73   bandwidth.c \
74   bio.c \
75   client.c \
76   common_allocation.c \
77   common_endian.c \
78   common_logging.c \
79   configuration.c \
80   connection.c \
81   container_bloomfilter.c \
82   container_heap.c \
83   container_meta_data.c \
84   container_multihashmap.c \
85   container_multipeermap.c \
86   container_multihashmap32.c \
87   container_slist.c \
88   crypto_symmetric.c \
89   crypto_crc.c \
90   crypto_ecc.c \
91   crypto_hash.c \
92   crypto_hkdf.c \
93   crypto_kdf.c \
94   crypto_mpi.c \
95   crypto_paillier.c \
96   crypto_random.c \
97   disk.c \
98   disk.h \
99   getopt.c \
100   getopt_helpers.c \
101   helper.c \
102   load.c \
103   mq.c \
104   network.c \
105   os_installation.c \
106   os_network.c \
107   os_priority.c \
108   peer.c \
109   plugin.c \
110   program.c \
111   resolver_api.c resolver.h \
112   scheduler.c \
113   server.c \
114   server_mst.c \
115   server_nc.c \
116   server_tc.c \
117   service.c \
118   signal.c \
119   strings.c \
120   time.c \
121   speedup.c
122
123 libgnunetutil_la_LIBADD = \
124   $(GCLIBADD) $(WINLIB) \
125   $(LIBGCRYPT_LIBS) \
126   $(LTLIBICONV) \
127   $(LTLIBINTL) \
128   -lltdl $(Z_LIBS) -lunistring $(XLIB)
129
130 libgnunetutil_la_LDFLAGS = \
131   $(GN_LIB_LDFLAGS) \
132   -version-info 11:0:2
133
134 if HAVE_TESTING
135   GNUNET_ECC = gnunet-ecc
136   GNUNET_SCRYPT = gnunet-scrypt
137 endif
138
139
140 libexec_PROGRAMS = \
141  gnunet-service-resolver \
142  $(W32CONSOLEHELPER)
143
144 bin_SCRIPTS =\
145  gnunet-qr
146
147 bin_PROGRAMS = \
148  gnunet-resolver \
149  gnunet-config \
150  $(GNUNET_ECC) \
151  $(GNUNET_SCRYPT) \
152  gnunet-uri
153
154 do_subst = $(SED) -e 's,[@]PYTHON[@],$(PYTHON),g'
155
156 gnunet-qr: gnunet-qr.py.in Makefile
157         $(do_subst) < gnunet-qr.py.in > gnunet-qr
158         chmod +x gnunet-qr
159
160 gnunet_service_resolver_SOURCES = \
161  gnunet-service-resolver.c
162 gnunet_service_resolver_LDADD = \
163   $(top_builddir)/src/util/libgnunetutil.la \
164   $(GN_LIBINTL)
165 gnunet_service_resolver_DEPENDENCIES = \
166   libgnunetutil.la
167
168
169 gnunet_resolver_SOURCES = \
170  gnunet-resolver.c
171 gnunet_resolver_LDADD = \
172   $(top_builddir)/src/util/libgnunetutil.la \
173   $(GN_LIBINTL)
174 gnunet_resolver_DEPENDENCIES = \
175   libgnunetutil.la
176
177
178 gnunet_ecc_SOURCES = \
179  gnunet-ecc.c
180 gnunet_ecc_LDADD = \
181   $(top_builddir)/src/util/libgnunetutil.la \
182   $(GN_LIBINTL) -lgcrypt
183 gnunet_ecc_DEPENDENCIES = \
184   libgnunetutil.la
185
186 gnunet_scrypt_SOURCES = \
187  gnunet-scrypt.c
188 gnunet_scrypt_LDADD = \
189   $(top_builddir)/src/util/libgnunetutil.la \
190   $(GN_LIBINTL) -lgcrypt
191 gnunet_scrypt_DEPENDENCIES = \
192   libgnunetutil.la
193
194
195 gnunet_config_SOURCES = \
196  gnunet-config.c
197 gnunet_config_LDADD = \
198   $(top_builddir)/src/util/libgnunetutil.la \
199   $(GN_LIBINTL)
200 gnunet_config_DEPENDENCIES = \
201   libgnunetutil.la
202
203
204 gnunet_uri_SOURCES = \
205  gnunet-uri.c
206 gnunet_uri_LDADD = \
207   $(top_builddir)/src/util/libgnunetutil.la \
208   $(GN_LIBINTL)
209 gnunet_uri_DEPENDENCIES = \
210   libgnunetutil.la
211
212 plugin_LTLIBRARIES = \
213   libgnunet_plugin_test.la
214
215 libgnunet_plugin_test_la_SOURCES = \
216   test_plugin_plug.c
217 libgnunet_plugin_test_la_LDFLAGS = \
218  $(GN_PLUGIN_LDFLAGS)
219
220 if HAVE_BENCHMARKS
221  BENCHMARKS = \
222   perf_crypto_hash \
223   perf_crypto_symmetric \
224   perf_malloc
225 endif
226
227 check_PROGRAMS = \
228  test_bio \
229  test_client \
230  test_common_allocation \
231  test_common_endian \
232  test_common_logging \
233  test_configuration \
234  test_container_bloomfilter \
235  test_container_meta_data \
236  test_container_multihashmap \
237  test_container_multihashmap32 \
238  test_container_multipeermap \
239  test_container_heap \
240  test_container_slist \
241  test_crypto_symmetric \
242  test_crypto_crc \
243  test_crypto_ecdsa \
244  test_crypto_eddsa \
245  test_crypto_ecdhe \
246  test_crypto_hash \
247  test_crypto_hkdf \
248  test_crypto_paillier \
249  test_crypto_random \
250  test_disk \
251  test_getopt \
252  test_connection \
253  test_connection_addressing \
254  test_connection_receive_cancel \
255  test_connection_timeout \
256  test_connection_timeout_no_connect \
257  test_connection_transmit_cancel \
258  test_mq \
259  test_mq_client \
260  test_os_network \
261  test_peer \
262  test_plugin \
263  test_program \
264  test_resolver_api \
265  test_scheduler \
266  test_scheduler_delay \
267  test_server_mst_interrupt \
268  test_server \
269  test_server_disconnect \
270  test_server_with_client \
271  $(SERVER_CLIENT_UNIX) \
272  test_service \
273  test_strings \
274  test_strings_to_data \
275  test_time \
276  test_speedup \
277  $(BENCHMARKS) \
278  test_os_start_process \
279  test_common_logging_runtime_loglevels
280
281 if ENABLE_TEST_RUN
282 AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;
283 TESTS = $(check_PROGRAMS)
284 endif
285
286 test_bio_SOURCES = \
287  test_bio.c
288 test_bio_LDADD = \
289  $(top_builddir)/src/util/libgnunetutil.la
290
291
292 test_os_start_process_SOURCES = \
293  test_os_start_process.c
294 test_os_start_process_LDADD = \
295  $(top_builddir)/src/util/libgnunetutil.la
296 test_os_start_process_DEPENDENCIES = \
297  $(WINCAT)
298
299 test_client_SOURCES = \
300  test_client.c
301 test_client_LDADD = \
302  $(top_builddir)/src/util/libgnunetutil.la
303
304 test_common_allocation_SOURCES = \
305  test_common_allocation.c
306 test_common_allocation_LDADD = \
307  $(top_builddir)/src/util/libgnunetutil.la
308
309 test_common_endian_SOURCES = \
310  test_common_endian.c
311 test_common_endian_LDADD = \
312  $(top_builddir)/src/util/libgnunetutil.la
313
314 test_common_logging_SOURCES = \
315  test_common_logging.c
316 test_common_logging_LDADD = \
317  $(top_builddir)/src/util/libgnunetutil.la
318
319 test_common_logging_runtime_loglevels_SOURCES = \
320  test_common_logging_runtime_loglevels.c
321 test_common_logging_runtime_loglevels_LDADD = \
322  $(top_builddir)/src/util/libgnunetutil.la
323
324 test_configuration_SOURCES = \
325  test_configuration.c
326 test_configuration_LDADD = \
327  $(top_builddir)/src/util/libgnunetutil.la
328
329 test_container_bloomfilter_SOURCES = \
330  test_container_bloomfilter.c
331 test_container_bloomfilter_LDADD = \
332  $(top_builddir)/src/util/libgnunetutil.la
333
334 test_container_meta_data_SOURCES = \
335  test_container_meta_data.c
336 test_container_meta_data_LDADD = \
337  $(top_builddir)/src/util/libgnunetutil.la -lextractor
338
339 test_container_multihashmap_SOURCES = \
340  test_container_multihashmap.c
341 test_container_multihashmap_LDADD = \
342  $(top_builddir)/src/util/libgnunetutil.la
343
344 test_container_multihashmap32_SOURCES = \
345  test_container_multihashmap32.c
346 test_container_multihashmap32_LDADD = \
347  $(top_builddir)/src/util/libgnunetutil.la
348
349 test_container_multipeermap_SOURCES = \
350  test_container_multipeermap.c
351 test_container_multipeermap_LDADD = \
352  $(top_builddir)/src/util/libgnunetutil.la
353
354 test_container_heap_SOURCES = \
355  test_container_heap.c
356 test_container_heap_LDADD = \
357  $(top_builddir)/src/util/libgnunetutil.la
358
359 test_container_slist_SOURCES = \
360  test_container_slist.c
361 test_container_slist_LDADD = \
362  $(top_builddir)/src/util/libgnunetutil.la
363
364 test_crypto_symmetric_SOURCES = \
365  test_crypto_symmetric.c
366 test_crypto_symmetric_LDADD = \
367  $(top_builddir)/src/util/libgnunetutil.la
368
369 test_crypto_crc_SOURCES = \
370  test_crypto_crc.c
371 test_crypto_crc_LDADD = \
372  $(top_builddir)/src/util/libgnunetutil.la
373
374 test_crypto_ecdsa_SOURCES = \
375  test_crypto_ecdsa.c
376 test_crypto_ecdsa_LDADD = \
377  $(top_builddir)/src/util/libgnunetutil.la \
378  $(LIBGCRYPT_LIBS)
379
380 test_crypto_eddsa_SOURCES = \
381  test_crypto_eddsa.c
382 test_crypto_eddsa_LDADD = \
383  $(top_builddir)/src/util/libgnunetutil.la \
384  $(LIBGCRYPT_LIBS)
385
386 test_crypto_ecdhe_SOURCES = \
387  test_crypto_ecdhe.c
388 test_crypto_ecdhe_LDADD = \
389  $(top_builddir)/src/util/libgnunetutil.la \
390  $(LIBGCRYPT_LIBS)
391
392 test_crypto_hash_SOURCES = \
393  test_crypto_hash.c
394 test_crypto_hash_LDADD = \
395  $(top_builddir)/src/util/libgnunetutil.la
396
397 test_crypto_hkdf_SOURCES = \
398  test_crypto_hkdf.c
399 test_crypto_hkdf_LDADD = \
400  $(top_builddir)/src/util/libgnunetutil.la
401
402 test_crypto_paillier_SOURCES = \
403  test_crypto_paillier.c
404 test_crypto_paillier_LDADD = \
405  -lgcrypt \
406  $(top_builddir)/src/util/libgnunetutil.la
407
408 test_crypto_random_SOURCES = \
409  test_crypto_random.c
410 test_crypto_random_LDADD = \
411  $(top_builddir)/src/util/libgnunetutil.la
412
413 test_disk_SOURCES = \
414  test_disk.c
415 test_disk_LDADD = \
416  $(top_builddir)/src/util/libgnunetutil.la
417
418 test_getopt_SOURCES = \
419  test_getopt.c
420 test_getopt_LDADD = \
421  $(top_builddir)/src/util/libgnunetutil.la
422
423 test_connection_SOURCES = \
424  test_connection.c
425 test_connection_LDADD = \
426  $(top_builddir)/src/util/libgnunetutil.la
427
428 test_connection_addressing_SOURCES = \
429  test_connection_addressing.c
430 test_connection_addressing_LDADD = \
431  $(top_builddir)/src/util/libgnunetutil.la
432
433 test_connection_receive_cancel_SOURCES = \
434  test_connection_receive_cancel.c
435 test_connection_receive_cancel_LDADD = \
436  $(top_builddir)/src/util/libgnunetutil.la
437
438 test_connection_timeout_SOURCES = \
439  test_connection_timeout.c
440 test_connection_timeout_LDADD = \
441  $(top_builddir)/src/util/libgnunetutil.la
442
443 test_connection_timeout_no_connect_SOURCES = \
444  test_connection_timeout_no_connect.c
445 test_connection_timeout_no_connect_LDADD = \
446  $(top_builddir)/src/util/libgnunetutil.la
447
448 test_connection_transmit_cancel_SOURCES = \
449  test_connection_transmit_cancel.c
450 test_connection_transmit_cancel_LDADD = \
451  $(top_builddir)/src/util/libgnunetutil.la
452
453 test_mq_SOURCES = \
454  test_mq.c
455 test_mq_LDADD = \
456  $(top_builddir)/src/util/libgnunetutil.la
457
458 test_mq_client_SOURCES = \
459  test_mq_client.c
460 test_mq_client_LDADD = \
461  $(top_builddir)/src/util/libgnunetutil.la
462
463 test_os_network_SOURCES = \
464  test_os_network.c
465 test_os_network_LDADD = \
466  $(top_builddir)/src/util/libgnunetutil.la
467
468 test_peer_SOURCES = \
469  test_peer.c
470 test_peer_LDADD = \
471 $(top_builddir)/src/util/libgnunetutil.la -lgcrypt
472
473 test_plugin_SOURCES = \
474  test_plugin.c
475 test_plugin_LDADD = \
476  $(top_builddir)/src/util/libgnunetutil.la
477
478 test_program_SOURCES = \
479  test_program.c
480 test_program_LDADD = \
481  $(top_builddir)/src/util/libgnunetutil.la
482
483 test_resolver_api_SOURCES = \
484  test_resolver_api.c
485 test_resolver_api_LDADD = \
486   $(top_builddir)/src/util/libgnunetutil.la
487
488 test_scheduler_SOURCES = \
489  test_scheduler.c
490 test_scheduler_LDADD = \
491  $(top_builddir)/src/util/libgnunetutil.la
492
493 test_scheduler_delay_SOURCES = \
494  test_scheduler_delay.c
495 test_scheduler_delay_LDADD = \
496  $(top_builddir)/src/util/libgnunetutil.la
497
498 test_server_mst_interrupt_SOURCES = \
499  test_server_mst_interrupt.c
500 test_server_mst_interrupt_LDADD = \
501  $(top_builddir)/src/util/libgnunetutil.la
502
503 test_server_SOURCES = \
504  test_server.c
505 test_server_LDADD = \
506  $(top_builddir)/src/util/libgnunetutil.la
507
508 test_server_disconnect_SOURCES = \
509  test_server_disconnect.c
510 test_server_disconnect_LDADD = \
511  $(top_builddir)/src/util/libgnunetutil.la
512
513 test_server_with_client_SOURCES = \
514  test_server_with_client.c
515 test_server_with_client_LDADD = \
516  $(top_builddir)/src/util/libgnunetutil.la
517
518 test_server_with_client_unix_SOURCES = \
519  test_server_with_client_unix.c
520 test_server_with_client_unix_LDADD = \
521  $(top_builddir)/src/util/libgnunetutil.la
522
523
524 test_service_SOURCES = \
525  test_service.c
526 test_service_LDADD = \
527  $(top_builddir)/src/util/libgnunetutil.la
528
529 test_strings_SOURCES = \
530  test_strings.c
531 test_strings_LDADD = \
532  $(top_builddir)/src/util/libgnunetutil.la
533
534
535 test_strings_to_data_SOURCES = \
536  test_strings_to_data.c
537 test_strings_to_data_LDADD = \
538  $(top_builddir)/src/util/libgnunetutil.la
539
540
541 test_time_SOURCES = \
542  test_time.c
543 test_time_LDADD = \
544  $(top_builddir)/src/util/libgnunetutil.la
545
546 test_speedup_SOURCES = \
547  test_speedup.c
548 test_speedup_LDADD = \
549  $(top_builddir)/src/util/libgnunetutil.la
550
551 perf_crypto_hash_SOURCES = \
552  perf_crypto_hash.c
553 perf_crypto_hash_LDADD = \
554  $(top_builddir)/src/util/libgnunetutil.la
555
556 perf_crypto_symmetric_SOURCES = \
557  perf_crypto_symmetric.c
558 perf_crypto_symmetric_LDADD = \
559  $(top_builddir)/src/util/libgnunetutil.la
560
561 perf_malloc_SOURCES = \
562  perf_malloc.c
563 perf_malloc_LDADD = \
564  $(top_builddir)/src/util/libgnunetutil.la
565
566
567 EXTRA_DIST = \
568   test_configuration_data.conf \
569   test_program_data.conf \
570   test_resolver_api_data.conf \
571   test_service_data.conf \
572   test_speedup_data.conf \
573   gnunet-qr.py.in