configure.ac 10.8 KB
Newer Older
Bastien Nocera's avatar
Bastien Nocera committed
1
AC_INIT([libfprint], [0.5.0])
2
AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz check-news])
Daniel Drake's avatar
Daniel Drake committed
3
AC_CONFIG_MACRO_DIR([m4])
Daniel Drake's avatar
Daniel Drake committed
4 5 6
AC_CONFIG_SRCDIR([libfprint/core.c])
AM_CONFIG_HEADER([config.h])

Bastien Nocera's avatar
Bastien Nocera committed
7 8 9
# Enable silent build when available (Automake 1.11)
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])

Daniel Drake's avatar
Daniel Drake committed
10
AC_PREREQ([2.50])
Daniel Drake's avatar
Daniel Drake committed
11 12 13
AC_PROG_CC
AC_PROG_LIBTOOL
AC_C_INLINE
14
AM_PROG_CC_C_O
15
AC_PROG_CXX
16
AC_DEFINE([_GNU_SOURCE], [], [Use GNU extensions])
Daniel Drake's avatar
Daniel Drake committed
17 18 19 20 21 22 23 24 25

# Library versioning
lt_major="0"
lt_revision="0"
lt_age="0"
AC_SUBST(lt_major)
AC_SUBST(lt_revision)
AC_SUBST(lt_age)

26
all_drivers="upeke2 upekts upektc upeksonly vcom5s uru4000 fdu2000 aes1610 aes1660 aes2501 aes2550 aes2660 aes4000 vfs101 vfs301"
27

Bastien Nocera's avatar
Bastien Nocera committed
28
require_imaging='no'
29
require_aeslib='no'
30
require_aesX660='no'
31
enable_upeke2='no'
32 33 34 35 36 37 38
enable_upekts='no'
enable_upektc='no'
enable_upeksonly='no'
enable_vcom5s='no'
enable_uru4000='no'
enable_fdu2000='no'
enable_aes1610='no'
39
enable_aes1660='no'
40
enable_aes2501='no'
41
enable_aes2550='no'
42
enable_aes2660='no'
43
enable_aes4000='no'
44
enable_vfs101='no'
45
enable_vfs301='no'
46 47 48 49 50 51

AC_ARG_WITH([drivers],[AS_HELP_STRING([--with-drivers],
	[List of drivers to enable])],
	[drivers="$withval"],
	[drivers="$all_drivers"])

52
if test "x$drivers" = "xall" ; then
53 54 55
	drivers=$all_drivers
fi

56 57 58 59 60 61
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"
		;;
62 63 64 65
		upeke2)
			AC_DEFINE([ENABLE_UPEKE2], [], [Build UPEK Eikon 2])
			enable_upeke2="yes"
		;;
66 67
		upektc)
			AC_DEFINE([ENABLE_UPEKTC], [], [Build UPEK TouchChip driver])
68
			enable_upektc="yes"
69 70 71 72 73 74 75 76 77 78 79
		;;
		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"
		;;
		fdu2000)
			AC_DEFINE([ENABLE_FDU2000], [], [Build Secugen FDU 2000 driver])
80 81
			enable_fdu2000="no"
			# Driver not ported
82 83 84 85 86 87 88 89 90 91
		;;
		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"
		;;
92 93 94 95 96
		aes2550)
			AC_DEFINE([ENABLE_AES2550], [], [Build AuthenTec AES2550/AES2810 driver])
			require_aeslib="yes"
			enable_aes2550="yes"
		;;
97 98 99 100 101
		aes1610)
			AC_DEFINE([ENABLE_AES1610], [], [Build AuthenTec AES1610 driver])
			require_aeslib="yes"
			enable_aes1610="yes"
		;;
102 103 104 105 106 107
		aes1660)
			AC_DEFINE([ENABLE_AES1660], [], [Build AuthenTec AES1660 driver])
			require_aeslib="yes"
			require_aesX660="yes"
			enable_aes1660="yes"
		;;
108 109 110 111 112 113
		aes2660)
			AC_DEFINE([ENABLE_AES2660], [], [Build AuthenTec AES1660 driver])
			require_aeslib="yes"
			require_aesX660="yes"
			enable_aes2660="yes"
		;;
114 115 116
		aes4000)
			AC_DEFINE([ENABLE_AES4000], [], [Build AuthenTec AES4000 driver])
			require_aeslib="yes"
