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_plain = files('''
227 basic_sources_plain = files('''
301 parse-printf-format.c
302 parse-printf-format.h
365 missing_h = files('missing.h')
367 generate_gperfs = find_program('generate-gperfs.py')
369 #if 0 /// elogind has only the cap and errno list.
370 # generate_af_list = find_program('generate-af-list.sh')
371 # af_list_txt = custom_target(
373 # output : 'af-list.txt',
374 # command : [generate_af_list, cpp],
377 # generate_arphrd_list = find_program('generate-arphrd-list.sh')
378 # arphrd_list_txt = custom_target(
380 # output : 'arphrd-list.txt',
381 # command : [generate_arphrd_list, cpp],
385 generate_cap_list = find_program('generate-cap-list.sh')
386 cap_list_txt = custom_target(
388 output : 'cap-list.txt',
389 #if 0 /// elogind needs musl_missing.h, so generate_cap_list must know the source root
390 # command : [generate_cap_list, cpp, config_h, missing_h],
392 command : [generate_cap_list, cpp, meson.source_root(), config_h, missing_h],
396 generate_errno_list = find_program('generate-errno-list.sh')
397 errno_list_txt = custom_target(
399 output : 'errno-list.txt',
400 command : [generate_errno_list, cpp],
403 generated_gperf_headers = []
404 #if 0 /// elogind has only the cap and errno list.
405 # foreach item : [['af', af_list_txt, 'af', ''],
406 # ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'],
407 # ['cap', cap_list_txt, 'capability', ''],
408 # ['errno', errno_list_txt, 'errno', '']]
410 foreach item : [['cap', cap_list_txt, 'capability', ''],
411 ['errno', errno_list_txt, 'errno', '']]
414 fname = '@0@-from-name.gperf'.format(item[0])
415 gperf_file = custom_target(
419 command : [generate_gperfs, item[2], item[3], '@INPUT@'],
422 fname = '@0@-from-name.h'.format(item[0])
423 target1 = custom_target(
428 '-L', 'ANSI-C', '-t', '--ignore-case',
429 '-N', 'lookup_@0@'.format(item[2]),
430 '-H', 'hash_@0@_name'.format(item[2]),
435 fname = '@0@-to-name.h'.format(item[0])
436 awkscript = '@0@-to-name.awk'.format(item[0])
437 target2 = custom_target(
439 input : [awkscript, item[1]],
441 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
444 generated_gperf_headers += [target1, target2]
447 basic_sources = basic_sources_plain + [missing_h] + generated_gperf_headers
449 libbasic = static_library(
452 include_directories : includes,
453 dependencies : [threads,
455 #if 0 /// no blkid in elogind