doc: add missing -lm option to command line for compiling tut1
[comedilib.git] / configure.ac
index 900978ee5ffa28fc0e9111112e95920ec8ad27fd..ffc9bbd58518d0ee2cd3b27b48633a32d527cb78 100644 (file)
 #  else, `c:r:a' becomes `c:r+1:a'.
 #
 m4_define([comedilib_lt_current], [10])
-m4_define([comedilib_lt_revision], [0])
+m4_define([comedilib_lt_revision], [2])
 m4_define([comedilib_lt_age], [10])
+# Set 'letter', normally empty.  See below for rules.
+m4_define([comedilib_version_letter], [])
 
 #libscxi c:r:a
 m4_define([scxi_lt_current], [9])
 m4_define([scxi_lt_revision], [0])
 m4_define([scxi_lt_age], [9])
 
-# comedilib version: major.minor.micro
+# comedilib library version: major.minor.micro
+# comedilib package version: major.minor.micro[letter]
 #
 # Currently:
 #  * 'major' may be incremented at the whim of the maintainers.
 #  * 'minor' is libtool 'current' minus the value of 'current' when major
 #    changed (comedilib_major_base_current).
 #  * 'micro' is libtool 'revision'.
+#  * 'letter' is normally absent and is removed if any of 'major', 'minor'
+#    or 'micro' are changed between releases.  Otherwise it is set if the
+#    only changes between releases are outside the library source code or
+#    language binding, for example the comedilib manual, "readme" files
+#    or sample configuration files.  When it needs to be set, it is set to
+#    'a' if previously absent, otherwise the next lower-case ASCII letter
+#    in the sequence.  (In the unlikely event that we we need to go beyond
+#    'z', append an extra letter.)
+#
+# Example package version sequence: 0.10.1, 0.10.1a, 0.10.1b, 0.10.2,
+# 0.10.2a, ..., 0.10.2z, 0.10.2za, 0,10.2zb, 0.11.0.
+
+# Gentle reminder: The comedilib manual mentions the version of comedilib
+# it applies to.  This is done by setting the 'comedilib_version' entity
+# in "doc/comedilib.ent".  That needs to be edited manually as it is not
+# updated automatically.  Policy: the version of the manual is usually only
+# updated if the contents have changed since the previous release.  In that
+# case, it is set to the comedilib package version.
 
 # Manually set 'comedilib_major_base_current' to new 'comedilib_lt_current'
 # whenever 'comedilib_version_major' is incremented below.
@@ -44,7 +65,11 @@ m4_define([comedilib_version_minor],
          [m4_eval(comedilib_lt_current - comedilib_major_base_current)])
 m4_define([comedilib_version_micro], [comedilib_lt_revision])
 m4_define([comedilib_pkg_version],
-         [comedilib_version_major.comedilib_version_minor.comedilib_version_micro])
+         [m4_join([],
+                  m4_join([.], comedilib_version_major,
+                          comedilib_version_minor,
+                          comedilib_version_micro),
+                  comedilib_version_letter)])
 
 AC_INIT([comedilib], [comedilib_pkg_version])
 AC_CANONICAL_TARGET([])
@@ -62,17 +87,13 @@ AC_CONFIG_AUX_DIR([.])
 COMEDILIB_DEBUG="-Wall"
 AM_INIT_AUTOMAKE([-Wall -Werror])
 
-# AS_LIBTOOL arguments are (prefix, current, revision, age)
-AS_LIBTOOL(COMEDILIB, comedilib_lt_current, comedilib_lt_revision, comedilib_lt_age)
-SCXI_SO_VERSION=scxi_lt_current:scxi_lt_revision:scxi_lt_age
-AC_SUBST(SCXI_SO_VERSION)
-
-AM_CONFIG_HEADER(config.h)
+AC_CONFIG_HEADERS([config.h])
 
 ACLOCAL="$ACLOCAL -I m4"
 
 AM_MAINTAINER_MODE
 
+AM_PROG_AR
 AC_PROG_CC
 AM_PROG_CC_C_O
 AC_PROG_CC_STDC
@@ -85,6 +106,11 @@ AC_HEADER_STDC([])
 
 AX_TLS
 
+# AS_LIBTOOL arguments are (prefix, current, revision, age)
+AS_LIBTOOL(COMEDILIB, comedilib_lt_current, comedilib_lt_revision, comedilib_lt_age)
+SCXI_SO_VERSION=scxi_lt_current:scxi_lt_revision:scxi_lt_age
+AC_SUBST(SCXI_SO_VERSION)
+
 COMEDILIB_CFLAGS="$COMEDILIB_CFLAGS -I\$(top_srcdir)/include -I\$(top_builddir)/include $COMEDILIB_DEBUG"
 COMEDILIB_LIBS="$COMEDILIB_LIBS \$(top_builddir)/lib/libcomedi.la -lm"
 AC_SUBST(COMEDILIB_CFLAGS)
@@ -180,21 +206,69 @@ if test "$ENABLE_DOCBOOK" == "yes"; then
        if test "$XMLTO" = "no" ; then
                AC_MSG_WARN([xmlto not found, will not be able to rebuild documentation])
        fi
-       AC_PATH_PROG(DBLATEX, dblatex, no)
-        if test "$DBLATEX" = "no" ; then
-                AC_MSG_WARN([dblatex not found, will not be able to generate pdfs])
-        fi
 else
        XMLTO="no"
-       DBLATEX="no"
 fi
