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('''
184 # socket-protocol-list.c
185 # socket-protocol-list.h
233 basic_sources_plain = files('''
307 parse-printf-format.c
308 parse-printf-format.h
375 missing_h = files('missing.h')
377 generate_gperfs = find_program('generate-gperfs.py')
379 #if 0 /// elogind has only the cap and errno list.
380 # generate_af_list = find_program('generate-af-list.sh')
381 # af_list_txt = custom_target(
383 # output : 'af-list.txt',
384 # command : [generate_af_list, cpp],
387 # generate_arphrd_list = find_program('generate-arphrd-list.sh')
388 # arphrd_list_txt = custom_target(
390 # output : 'arphrd-list.txt',
391 # command : [generate_arphrd_list, cpp],
395 generate_cap_list = find_program('generate-cap-list.sh')
396 cap_list_txt = custom_target(
398 output : 'cap-list.txt',
399 #if 0 /// elogind needs musl_missing.h, so generate_cap_list must know the source root
400 # command : [generate_cap_list, cpp, config_h, missing_h],
402 command : [generate_cap_list, cpp, meson.source_root(), config_h, missing_h],
406 generate_errno_list = find_program('generate-errno-list.sh')
407 errno_list_txt = custom_target(
409 output : 'errno-list.txt',
410 command : [generate_errno_list, cpp],
413 generate_socket_protocol_list = find_program('generate-socket-protocol-list.sh')
414 socket_protocol_list_txt = custom_target(
415 'socket-protocol-list.txt',
416 output : 'socket-protocol-list.txt',
417 command : [generate_socket_protocol_list, cpp],
420 generated_gperf_headers = []
421 #if 0 /// elogind has only the cap and errno list.
422 # foreach item : [['af', af_list_txt, 'af', ''],
423 # ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'],
424 # ['cap', cap_list_txt, 'capability', ''],
425 # ['errno', errno_list_txt, 'errno', ''],
426 # ['socket-protocol', socket_protocol_list_txt, 'socket_protocol', 'IPPROTO_']]
428 foreach item : [['cap', cap_list_txt, 'capability', ''],
429 ['errno', errno_list_txt, 'errno', '']]
432 fname = '@0@-from-name.gperf'.format(item[0])
433 gperf_file = custom_target(
437 command : [generate_gperfs, item[2], item[3], '@INPUT@'],
440 fname = '@0@-from-name.h'.format(item[0])
441 target1 = custom_target(
446 '-L', 'ANSI-C', '-t', '--ignore-case',
447 '-N', 'lookup_@0@'.format(item[2]),
448 '-H', 'hash_@0@_name'.format(item[2]),
453 fname = '@0@-to-name.h'.format(item[0])
454 awkscript = '@0@-to-name.awk'.format(item[0])
455 target2 = custom_target(
457 input : [awkscript, item[1]],
459 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
462 generated_gperf_headers += [target1, target2]
465 basic_sources += [missing_h] + generated_gperf_headers
467 libbasic = static_library(
470 include_directories : includes,
471 dependencies : [threads,
473 #if 0 /// no blkid in elogind
478 c_args : ['-fvisibility=default'],
481 # A convenience library that is separate from libbasic to avoid
482 # unnecessary linking to libgcrypt.
483 libbasic_gcrypt = static_library(
487 include_directories : includes,
488 dependencies : [libgcrypt],
489 c_args : ['-fvisibility=default'])