From 4ce3a8969f8dbe49e0c96084bad8b256fd674318 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Mon, 14 May 2018 15:15:52 +0200 Subject: [PATCH] build: Port to meson And remove the autotools. Faster, cleaner. https://bugs.freedesktop.org/show_bug.cgi?id=106514 --- Makefile.am | 25 -- autogen.sh | 20 -- configure.ac | 435 ---------------------------- doc/Makefile.am | 10 - doc/{doxygen.cfg => doxygen.cfg.in} | 4 +- doc/meson.build | 17 ++ examples/Makefile.am | 26 -- examples/meson.build | 29 ++ libfprint.pc.in | 11 - libfprint/Makefile.am | 227 --------------- libfprint/meson.build | 194 +++++++++++++ meson.build | 117 ++++++++ meson_options.txt | 24 ++ 13 files changed, 383 insertions(+), 756 deletions(-) delete mode 100644 Makefile.am delete mode 100755 autogen.sh delete mode 100644 configure.ac delete mode 100644 doc/Makefile.am rename doc/{doxygen.cfg => doxygen.cfg.in} (99%) create mode 100644 doc/meson.build delete mode 100644 examples/Makefile.am create mode 100644 examples/meson.build delete mode 100644 libfprint.pc.in delete mode 100644 libfprint/Makefile.am create mode 100644 libfprint/meson.build create mode 100644 meson.build create mode 100644 meson_options.txt diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 74f0971..0000000 --- a/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -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/ diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index cd72a66..0000000 --- a/autogen.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/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 diff --git a/configure.ac b/configure.ac deleted file mode 100644 index d8b2119..0000000 --- a/configure.ac +++ /dev/null @@ -1,435 +0,0 @@ -AC_INIT([libfprint], [0.7.0]) -AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz check-news subdir-objects]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_SRCDIR([libfprint/core.c]) -AC_CONFIG_HEADERS([config.h]) - -# Enable silent build when available (Automake 1.11) -m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) - -AC_PREREQ([2.50]) -AC_PROG_CC -AC_PROG_LIBTOOL -AC_C_INLINE -AM_PROG_CC_C_O -AC_PROG_CXX -AC_DEFINE([_GNU_SOURCE], [], [Use GNU extensions]) - -# Library versioning -lt_major="0" -lt_revision="0" -lt_age="0" -AC_SUBST(lt_major) -AC_SUBST(lt_revision) -AC_SUBST(lt_age) - -all_drivers="upekts upektc upeksonly vcom5s uru4000 fdu2000 aes1610 aes1660 aes2501 aes2550 aes2660 aes3500 aes4000 vfs101 vfs301 vfs5011 upektc_img etes603 vfs0050 elan" - -require_imaging='no' -require_aeslib='no' -require_aesX660='no' -require_aes3k='no' -require_nss='no' -enable_upekts='no' -enable_upektc='no' -enable_upeksonly='no' -enable_vcom5s='no' -enable_uru4000='no' -enable_fdu2000='no' -enable_aes1610='no' -enable_aes1660='no' -enable_aes2501='no' -enable_aes2550='no' -enable_aes2660='no' -enable_aes3500='no' -enable_aes4000='no' -enable_vfs101='no' -enable_vfs301='no' -enable_vfs5011='no' -enable_upektc_img='no' -enable_etes603='no' -enable_vfs0050='no' -enable_elan='no' - -AC_ARG_WITH([drivers],[AS_HELP_STRING([--with-drivers], - [List of drivers to enable])], - [drivers="$withval"], - [drivers="$all_drivers"]) - -if test "x$drivers" = "xall" ; then - drivers=$all_drivers -fi - -for driver in `echo ${drivers} | sed -e 's/,/ /g' -e 's/,$//g'`; do - case ${driver} in - upekts) - AC_DEFINE([ENABLE_UPEKTS], [], [Build UPEK TouchStrip driver]) - enable_upekts="yes" - ;; - upektc) - AC_DEFINE([ENABLE_UPEKTC], [], [Build UPEK TouchChip driver]) - enable_upektc="yes" - ;; - upeksonly) - AC_DEFINE([ENABLE_UPEKSONLY], [], [Build UPEK TouchStrip sensor-only driver]) - enable_upeksonly="yes" - ;; - uru4000) - AC_DEFINE([ENABLE_URU4000], [], [Build Digital Persona U.are.U 4000 driver]) - enable_uru4000="yes" - require_nss="yes" - ;; - fdu2000) - AC_DEFINE([ENABLE_FDU2000], [], [Build Secugen FDU 2000 driver]) - enable_fdu2000="no" - # Driver not ported - ;; - vcom5s) - AC_DEFINE([ENABLE_VCOM5S], [], [Build Veridicom 5thSense driver]) - enable_vcom5s="yes" - ;; - aes2501) - AC_DEFINE([ENABLE_AES2501], [], [Build AuthenTec AES2501 driver]) - require_aeslib="yes" - enable_aes2501="yes" - ;; - aes2550) - AC_DEFINE([ENABLE_AES2550], [], [Build AuthenTec AES2550/AES2810 driver]) - require_aeslib="yes" - enable_aes2550="yes" - ;; - aes1610) - AC_DEFINE([ENABLE_AES1610], [], [Build AuthenTec AES1610 driver]) - require_aeslib="yes" - enable_aes1610="yes" - ;; - aes1660) - AC_DEFINE([ENABLE_AES1660], [], [Build AuthenTec AES1660 driver]) - require_aeslib="yes" - require_aesX660="yes" - enable_aes1660="yes" - ;; - aes2660) - AC_DEFINE([ENABLE_AES2660], [], [Build AuthenTec AES1660 driver]) - require_aeslib="yes" - require_aesX660="yes" - enable_aes2660="yes" - ;; - aes3500) - AC_DEFINE([ENABLE_AES3500], [], [Build AuthenTec AES3500 driver]) - require_aeslib="yes" - require_imaging="yes" - require_aes3k="yes" - enable_aes3500="yes" - ;; - aes4000) - AC_DEFINE([ENABLE_AES4000], [], [Build AuthenTec AES4000 driver]) - require_aeslib="yes" - require_imaging="yes" - require_aes3k="yes" - enable_aes4000="yes" - ;; - vfs101) - AC_DEFINE([ENABLE_VFS101], [], [Build Validity VFS101 driver]) - enable_vfs101="yes" - ;; - vfs301) - AC_DEFINE([ENABLE_VFS301], [], [Build Validity VFS301/VFS300 driver]) - enable_vfs301="yes" - ;; - vfs5011) - AC_DEFINE([ENABLE_VFS5011], [], [Build Validity VFS5011 driver]) - enable_vfs5011="yes" - ;; - upektc_img) - AC_DEFINE([ENABLE_UPEKTC_IMG], [], [Build Upek TouchChip Fingerprint Coprocessor driver]) - enable_upektc_img="yes" - ;; - etes603) - AC_DEFINE([ENABLE_ETES603], [], [Build EgisTec ES603 driver]) - enable_etes603="yes" - ;; - vfs0050) - AC_DEFINE([ENABLE_VFS0050], [], [Build Validity VFS0050 driver]) - enable_vfs0050="yes" - ;; - elan) - AC_DEFINE([ENABLE_ELAN], [], [Build Elan driver]) - enable_elan="yes" - ;; - esac -done - -AM_CONDITIONAL([ENABLE_UPEKTS], [test "$enable_upekts" = "yes"]) -AM_CONDITIONAL([ENABLE_UPEKTC], [test "$enable_upektc" = "yes"]) -AM_CONDITIONAL([ENABLE_UPEKSONLY], [test "$enable_upeksonly" = "yes"]) -AM_CONDITIONAL([ENABLE_VCOM5S], [test "$enable_vcom5s" = "yes"]) -AM_CONDITIONAL([ENABLE_URU4000], [test "$enable_uru4000" = "yes"]) -AM_CONDITIONAL([ENABLE_FDU2000], [test "$enable_fdu2000" = "yes"]) -AM_CONDITIONAL([ENABLE_AES1610], [test "$enable_aes1610" = "yes"]) -AM_CONDITIONAL([ENABLE_AES1660], [test "$enable_aes1660" = "yes"]) -AM_CONDITIONAL([ENABLE_AES2501], [test "$enable_aes2501" = "yes"]) -AM_CONDITIONAL([ENABLE_AES2550], [test "$enable_aes2550" = "yes"]) -AM_CONDITIONAL([ENABLE_AES2660], [test "$enable_aes2660" = "yes"]) -AM_CONDITIONAL([ENABLE_AES3500], [test "$enable_aes3500" = "yes"]) -AM_CONDITIONAL([ENABLE_AES4000], [test "$enable_aes4000" = "yes"]) -AM_CONDITIONAL([REQUIRE_AESLIB], [test "$require_aeslib" = "yes"]) -AM_CONDITIONAL([REQUIRE_AESX660], [test "$require_aesX660" = "yes"]) -AM_CONDITIONAL([REQUIRE_AES3K], [test "$require_aes3k" = "yes"]) -AM_CONDITIONAL([ENABLE_VFS101], [test "$enable_vfs101" = "yes"]) -AM_CONDITIONAL([ENABLE_VFS301], [test "$enable_vfs301" = "yes"]) -AM_CONDITIONAL([ENABLE_VFS5011], [test "$enable_vfs5011" = "yes"]) -AM_CONDITIONAL([ENABLE_UPEKTC_IMG], [test "$enable_upektc_img" = "yes"]) -AM_CONDITIONAL([ENABLE_ETES603], [test "$enable_etes603" = "yes"]) -AM_CONDITIONAL([ENABLE_VFS0050], [test "$enable_vfs0050" = "yes"]) -AM_CONDITIONAL([ENABLE_ELAN], [test "$enable_elan" = "yes"]) - - -PKG_CHECK_MODULES(LIBUSB, [libusb-1.0 >= 0.9.1]) -AC_SUBST(LIBUSB_CFLAGS) -AC_SUBST(LIBUSB_LIBS) - -if test "$require_nss" = "yes"; then - # check for NSS - PKG_CHECK_MODULES(CRYPTO, nss, [nss_found=yes], [nss_found=no]) - if test "$nss_found" != "yes"; then - AC_MSG_ERROR([NSS is required for the URU4000/URU4500 driver]) - fi -fi -AC_SUBST(CRYPTO_CFLAGS) -AC_SUBST(CRYPTO_LIBS) - -PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.28]) -AC_SUBST(GLIB_CFLAGS) -AC_SUBST(GLIB_LIBS) - -pixman_found=no - -AC_ARG_ENABLE(udev-rules, - AC_HELP_STRING([--enable-udev-rules],[Update the udev rules]), - [case "${enableval}" in - yes) ENABLE_UDEV_RULES=yes ;; - no) ENABLE_UDEV_RULES=no ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-udev-rules) ;; - esac], - [ENABLE_UDEV_RULES=yes]) dnl Default value -AM_CONDITIONAL(ENABLE_UDEV_RULES, test x$ENABLE_UDEV_RULES = "xyes") - -if test $ENABLE_UDEV_RULES = no && test -d .git/ ; then - AC_MSG_ERROR(--disable-udev-rules can only be used when building from tarballs) -fi - -AC_ARG_WITH(udev-rules-dir, - AS_HELP_STRING([--with-udev-rules-dir=DIR],[Installation path for udev rules @<:@auto@:>@]), - [ac_with_udev_rules_dir=$withval], - [ac_with_udev_rules_dir=""]) - -if test "${ac_with_udev_rules_dir}" = ""; then - ac_with_udev_rules_dir=`$PKG_CONFIG --variable=udevdir udev`/rules.d -fi -AC_MSG_NOTICE([installing udev rules in ${ac_with_udev_rules_dir}]) -AC_SUBST([udev_rulesdir],[${ac_with_udev_rules_dir}]) - -if test "$require_imaging" = "yes"; then - PKG_CHECK_MODULES(IMAGING, pixman-1, [pixman_found=yes], [pixman_found=no]) - if test "$pixman_found" != "yes"; then - AC_MSG_ERROR([pixman is required for imaging support]) - fi -fi - -AM_CONDITIONAL([REQUIRE_PIXMAN], [test "$pixman_found" = "yes"]) -AC_SUBST(IMAGING_CFLAGS) -AC_SUBST(IMAGING_LIBS) - -# Examples build -AC_ARG_ENABLE([examples-build], [AS_HELP_STRING([--enable-examples-build], - [build example applications (default n)])], - [build_examples=$enableval], - [build_examples='no']) -AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$build_examples" != "xno"]) - -# Examples build -AC_ARG_ENABLE([x11-examples-build], [AS_HELP_STRING([--enable-x11-examples-build], - [build X11 example applications (default n)])], - [build_x11_examples=$enableval], - [build_x11_examples='no']) -AM_CONDITIONAL([BUILD_X11_EXAMPLES], [test "x$build_x11_examples" != "xno"]) - - -if test "x$build_x11_examples" != "xno"; then - # check for Xv extensions - # imported from Coriander - AC_DEFUN([AC_CHECK_XV],[ - AC_SUBST(XV_CFLAGS) - AC_SUBST(XV_LIBS) - AC_MSG_CHECKING(for Xv extensions) - AC_TRY_COMPILE([ - #include - #include ],[ - int main(void) { (void) XvGetPortAttribute(0, 0, 0, 0); return 0; } - ],xv=yes,xv=no); - AC_MSG_RESULT($xv) - if test x$xv = xyes; then - XV_LIBS="-lXv -lXext" - XV_CFLAGS="" - AC_DEFINE(HAVE_XV,1,[defined if XV video overlay is available]) - else - AC_MSG_ERROR([XV is required for X11 examples]) - fi - ]) - AC_CHECK_XV -fi - -# Message logging -AC_ARG_ENABLE([log], [AS_HELP_STRING([--disable-log], [disable all logging])], - [log_enabled=$enableval], - [log_enabled='yes']) -if test "x$log_enabled" != "xno"; then - AC_DEFINE([ENABLE_LOGGING], 1, [Message logging]) -fi - -AC_ARG_ENABLE([debug-log], [AS_HELP_STRING([--enable-debug-log], - [enable debug logging (default n)])], - [debug_log_enabled=$enableval], - [debug_log_enabled='no']) -if test "x$debug_log_enabled" != "xno"; then - AC_DEFINE([ENABLE_DEBUG_LOGGING], 1, [Debug message logging]) -fi - -# Restore gnu89 inline semantics on gcc 4.3 and newer -saved_cflags="$CFLAGS" -CFLAGS="$CFLAGS -fgnu89-inline" -AC_COMPILE_IFELSE([AC_LANG_SOURCE([[]])], inline_cflags="-fgnu89-inline", inline_cflags="") -CFLAGS="$saved_cflags" - -AC_DEFINE([API_EXPORTED], [__attribute__((visibility("default")))], [Default visibility]) -AM_CFLAGS="-std=gnu99 $inline_cflags -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow" -AC_SUBST(AM_CFLAGS) - -if test "$require_imaging" = "yes"; then - if test x$pixman_found != no; then - AC_MSG_NOTICE([** Using pixman for imaging]) - fi -else - AC_MSG_NOTICE([ Imaging support disabled]) -fi - -if test x$enable_upekts != xno ; then - AC_MSG_NOTICE([** upekts driver enabled]) -else - AC_MSG_NOTICE([ upekts driver disabled]) -fi -if test x$enable_upektc != xno ; then - AC_MSG_NOTICE([** upektc driver enabled]) -else - AC_MSG_NOTICE([ upektc driver disabled]) -fi -if test x$enable_upeksonly != xno ; then - AC_MSG_NOTICE([** upeksonly driver enabled]) -else - AC_MSG_NOTICE([ upeksonly driver disabled]) -fi -if test x$enable_vcom5s != xno ; then - AC_MSG_NOTICE([** vcom5s driver enabled]) -else - AC_MSG_NOTICE([ vcom5s driver disabled]) -fi -if test x$enable_uru4000 != xno ; then - AC_MSG_NOTICE([** uru4000 driver enabled]) -else - AC_MSG_NOTICE([ uru4000 driver disabled]) -fi -if test x$enable_fdu2000 != xno ; then - AC_MSG_NOTICE([** fdu2000 driver enabled]) -else - AC_MSG_NOTICE([ fdu2000 driver disabled (not ported)]) -fi -if test x$enable_aes1610 != xno ; then - AC_MSG_NOTICE([** aes1610 driver enabled]) -else - AC_MSG_NOTICE([ aes1610 driver disabled]) -fi -if test x$enable_aes1660 != xno ; then - AC_MSG_NOTICE([** aes1660 driver enabled]) -else - AC_MSG_NOTICE([ aes1660 driver disabled]) -fi -if test x$enable_aes2501 != xno ; then - AC_MSG_NOTICE([** aes2501 driver enabled]) -else - AC_MSG_NOTICE([ aes2501 driver disabled]) -fi -if test x$enable_aes2550 != xno ; then - AC_MSG_NOTICE([** aes2550/aes2810 driver enabled]) -else - AC_MSG_NOTICE([ aes2550/aes2810 driver disabled]) -fi -if test x$enable_aes2660 != xno ; then - AC_MSG_NOTICE([** aes2660 driver enabled]) -else - AC_MSG_NOTICE([ aes2660 driver disabled]) -fi -if test x$enable_aes3500 != xno ; then - AC_MSG_NOTICE([** aes3500 driver enabled]) -else - AC_MSG_NOTICE([ aes3500 driver disabled]) -fi -if test x$enable_aes4000 != xno ; then - AC_MSG_NOTICE([** aes4000 driver enabled]) -else - AC_MSG_NOTICE([ aes4000 driver disabled]) -fi -if test x$enable_vfs101 != xno ; then - AC_MSG_NOTICE([** vfs101 driver enabled]) -else - AC_MSG_NOTICE([ vfs101 driver disabled]) -fi -if test x$enable_vfs301 != xno ; then - AC_MSG_NOTICE([** vfs301 driver enabled]) -else - AC_MSG_NOTICE([ vfs301 driver disabled]) -fi -if test x$enable_vfs5011 != xno ; then - AC_MSG_NOTICE([** vfs5011 driver enabled]) -else - AC_MSG_NOTICE([ vfs5011 driver disabled]) -fi -if test x$enable_upektc_img != xno ; then - AC_MSG_NOTICE([** upektc_img driver enabled]) -else - AC_MSG_NOTICE([ upektc_img driver disabled]) -fi -if test x$enable_etes603 != xno ; then - AC_MSG_NOTICE([** etes603 driver enabled]) -else - AC_MSG_NOTICE([ etes603 driver disabled]) -fi -if test x$enable_vfs0050 != xno ; then - AC_MSG_NOTICE([** vfs0050 driver enabled]) -else - AC_MSG_NOTICE([ vfs0050 driver disabled]) -fi -if test x$enable_elan != xno ; then - AC_MSG_NOTICE([** elan driver enabled]) -else - AC_MSG_NOTICE([ elan driver disabled]) -fi -if test x$require_aeslib != xno ; then - AC_MSG_NOTICE([** aeslib helper functions enabled]) -else - AC_MSG_NOTICE([ aeslib helper functions disabled]) -fi -if test x$require_aesX660 != xno ; then - AC_MSG_NOTICE([** aesX660 common routines enabled]) -else - AC_MSG_NOTICE([ aesX660 common routines disabled]) -fi -if test x$require_aes3k != xno ; then - AC_MSG_NOTICE([** aes3k common routines enabled]) -else - AC_MSG_NOTICE([ aes3k common routines disabled]) -fi - -AC_CONFIG_FILES([libfprint.pc] [Makefile] [libfprint/Makefile] [examples/Makefile] [doc/Makefile]) -AC_OUTPUT - diff --git a/doc/Makefile.am b/doc/Makefile.am deleted file mode 100644 index 7f200a0..0000000 --- a/doc/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -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 - diff --git a/doc/doxygen.cfg b/doc/doxygen.cfg.in similarity index 99% rename from doc/doxygen.cfg rename to doc/doxygen.cfg.in index 3548e66..da7bf49 100644 --- a/doc/doxygen.cfg +++ b/doc/doxygen.cfg.in @@ -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 diff --git a/doc/meson.build b/doc/meson.build new file mode 100644 index 0000000..717efac --- /dev/null +++ b/doc/meson.build @@ -0,0 +1,17 @@ +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) diff --git a/examples/Makefile.am b/examples/Makefile.am deleted file mode 100644 index 8aa486c..0000000 --- a/examples/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -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 - diff --git a/examples/meson.build b/examples/meson.build new file mode 100644 index 0000000..cba326f --- /dev/null +++ b/examples/meson.build @@ -0,0 +1,29 @@ + +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 diff --git a/libfprint.pc.in b/libfprint.pc.in deleted file mode 100644 index 30687d1..0000000 --- a/libfprint.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -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 - diff --git a/libfprint/Makefile.am b/libfprint/Makefile.am deleted file mode 100644 index 29ecd40..0000000 --- a/libfprint/Makefile.am +++ /dev/null @@ -1,227 +0,0 @@ -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 diff --git a/libfprint/meson.build b/libfprint/meson.build new file mode 100644 index 0000000..6bb919f --- /dev/null +++ b/libfprint/meson.build @@ -0,0 +1,194 @@ +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 diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..f30732a --- /dev/null +++ b/meson.build @@ -0,0 +1,117 @@ +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'), +) diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..709e0ea --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,24 @@ +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) -- 2.17.0