2 AC_INIT([comedilib], [0.9.0])
3 AC_CANONICAL_TARGET([])
5 AC_CONFIG_MACRO_DIR([m4])
7 #COMEDILIB_DEBUG="-Wall -Werror"
8 COMEDILIB_DEBUG="-Wall"
9 AM_INIT_AUTOMAKE([-Wall -Werror])
11 # libtool version: current:revision:age
13 # If the library source code has changed at all since the last update, then
14 # increment revision (`c:r:a' becomes `c:r+1:a').
16 # If any interfaces have been added, removed, or changed since the last update,
17 # increment current, and set revision to 0.
19 # If any interfaces have been added since the last public release, then
22 # If any interfaces have been removed since the last public release, then set
25 # AS_LIBTOOL arguments are (prefix, current, revision, age)
26 AS_LIBTOOL(COMEDILIB, 9, 0, 9)
29 AC_SUBST(SCXI_SO_VERSION)
31 AM_CONFIG_HEADER(config.h)
33 ACLOCAL="$ACLOCAL -I m4"
49 COMEDILIB_CFLAGS="$COMEDILIB_CFLAGS -I\$(top_srcdir)/include $COMEDILIB_DEBUG"
50 COMEDILIB_LIBS="$COMEDILIB_LIBS \$(top_builddir)/lib/libcomedi.la -lm"
51 AC_SUBST(COMEDILIB_CFLAGS)
52 AC_SUBST(COMEDILIB_LIBS)
54 # autoconf backwards compatibility
55 if test "$datarootdir" = ""; then
56 datarootdir='${datadir}'
60 if test "$docdir" = ""; then
61 docdir='${datarootdir}/doc/${PACKAGE}'
65 if test "$htmldir" = ""; then
70 if test "$pdfdir" = ""; then
76 AC_PATH_PROG(SWIG, swig, "no")
77 if test "$SWIG" == "no" ; then
78 AC_MSG_WARN([swig not found, will not be able to build swig based bindings])
82 AC_ARG_ENABLE([python-binding],[ --disable-python-binding Disable building of Python binding],
83 [ENABLE_PYTHON=$enableval],[ENABLE_PYTHON="yes"])
84 if test "$ENABLE_PYTHON" == "yes" && test "$SWIG" != "no"; then
86 AM_CHECK_PYTHON_HEADERS(HAVE_PYTHON=yes,[HAVE_PYTHON=no;AC_MSG_WARN([python headers not found, disabling python binding])])
90 AM_CONDITIONAL(HAVE_PYTHON, [test "$HAVE_PYTHON" == "yes" && test "$ENABLE_PYTHON" == "yes"])
92 AS_COMPILER_FLAG([-fno-strict-aliasing],[PYTHON_QUIET="$PYTHON_QUIET -fno-strict-aliasing"], true )
93 AS_COMPILER_FLAG([-Wno-unused-function],[PYTHON_QUIET="$PYTHON_QUIET -Wno-unused-function"], true )
94 AC_SUBST(PYTHON_QUIET)
97 AC_ARG_ENABLE([ruby-binding], [ --disable-ruby-binding Disable building of Ruby binding],
98 [ENABLE_RUBY=$enableval], [ENABLE_RUBY="yes"])
99 if test "$ENABLE_RUBY" == "yes" && test "$SWIG" != "no"; then
100 AC_PATH_PROG(RUBY, ruby, no)
101 if test "$RUBY" != "no" ; then
102 RUBY_INC_DIR=`$RUBY -e "require 'rbconfig'; c = ::Config::CONFIG; print c[['archdir']];"`
103 AC_CHECK_HEADER([$RUBY_INC_DIR/ruby.h],[],[ENABLE_RUBY="no";AC_MSG_WARN([ruby.h not found, disabling Ruby binding])])
105 AC_MSG_WARN([ruby not found, disabling ruby binding])
112 AM_CONDITIONAL(HAVE_RUBY, [test "$ENABLE_RUBY" == "yes"])
114 AC_ARG_VAR(RUBY_PREFIX,[path prefix for Ruby binding])
115 AC_ARG_VAR(RUBY_SO_DIR,[path for Ruby extensions])
116 if test "$RUBY_PREFIX" != "" ; then
117 RUBY_CONFIG_OPTIONS="$RUBY_CONFIG_OPTIONS --prefix=\$(RUBY_PREFIX)"
119 if test "$RUBY_SO_DIR" != "" ; then
120 RUBY_CONFIG_OPTIONS="$RUBY_CONFIG_OPTIONS --so-dir=\$(RUBY_SO_DIR)"
122 AC_SUBST(RUBY_CONFIG_OPTIONS)
125 AC_ARG_ENABLE([scxi], [ --enable-scxi Enable SCXI convenience library],
126 [ENABLE_SCXI=$enableval], [ENABLE_SCXI="no"])
127 AM_CONDITIONAL(BUILD_SCXI, [test "$ENABLE_SCXI" == "yes"])
130 AC_ARG_ENABLE([docbook],[ --disable-docbook-binding Disable docbook],[ENABLE_DOCBOOK=$enableval],[ENABLE_DOCBOOK="yes"])
132 if test "$ENABLE_DOCBOOK" == "yes"; then
133 AC_PATH_PROG(XMLTO, xmlto, no)
134 if test "$XMLTO" = "no" ; then
135 AC_MSG_WARN([xmlto not found, will not be able to rebuild documentation])
140 AM_CONDITIONAL(HAVE_XMLTO, [test "$XMLTO" != "no"])
142 pcmciadir="\${sysconfdir}/pcmcia"
148 AC_ARG_WITH([udev-hotplug], [ --with-udev-hotplug=[[/lib]] enable udev hotplug],
149 [ENABLE_UDEVHOTPLUG=$withval], [ENABLE_UDEVHOTPLUG="no"])
150 AM_CONDITIONAL(INSTALL_UDEVHOTPLUG, [test "$ENABLE_UDEVHOTPLUG" != "no"])
151 if test "$ENABLE_UDEVHOTPLUG" != "no"; then
152 udevrulesdir="\${sysconfdir}/udev/rules.d/"
153 if test "$ENABLE_UDEVHOTPLUG" == "yes"; then
154 AC_MSG_ERROR([udev-hotplug needs a path as an argument (usually: --enable-udev-hotplug=/lib).])
156 if test "$ENABLE_UDEVHOTPLUG" != "/lib"; then
157 AC_MSG_WARN([Installing the udev scripts in the non-standard location: $ENABLE_UDEVHOTPLUG (should be --enable-udev-hotplug=/lib)])
159 if test "$sysconfdir" != "/etc"; then
160 AC_MSG_WARN([udev hotplug works only if sysconfdir is set to /etc.])
162 udevfirmwaredir="$ENABLE_UDEVHOTPLUG/firmware"
163 udevscriptsdir="$ENABLE_UDEVHOTPLUG/udev"
164 AC_SUBST(udevrulesdir)
165 AC_SUBST(udevfirmwaredir)
166 AC_SUBST(udevscriptsdir)
168 ENABLE_UDEVHOTPLUG="no"
172 # old hotplug mechanism
173 AC_ARG_ENABLE([etc-hotplug], [ --enable-etc-hotplug enable old hotplug in /etc/hotplug],
174 [ENABLE_ETCHOTPLUG=$enableval], [ENABLE_ETCHOTPLUG="no"])
175 AM_CONDITIONAL(INSTALL_ETCHOTPLUG, [test "$ENABLE_ETCHOTPLUG" != "no"])
177 if test "$ENABLE_ETCHOTPLUG" != "no"; then
178 #see: http://linux-hotplug.sourceforge.net/
179 #the hotplug expects the device dependent scripts here:
180 usbhotplugdir="\${sysconfdir}/hotplug/usb"
181 AC_SUBST(usbhotplugdir)
183 #firmware for the hotplug script
184 #see: http://linux-hotplug.sourceforge.net/
185 usbfirmwaredir="\${datadir}/usb"
186 AC_SUBST(usbfirmwaredir)
187 if test "$sysconfdir" != "/etc"; then
188 AC_MSG_WARN([hotplug works only if sysconfdir is set to /etc.])
192 if test "$ENABLE_ETCHOTPLUG" = "no" && test "$ENABLE_UDEVHOTPLUG" = "no" ; then
193 AC_MSG_WARN([No hotplug mechanism will be installed. Consult ./configure --help if you want hotplug.])
198 comedi_config/Makefile
204 etc/hotplug/usb/Makefile
205 etc/hotplug/usb/usbdux/Makefile
206 etc/hotplug/usb/usbduxfast/Makefile