+
+if test "$XMLTO" != "no"; then
+       AC_ARG_WITH([pdf-backend],
+               [AS_HELP_STRING([--with-pdf-backend=[[yes|no|dblatex|fop|default]]],
+                       [Enable or disable PDF generation with backend])],
+               [WITH_PDF_BACKEND=$withval],[WITH_PDF_BACKEND="yes"])
+       case "$WITH_PDF_BACKEND" in
+       no)
+               PDF_BACKEND="no"
+               ;;
+       yes)
+               # Prefer dblatex, then default backend.
+               # Could use [dblatex fop] to prefer dblatex or fop.
+               AC_CHECK_PROGS([PDF_BACKEND], [dblatex], [default])
+               # The default backend is broken, so avoid it for now.
+               if test "$PDF_BACKEND" = "default"; then
+                       AC_MSG_WARN([Default PDF backend is broken, disabling PDF generation])
+                       AC_MSG_WARN([(dblatex is recommended for PDF generation)])
+                       PDF_BACKEND="no"
+               fi
+               if test "$PDF_BACKEND" != "no"; then
+                       AC_MSG_NOTICE([Will use $PDF_BACKEND backend for PDF generation])
+               fi
+               ;;
+       default)
+               # Use xmlto's default backend.
+               PDF_BACKEND="default"
+               ;;
+       dblatex|fop)
+               AC_CHECK_PROG([PDF_BACKEND], [$WITH_PDF_BACKEND],
+                       [$WITH_PDF_BACKEND], [no])
+               if test "$PDF_BACKEND" = "no"; then
+                       AC_MSG_WARN([$WITH_PDF_BACKEND not found, disabling PDF generation])
+               fi
+               ;;
+       *)
+               AC_MSG_WARN([Bad --with-pdf-backend option, disabling PDF generation])
+               PDF_BACKEND="no"
+               ;;
+       esac
+else
+       PDF_BACKEND="no"
+fi
+case $PDF_BACKEND in
+fop|default)
+       AC_MSG_WARN([$PDF_BACKEND PDF backend might not work.  --without-pdf-backend disables PDF generation.])
+       ;;
+esac
 AM_CONDITIONAL(HAVE_XMLTO, [test "$XMLTO" != "no"])
-AM_CONDITIONAL(HAVE_DBLATEX, [test "$DBLATEX" != "no"])
+AM_CONDITIONAL(BUILD_PDF, [test "$PDF_BACKEND" != "no"])
+AM_CONDITIONAL(BUILD_PDF_USING_DBLATEX, [test "$PDF_BACKEND" = "dblatex"])
+AM_CONDITIONAL(BUILD_PDF_USING_FOP, [test "$PDF_BACKEND" = "fop"])
 
 pcmciadir="\${sysconfdir}/pcmcia"
 AC_SUBST(pcmciadir)
 
-
+# firmware
+AC_ARG_ENABLE([firmware],
+       [AS_HELP_STRING([--disable-firmware], [Disable installation of firmware files])],
+       [ENABLE_FIRMWARE=$enableval],[ENABLE_FIRMWARE="yes"])
 
 # new udev hotplug
 AC_ARG_WITH([udev-hotplug],
@@ -208,49 +282,26 @@ if test "$ENABLE_UDEVHOTPLUG" != "no"; then
        if test "$ENABLE_UDEVHOTPLUG" != "/lib"; then
                AC_MSG_WARN([Installing the udev scripts in the non-standard location: $ENABLE_UDEVHOTPLUG (should be --enable-udev-hotplug=/lib)])
        fi
-       if test "$sysconfdir" != "/etc"; then
-               AC_MSG_WARN([udev hotplug works only if sysconfdir is set to /etc.])
-       fi
        udevrulesdir="$ENABLE_UDEVHOTPLUG/udev/rules.d/"
-       udevfirmwaredir="$ENABLE_UDEVHOTPLUG/firmware"
        udevscriptsdir="$ENABLE_UDEVHOTPLUG/udev"
        AC_SUBST(udevrulesdir)
-       AC_SUBST(udevfirmwaredir)
        AC_SUBST(udevscriptsdir)
+       if test "$ENABLE_FIRMWARE" == "yes"; then
+       udevfirmwaredir="$ENABLE_UDEVHOTPLUG/firmware"
+       AC_SUBST(udevfirmwaredir)
+       fi
 else
        ENABLE_UDEVHOTPLUG="no"
 fi
 
-
-# old hotplug mechanism
-AC_ARG_ENABLE([etc-hotplug],
-       [AS_HELP_STRING([--enable-etc-hotplug],
-               [enable old hotplug in /etc/hotplug])],
-       [ENABLE_ETCHOTPLUG=$enableval], [ENABLE_ETCHOTPLUG="no"])
-AM_CONDITIONAL(INSTALL_ETCHOTPLUG, [test "$ENABLE_ETCHOTPLUG" != "no"])
-
-if test "$ENABLE_ETCHOTPLUG" != "no"; then
-#see: http://linux-hotplug.sourceforge.net/
-#the hotplug expects the device dependent scripts here:
-       usbhotplugdir="\${sysconfdir}/hotplug/usb"
-       AC_SUBST(usbhotplugdir)
-
-#firmware for the hotplug script
-#see: http://linux-hotplug.sourceforge.net/
-       usbfirmwaredir="\${datadir}/usb"
-       AC_SUBST(usbfirmwaredir)
-       if test "$sysconfdir" != "/etc"; then
-               AC_MSG_WARN([hotplug works only if sysconfdir is set to /etc.])
-       fi
-fi
-
-if test "$ENABLE_ETCHOTPLUG" = "no" && test "$ENABLE_UDEVHOTPLUG" = "no" ; then
+if test "$ENABLE_UDEVHOTPLUG" = "no" ; then
                AC_MSG_WARN([No hotplug mechanism will be installed. Consult ./configure --help if you want hotplug.])
 fi
 
 AC_CONFIG_FILES(
 Makefile
 comedi_config/Makefile
+comedi_board_info/Makefile
 c++/Makefile
 c++/include/Makefile
 etc/Makefile