Rework some image handling; add public binarization API
[libfprint.git] / configure.ac
blob177c78807441320cf11bb79ec5a0a618255f3867
1 AC_INIT([libfprint], [0.0.1])
2 AM_INIT_AUTOMAKE
3 AC_CONFIG_SRCDIR([libfprint/core.c])
4 AM_CONFIG_HEADER([config.h])
6 AC_PREREQ([2.50])
7 AC_PROG_CC
8 AC_PROG_LIBTOOL
9 AC_C_INLINE
10 AM_PROG_CC_C_O
12 # Library versioning
13 lt_major="0"
14 lt_revision="0"
15 lt_age="0"
16 AC_SUBST(lt_major)
17 AC_SUBST(lt_revision)
18 AC_SUBST(lt_age)
20 PKG_CHECK_MODULES(LIBUSB, "libusb")
21 AC_SUBST(LIBUSB_CFLAGS)
22 AC_SUBST(LIBUSB_LIBS)
24 PKG_CHECK_MODULES(GLIB, "glib-2.0")
25 AC_SUBST(GLIB_CFLAGS)
26 AC_SUBST(GLIB_LIBS)
28 PKG_CHECK_MODULES(IMAGEMAGICK, "ImageMagick")
29 AC_SUBST(IMAGEMAGICK_CFLAGS)
30 AC_SUBST(IMAGEMAGICK_LIBS)
32 # Examples build
33 AC_ARG_ENABLE([examples-build], [AS_HELP_STRING([--enable-examples-build],
34         [build example applications (default n)])],
35         [build_examples=$enableval],
36         [build_examples='no'])
37 AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$build_examples" != "xno"])
39 # Examples build
40 AC_ARG_ENABLE([x11-examples-build], [AS_HELP_STRING([--enable-x11-examples-build],
41         [build X11 example applications (default n)])],
42         [build_x11_examples=$enableval],
43         [build_x11_examples='no'])
44 AM_CONDITIONAL([BUILD_X11_EXAMPLES], [test "x$build_x11_examples" != "xno"])
47 if test "x$build_x11_examples" != "xno"; then
48         # check for Xv extensions
49         # imported from Coriander
50         AC_DEFUN([AC_CHECK_XV],[
51                 AC_SUBST(XV_CFLAGS)
52                 AC_SUBST(XV_LIBS)
53                 AC_MSG_CHECKING(for Xv extensions)
54                 AC_TRY_COMPILE([
55                 #include <X11/Xlib.h>
56                 #include <X11/extensions/Xvlib.h>],[
57                 int main(void) { (void) XvGetPortAttribute(0, 0, 0, 0); return 0; }
58                 ],xv=yes,xv=no);
59                 AC_MSG_RESULT($xv)
60                 if test x$xv = xyes; then
61                XV_LIBS="-lXv -lXext"
62                    XV_CFLAGS=""
63                    AC_DEFINE(HAVE_XV,1,[defined if XV video overlay is available])
64                 else
65                         AC_MSG_ERROR([XV is required for X11 examples])
66                 fi
67         ])
68         AC_CHECK_XV
71 # Message logging
72 AC_ARG_ENABLE([log], [AS_HELP_STRING([--disable-log], [disable all logging])],
73         [log_enabled=$enableval],
74         [log_enabled='yes'])
75 if test "x$log_enabled" != "xno"; then
76         AC_DEFINE([ENABLE_LOGGING], 1, [Message logging])
79 AC_ARG_ENABLE([debug-log], [AS_HELP_STRING([--enable-debug-log],
80         [enable debug logging (default n)])],
81         [debug_log_enabled=$enableval],
82         [debug_log_enabled='no'])
83 if test "x$debug_log_enabled" != "xno"; then
84         AC_DEFINE([ENABLE_DEBUG_LOGGING], 1, [Debug message logging])
88 AC_DEFINE([API_EXPORTED], [__attribute__((visibility("default")))], [Default visibility])
89 AM_CFLAGS="-Werror-implicit-function-declaration -Wimplicit-int -Wunreachable-code -Wunused-function -Wunused-label -Wunused-value -Wunused-variable -Wnonnull -Wreturn-type -Wextra -Wshadow"
90 AC_SUBST(AM_CFLAGS)
92 AC_CONFIG_FILES([libfprint.pc] [Makefile] [libfprint/Makefile] [examples/Makefile] [doc/Makefile])
93 AC_OUTPUT