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('''
227 basic_sources_plain = files('''
301 parse-printf-format.c
302 parse-printf-format.h
369 missing_h = files('missing.h')
371 generate_gperfs = find_program('generate-gperfs.py')
373 #if 0 /// elogind has only the cap and errno list.
374 # generate_af_list = find_program('generate-af-list.sh')
375 # af_list_txt = custom_target(
377 # output : 'af-list.txt',
378 # command : [generate_af_list, cpp],
381 # generate_arphrd_list = find_program('generate-arphrd-list.sh')
382 # arphrd_list_txt = custom_target(
384 # output : 'arphrd-list.txt',
385 # command : [generate_arphrd_list, cpp],
389 generate_cap_list = find_program('generate-cap-list.sh')
390 cap_list_txt = custom_target(
392 output : 'cap-list.txt',
393 #if 0 /// elogind needs musl_missing.h, so generate_cap_list must know the source root
394 # command : [generate_cap_list, cpp, config_h, missing_h],
396 command : [generate_cap_list, cpp, meson.source_root(), config_h, missing_h],
400 generate_errno_list = find_program('generate-errno-list.sh')
401 errno_list_txt = custom_target(
403 output : 'errno-list.txt',
404 command : [generate_errno_list, cpp],
407 generated_gperf_headers = []
408 #if 0 /// elogind has only the cap and errno list.
409 # foreach item : [['af', af_list_txt, 'af', ''],
410 # ['arphrd', arphrd_list_txt, 'arphrd', 'ARPHRD_'],
411 # ['cap', cap_list_txt, 'capability', ''],
413 foreach item : [['cap', cap_list_txt, 'capability', ''],
414 ['errno', errno_list_txt, 'errno', '']]
417 fname = '@0@-from-name.gperf'.format(item[0])
418 gperf_file = custom_target(
422 command : [generate_gperfs, item[2], item[3], '@INPUT@'],
425 fname = '@0@-from-name.h'.format(item[0])
426 target1 = custom_target(
431 '-L', 'ANSI-C', '-t', '--ignore-case',
432 '-N', 'lookup_@0@'.format(item[2]),
433 '-H', 'hash_@0@_name'.format(item[2]),
438 fname = '@0@-to-name.h'.format(item[0])
439 awkscript = '@0@-to-name.awk'.format(item[0])
440 target2 = custom_target(
442 input : [awkscript, item[1]],
444 command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
447 generated_gperf_headers += [target1, target2]
450 basic_sources += [missing_h] + generated_gperf_headers
452 libbasic = static_library(
455 include_directories : includes,
456 dependencies : [threads,
458 #if 0 /// no blkid in elogind
462 c_args : ['-fvisibility=default'],
465 # A convenience library that is separate from libbasic to avoid
466 # unnecessary linking to libgcrypt.
467 libbasic_gcrypt = static_library(
471 include_directories : includes,
472 dependencies : [libgcrypt],
473 c_args : ['-fvisibility=default'])