Bastien Nocera's avatar
Bastien Nocera committed
117
			require_imaging="yes"
118 119
			enable_aes4000="yes"
		;;
120 121 122 123
		vfs101)
			AC_DEFINE([ENABLE_VFS101], [], [Build Validity VFS101 driver])
			enable_vfs101="yes"
		;;
124 125 126 127
		vfs301)
			AC_DEFINE([ENABLE_VFS301], [], [Build Validity VFS301/VFS300 driver])
			enable_vfs301="yes"
		;;
128 129 130
	esac
done

131 132
AM_CONDITIONAL([ENABLE_UPEKTS], [test "$enable_upekts" = "yes"])
AM_CONDITIONAL([ENABLE_UPEKE2], [test "$enable_upeke2" = "yes"])
133
AM_CONDITIONAL([ENABLE_UPEKTC], [test "$enable_upektc" = "yes"])
134 135 136 137 138
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"])
139
AM_CONDITIONAL([ENABLE_AES1660], [test "$enable_aes1660" = "yes"])
140
AM_CONDITIONAL([ENABLE_AES2501], [test "$enable_aes2501" = "yes"])
141
AM_CONDITIONAL([ENABLE_AES2550], [test "$enable_aes2550" = "yes"])
142
AM_CONDITIONAL([ENABLE_AES2660], [test "$enable_aes2660" = "yes"])
143 144
AM_CONDITIONAL([ENABLE_AES4000], [test "$enable_aes4000" = "yes"])
AM_CONDITIONAL([REQUIRE_AESLIB], [test "$require_aeslib" = "yes"])
145
AM_CONDITIONAL([REQUIRE_AESX660], [test "$require_aesX660" = "yes"])
146
AM_CONDITIONAL([ENABLE_VFS101], [test "$enable_vfs101" = "yes"])
147
AM_CONDITIONAL([ENABLE_VFS301], [test "$enable_vfs301" = "yes"])
148 149


Daniel Drake's avatar
Daniel Drake committed
150
PKG_CHECK_MODULES(LIBUSB, [libusb-1.0 >= 0.9.1])
Daniel Drake's avatar
Daniel Drake committed
151 152 153
AC_SUBST(LIBUSB_CFLAGS)
AC_SUBST(LIBUSB_LIBS)

154
# check for OpenSSL's libcrypto
155
PKG_CHECK_MODULES(CRYPTO, nss)
156 157 158
AC_SUBST(CRYPTO_CFLAGS)
AC_SUBST(CRYPTO_LIBS)

Daniel Drake's avatar
Daniel Drake committed
159 160 161 162
PKG_CHECK_MODULES(GLIB, "glib-2.0")
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)

Bastien Nocera's avatar
Bastien Nocera committed
163 164 165
imagemagick_found=no
gdkpixbuf_found=no

166 167 168 169 170 171 172 173 174 175
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")

176 177 178 179 180 181 182 183 184 185
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}])
186

187
if test "$require_imaging" = "yes"; then
Bastien Nocera's avatar
Bastien Nocera committed
188 189 190 191 192 193
	PKG_CHECK_MODULES(IMAGING, gthread-2.0 gdk-pixbuf-2.0, [gdkpixbuf_found=yes], [gdkpixbuf_found=no])
	if test "$gdkpixbuf_found" != "yes"; then
		PKG_CHECK_MODULES(IMAGING, ImageMagick, [imagemagick_found=yes], [imagemagick_found=no])
	fi
fi

194
if test "$require_imaging" = "yes"; then
Bastien Nocera's avatar
Bastien Nocera committed
195 196 197 198 199
	if test "$gdkpixbuf_found" != "yes" && test "$imagemagick_found" != "yes"; then
		AC_MSG_ERROR([gdk-pixbuf or ImageMagick is required for imaging support])
	fi
fi

200 201
AM_CONDITIONAL([REQUIRE_GDKPIXBUF], [test "$gdkpixbuf_found" = "yes"])
AM_CONDITIONAL([REQUIRE_IMAGEMAGICK], [test "$imagemagick_found" = "yes"])
Bastien Nocera's avatar
Bastien Nocera committed
202 203
AC_SUBST(IMAGING_CFLAGS)
AC_SUBST(IMAGING_LIBS)
Daniel Drake's avatar
Daniel Drake committed
204

205 206 207 208 209 210 211
# 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"])

212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228
# 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 <X11/Xlib.h>
229
		#include <X11/extensions/Xvlib.h>],[
