Hi again
I have tried to make the patch as clean as possible, but I have failed
at making autoconf/automake understand anything like "ENABLE_$driver" so
the patch is probably by far not the best one that could be made, anyone
is more than welcome to make a better and cleaner one :-)
anyway, the default setting should make as minimal build as currently
possible (I even tried to remove imgdev and NBIS, but that is not
possible without significant change of code), excluding all the drivers,
aeslib and the dependency on ImageMagick.
And once again, anyone please test this patch, I don't have a
fingerprint scanner so I can only make sure it compiles fine.
Pavel
diff -ur a/configure.ac b/configure.ac
--- a/configure.ac 2008-07-17 14:06:12.000000000 +0200
+++ b/configure.ac 2008-07-17 22:03:12.000000000 +0200
@@ -18,6 +18,67 @@
AC_SUBST(lt_revision)
AC_SUBST(lt_age)
+require_imagemagick='no'
+require_aeslib='no'
+
+AC_ARG_ENABLE([upekts], [AS_HELP_STRING([--enable-upekts],
+ [enable UPEK TouchStrip (coprocessor variant) driver])],
+ [enable_upekts=$enableval],
+ [enable_upekts='no'])
+AM_CONDITIONAL([ENABLE_UPEKTS], [test "$enable_upekts" != "no"])
+
+#AC_ARG_ENABLE([upektc], [AS_HELP_STRING([--enable-upektc],
+# [enable UPEK TouchChip driver])],
+# [enable_upektc=$enableval],
+# [enable_upektc='no'])
+#AM_CONDITIONAL([ENABLE_UPEKTC], [test "$enable_upektc" != "no"])
+
+AC_ARG_ENABLE([upeksonly], [AS_HELP_STRING([--enable-upeksonly],
+ [enable UPEK TouchStrip (sensor-only variant) driver])],
+ [enable_upeksonly=$enableval],
+ [enable_upeksonly='no'])
+AM_CONDITIONAL([ENABLE_UPEKSONLY], [test "$enable_upeksonly" != "no"])
+
+AC_ARG_ENABLE([vcom5s], [AS_HELP_STRING([--enable-vcom5s],
+ [enable Veridicom 5thSense driver])],
+ [enable_vcom5s=$enableval],
+ [enable_vcom5s='no'])
+AM_CONDITIONAL([ENABLE_VCOM5S], [test "$enable_vcom5s" != "no"])
+
+AC_ARG_ENABLE([uru4000], [AS_HELP_STRING([--enable-uru4000],
+ [enable U are U 4000 driver])],
+ [enable_uru4000=$enableval],
+ [enable_uru4000='no'])
+AM_CONDITIONAL([ENABLE_URU4000], [test "$enable_uru4000" != "no"])
+
+#AC_ARG_ENABLE([fdu2000], [AS_HELP_STRING([--enable-fdu2000],
+# [enable Secugen FDU 2000 driver])],
+# [enable_fdu2000=$enableval],
+# [enable_fdu2000='no'])
+#AM_CONDITIONAL([ENABLE_FDU2000], [test "$enable_fdu2000" != "no"])
+
+#AC_ARG_ENABLE([aes1610], [AS_HELP_STRING([--enable-aes1610],
+# [enable Authentec AES1610 driver])],
+# [enable_aes1610=$enableval;require_aeslib='yes'],
+# [enable_aes1610='no'])
+#AM_CONDITIONAL([ENABLE_AES1610], [test "$enable_aes1610" != "no"])
+
+AC_ARG_ENABLE([aes2501], [AS_HELP_STRING([--enable-aes2501],
+ [enable Authentec AES2501 driver])],
+ [enable_aes2501=$enableval;require_aeslib='yes'],
+ [enable_aes2501='no'])
+AM_CONDITIONAL([ENABLE_AES2501], [test "$enable_aes2501" != "no"])
+
+AC_ARG_ENABLE([aes4000], [AS_HELP_STRING([--enable-aes4000],
+ [enable Authentec AES4000 driver (requires ImageMagick)])],
+ [enable_aes4000=$enableval;require_imagemagick='yes';require_aeslib='yes'],
+ [enable_aes4000='no'])
+AM_CONDITIONAL([ENABLE_AES4000], [test "$enable_aes4000" != "no"])
+
+AM_CONDITIONAL([REQUIRE_IMAGEMAGICK], [test "$require_imagemagick" != "no"])
+AM_CONDITIONAL([REQUIRE_AESLIB], [test "$require_aeslib" != "no"])
+
+
PKG_CHECK_MODULES(LIBUSB, [libusb-1.0 >= 0.9.1])
AC_SUBST(LIBUSB_CFLAGS)
AC_SUBST(LIBUSB_LIBS)
@@ -31,9 +92,11 @@
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
+if test "$require_imagemagick" != "no"; then
PKG_CHECK_MODULES(IMAGEMAGICK, "ImageMagick")
AC_SUBST(IMAGEMAGICK_CFLAGS)
AC_SUBST(IMAGEMAGICK_LIBS)
+fi;
# Examples build
AC_ARG_ENABLE([examples-build], [AS_HELP_STRING([--enable-examples-build],
diff -ur a/libfprint/Makefile.am b/libfprint/Makefile.am
--- a/libfprint/Makefile.am 2008-07-17 14:06:23.000000000 +0200
+++ b/libfprint/Makefile.am 2008-07-17 22:11:20.000000000 +0200
@@ -10,9 +10,7 @@
FDU2000_SRC = drivers/fdu2000.c
VCOM5S_SRC = drivers/vcom5s.c
-DRIVER_SRC = $(UPEKTS_SRC) $(AES4000_SRC) $(AES2501_SRC) $(URU4000_SRC) $(VCOM5S_SRC) $(UPEKSONLY_SRC)
-#DRIVER_SRC = $(AES1610_SRC) $(UPEKTC_SRC) $(FDU2000_SRC)
-
+DRIVER_SRC = ""
NBIS_SRC = \
nbis/include/bozorth.h \
nbis/include/bz_array.h \
@@ -50,9 +48,63 @@
nbis/mindtct/sort.c \
nbis/mindtct/util.c
-libfprint_la_CFLAGS = -fvisibility=hidden -I$(srcdir)/nbis/include $(LIBUSB_CFLAGS) $(GLIB_CFLAGS) $(IMAGEMAGICK_CFLAGS) $(CRYPTO_CFLAGS) $(AM_CFLAGS)
+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) $(IMAGEMAGICK_LIBS) $(CRYPTO_LIBS)
+libfprint_la_LIBADD = -lm $(LIBUSB_LIBS) $(GLIB_LIBS) $(CRYPTO_LIBS)
+
+if ENABLE_UPEKTS
+DRIVER_SRC += $(UPEKTS_SRC)
+libfprint_la_CFLAGS += -DENABLE_UPEKTS
+endif
+
+if ENABLE_UPEKSONLY
+DRIVER_SRC += $(UPEKSONLY_SRC)
+libfprint_la_CFLAGS += -DENABLE_UPEKSONLY
+endif
+
+#if ENABLE_UPEKTC
+#DRIVER_SRC += $(UPEKTC_SRC)
+#libfprint_la_CFLAGS += -DENABLE_UPEKTC
+#endif
+
+if ENABLE_URU4000
+DRIVER_SRC += $(URU4000_SRC)
+libfprint_la_CFLAGS += -DENABLE_URU4000
+endif
+
+if ENABLE_VCOM5S
+DRIVER_SRC += $(VCOM5S_SRC)
+libfprint_la_CFLAGS += -DENABLE_VCOM5S
+endif
+
+#if ENABLE_FDU2000
+#DRIVER_SRC += $(FDU2000_SRC)
+#libfprint_la_CFLAGS += -DENABLE_FDU2000
+#endif
+
+#if ENABLE_AES1610
+#DRIVER_SRC += $(AES1610_SRC)
+#libfprint_la_CFLAGS += -DENABLE_AES1610
+#endif
+
+if ENABLE_AES2501
+DRIVER_SRC += $(AES2501_SRC)
+libfprint_la_CFLAGS += -DENABLE_AES2501
+endif
+
+if ENABLE_AES4000
+DRIVER_SRC += $(AES4000_SRC)
+libfprint_la_CFLAGS += -DENABLE_AES4000
+endif
+
+if REQUIRE_IMAGEMAGICK
+libfprint_la_CFLAGS += $(IMAGEMAGICK_CFLAGS) -DREQUIRE_IMAGEMAGICK
+libfprint_la_LIBADD += $(IMAGEMAGICK_LIBS)
+endif
+
+if REQUIRE_AESLIB
+OTHER_SRC += aeslib.c aeslib.h
+endif
libfprint_la_SOURCES = \
fp_internal.h \
@@ -60,12 +112,10 @@
core.c \
data.c \
drv.c \
- img.c \
- imgdev.c \
poll.c \
sync.c \
- aeslib.c \
- aeslib.h \
+ imgdev.c \
+ img.c \
$(DRIVER_SRC) \
$(NBIS_SRC)
diff -ur a/libfprint/core.c b/libfprint/core.c
--- a/libfprint/core.c 2008-07-17 14:06:28.000000000 +0200
+++ b/libfprint/core.c 2008-07-17 22:03:26.000000000 +0200
@@ -327,18 +327,38 @@
}
static struct fp_driver * const primitive_drivers[] = {
+#ifdef ENABLE_UPEKTS
&upekts_driver,
+#endif
};
static struct fp_img_driver * const img_drivers[] = {
+#ifdef ENABLE_AES4000
&aes4000_driver,
+#endif
+#ifdef ENABLE_AES2501
&aes2501_driver,
+#endif
+#ifdef ENABLE_URU4000
&uru4000_driver,
+#endif
+#ifdef ENABLE_VCOM5S
&vcom5s_driver,
+#endif
+#ifdef ENABLE_UPEKSONLY
&upeksonly_driver,
- /* &aes1610_driver,
+#endif
+ /*
+#ifdef ENABLE_AES1610
+ &aes1610_driver,
+#endif
+#ifdef ENABLE_UPEKTC
&upektc_driver,
- &fdu2000_driver, */
+#endif
+#ifdef ENABLE_FDU2000
+ &fdu2000_driver,
+#endif
+ */
};
static void register_drivers(void)
diff -ur a/libfprint/fp_internal.h b/libfprint/fp_internal.h
--- a/libfprint/fp_internal.h 2008-07-17 14:06:38.000000000 +0200
+++ b/libfprint/fp_internal.h 2008-07-17 22:03:26.000000000 +0200
@@ -232,16 +232,33 @@
int (*change_state)(struct fp_img_dev *dev, enum fp_imgdev_state state);
void (*deactivate)(struct fp_img_dev *dev);
};
-
+#ifdef ENABLE_UPEKTS
extern struct fp_driver upekts_driver;
+#endif
+#ifdef ENABLE_UPEKTC
extern struct fp_img_driver upektc_driver;
+#endif
+#ifdef ENABLE_UPEKSONLY
extern struct fp_img_driver upeksonly_driver;
+#endif
+#ifdef ENABLE_URU4000
extern struct fp_img_driver uru4000_driver;
+#endif
+#ifdef ENABLE_AES1610
extern struct fp_img_driver aes1610_driver;
+#endif
+#ifdef ENABLE_AES2501
extern struct fp_img_driver aes2501_driver;
+#endif
+#ifdef ENABLE_AES4000
extern struct fp_img_driver aes4000_driver;
+#endif
+#ifdef ENABLE_FDU2000
extern struct fp_img_driver fdu2000_driver;
+#endif
+#ifdef ENABLE_VCOM5S
extern struct fp_img_driver vcom5s_driver;
+#endif
extern libusb_context *fpi_usb_ctx;
extern GSList *opened_devices;
diff -ur a/libfprint/imgdev.c b/libfprint/imgdev.c
--- a/libfprint/imgdev.c 2008-07-17 14:06:33.000000000 +0200
+++ b/libfprint/imgdev.c 2008-07-17 22:03:26.000000000 +0200
@@ -20,8 +20,9 @@
#include <errno.h>
#include <glib.h>
+#ifdef REQUIRE_IMAGEMAGICK
#include <magick/ImageMagick.h>
-
+#endif
#include "fp_internal.h"
#define MIN_ACCEPTABLE_MINUTIAE 10
@@ -86,6 +87,7 @@
return 0;
return imgdrv->change_state(imgdev, state);
}
+#ifdef REQUIRE_IMAGEMAGICK
static struct fp_img *im_resize(struct fp_img *img, unsigned int factor)
{
@@ -129,6 +131,7 @@
return newimg;
}
+#endif
/* check image properties and resize it if necessary. potentially returns a new
* image after freeing the old one. */
@@ -156,7 +159,7 @@
fp_err("image is not sane!");
return -EINVAL;
}
-
+#ifdef REQUIRE_IMAGEMAGICK
if (imgdrv->enlarge_factor > 1) {
/* FIXME: enlarge_factor should not exist! instead, MINDTCT should
* actually look at the value of the pixels-per-mm parameter and
@@ -166,6 +169,7 @@
fp_img_free(img);
*_img = tmp;
}
+#endif
return 0;
}
_______________________________________________
fprint mailing list
[email protected]
http://lists.reactivated.net/mailman/listinfo/fprint