3 AM_CONFIG_HEADER(config.h)
10 AC_CONFIG_MACRO_DIR([m4])
12 dnl check for libusb-1.0
14 PKG_CHECK_MODULES(LIBUSB_1_0, [ libusb-1.0 >= 1.0.0 ], have_libusb_1_0=yes, have_libusb_1_0=no)
15 if test "$have_libusb_1_0" = "yes"; then
16 CFLAGS="$CFLAGS $LIBUSB_1_0_CFLAGS"
17 CXXFLAGS="$CXXFLAGS $LIBUSB_1_0_CFLAGS"
18 USB_LIBS="$USB_LIBS $LIBUSB_1_0_LIBS"
20 AC_DEFINE(HAVE_LIBUSB_1_0, 1, [Define to 1 if you have libusb-1.0.])
23 AC_MSG_ERROR([libusb-1.0 not found.])
27 AC_ARG_WITH(async-mode,
28 [ --with-async-mode enable experimental async mode. Linux only.],
30 AC_MSG_CHECKING(for experimental linux async mode)
31 if test "$withval" != "no"; then
33 CFLAGS="$CFLAGS -DLIBFTDI_LINUX_ASYNC_MODE"
39 AC_SUBST(ENABLE_ASYNC_MODE)
42 AS_HELP_STRING([--without-examples], [disable example programs]))
43 AM_CONDITIONAL(BUILD_EXAMPLES, [test "x$with_examples" != "xno"])
46 LIBFTDI_MODULES_PKGCONFIG=
48 dnl libftdi C++ wrapper. Needs boost.
51 AC_MSG_CHECKING(if we can build the C++ wrapper)
52 AC_ARG_ENABLE(libftdipp,
53 AS_HELP_STRING([--enable-libftdipp],
54 [enable libftdi C++ wrapper. Needs boost (default: auto)]),
56 if test "$enableval" != "no"; then
57 if test "x$HAVE_BOOST" != "xyes"; then
58 AC_MSG_ERROR(Sorry, we need the boost library for the C++ wrapper)
64 dnl Build the wrapper if we got the boost library
65 if test "x$HAVE_BOOST" = "xyes"; then
69 if test "x$ENABLE_LIBFTDIPP" = "x1"; then
70 LIBFTDI_MODULES="$LIBFTDI_MODULES ftdipp"
71 LIBFTDI_MODULES_PKGCONFIG="$LIBFTDI_MODULES_PKGCONFIG libftdipp.pc"
76 AM_CONDITIONAL(HAVE_LIBFTDIPP, [test "x$ENABLE_LIBFTDIPP" = "x1"])
80 AS_HELP_STRING([--without-docs], [disable doxygen usage]))
81 if test "x$with_docs" != "xno"; then
82 AC_PATH_PROG(DOXYGEN, doxygen)
86 AM_CONDITIONAL(HAVE_DOXYGEN, test -n $DOXYGEN)
88 dnl ============================
89 dnl Bindings for other languages
95 AC_PATH_PROG([SWIG], [swig])
96 AM_CONDITIONAL(HAVE_SWIG, test "$SWIG")
100 dnl =================
101 AM_PATH_PYTHON([2.0],
103 [AC_MSG_WARN([Python not found. Python is required to build presage python binding. Python can be obtained from http://www.pyth
107 python_include_path=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_python_inc();"`
108 AC_CHECK_HEADERS([${python_include_path}/Python.h],
109 [have_python_header=true],
110 [AC_MSG_WARN([Python.h header file not found. Python development files are required to build presage python binding. Pyt
111 hon can be obtained from http://www.python.org])],
114 AM_CONDITIONAL(HAVE_PYTHON, test "$PYTHON" -a "x$have_python_header" = "xtrue")
116 AC_ARG_ENABLE([python-binding],
117 AS_HELP_STRING([--enable-python-binding],
118 [build python binding (default=no)]),
119 [ac_enable_python_binding=$enableval],
120 [ac_enable_python_binding=no])
121 if test "x$ac_enable_python_binding" = "xyes"
123 if test ! "$SWIG" -o ! "$PYTHON" -o ! "x$have_python_header" = "xtrue"
125 AC_MSG_WARN([Python binding for libftdi cannot be built. Ensure that SWIG and Python packages are available.])
128 AC_MSG_NOTICE([Python binding for libftdi will not be built.])
129 AC_MSG_NOTICE([Enable Python binding module building with --enable-python-binding])
131 AM_CONDITIONAL(ENABLE_PYTHON_BINDING, test "x$ac_enable_python_binding" = "xyes")
133 if test "$SWIG" -a "$PYTHON" -a "x$have_python_header" = "xtrue" -a "x$ac_enable_python_binding" = "xyes"
135 AC_MSG_NOTICE([Python binding for libftdi will be built.])
136 build_python_binding="yes"
138 build_python_binding="no"
141 AC_SUBST(LIBFTDI_MODULES)
142 AC_SUBST(LIBFTDI_MODULES_PKGCONFIG)
144 AC_CONFIG_FILES([libftdi-config],[chmod a+x libftdi-config])
145 AC_CONFIG_FILES(Makefile src/Makefile bindings/Makefile bindings/python/Makefile bindings/python/setup.py examples/Makefile doc/Doxyfile doc/Makefile libftdi.pc libftdi.spec)
147 if test "x$ENABLE_LIBFTDIPP" = "x1"; then
148 AC_CONFIG_FILES(ftdipp/Makefile libftdipp.pc)