Skip to content

Commit

Permalink
Initial support for meson build system
Browse files Browse the repository at this point in the history
Signed-off-by: Reagan Bohan <[email protected]>
  • Loading branch information
xbjfk committed Apr 29, 2022
1 parent 6be2cb1 commit 175d498
Show file tree
Hide file tree
Showing 22 changed files with 92 additions and 1,064 deletions.
86 changes: 0 additions & 86 deletions Makefile

This file was deleted.

58 changes: 0 additions & 58 deletions docs/Makefile

This file was deleted.

29 changes: 29 additions & 0 deletions docs/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
mans = ['efi_append_variable.3', 'efi_del_variable.3', 'efidp_make_generic.3', 'efi_get_next_variable_name.3', 'efi_get_variable.3', 'efi_get_variable_attributes.3', 'efi_get_variable_size.3', 'efi_guid_to_id_guid.3', 'efi_guid_to_name.3', 'efi_guid_to_str.3', 'efi_guid_to_symbol.3', 'efi_id_guid_to_guid.3', 'efi_name_to_guid.3', 'efi_set_variable.3', 'efi_str_to_guid.3', 'efi_symbol_to_guid.3', 'efivar.1', 'efi_variable_alloc.3', 'efi_variable_export.3', 'efi_variable_free.3', 'efi_variable_get_attributes.3', 'efi_variable_get_data.3', 'efi_variable_get_guid.3', 'efi_variable_get_name.3', 'efi_variable_import.3', 'efi_variable_realize.3', 'efi_variable_set_attributes.3', 'efi_variable_set_data.3', 'efi_variable_set_guid.3', 'efi_variable_set_name.3', 'efi_variables_supported.3', 'efi_variable_t.3']

mdocs = ['efisecdb.1.mdoc']

foreach man : mans
install_man(man)
endforeach

mandoc = find_program('mandoc', required : get_option('convert_mandocs'))

foreach mdoc : mdocs
if mandoc.found()
# Unfortunately install_man won't take target or generator output: meson bug #1550
man = custom_target(mdoc.substring(0, -5),
input : mdoc,
output : mdoc.substring(0, -5),
command : [mandoc, '-mdoc', '-Tman',
'-Ios=Linux', '@INPUT@'],
capture : true,
install : true,
install_dir : join_paths(get_option('mandir'), 'man' + mdoc[-6]))
else
# configure_file is used to remove .mdoc extension
man = configure_file(input : mdoc,
output : mdoc.substring(0, -5),
copy : true)
install_man(man)
endif
endforeach
7 changes: 7 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
project('efivar', 'c', license: 'LGPL-2.1-only', version: '38')

so_ver = '1.@0@'.format(meson.project_version())
add_project_arguments('-DLIBEFIVAR_VERSION=@0@'.format(meson.project_version()), language : 'c')

subdir('src')
subdir('docs')
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
option('convert_mandocs', type : 'feature', value : 'auto', description : 'Convert man pages in mdoc format to man format.')
166 changes: 0 additions & 166 deletions src/Makefile

This file was deleted.

9 changes: 0 additions & 9 deletions src/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,6 @@
#define PRINTF(...) __attribute__((__format__(printf, __VA_ARGS__)))
#define FLATTEN __attribute__((__flatten__))
#define PACKED __attribute__((__packed__))
#if defined(__clang__)
# define VERSION(sym, ver)
#else
# if GNUC_PREREQ(10,0)
# define VERSION(sym, ver) __attribute__ ((symver (# ver)))
# else
# define VERSION(sym, ver) __asm__(".symver " # sym "," # ver);
# endif
#endif
#define NORETURN __attribute__((__noreturn__))
#define ALIGNED(n) __attribute__((__aligned__(n)))
#define CLEANUP_FUNC(x) __attribute__((__cleanup__(x)))
Expand Down
Loading

0 comments on commit 175d498

Please sign in to comment.