Simplify compile options (either --enable-ccid or --enable-openct implies --enable...
[librfid] / configure.in
1 dnl Process this file with autoconf to create configure.
2
3 AC_INIT
4
5 AC_CANONICAL_SYSTEM
6
7 AM_INIT_AUTOMAKE(librfid, 0.1.0)
8
9 AC_PROG_CC
10 AC_EXEEXT
11 AM_PROG_LIBTOOL
12 AC_SUBST(LIBTOOL_DEPS)
13
14 AC_ARG_ENABLE(ccid,
15         [  --enable-ccid        Include internal CCID driver for CM5121],
16         [MY_CCID=1], [MY_CCID=0])
17 # AC_SUBST(MY_CCID)
18 AM_CONDITIONAL(ENABLE_CCID, test "$MY_CCID" == "1")
19
20 dnl Enable/disable openct
21 AC_ARG_ENABLE(openct,
22         AC_HELP_STRING([--enable-openct], [Use (patched) OpenCT for CM5121 CCID access. [[default=no]]]),
23         [ENABLE_OPENCT="${enableval}"],
24         [ENABLE_OPENCT="no"])
25
26 OPENCT_MSG=no
27 if test "x${ENABLE_OPENCT}" = "xyes"; then
28         PKG_CHECK_MODULES(OPENCT, [libopenct], [
29                 OPENCT_MSG=yes
30                 AC_DEFINE(HAVE_OPENCT, 1, [Have OpenCT libraries and header files])
31                 ], [
32                 OPENCT_MSG=no
33                 ])
34         AC_SUBST(OPENCT_CFLAGS)
35         AC_SUBST(OPENCT_LIBS)
36 fi
37 AM_CONDITIONAL(HAVE_OPENCT, test "x$OPENCT_MSG" = "xyes")
38
39 AC_ARG_WITH(firmware,
40         [  --with-firmware=PATH Compile for running inside firmware],
41         [FIRMWARE_PATH="$withval"], [FIRMWARE_PATH=""])
42 AC_SUBST(FIRMWARE_PATH)
43
44 AC_ARG_ENABLE(static,
45         [  --enable-static      Don't use dynamic allocations at all],
46         [ENABLE_STATIC=1], [ENABLE_STATIC=0]) 
47 AM_CONDITIONAL(ENABLE_STATIC, test "$ENABLE_STATIC" == "1")
48
49 AC_ARG_ENABLE(firmware,
50         [  --enable-firmware    Don't use dynamic allocations at all],
51         [ENABLE_FIRMWARE=1], [ENABLE_FIRMWARE=0]) 
52 AM_CONDITIONAL(ENABLE_FIRMWARE, test "$ENABLE_FIRMWARE" == "1")
53
54 AC_ARG_WITH()
55 #AC_CHECK_HEADERS(usb.h, [have_libusb="yes"], [ AC_MSG_WARN([usb.h not found, use --enable-libusb=PATH. Otherwise, INDI will compile without Apogee USB support.]) ])
56
57 AC_CHECK_LIB(usb, usb_close,,)
58 AM_CONDITIONAL(HAVE_LIBUSB, test "x$have_libusb" = "xyes")
59
60 dnl Output the makefile
61 AC_OUTPUT(Makefile etc/Makefile etc/udev/Makefile src/Makefile include/Makefile include/librfid/Makefile utils/Makefile src/librfid.pc)