230 231 232
		int main(void) { (void) XvGetPortAttribute(0, 0, 0, 0); return 0; }
		],xv=yes,xv=no);
		AC_MSG_RESULT($xv)
233 234 235
		if test x$xv = xyes; then
	       XV_LIBS="-lXv -lXext"
	       XV_CFLAGS=""
236 237 238
		   AC_DEFINE(HAVE_XV,1,[defined if XV video overlay is available])
		else
			AC_MSG_ERROR([XV is required for X11 examples])
239
		fi
240 241 242 243
	])
	AC_CHECK_XV
fi

Daniel Drake's avatar
Daniel Drake committed
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259
# 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

260 261 262 263 264
# Restore gnu89 inline semantics on gcc 4.3 and newer
saved_cflags="$CFLAGS"
CFLAGS="$CFLAGS -fgnu89-inline"
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]), inline_cflags="-fgnu89-inline", inline_cflags="")
CFLAGS="$saved_cflags"
Daniel Drake's avatar
Daniel Drake committed
265

Daniel Drake's avatar
Daniel Drake committed
266
AC_DEFINE([API_EXPORTED], [__attribute__((visibility("default")))], [Default visibility])
267
AM_CFLAGS="-std=gnu99 $inline_cflags -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow"
Daniel Drake's avatar
Daniel Drake committed
268
AC_SUBST(AM_CFLAGS)
Daniel Drake's avatar
Daniel Drake committed
269

270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319
if test "$require_imaging" = "yes"; then
	if test x$gdkpixbuf_found != no; then
		AC_MSG_NOTICE([** Using gdk-pixbuf for imaging])
	else
		AC_MSG_NOTICE([** Using ImageMagick 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_upeke2 != xno ; then
	AC_MSG_NOTICE([** upeke2 driver enabled])
else
	AC_MSG_NOTICE([   upeke2 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])
fi
if test x$enable_aes1610 != xno ; then
	AC_MSG_NOTICE([** aes1610 driver enabled])
else
	AC_MSG_NOTICE([   aes1610 driver disabled])
fi
320 321 322 323 324
if test x$enable_aes1660 != xno ; then
	AC_MSG_NOTICE([** aes1660 driver enabled])
else
	AC_MSG_NOTICE([   aes1660 driver disabled])
fi
325 326 327 328 329
if test x$enable_aes2501 != xno ; then
	AC_MSG_NOTICE([** aes2501 driver enabled])
else
	AC_MSG_NOTICE([   aes2501 driver disabled])
fi
330 331 332 333 334
if test x$enable_aes2550 != xno ; then
	AC_MSG_NOTICE([** aes2550/aes2810 driver enabled])
else
	AC_MSG_NOTICE([   aes2550/aes2810 driver disabled])
fi
335 336 337 338 339
if test x$enable_aes2660 != xno ; then
	AC_MSG_NOTICE([** aes2660 driver enabled])
else
	AC_MSG_NOTICE([   aes2660 driver disabled])
fi
340 341 342 343 344
if test x$enable_aes4000 != xno ; then
	AC_MSG_NOTICE([** aes4000 driver enabled])
else
	AC_MSG_NOTICE([   aes4000 driver disabled])
fi
345 346 347 348 349
if test x$enable_vfs101 != xno ; then
	AC_MSG_NOTICE([** vfs101 driver enabled])
else
	AC_MSG_NOTICE([   vfs101 driver disabled])
fi
350 351 352 353 354
if test x$enable_vfs301 != xno ; then
	AC_MSG_NOTICE([** vfs301 driver enabled])
else
	AC_MSG_NOTICE([   vfs301 driver disabled])
fi
355 356 357 358 359
if test x$require_aeslib != xno ; then
	AC_MSG_NOTICE([** aeslib helper functions enabled])
else
	AC_MSG_NOTICE([   aeslib helper functions disabled])
fi
360 361 362 363 364
if test x$require_aesX660 != xno ; then
	AC_MSG_NOTICE([** aesX660 common routines enabled])
else
	AC_MSG_NOTICE([   aesX660 common routines disabled])
fi
365

Daniel Drake's avatar
Daniel Drake committed
366
AC_CONFIG_FILES([libfprint.pc] [Makefile] [libfprint/Makefile] [examples/Makefile] [doc/Makefile])
Daniel Drake's avatar
Daniel Drake committed
367 368
AC_OUTPUT