Changed condition for including <asm/bug.h>.
[comedi.git] / configure.ac
1
2 AC_INIT([comedi],[0.7.76])
3 AC_CONFIG_SRCDIR([comedi/comedi_fops.c])
4 AC_CONFIG_HEADERS(config.h)
5
6 AC_CANONICAL_TARGET([])
7
8 if test x$prefix = xNONE ; then
9   prefix=/
10 fi
11
12 PACKAGE=comedi
13 COMEDI_MAJORVERSION=0
14 COMEDI_MINORVERSION=7
15 COMEDI_MICROVERSION=76
16 # set the nanoversion to 0 for releases, 1 for CVS, >= 2 for prereleases
17 COMEDI_NANOVERSION=0
18
19 if test x$COMEDI_NANOVERSION = x0 ; then
20   VERSION=$COMEDI_MAJORVERSION.$COMEDI_MINORVERSION.$COMEDI_MICROVERSION
21 else
22   VERSION=$COMEDI_MAJORVERSION.$COMEDI_MINORVERSION.$COMEDI_MICROVERSION.$COMEDI_NANOVERSION
23 fi
24
25 AM_INIT_AUTOMAKE([])
26 AM_MAINTAINER_MODE
27
28 AC_SUBST(PACKAGE)
29 AC_SUBST(VERSION)
30 AC_DEFINE_UNQUOTED(COMEDI_MAJORVERSION, $COMEDI_MAJORVERSION, [Comedi major version])
31 AC_DEFINE_UNQUOTED(COMEDI_MINORVERSION, $COMEDI_MINORVERSION, [Comedi minor version])
32 AC_DEFINE_UNQUOTED(COMEDI_MICROVERSION, $COMEDI_MICROVERSION, [Comedi micro version])
33
34 AC_PROG_CC()
35 AM_PROG_CC_C_O
36 AC_PATH_TOOL([STRIP],[strip])
37 AC_PATH_PROG([DEPMOD], [depmod], [no], [$PATH:/sbin:/usr/sbin:/usr/local/sbin])
38 if test "$DEPMOD" == "no" ; then
39         AC_MSG_ERROR([unable to find the 'depmod' program.])
40 fi
41
42 AS_LINUX()
43 AS_LINUX_MODTOOL()
44
45 AC_ARG_ENABLE([rtai], [  --disable-rtai disable use of rtai],
46         [ENABLE_RTAI=$enableval], [ENABLE_RTAI="yes"])
47 DS_RTAI([HAVE_RTAI=yes],[HAVE_RTAI=no])
48 if test "$HAVE_RTAI" == "yes" -a "$ENABLE_RTAI" == "yes"; then
49         USE_RTAI="yes"
50 else
51         USE_RTAI="no"
52 fi
53 DS_RTLINUX([USE_RTLINUX=yes],[USE_RTLINUX=no])
54 AM_CONDITIONAL([CONFIG_COMEDI_RT],
55         [test ${USE_RTAI} = "yes" -o ${USE_RTLINUX} = "yes"])
56 if test ${USE_RTAI} = "yes" -o ${USE_RTLINUX} = "yes" ; then
57         AC_DEFINE([CONFIG_COMEDI_RT],[true],[Define to enable Comedi's real-time support])
58 fi
59
60
61 CC=$LINUX_CC
62
63 #ERROR_CFLAGS="-Werror"
64
65 [COMEDI_CFLAGS="$ERROR_CFLAGS -I\$(top_srcdir)/include/\
66  -DKBUILD_MODNAME=\$(shell basename \$@ .o | sed 's/\(.*\)_ko.*/\1/g')\
67  -DKBUILD_BASENAME=\$(shell basename \$< .c)"]
68 AC_SUBST(COMEDI_CFLAGS)
69
70 AS_CHECK_LINUX_CONFIG_OPTION([CONFIG_PCI],[HAVE_PCI="yes"],[HAVE_PCI="yes"],[HAVE_PCI="no"])
71 AM_CONDITIONAL([CONFIG_PCI],[test "$HAVE_PCI" = "yes"])
72 AC_ARG_ENABLE([pci],[  --disable-pci            Disable support for PCI devices],
73         [ENABLE_PCI=$enableval],[ENABLE_PCI="maybe"])
74 if test "$HAVE_PCI" = "yes" ; then
75         if test "$ENABLE_PCI" = "no" ; then
76                 AC_MSG_NOTICE([PCI support disabled])
77                 USE_PCI="no"
78         else
79                 AC_DEFINE([CONFIG_COMEDI_PCI],[true],[Define if PCI support is enabled])
80                 USE_PCI="yes"
81         fi
82 else
83         if test "$ENABLE_PCI" = "yes" ; then
84                 AC_MSG_ERROR([Kernel does not support PCI])
85         fi
86         USE_PCI="no"
87 fi
88 AM_CONDITIONAL([CONFIG_COMEDI_PCI],[test "$USE_PCI" = "yes"])
89
90 COMEDI_CHECK_PCMCIA_PROBE([$LINUX_SRC_DIR], [HAVE_PCMCIA="yes"], [HAVE_PCMCIA="no"])
91 AM_CONDITIONAL([CONFIG_PCMCIA],[test "$HAVE_PCMCIA" = "yes"])
92 AC_ARG_ENABLE([pcmcia],[  --disable-pcmcia      Disable support for PCMCIA devices],
93         [ENABLE_PCMCIA=$enableval],[ENABLE_PCMCIA="maybe"])
94 if test "$HAVE_PCMCIA" = "yes" ; then
95         if test "$ENABLE_PCMCIA" = "no" ; then
96                 AC_MSG_NOTICE([PCMCIA support disabled])
97                 USE_PCMCIA="no"
98         else
99                 AC_DEFINE([CONFIG_COMEDI_PCMCIA],[true],[Define if using PCMCIA support])
100                 USE_PCMCIA="yes"
101         fi
102 else
103         if test "$ENABLE_PCMCIA" = "yes" ; then
104                 AC_MSG_ERROR([Kernel does not support PCMCIA or its API is not suported by Comedi])
105         fi
106         USE_PCMCIA="no"
107 fi
108 AM_CONDITIONAL([CONFIG_COMEDI_PCMCIA],[test "$USE_PCMCIA" = "yes"])
109
110 AS_CHECK_LINUX_CONFIG_OPTION([CONFIG_USB],[HAVE_USB="yes"],[HAVE_USB="yes"],[HAVE_USB="no"])
111 AM_CONDITIONAL([CONFIG_USB],[test "$HAVE_USB" = "yes"])
112 AC_ARG_ENABLE([usb],[  --disable-usb            Disable support for USB devices],
113         [ENABLE_USB=$enableval],[ENABLE_USB="maybe"])
114 if test "$HAVE_USB" = "yes" ; then
115         if test "$ENABLE_USB" = "no" ; then
116                 AC_MSG_NOTICE([USB support disabled])
117                 USE_USB="no"
118         else
119                 AC_DEFINE([CONFIG_COMEDI_USB],[true],[Define if using USB support])
120                 USE_USB="yes"
121         fi
122 else
123         if test "$ENABLE_USB" = "yes" ; then
124                 AC_MSG_ERROR([Kernel does not support USB])
125         fi
126         USE_USB="no"
127 fi
128 AM_CONDITIONAL([CONFIG_COMEDI_USB],[test "$USE_USB" = "yes"])
129
130 COMEDI_CHECK_LINUX_KBUILD([$LINUX_SRC_DIR], [ENABLE_KBUILD="yes"], [ENABLE_KBUILD="no"])
131 AC_ARG_ENABLE([kbuild], [  --enable-kbuild      Force use (or not) of kernel's Kbuild system to build modules (needs recent 2.6 kernel)],
132         [ENABLE_KBUILD=$enableval], [])
133 AM_CONDITIONAL([CONFIG_KBUILD], [test ${ENABLE_KBUILD} = "yes"])
134 COMEDI_CHECK_HAVE_MUTEX_H([$LINUX_SRC_DIR], [HAVE_MUTEX_H="yes"], [HAVE_MUTEX_H="no"])
135 AS_LINUX_CONFIG_OPTION_MODULE(CONFIG_ISA)
136
137 AC_DEFINE(CONFIG_COMEDI_DEBUG, true, [Define if debugging is enabled])
138 AC_DEFINE(CONFIG_COMEDI_8255, true, [Define if 8255 support is enabled])
139
140 DISTCHECK_CONFIGURE_FLAGS="--with-modulesdir=\\\$\$\(prefix\)/modules"
141 AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
142
143 AC_CONFIG_FILES([
144 Makefile
145 comedi/Makefile
146 comedi/comedi_kbuild.inc
147 comedi/drivers/Makefile
148 comedi/drivers/addi-data/Makefile
149 comedi/kcomedilib/Makefile
150 include/Makefile
151 include/asm/Makefile
152 include/linux/Makefile
153 include/pcmcia/Makefile
154 ])
155 AC_OUTPUT
156