2018-05-14 13:15:52 +00:00
|
|
|
project('libfprint', [ 'c', 'cpp' ],
|
2019-06-13 13:00:25 +00:00
|
|
|
version: '1.90.0',
|
2018-05-14 13:15:52 +00:00
|
|
|
license: 'LGPLv2.1+',
|
|
|
|
default_options: [
|
|
|
|
'buildtype=debugoptimized',
|
|
|
|
'warning_level=1',
|
|
|
|
'c_std=c99',
|
|
|
|
],
|
|
|
|
meson_version: '>= 0.45.0')
|
|
|
|
|
2019-07-03 21:29:05 +00:00
|
|
|
gnome = import('gnome')
|
|
|
|
|
2018-05-14 13:15:52 +00:00
|
|
|
add_project_arguments([ '-D_GNU_SOURCE' ], language: 'c')
|
2018-05-23 15:48:55 +00:00
|
|
|
add_project_arguments([ '-DG_LOG_DOMAIN="libfprint"' ], language: 'c')
|
2018-05-14 13:15:52 +00:00
|
|
|
|
|
|
|
libfprint_conf = configuration_data()
|
|
|
|
|
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
cpp = meson.get_compiler('cpp')
|
|
|
|
host_system = host_machine.system()
|
|
|
|
|
|
|
|
common_cflags = cc.get_supported_arguments([
|
|
|
|
'-fgnu89-inline',
|
|
|
|
'-std=gnu99',
|
|
|
|
'-Wall',
|
|
|
|
'-Wundef',
|
|
|
|
'-Wunused',
|
|
|
|
'-Wstrict-prototypes',
|
|
|
|
'-Werror-implicit-function-declaration',
|
|
|
|
'-Wno-pointer-sign',
|
2019-06-13 11:54:48 +00:00
|
|
|
'-Wshadow',
|
|
|
|
'-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_50',
|
|
|
|
'-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_50',
|
2018-05-14 13:15:52 +00:00
|
|
|
])
|
|
|
|
|
|
|
|
# maintaining compatibility with the previous libtool versioning
|
|
|
|
# current = binary - interface
|
|
|
|
# revision = interface
|
2019-06-13 13:00:25 +00:00
|
|
|
soversion = 2
|
2018-05-14 13:15:52 +00:00
|
|
|
current = 0
|
|
|
|
revision = 0
|
|
|
|
libversion = '@0@.@1@.@2@'.format(soversion, current, revision)
|
|
|
|
|
|
|
|
# Dependencies
|
2019-06-13 11:54:48 +00:00
|
|
|
glib_dep = dependency('glib-2.0', version: '>= 2.50')
|
2019-07-03 21:29:05 +00:00
|
|
|
gio_dep = dependency('gio-unix-2.0', version: '>= 2.44.0')
|
2019-06-13 12:57:56 +00:00
|
|
|
gusb_dep = dependency('gusb', version: '>= 0.3.0')
|
2018-05-14 13:15:52 +00:00
|
|
|
mathlib_dep = cc.find_library('m', required: false)
|
|
|
|
|
|
|
|
# Drivers
|
|
|
|
drivers = get_option('drivers').split(',')
|
2019-07-03 21:31:18 +00:00
|
|
|
virtual_drivers = [ 'virtual_image' ]
|
2019-07-01 15:28:48 +00:00
|
|
|
#default_drivers = [ 'upekts', 'upektc', 'upeksonly', 'vcom5s', 'uru4000', 'aes1610', 'aes1660', 'aes2501', 'aes2550', 'aes2660', 'aes3500', 'aes4000', 'vfs101', 'vfs301', 'vfs5011', 'upektc_img', 'etes603', 'vfs0050', 'elan' ]
|
|
|
|
default_drivers = [ ]
|
2018-05-14 13:15:52 +00:00
|
|
|
|
2019-06-13 13:24:51 +00:00
|
|
|
all_drivers = default_drivers + virtual_drivers
|
|
|
|
|
2018-05-14 13:15:52 +00:00
|
|
|
if drivers == [ 'all' ]
|
|
|
|
drivers = all_drivers
|
|
|
|
endif
|
|
|
|
|
2019-06-13 13:24:51 +00:00
|
|
|
if drivers == [ 'default' ]
|
|
|
|
drivers = default_drivers
|
|
|
|
endif
|
|
|
|
|
2018-10-11 12:28:04 +00:00
|
|
|
if drivers.length() == 0 or drivers[0] == ''
|
|
|
|
error('Cannot build libfprint without drivers, please specify a valid value for the drivers option')
|
|
|
|
endif
|
|
|
|
|
2018-09-28 13:59:45 +00:00
|
|
|
nss_dep = dependency('', required: false)
|
|
|
|
imaging_dep = dependency('', required: false)
|
2019-07-03 21:29:05 +00:00
|
|
|
libfprint_conf.set10('HAVE_PIXMAN', false)
|
2018-05-14 13:15:52 +00:00
|
|
|
foreach driver: drivers
|
|
|
|
if driver == 'uru4000'
|
|
|
|
nss_dep = dependency('nss', required: false)
|
|
|
|
if not nss_dep.found()
|
|
|
|
error('NSS is required for the URU4000/URU4500 driver')
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
if driver == 'aes3500' or driver == 'aes4000'
|
|
|
|
imaging_dep = dependency('pixman-1', required: false)
|
|
|
|
if not imaging_dep.found()
|
|
|
|
error('pixman is required for imaging support')
|
|
|
|
endif
|
2019-07-03 21:29:05 +00:00
|
|
|
|
|
|
|
libfprint_conf.set10('HAVE_PIXMAN', true)
|
2018-05-14 13:15:52 +00:00
|
|
|
endif
|
|
|
|
if not all_drivers.contains(driver)
|
|
|
|
error('Invalid driver \'' + driver + '\'')
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
2019-07-03 21:29:05 +00:00
|
|
|
# Export the drivers' types to the core code
|
|
|
|
drivers_type_list = '#include <glib-object.h>\n'
|
|
|
|
drivers_type_func = 'void fpi_get_driver_types(GArray *drivers)\n{\n\tGType t;\n'
|
2018-05-24 10:16:18 +00:00
|
|
|
foreach driver: drivers
|
2019-07-03 21:29:05 +00:00
|
|
|
drivers_type_list += 'extern GType (fpi_device_' + driver + '_get_type) (void);\n'
|
|
|
|
drivers_type_func += ' t = fpi_device_' + driver + '_get_type(); g_array_append_val (drivers, t);\n'
|
2018-05-24 10:16:18 +00:00
|
|
|
endforeach
|
2019-07-03 21:29:05 +00:00
|
|
|
drivers_type_list += ''
|
|
|
|
drivers_type_func += '};'
|
2018-05-14 13:15:52 +00:00
|
|
|
|
|
|
|
root_inc = include_directories('.')
|
|
|
|
|
|
|
|
if get_option('udev_rules')
|
|
|
|
udev_rules_dir = get_option('udev_rules_dir')
|
|
|
|
|
|
|
|
if udev_rules_dir == 'auto'
|
|
|
|
udev_dep = dependency('udev')
|
2018-06-12 14:03:34 +00:00
|
|
|
udev_rules_dir = udev_dep.get_pkgconfig_variable('udevdir') + '/rules.d'
|
2018-05-14 13:15:52 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2019-07-03 21:47:35 +00:00
|
|
|
# if get_option('x11-examples')
|
|
|
|
# x11_dep = cc.find_library('X11')
|
|
|
|
# xv_dep = dependency('xv', required: false)
|
|
|
|
# if not xv_dep.found()
|
|
|
|
# error('XV is required for X11 examples')
|
|
|
|
# endif
|
|
|
|
# endif
|
2018-05-14 13:15:52 +00:00
|
|
|
|
2018-10-08 14:33:04 +00:00
|
|
|
if get_option('gtk-examples')
|
|
|
|
gnome = import('gnome')
|
|
|
|
|
|
|
|
gtk_dep = dependency('gtk+-3.0', required: false)
|
|
|
|
if not gtk_dep.found()
|
|
|
|
error('GTK+ 3.x is required for GTK+ examples')
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2018-05-14 13:15:52 +00:00
|
|
|
configure_file(output: 'config.h', configuration: libfprint_conf)
|
|
|
|
|
|
|
|
subdir('libfprint')
|
|
|
|
subdir('examples')
|
2018-05-17 00:58:59 +00:00
|
|
|
if get_option('doc')
|
|
|
|
gnome = import('gnome')
|
|
|
|
subdir('doc')
|
|
|
|
endif
|
2018-10-08 14:33:04 +00:00
|
|
|
if get_option('gtk-examples')
|
|
|
|
subdir('demo')
|
|
|
|
endif
|
2018-05-14 13:15:52 +00:00
|
|
|
|
2019-07-03 21:39:08 +00:00
|
|
|
# The tests require introspeciton support to run
|
|
|
|
if get_option('introspection')
|
|
|
|
subdir('tests')
|
|
|
|
endif
|
|
|
|
|
2018-05-14 13:15:52 +00:00
|
|
|
pkgconfig = import('pkgconfig')
|
|
|
|
pkgconfig.generate(
|
|
|
|
name: 'libfprint',
|
|
|
|
description: 'Generic C API for fingerprint reader access',
|
|
|
|
version: meson.project_version(),
|
|
|
|
libraries: libfprint,
|
|
|
|
subdirs: 'libfprint',
|
2019-06-13 13:00:25 +00:00
|
|
|
filebase: 'libfprint2',
|
2018-05-14 13:15:52 +00:00
|
|
|
install_dir: join_paths(get_option('libdir'), 'pkgconfig'),
|
|
|
|
)
|