Files
test-repo/meson.build
Alexis Engelke c050b34ff9 instrs: Add support for undocumented instructions
Undocumented instruction are not decoded by default.

- SALC: undocumented in any recent manual and unsupported by newer
  Intel CPUs. Including as listed by [1,2].
- Undocumented FPU instructions: see [2].

[1]: http://www.rcollins.org/secrets/opcodes/SALC.html
[2]: https://github.com/xoreaxeaxeax/sandsifter/issues/33
2021-01-10 15:04:37 +01:00

71 lines
2.5 KiB
Meson

project('fadec', ['c'], default_options: ['warning_level=3', 'c_std=c99'],
meson_version: '>=0.40')
python3 = find_program('python3')
# Check Python version
py_version_res = run_command(python3, ['--version'])
py_version = py_version_res.stdout().split(' ')[1]
if py_version_res.returncode() != 0 or not py_version.version_compare('>=3.6')
error('Python 3.6 required, got @0@'.format(py_version))
endif
if get_option('warning_level').to_int() >= 3
extra_warnings = [
'-Wmissing-prototypes', '-Wshadow', '-Wwrite-strings', '-Wswitch-default',
'-Winline', '-Wstrict-prototypes', '-Wundef',
# We have strings longer than 4095 characters
'-Wno-overlength-strings',
# GCC 8 requires an extra option for strict cast alignment checks, Clang
# always warns, even on architectures without alignment requirements.
'-Wcast-align', '-Wcast-align=strict',
]
cc = meson.get_compiler('c')
foreach warning : extra_warnings
if cc.has_argument(warning)
add_project_arguments(warning, language: 'c')
endif
endforeach
endif
generate_args = []
if get_option('archmode') != 'only64'
generate_args += ['--32']
endif
if get_option('archmode') != 'only32'
generate_args += ['--64']
endif
if get_option('with_undoc')
generate_args += ['--with-undoc']
endif
instr_data = custom_target('tables',
command: [python3, '@INPUT0@', '@INPUT1@', '@OUTPUT@'] + generate_args,
input: files('parseinstrs.py', 'instrs.txt'),
output: [
'fadec-mnems.inc', 'fadec-table.inc',
'fadec-enc-mnems.inc', 'fadec-enc-cases.inc',
],
install: true,
install_dir: [
get_option('includedir'), false,
get_option('includedir'), false,
])
libfadec = static_library('fadec', 'decode.c', 'encode.c', 'format.c', instr_data,
install: true)
fadec = declare_dependency(link_with: libfadec,
include_directories: include_directories('.'),
sources: instr_data)
subdir('tests')
install_headers('fadec.h', 'fadec-enc.h')
pkg = import('pkgconfig')
pkg.generate(libraries: libfadec,
version: '0.1',
name: 'fadec',
filebase: 'fadec',
description: 'Fast Decoder for x86-32 and x86-64')