1 # SPDX-License-Identifier: LGPL-2.1+
3 # Copyright 2017 Zbigniew Jędrzejewski-Szmek
5 # elogind is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU Lesser General Public License as published by
7 # the Free Software Foundation; either version 2.1 of the License, or
8 # (at your option) any later version.
10 # elogind is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public License
16 # along with elogind; If not, see <http://www.gnu.org/licenses/>.
18 #if 0 /// elogind has a shorter list
19 # basic_sources = files('''
187 # socket-protocol-list.c
188 # socket-protocol-list.h
236 basic_sources = files('''
310 parse-printf-format.c
311 parse-printf-format.h
381 missing_h = files('missing.h')
383 generate_gperfs = find_program('generate-gperfs.py')
385 #if 0 /// elogind has only the cap and errno list.
386 # generate_af_list = find_program('generate-af-list.sh')
387 # af_list_txt = custom_target(
389 # output : 'af-list.txt',
390 # command : [generate_af_list, cpp],
393 # generate_arphrd_list = find_program('generate-arphrd-list.sh')
394 # arphrd_list_txt = custom_target(
396 # output : 'arphrd-list.txt',
397 # command : [generate_arphrd_list, cpp],
401 generate_cap_list = find_program('generate-cap-list.sh')
402 cap_list_txt = custom_target(
404 output : 'cap-list.txt',
405 #if 0 /// elogind needs musl_missing.h, so generate_cap_list must know the source root
406 # command : [generate_cap_list, cpp, config_h, missing_h],
408 command : [generate_cap_list, cpp, meson.source_root(), config_h, missing_h],
412 generate_errno_list = find_program('generate-errno-list.sh')
413 errno_list_txt = custom_target(
415 output : 'errno-list.txt',
416 command : [generate_errno_list, cpp],
419 generate_socket_protocol_list = find_program('generate-socket-protocol-list.sh')
420 socket_protocol_list_txt = custom_target(
421 'socket-protocol-list.txt',
422 output : 'socket-protocol-list.txt',
423 command : [generate_socket_protocol_list, cpp],
426 generated_gperf_headers = []
427 #if 0 /// elogind has only the cap and errno list.
428 # foreach item : [['af', af_list_txt, 'af', ''],
429 # ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'],
430 # ['cap', cap_list_txt, 'capability', ''],
431 # ['errno', errno_list_txt, 'errno', ''],
432 # ['socket-protocol', socket_protocol_list_txt, 'socket_protocol', 'IPPROTO_']]
434 foreach item : [['cap', cap_list_txt, 'capability', ''],
435 ['errno', errno_list_txt, 'errno', '']]
438 fname = '@0@-from-name.gperf'.format(item[0])
439 gperf_file = custom_target(
443 command : [generate_gperfs, item[2], item[3], '@INPUT@'],
446 fname = '@0@-from-name.h'.format(item[0])
447 target1 = custom_target(
452 '-L', 'ANSI-C', '-t', '--ignore-case',
453 '-N', 'lookup_@0@'.format(item[2]),
454 '-H', 'hash_@0@_name'.format(item[2]),
459 fname = '@0@-to-name.h'.format(item[0])
460 awkscript = '@0@-to-name.awk'.format(item[0])
461 target2 = custom_target(
463 input : [awkscript, item[1]],
465 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
468 generated_gperf_headers += [target1, target2]
471 basic_sources += [missing_h] + generated_gperf_headers
473 libbasic = static_library(
476 include_directories : includes,
477 dependencies : [threads,
479 #if 0 /// no blkid in elogind
484 c_args : ['-fvisibility=default'],
487 #if 0 /// elogind does not need gcrypt
488 # # A convenience library that is separate from libbasic to avoid
489 # # unnecessary linking to libgcrypt.
490 # libbasic_gcrypt = static_library(
494 # include_directories : includes,
495 # dependencies : [libgcrypt],
496 # c_args : ['-fvisibility=default'])