Commit dac153d2 authored by Bastien Nocera's avatar Bastien Nocera

build: Port to meson

And remove the autotools. Faster, cleaner.

https://bugs.freedesktop.org/show_bug.cgi?id=106514
parent 3661d146
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = THANKS TODO HACKING libfprint.pc.in
DISTCLEANFILES = ChangeLog libfprint.pc
SUBDIRS = libfprint doc
if BUILD_EXAMPLES
SUBDIRS += examples
endif
DIST_SUBDIRS = libfprint doc examples
DISTCHECK_CONFIGURE_FLAGS = --with-drivers=all --enable-examples-build --enable-x11-examples-build --with-udev-rules-dir='$${libdir}/udev/rules.d-distcheck'
pkgconfigdir=$(libdir)/pkgconfig
pkgconfig_DATA=libfprint.pc
.PHONY: ChangeLog dist-up
ChangeLog:
git --git-dir $(top_srcdir)/.git log > ChangeLog || touch ChangeLog
dist-hook: ChangeLog
dist-up: dist
rsync $(distdir).tar.bz2 frs.sourceforge.net:uploads/
#!/bin/sh
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
olddir="`pwd`"
cd "$srcdir"
libtoolize --copy --force || exit 1
aclocal || exit 1
autoheader || exit 1
autoconf || exit 1
automake -a -c || exit 1
cd "$olddir"
if test -z "$NOCONFIGURE"; then
$srcdir/configure --enable-maintainer-mode --enable-examples-build \
--enable-x11-examples-build --enable-debug-log $*
fi
This diff is collapsed.
EXTRA_DIST = doxygen.cfg
docs: doxygen.cfg
doxygen $^
docs-upload: docs
ln -s html api
ncftpput -f ~/.ncftp/reactivated -m -R httpdocs/fprint api/
rm -f api
......@@ -477,7 +477,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = ../libfprint
INPUT = "@SRCDIR@"
# This tag can be used to specify the character encoding of the source files that
# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default
......@@ -672,7 +672,7 @@ GENERATE_HTML = YES
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `html' will be used as the default path.
HTML_OUTPUT = html
HTML_OUTPUT = "@BUILDDIR@/html"
# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
......
cdata = configuration_data()
cdata.set('SRCDIR', join_paths(meson.source_root(), 'libfprint'))
cdata.set('BUILDDIR', join_paths(meson.build_root(), 'doc'))
cfg = configure_file(input: 'doxygen.cfg.in',
output: 'doxygen.cfg',
configuration: cdata,
install: false)
doxygen = find_program('doxygen')
datadir = join_paths(get_option('datadir'), 'doc', 'libfprint-devel')
custom_target('docs',
input: cfg,
output: 'html',
command: [ doxygen, '@INPUT@' ],
install: true,
install_dir: datadir)
AM_CFLAGS = -I$(top_srcdir)
noinst_PROGRAMS = verify_live enroll verify img_capture cpp-test
verify_live_SOURCES = verify_live.c
verify_live_LDADD = ../libfprint/libfprint.la
enroll_SOURCES = enroll.c
enroll_LDADD = ../libfprint/libfprint.la
verify_SOURCES = verify.c
verify_LDADD = ../libfprint/libfprint.la
img_capture_SOURCES = img_capture.c
img_capture_LDADD = ../libfprint/libfprint.la
cpp_test_SOURCES = cpp-test.cpp
cpp_test_LDADD = ../libfprint/libfprint.la
if BUILD_X11_EXAMPLES
noinst_PROGRAMS += img_capture_continuous
img_capture_continuous_CFLAGS = $(X_CFLAGS) $(XV_CFLAGS)
img_capture_continuous_SOURCES = img_capture_continuous.c
img_capture_continuous_LDADD = ../libfprint/libfprint.la $(X_LIBS) $(X_PRE_LIBS) $(XV_LIBS) -lX11 $(X_EXTRA_LIBS);
endif
examples = [ 'verify_live', 'enroll', 'verify', 'img_capture' ]
foreach example: examples
executable(example,
example + '.c',
dependencies: libfprint_dep,
include_directories: [
root_inc,
],
c_args: common_cflags)
endforeach
executable('cpp-test',
'cpp-test.cpp',
dependencies: libfprint_dep,
include_directories: [
root_inc,
],
c_args: common_cflags)
if get_option('x11-examples')
executable('img_capture_continuous',
'img_capture_continuous.c',
dependencies: [ libfprint_dep, xv_dep, x11_dep ],
include_directories: [
root_inc,
],
c_args: common_cflags)
endif
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: libfprint
Description: Generic C API for fingerprint reader access
Version: @VERSION@
Libs: -L${libdir} -lfprint
Cflags: -I${includedir}/libfprint
lib_LTLIBRARIES = libfprint.la
noinst_PROGRAMS = fprint-list-udev-rules
MOSTLYCLEANFILES = $(udev_rules_DATA)
UPEKTS_SRC = drivers/upekts.c
UPEKTC_SRC = drivers/upektc.c drivers/upektc.h
UPEKSONLY_SRC = drivers/upeksonly.c drivers/upeksonly.h
URU4000_SRC = drivers/uru4000.c
AES1610_SRC = drivers/aes1610.c
AES1660_SRC = drivers/aes1660.c drivers/aes1660.h
AES2501_SRC = drivers/aes2501.c drivers/aes2501.h
AES2550_SRC = drivers/aes2550.c drivers/aes2550.h
AES2660_SRC = drivers/aes2660.c drivers/aes2660.h
AES3500_SRC = drivers/aes3500.c
AES4000_SRC = drivers/aes4000.c
FDU2000_SRC = drivers/fdu2000.c
VCOM5S_SRC = drivers/vcom5s.c
VFS101_SRC = drivers/vfs101.c
VFS301_SRC = drivers/vfs301.c drivers/vfs301_proto.c drivers/vfs301_proto.h drivers/vfs301_proto_fragments.h
VFS5011_SRC = drivers/vfs5011.c drivers/vfs5011_proto.h
UPEKTC_IMG_SRC = drivers/upektc_img.c drivers/upektc_img.h
ETES603_SRC = drivers/etes603.c
VFS0050_SRC = drivers/vfs0050.c drivers/vfs0050.h
ELAN_SRC = drivers/elan.c drivers/elan.h
EXTRA_DIST = \
$(UPEKTS_SRC) \
$(UPEKTC_SRC) \
$(UPEKSONLY_SRC) \
$(URU4000_SRC) \
$(AES1610_SRC) \
$(AES1660_SRC) \
$(AES2501_SRC) \
$(AES2550_SRC) \
$(AES2660_SRC) \
$(AES3500_SRC) \
$(AES4000_SRC) \
$(FDU2000_SRC) \
$(VCOM5S_SRC) \
$(VFS101_SRC) \
$(VFS301_SRC) \
$(VFS5011_SRC) \
$(UPEKTC_IMG_SRC) \
$(ETES603_SRC) \
$(VFS0050_SRC) \
$(ELAN_SRC) \
drivers/aesx660.c \
drivers/aesx660.h \
drivers/aes3k.c \
drivers/aes3k.h \
drivers/driver_ids.h \
aeslib.c aeslib.h \
assembling.c \
assembling.h \
pixman.c \
60-fprint-autosuspend.rules
DRIVER_SRC =
OTHER_SRC =
NBIS_SRC = \
nbis/include/bozorth.h \
nbis/include/bz_array.h \
nbis/include/defs.h \
nbis/include/lfs.h \
nbis/include/log.h \
nbis/include/morph.h \
nbis/include/sunrast.h \
nbis/bozorth3/bozorth3.c \
nbis/bozorth3/bz_alloc.c \
nbis/bozorth3/bz_drvrs.c \
nbis/bozorth3/bz_gbls.c \
nbis/bozorth3/bz_io.c \
nbis/bozorth3/bz_sort.c \
nbis/mindtct/binar.c \
nbis/mindtct/block.c \
nbis/mindtct/contour.c \
nbis/mindtct/detect.c \
nbis/mindtct/dft.c \
nbis/mindtct/free.c \
nbis/mindtct/globals.c \
nbis/mindtct/imgutil.c \
nbis/mindtct/init.c \
nbis/mindtct/line.c \
nbis/mindtct/log.c \
nbis/mindtct/loop.c \
nbis/mindtct/maps.c \
nbis/mindtct/matchpat.c \
nbis/mindtct/minutia.c \
nbis/mindtct/morph.c \
nbis/mindtct/quality.c \
nbis/mindtct/remove.c \
nbis/mindtct/ridges.c \
nbis/mindtct/shape.c \
nbis/mindtct/sort.c \
nbis/mindtct/util.c
libfprint_la_CFLAGS = -fvisibility=hidden -I$(srcdir)/nbis/include $(LIBUSB_CFLAGS) $(GLIB_CFLAGS) $(CRYPTO_CFLAGS) $(AM_CFLAGS)
libfprint_la_LDFLAGS = -version-info @lt_major@:@lt_revision@:@lt_age@
libfprint_la_LIBADD = -lm $(LIBUSB_LIBS) $(GLIB_LIBS) $(CRYPTO_LIBS)
fprint_list_udev_rules_SOURCES = fprint-list-udev-rules.c
fprint_list_udev_rules_CFLAGS = -fvisibility=hidden -I$(srcdir)/nbis/include $(LIBUSB_CFLAGS) $(GLIB_CFLAGS) $(CRYPTO_CFLAGS) $(AM_CFLAGS)
fprint_list_udev_rules_LDADD = $(builddir)/libfprint.la $(GLIB_LIBS)
udev_rules_DATA = 60-fprint-autosuspend.rules
if ENABLE_UDEV_RULES
$(udev_rules_DATA): fprint-list-udev-rules
$(builddir)/fprint-list-udev-rules > $@
endif
if ENABLE_UPEKTS
DRIVER_SRC += $(UPEKTS_SRC)
endif
if ENABLE_UPEKSONLY
DRIVER_SRC += $(UPEKSONLY_SRC)
endif
if ENABLE_UPEKTC
DRIVER_SRC += $(UPEKTC_SRC)
endif
if ENABLE_URU4000
DRIVER_SRC += $(URU4000_SRC)
endif
if ENABLE_VCOM5S
DRIVER_SRC += $(VCOM5S_SRC)
endif
#if ENABLE_FDU2000
#DRIVER_SRC += $(FDU2000_SRC)
#endif
if ENABLE_AES1610
DRIVER_SRC += $(AES1610_SRC)
endif
if ENABLE_AES1660
DRIVER_SRC += $(AES1660_SRC)
endif
if ENABLE_AES2501
DRIVER_SRC += $(AES2501_SRC)
endif
if ENABLE_AES2550
DRIVER_SRC += $(AES2550_SRC)
endif
if ENABLE_AES2660
DRIVER_SRC += $(AES2660_SRC)
endif
if ENABLE_AES3500
DRIVER_SRC += $(AES3500_SRC)
endif
if ENABLE_AES4000
DRIVER_SRC += $(AES4000_SRC)
endif
if ENABLE_VFS101
DRIVER_SRC += $(VFS101_SRC)
endif
if ENABLE_VFS301
DRIVER_SRC += $(VFS301_SRC)
endif
if ENABLE_VFS5011
DRIVER_SRC += $(VFS5011_SRC)
endif
if ENABLE_UPEKTC_IMG
DRIVER_SRC += $(UPEKTC_IMG_SRC)
endif
if ENABLE_ETES603
DRIVER_SRC += $(ETES603_SRC)
endif
if ENABLE_VFS0050
DRIVER_SRC += $(VFS0050_SRC)
endif
if ENABLE_ELAN
DRIVER_SRC += $(ELAN_SRC)
endif
if REQUIRE_PIXMAN
OTHER_SRC += pixman.c
libfprint_la_CFLAGS += $(IMAGING_CFLAGS)
libfprint_la_LIBADD += $(IMAGING_LIBS)
endif
if REQUIRE_AESLIB
OTHER_SRC += aeslib.c aeslib.h
endif
if REQUIRE_AESX660
OTHER_SRC += drivers/aesx660.c drivers/aesx660.h
endif
if REQUIRE_AES3K
OTHER_SRC += drivers/aes3k.c drivers/aes3k.h
endif
libfprint_la_SOURCES = \
fp_internal.h \
async.c \
core.c \
data.c \
drv.c \
img.c \
imgdev.c \
poll.c \
sync.c \
assembling.c \
assembling.h \
$(DRIVER_SRC) \
$(OTHER_SRC) \
$(NBIS_SRC)
pkginclude_HEADERS = fprint.h
libfprint_sources = [
'fp_internal.h',
'async.c',
'core.c',
'data.c',
'drv.c',
'img.c',
'imgdev.c',
'poll.c',
'sync.c',
'assembling.c',
'assembling.h',
'drivers/driver_ids.h',
]
nbis_sources = [
'nbis/include/bozorth.h',
'nbis/include/bz_array.h',
'nbis/include/defs.h',
'nbis/include/lfs.h',
'nbis/include/log.h',
'nbis/include/morph.h',
'nbis/include/sunrast.h',
'nbis/bozorth3/bozorth3.c',
'nbis/bozorth3/bz_alloc.c',
'nbis/bozorth3/bz_drvrs.c',
'nbis/bozorth3/bz_gbls.c',
'nbis/bozorth3/bz_io.c',
'nbis/bozorth3/bz_sort.c',
'nbis/mindtct/binar.c',
'nbis/mindtct/block.c',
'nbis/mindtct/contour.c',
'nbis/mindtct/detect.c',
'nbis/mindtct/dft.c',
'nbis/mindtct/free.c',
'nbis/mindtct/globals.c',
'nbis/mindtct/imgutil.c',
'nbis/mindtct/init.c',
'nbis/mindtct/line.c',
'nbis/mindtct/log.c',
'nbis/mindtct/loop.c',
'nbis/mindtct/maps.c',
'nbis/mindtct/matchpat.c',
'nbis/mindtct/minutia.c',
'nbis/mindtct/morph.c',
'nbis/mindtct/quality.c',
'nbis/mindtct/remove.c',
'nbis/mindtct/ridges.c',
'nbis/mindtct/shape.c',
'nbis/mindtct/sort.c',
'nbis/mindtct/util.c',
]
aeslib = false
aesx660 = false
aes3k = false
drivers_sources = []
drivers_cflags = []
foreach driver: drivers
if driver == 'upekts'
drivers_sources += [ 'drivers/upekts.c' ]
endif
if driver == 'upektc'
drivers_sources += [ 'drivers/upektc.c', 'drivers/upektc.h' ]
endif
if driver == 'upeksonly'
drivers_sources += [ 'drivers/upeksonly.c', 'drivers/upeksonly.h' ]
endif
if driver == 'uru4000'
drivers_sources += [ 'drivers/uru4000.c' ]
endif
if driver == 'aes1610'
drivers_sources += [ 'drivers/aes1610.c' ]
aeslib = true
endif
if driver == 'aes1660'
drivers_sources += [ 'drivers/aes1660.c', 'drivers/aes1660.h' ]
aeslib = true
aesx660 = true
endif
if driver == 'aes2501'
drivers_sources += [ 'drivers/aes2501.c', 'drivers/aes2501.h' ]
aeslib = true
endif
if driver == 'aes2550'
drivers_sources += [ 'drivers/aes2550.c', 'drivers/aes2550.h' ]
aeslib = true
endif
if driver == 'aes2660'
drivers_sources += [ 'drivers/aes2660.c', 'drivers/aes2660.h' ]
aeslib = true
aesx660 = true
endif
if driver == 'aes3500'
drivers_sources += [ 'drivers/aes3500.c' ]
aeslib = true
aes3k = true
endif
if driver == 'aes4000'
drivers_sources += [ 'drivers/aes4000.c' ]
aeslib = true
aes3k = true
endif
if driver == 'fdu2000'
drivers_sources += [ 'drivers/fdu2000.c' ]
endif
if driver == 'vcom5s'
drivers_sources += [ 'drivers/vcom5s.c' ]
endif
if driver == 'vfs101'
drivers_sources += [ 'drivers/vfs101.c' ]
endif
if driver == 'vfs301'
drivers_sources += [ 'drivers/vfs301.c', 'drivers/vfs301_proto.c', 'drivers/vfs301_proto.h', 'drivers/vfs301_proto_fragments.h' ]
endif
if driver == 'vfs5011'
drivers_sources += [ 'drivers/vfs5011.c', 'drivers/vfs5011_proto.h' ]
endif
if driver == 'upektc_img'
drivers_sources += [ 'drivers/upektc_img.c', 'drivers/upektc_img.h' ]
endif
if driver == 'etes603'
drivers_sources += [ 'drivers/etes603.c' ]
endif
if driver == 'vfs0050'
drivers_sources += [ 'drivers/vfs0050.c', 'drivers/vfs0050.h' ]
endif
if driver == 'elan'
drivers_sources += [ 'drivers/elan.c', 'drivers/elan.h' ]
endif
drivers_cflags += [ '-DENABLE_' + driver.to_upper() + '=1' ]
endforeach
if aeslib
drivers_sources += [ 'aeslib.c', 'aeslib.h' ]
endif
if aesx660
drivers_sources += ['drivers/aesx660.c', 'drivers/aesx660.h' ]
endif
if aes3k
drivers_sources += ['drivers/aes3k.c', 'drivers/aes3k.h' ]
endif
other_sources = []
if imaging_dep.found()
other_sources += [ 'pixman.c' ]
endif
deps = [ mathlib_dep, glib_dep, libusb_dep, nss_dep, imaging_dep ]
libfprint = library('fprint',
libfprint_sources + drivers_sources + nbis_sources + other_sources,
soversion: soversion,
version: libversion,
c_args: common_cflags + drivers_cflags,
include_directories: [
root_inc,
include_directories('nbis/include'),
],
dependencies: deps,
install: true)
libfprint_dep = declare_dependency(link_with: libfprint,
include_directories: root_inc)
install_headers(['fprint.h'])
udev_rules = executable('fprint-list-udev-rules',
'fprint-list-udev-rules.c',
include_directories: [
root_inc,
],
dependencies: [ deps, libfprint_dep ],
install: false)
if get_option('udev_rules')
custom_target('udev-rules',
output: '60-fprint-autosuspend.rules',
capture: true,
command: [ udev_rules ],
install: true,
install_dir: udev_rules_dir)
endif
# MOSTLYCLEANFILES = $(udev_rules_DATA)
# EXTRA_DIST = \
# 60-fprint-autosuspend.rules
# udev_rules_DATA = 60-fprint-autosuspend.rules
# if ENABLE_UDEV_RULES
# $(udev_rules_DATA): fprint-list-udev-rules
# $(builddir)/fprint-list-udev-rules > $@
#endif
project('libfprint', [ 'c', 'cpp' ],
version: '0.7.0',
license: 'LGPLv2.1+',
default_options: [
'buildtype=debugoptimized',
'warning_level=1',
'c_std=c99',
],
meson_version: '>= 0.45.0')
add_project_arguments([ '-D_GNU_SOURCE' ], language: 'c')
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',
'-fvisibility=hidden',
'-std=gnu99',
'-Wall',
'-Wundef',
'-Wunused',
'-Wstrict-prototypes',
'-Werror-implicit-function-declaration',
'-Wno-pointer-sign',
'-Wshadow'
])
# maintaining compatibility with the previous libtool versioning
# current = binary - interface
# revision = interface
soversion = 0
current = 0
revision = 0
libversion = '@0@.@1@.@2@'.format(soversion, current, revision)
# Dependencies
glib_dep = dependency('glib-2.0', version: '>= 2.28')
libusb_dep = dependency('libusb-1.0', version: '>= 0.9.1')
mathlib_dep = cc.find_library('m', required: false)
# Drivers
drivers = get_option('drivers').split(',')
all_drivers = [ 'upekts', 'upektc', 'upeksonly', 'vcom5s', 'uru4000', 'aes1610', 'aes1660', 'aes2501', 'aes2550', 'aes2660', 'aes3500', 'aes4000', 'vfs101', 'vfs301', 'vfs5011', 'upektc_img', 'etes603', 'vfs0050', 'elan' ]
if drivers == [ 'all' ]
drivers = all_drivers
endif
nss_dep = []
imaging_dep = []
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
endif
if not all_drivers.contains(driver)
error('Invalid driver \'' + driver + '\'')
endif
endforeach
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')
udev_rules_dir = udev_dep.get_pkgconfig_variable('udevdir') + 'rules.d'
endif
endif
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
# Message logging
if get_option('log')
libfprint_conf.set('ENABLE_LOGGING', '1')
endif
if get_option('debug_log')
libfprint_conf.set('ENABLE_DEBUG_LOGGING', '1')
endif
libfprint_conf.set('API_EXPORTED', '__attribute__((visibility("default")))')
configure_file(output: 'config.h', configuration: libfprint_conf)
subdir('doc')
subdir('libfprint')
subdir('examples')
pkgconfig = import('pkgconfig')
pkgconfig.generate(
name: 'libfprint',
description: 'Generic C API for fingerprint reader access',
version: meson.project_version(),
libraries: libfprint,
subdirs: 'libfprint',
filebase: 'libfprint',
install_dir: join_paths(get_option('libdir'), 'pkgconfig'),
)
option('drivers',
description: 'Drivers to integrate',
type: 'string',
value: 'all')
option('udev_rules',
description: 'Whether to create a udev rules file',
type: 'boolean',
value: true)
option('udev_rules_dir',
description: 'Installation path for udev rules',
type: 'string',
value: 'auto')
option('x11-examples',
description: 'Whether to build X11 example applications',
type: 'boolean',
value: true)
option('log',
description: 'Message logging',
type: 'boolean',
value: true)
option('debug_log',
description: 'Debug message logging',
type: 'boolean',
value: false)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment