more autoconf support for ruby binding
[comedilib.git] / configure.ac
1
2 AC_INIT
3 AC_CANONICAL_TARGET([])
4
5 AC_CONFIG_AUX_DIR([.])
6 AS_VERSION(comedilib, COMEDILIB, 0, 7, 21)
7 #COMEDILIB_DEBUG="-Wall -Werror"
8 COMEDILIB_DEBUG="-Wall"
9 AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
10 AS_LIBTOOL(COMEDILIB, 0, 7, 18, yes)
11
12 AM_CONFIG_HEADER(config.h)
13
14 ACLOCAL="$ACLOCAL -I m4"
15
16 AM_MAINTAINER_MODE
17
18 AC_PROG_CC
19 AM_PROG_CC_STDC
20 AC_ISC_POSIX
21 AM_PROG_LEX
22 AC_PROG_YACC
23
24 AC_HEADER_STDC([])
25
26 COMEDILIB_CFLAGS="$COMEDILIB_CFLAGS -I\$(top_srcdir)/include $COMEDILIB_DEBUG"
27 COMEDILIB_LIBS="$COMEDILIB_LIBS \$(top_builddir)/lib/libcomedi.la -lm"
28 AC_SUBST(COMEDILIB_CFLAGS)
29 AC_SUBST(COMEDILIB_LIBS)
30
31 AC_PATH_PROG(SWIG, swig, no)
32 if test "$SWIG" == no ; then
33   AC_MSG_WARN([swig not found, will not be able to regenerate code for swig bindings])
34 fi
35 AM_CONDITIONAL(HAVE_SWIG, [test "$SWIG" != "no"])
36
37 AM_PATH_PYTHON
38 AM_CHECK_PYTHON_HEADERS(HAVE_PYTHON=yes,[HAVE_PYTHON=no;AC_MSG_WARN([python headers not found, disabling python binding])])
39 AM_CONDITIONAL(HAVE_PYTHON, [test "$HAVE_PYTHON" == "yes"])
40
41 AS_COMPILER_FLAG([-fno-strict-aliasing],[PYTHON_QUIET="$PYTHON_QUIET -fno-strict-aliasing"], true )
42 AS_COMPILER_FLAG([-Wno-unused-function],[PYTHON_QUIET="$PYTHON_QUIET -Wno-unused-function"], true )
43 AC_SUBST(PYTHON_QUIET)
44
45 AC_PATH_PROG(RUBY, ruby, no)
46 if test "$RUBY" == "no" ; then
47   AC_MSG_WARN([ruby not found, disabling ruby binding])
48 fi
49 AM_CONDITIONAL(HAVE_RUBY, [test "$RUBY" != "no"])
50 AC_ARG_VAR(RUBY_PREFIX,[path prefix for Ruby binding [PREFIX/]])
51 AC_ARG_VAR(RUBY_SO_DIR,[path for Ruby extensions])
52 if test "$RUBY_PREFIX" != "" ; then
53         RUBY_CONFIG_OPTIONS="$RUBY_CONFIG_OPTIONS --prefix=\$(RUBY_PREFIX)"
54 fi
55 if test "$RUBY_SO_DIR" != "" ; then
56         RUBY_CONFIG_OPTIONS="$RUBY_CONFIG_OPTIONS --so-dir=\$(RUBY_SO_DIR)"
57 fi
58 AC_SUBST(RUBY_CONFIG_OPTIONS)
59
60 AC_PATH_PROG(DOCBOOK2MAN, docbook2man, no)
61 if test "$DOCBOOK2MAN" = "no" ; then
62   AC_MSG_WARN([docbook2man not found, will not be able to rebuild man pages])
63 fi
64 AM_CONDITIONAL(HAVE_DOCBOOK2MAN, [test "$DOCBOOK2MAN" != "no"])
65
66 AC_PATH_PROG(DOCBOOK2PDF, docbook2pdf, no)
67 if test "$DOCBOOK2PDF" = "no" ; then
68   AC_MSG_WARN([docbook2pdf not found, will not be able to rebuild pdf documentation])
69 fi
70 AM_CONDITIONAL(HAVE_DOCBOOK2PDF, [test "$DOCBOOK2PDF" != "no"])
71
72 AC_PATH_PROG(DOCBOOK2HTML, docbook2html, no)
73 if test "$DOCBOOK2HTML" = "no" ; then
74   AC_MSG_WARN([docbook2html not found, will not be able to rebuild html documentation])
75 fi
76 AM_CONDITIONAL(HAVE_DOCBOOK2HTML, [test "$DOCBOOK2HTML" != "no"])
77
78 pcmciadir="\${sysconfdir}/pcmcia"
79 AC_SUBST(pcmciadir)
80
81 #see: http://linux-hotplug.sourceforge.net/
82 #the hotplug expects the device dependent scripts here:
83 usbhotplugdir="/etc/hotplug/usb"
84 AC_SUBST(usbhotplugdir)
85
86 #firmware for the hotplug script
87 #see: http://linux-hotplug.sourceforge.net/
88 usbfirmwaredir="/usr/share/usb"
89 AC_SUBST(usbfirmwaredir)
90
91 AC_CONFIG_FILES(
92 Makefile
93 comedi_calibrate/Makefile
94 comedi_config/Makefile
95 etc/Makefile
96 etc/pcmcia/Makefile
97 etc/hotplug/Makefile
98 etc/hotplug/usb/Makefile
99 etc/hotplug/usb/usbdux/Makefile
100 doc/Makefile
101 demo/Makefile
102 include/Makefile
103 lib/Makefile
104 man/Makefile
105 swig/Makefile
106 swig/python/Makefile
107 swig/ruby/Makefile
108 testing/Makefile
109 comedilib.spec
110 )
111
112 AC_OUTPUT
113
114