1 # SPDX-License-Identifier: LGPL-2.1+
3 # Copyright © 2017 Zbigniew Jędrzejewski-Szmek
5 #if 0 /// elogind has a shorter list
6 # basic_sources = files('''
179 # socket-protocol-list.c
180 # socket-protocol-list.h
228 basic_sources = files('''
302 parse-printf-format.c
303 parse-printf-format.h
373 missing_h = files('missing.h')
375 generate_gperfs = find_program('generate-gperfs.py')
377 #if 0 /// elogind has only the cap and errno list.
378 # generate_af_list = find_program('generate-af-list.sh')
379 # af_list_txt = custom_target(
381 # output : 'af-list.txt',
382 # command : [generate_af_list, cpp],
385 # generate_arphrd_list = find_program('generate-arphrd-list.sh')
386 # arphrd_list_txt = custom_target(
388 # output : 'arphrd-list.txt',
389 # command : [generate_arphrd_list, cpp],
393 generate_cap_list = find_program('generate-cap-list.sh')
394 cap_list_txt = custom_target(
396 output : 'cap-list.txt',
397 #if 0 /// elogind needs musl_missing.h, so generate_cap_list must know the source root
398 # command : [generate_cap_list, cpp, config_h, missing_h],
400 command : [generate_cap_list, cpp, meson.source_root(), config_h, missing_h],
404 generate_errno_list = find_program('generate-errno-list.sh')
405 errno_list_txt = custom_target(
407 output : 'errno-list.txt',
408 command : [generate_errno_list, cpp],
411 generate_socket_protocol_list = find_program('generate-socket-protocol-list.sh')
412 socket_protocol_list_txt = custom_target(
413 'socket-protocol-list.txt',
414 output : 'socket-protocol-list.txt',
415 command : [generate_socket_protocol_list, cpp],
418 generated_gperf_headers = []
419 #if 0 /// elogind has only the cap and errno list.
420 # foreach item : [['af', af_list_txt, 'af', ''],
421 # ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'],
422 # ['cap', cap_list_txt, 'capability', ''],
423 # ['errno', errno_list_txt, 'errno', ''],
424 # ['socket-protocol', socket_protocol_list_txt, 'socket_protocol', 'IPPROTO_']]
426 foreach item : [['cap', cap_list_txt, 'capability', ''],
427 ['errno', errno_list_txt, 'errno', '']]
430 fname = '@0@-from-name.gperf'.format(item[0])
431 gperf_file = custom_target(
435 command : [generate_gperfs, item[2], item[3], '@INPUT@'],
438 fname = '@0@-from-name.h'.format(item[0])
439 target1 = custom_target(
444 '-L', 'ANSI-C', '-t', '--ignore-case',
445 '-N', 'lookup_@0@'.format(item[2]),
446 '-H', 'hash_@0@_name'.format(item[2]),
451 fname = '@0@-to-name.h'.format(item[0])
452 awkscript = '@0@-to-name.awk'.format(item[0])
453 target2 = custom_target(
455 input : [awkscript, item[1]],
457 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
460 generated_gperf_headers += [target1, target2]
463 basic_sources += [missing_h] + generated_gperf_headers
464 basic_gcrypt_sources = files(
468 libbasic = static_library(
471 include_directories : includes,
472 dependencies : [threads,
474 #if 0 /// no blkid in elogind
479 c_args : ['-fvisibility=default'],
482 #if 0 /// elogind does not need gcrypt
483 # # A convenience library that is separate from libbasic to avoid
484 # # unnecessary linking to libgcrypt.
485 # libbasic_gcrypt = static_library(
487 # basic_gcrypt_sources,
488 # include_directories : includes,
489 # dependencies : [libgcrypt],
490 # c_args : ['-fvisibility=default'])