3 AC_CANONICAL_TARGET([])
6 #COMEDILIB_DEBUG="-Wall -Werror"
7 COMEDILIB_DEBUG="-Wall"
8 AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
9 AS_LIBTOOL(COMEDILIB, 7, 23, 7)
11 AM_CONFIG_HEADER(config.h)
13 ACLOCAL="$ACLOCAL -I m4"
27 COMEDILIB_CFLAGS="$COMEDILIB_CFLAGS -I\$(top_srcdir)/include $COMEDILIB_DEBUG"
28 COMEDILIB_LIBS="$COMEDILIB_LIBS \$(top_builddir)/lib/libcomedi.la -lm"
29 AC_SUBST(COMEDILIB_CFLAGS)
30 AC_SUBST(COMEDILIB_LIBS)
33 AC_PATH_PROG(SWIG, swig, "no")
34 if test "$SWIG" == "no" ; then
35 AC_MSG_WARN([swig not found, will not be able to build swig based bindings])
39 AC_ARG_ENABLE([python-binding],[ --disable-python-binding Disable building of Python binding],
40 [ENABLE_PYTHON=$enableval],[ENABLE_PYTHON="yes"])
41 if test "$ENABLE_PYTHON" == "yes" && test "$SWIG" != "no"; then
43 AM_CHECK_PYTHON_HEADERS(HAVE_PYTHON=yes,[HAVE_PYTHON=no;AC_MSG_WARN([python headers not found, disabling python binding])])
47 AM_CONDITIONAL(HAVE_PYTHON, [test "$HAVE_PYTHON" == "yes" && test "$ENABLE_PYTHON" == "yes"])
49 AS_COMPILER_FLAG([-fno-strict-aliasing],[PYTHON_QUIET="$PYTHON_QUIET -fno-strict-aliasing"], true )
50 AS_COMPILER_FLAG([-Wno-unused-function],[PYTHON_QUIET="$PYTHON_QUIET -Wno-unused-function"], true )
51 AC_SUBST(PYTHON_QUIET)
54 AC_ARG_ENABLE([ruby-binding], [ --disable-ruby-binding Disable building of Ruby binding],
55 [ENABLE_RUBY=$enableval], [ENABLE_RUBY="yes"])
56 if test "$ENABLE_RUBY" == "yes" && test "$SWIG" != "no"; then
57 AC_PATH_PROG(RUBY, ruby, no)
58 if test "$RUBY" != "no" ; then
59 RUBY_INC_DIR=`$RUBY -e "require 'rbconfig'; c = ::Config::CONFIG; print c[['archdir']];"`
60 AC_CHECK_HEADER([$RUBY_INC_DIR/ruby.h],[],[ENABLE_RUBY="no";AC_MSG_WARN([ruby.h not found, disabling Ruby binding])])
62 AC_MSG_WARN([ruby not found, disabling ruby binding])
69 AM_CONDITIONAL(HAVE_RUBY, [test "$ENABLE_RUBY" == "yes"])
71 AC_ARG_VAR(RUBY_PREFIX,[path prefix for Ruby binding])
72 AC_ARG_VAR(RUBY_SO_DIR,[path for Ruby extensions])
73 if test "$RUBY_PREFIX" != "" ; then
74 RUBY_CONFIG_OPTIONS="$RUBY_CONFIG_OPTIONS --prefix=\$(RUBY_PREFIX)"
76 if test "$RUBY_SO_DIR" != "" ; then
77 RUBY_CONFIG_OPTIONS="$RUBY_CONFIG_OPTIONS --so-dir=\$(RUBY_SO_DIR)"
79 AC_SUBST(RUBY_CONFIG_OPTIONS)
82 AC_ARG_ENABLE([scxi], [ --enable-scxi Enable SCXI convenience library],
83 [ENABLE_SCXI=$enableval], [ENABLE_SCXI="no"])
84 AM_CONDITIONAL(BUILD_SCXI, [test "$ENABLE_SCXI" == "yes"])
87 AC_ARG_ENABLE([docbook],[ --disable-docbook-binding Disable docbook],[ENABLE_DOCBOOK=$enableval],[ENABLE_DOCBOOK="yes"])
89 if test "$ENABLE_DOCBOOK" == "yes"; then
90 AC_PATH_PROG(DOCBOOK2MAN, docbook2man, no)
91 if test "$DOCBOOK2MAN" = "no" ; then
92 AC_MSG_WARN([docbook2man not found, will not be able to rebuild man pages])
97 AM_CONDITIONAL(HAVE_DOCBOOK2MAN, [test "$DOCBOOK2MAN" != "no"])
99 if test "$ENABLE_DOCBOOK" == "yes"; then
100 AC_PATH_PROG(DOCBOOK2PDF, docbook2pdf, no)
101 if test "$DOCBOOK2PDF" = "no" ; then
102 AC_MSG_WARN([docbook2pdf not found, will not be able to rebuild pdf documentation])
107 AM_CONDITIONAL(HAVE_DOCBOOK2PDF, [test "$DOCBOOK2PDF" != "no"])
110 if test "$ENABLE_DOCBOOK" == "yes"; then
111 AC_PATH_PROG(DOCBOOK2HTML, docbook2html, no)
112 if test "$DOCBOOK2HTML" = "no" ; then
113 AC_MSG_WARN([docbook2html not found, will not be able to rebuild html documentation])
118 AM_CONDITIONAL(HAVE_DOCBOOK2HTML, [test "$DOCBOOK2HTML" != "no"])
121 pcmciadir="\${sysconfdir}/pcmcia"
127 AC_ARG_WITH([udev-hotplug], [ --with-udev-hotplug=[[/lib]] enable udev hotplug],
128 [ENABLE_UDEVHOTPLUG=$withval], [ENABLE_UDEVHOTPLUG="no"])
129 AM_CONDITIONAL(INSTALL_UDEVHOTPLUG, [test "$ENABLE_UDEVHOTPLUG" != "no"])
130 if test "$ENABLE_UDEVHOTPLUG" != "no"; then
131 udevrulesdir="\${sysconfdir}/udev/rules.d/"
132 if test "$ENABLE_UDEVHOTPLUG" == "yes"; then
133 AC_MSG_ERROR([udev-hotplug needs a path as an argument (usually: --enable-udev-hotplug=/lib).])
135 if test "$ENABLE_UDEVHOTPLUG" != "/lib"; then
136 AC_MSG_WARN([Installing the udev scripts in the non-standard location: $ENABLE_UDEVHOTPLUG (should be --enable-udev-hotplug=/lib)])
138 if test "$sysconfdir" != "/etc"; then
139 AC_MSG_WARN([udev hotplug works only if sysconfdir is set to /etc.])
141 udevfirmwaredir="$ENABLE_UDEVHOTPLUG/firmware"
142 udevscriptsdir="$ENABLE_UDEVHOTPLUG/udev"
143 AC_SUBST(udevrulesdir)
144 AC_SUBST(udevfirmwaredir)
145 AC_SUBST(udevscriptsdir)
147 ENABLE_UDEVHOTPLUG="no"
151 # old hotplug mechanism
152 AC_ARG_ENABLE([etc-hotplug], [ --enable-etc-hotplug enable old hotplug in /etc/hotplug],
153 [ENABLE_ETCHOTPLUG=$enableval], [ENABLE_ETCHOTPLUG="no"])
154 AM_CONDITIONAL(INSTALL_ETCHOTPLUG, [test "$ENABLE_ETCHOTPLUG" != "no"])
156 if test "$ENABLE_ETCHOTPLUG" != "no"; then
157 #see: http://linux-hotplug.sourceforge.net/
158 #the hotplug expects the device dependent scripts here:
159 usbhotplugdir="\${sysconfdir}/hotplug/usb"
160 AC_SUBST(usbhotplugdir)
162 #firmware for the hotplug script
163 #see: http://linux-hotplug.sourceforge.net/
164 usbfirmwaredir="\${datadir}/usb"
165 AC_SUBST(usbfirmwaredir)
166 if test "$sysconfdir" != "/etc"; then
167 AC_MSG_WARN([hotplug works only if sysconfdir is set to /etc.])
171 if test "$ENABLE_ETCHOTPLUG" = "no" && test "$ENABLE_UDEVHOTPLUG" = "no" ; then
172 AC_MSG_WARN([No hotplug mechanism will we installed. Consult ./configure --help if you want hotplug.])
175 #documentaion goes here
176 doccomedilibdir="\${datadir}/doc/libcomedi0"
177 AC_SUBST(doccomedilibdir)
181 comedi_config/Makefile
185 etc/hotplug/usb/Makefile
186 etc/hotplug/usb/usbdux/Makefile
187 etc/hotplug/usb/usbduxfast/Makefile