add pkgconfig file
[comedilib.git] / configure.ac
index be6bdc1c69777bd809b22f869189d78e6eaaca97..302fac850b69de06fc07c7936a4c64c73f87131d 100644 (file)
@@ -44,15 +44,18 @@ AS_COMPILER_FLAG([-fno-strict-aliasing],[PYTHON_QUIET="$PYTHON_QUIET -fno-strict
 AS_COMPILER_FLAG([-Wno-unused-function],[PYTHON_QUIET="$PYTHON_QUIET -Wno-unused-function"], true )
 AC_SUBST(PYTHON_QUIET)
 
-AC_ARG_ENABLE([ruby-binding],[  --disable-ruby-binding Disable building of Ruby binding],
-       [ENABLE_RUBY=$enableval],[ENABLE_RUBY="yes"])
+AC_ARG_ENABLE([ruby-binding], [  --disable-ruby-binding        Disable building of Ruby binding],
+       [ENABLE_RUBY=$enableval], [ENABLE_RUBY="yes"])
 AC_PATH_PROG(RUBY, ruby, no)
-if test "$RUBY" == "no" ; then
+if test "$RUBY" != "no" ; then
+       RUBY_INC_DIR=`$RUBY -e "require 'rbconfig'; c = ::Config::CONFIG; print c[['archdir']];"`
+       AC_CHECK_HEADER([$RUBY_INC_DIR/ruby.h],[],[ENABLE_RUBY="no";AC_MSG_WARN([ruby.h not found, disabling Ruby binding])])
+else
        AC_MSG_WARN([ruby not found, disabling ruby binding])
        ENABLE_RUBY="no"
 fi
 AM_CONDITIONAL(HAVE_RUBY, [test "$ENABLE_RUBY" == "yes"])
-AC_ARG_VAR(RUBY_PREFIX,[path prefix for Ruby binding [PREFIX/]])
+AC_ARG_VAR(RUBY_PREFIX,[path prefix for Ruby binding])
 AC_ARG_VAR(RUBY_SO_DIR,[path for Ruby extensions])
 if test "$RUBY_PREFIX" != "" ; then
        RUBY_CONFIG_OPTIONS="$RUBY_CONFIG_OPTIONS --prefix=\$(RUBY_PREFIX)"
@@ -62,6 +65,10 @@ if test "$RUBY_SO_DIR" != "" ; then
 fi
 AC_SUBST(RUBY_CONFIG_OPTIONS)
 
+AC_ARG_ENABLE([scxi], [  --enable-scxi  Enable SCXI convenience library],
+       [ENABLE_SCXI=$enableval], [ENABLE_SCXI="no"])
+AM_CONDITIONAL(BUILD_SCXI, [test "$ENABLE_SCXI" == "yes"])
+
 AC_PATH_PROG(DOCBOOK2MAN, docbook2man, no)
 if test "$DOCBOOK2MAN" = "no" ; then
   AC_MSG_WARN([docbook2man not found, will not be able to rebuild man pages])
@@ -85,12 +92,12 @@ AC_SUBST(pcmciadir)
 
 #see: http://linux-hotplug.sourceforge.net/
 #the hotplug expects the device dependent scripts here:
-usbhotplugdir="/etc/hotplug/usb"
+usbhotplugdir="\${sysconfdir}/hotplug/usb"
 AC_SUBST(usbhotplugdir)
 
 #firmware for the hotplug script
 #see: http://linux-hotplug.sourceforge.net/
-usbfirmwaredir="/usr/share/usb"
+usbfirmwaredir="\${datadir}/usb"
 AC_SUBST(usbfirmwaredir)
 
 AC_CONFIG_FILES(
@@ -107,6 +114,7 @@ demo/Makefile
 include/Makefile
 lib/Makefile
 man/Makefile
+scxi/Makefile
 swig/Makefile
 swig/python/Makefile
 swig/ruby/Makefile