X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=configure.ac;h=d2f8926a3b1d4ecb79fdab777747a0fceb9283f7;hb=3532ed01256b986ecaf37ea5bb29d81465e2aa89;hp=d8483522700fbcddcbd64db472e5ce184af7c18b;hpb=022a7fe09fec0c58bd5f4e92f74610f46fb53d2b;p=libsigrok.git diff --git a/configure.ac b/configure.ac index d8483522..d2f8926a 100644 --- a/configure.ac +++ b/configure.ac @@ -181,37 +181,43 @@ m4_ifdef([AX_CXX_COMPILE_STDCXX_11], [AX_CXX_COMPILE_STDCXX_11(,[optional])], [AC_MSG_NOTICE([Missing macro m4_toupper(aX_CXX_COMPILE_STDCXX_11), no C++11 check])]) if test "x$HAVE_CXX11" != "x1"; then - BINDINGS_CXX="no" + BINDINGS_CXX="no"; cxx_msg="C++11 compiler required" fi -# The C++ bindings use gccxml to parse libsigrok symbols. -AC_CHECK_PROG([HAVE_GCCXML], [gccxml], [yes]) -if test "x$HAVE_GCCXML" != "xyes"; then - BINDINGS_CXX="no" +# The C++ bindings use doxygen to parse libsigrok symbols. +AC_CHECK_PROG([HAVE_DOXYGEN], [doxygen], [yes]) +if test "x$HAVE_DOXYGEN" != "xyes"; then + BINDINGS_CXX="no"; cxx_msg="doxygen required" fi -# Python is needed for the C++ (and Python) bindings. -PKG_CHECK_MODULES([python], [python3 >= 2.7], +# Python is needed for the C++ bindings. +AC_CHECK_PROG([HAVE_PYTHON], [python], [yes]) +if test "x$HAVE_PYTHON" != "xyes"; then + BINDINGS_CXX="no"; cxx_msg="Python required" +fi + +# The Python bindings need Python development files +PKG_CHECK_MODULES([python], [python >= 2.7], [CXXFLAGS="$CXXFLAGS $python_CFLAGS"; CXXLIBS="$CXXLIBS $python_LIBS"], - [BINDINGS_CXX="no"]) + [BINDINGS_PYTHON="no"; python_msg="Python headers required"]) -# The C++ bindings need the pygccxml Python module. -m4_ifdef([AX_PYTHON_MODULE], [AX_PYTHON_MODULE([pygccxml])], +# The Python bindings need the setuptools Python module. +m4_ifdef([AX_PYTHON_MODULE], [AX_PYTHON_MODULE([setuptools])], # We'll let it go through even if the macro wasn't found, the python # module may still be there. - [HAVE_PYTHON_PYGCCXML="yes"; - AC_MSG_NOTICE([Missing macro m4_toupper(aX_PYTHON_MODULE), no pygccxml check])] + [HAVE_PYTHON_SETUPTOOLS="yes"; + AC_MSG_NOTICE([Missing macro m4_toupper(aX_PYTHON_MODULE), no setuptools check])] ) -if test "x$HAVE_PYMOD_PYGCCXML" != "xyes"; then - BINDINGS_CXX="no" +if test "x$HAVE_PYMOD_SETUPTOOLS" != "xyes"; then + BINDINGS_PYTHON="no"; python_msg="Python setuptools module required" fi -# Python and Java bindings depend on C++ bindings. - -if test "x$BINDINGS_CXX" != "xyes"; then - BINDINGS_PYTHON="no" - BINDINGS_JAVA="no" +# The Python and Java bindings use swig to generate code. +AC_CHECK_PROG([HAVE_SWIG], [swig], [yes]) +if test "x$HAVE_SWIG" != "xyes"; then + BINDINGS_PYTHON="no"; python_msg="swig required" + BINDINGS_JAVA="no"; java_msg="swig required" fi # Checks for libraries. @@ -366,7 +372,8 @@ fi # glibmm-2.4 is needed for the C++ bindings. PKG_CHECK_MODULES([glibmm], [glibmm-2.4 >= 2.32.0], [CXXFLAGS="$CXXFLAGS $glibmm_CFLAGS"; - CXXLIBS="$CXXLIBS $glibmm_LIBS"], [BINDINGS_CXX="no"]) + CXXLIBS="$CXXLIBS $glibmm_LIBS"], + [BINDINGS_CXX="no"; cxx_msg="glibmm required"]) # PyGObject is needed for the Python bindings. PKG_CHECK_MODULES([pygobject], [pygobject-3.0 >= 3.0.0], @@ -376,7 +383,7 @@ PKG_CHECK_MODULES([pygobject], [pygobject-3.0 >= 3.0.0], [pyg_flags_signed=0], [pyg_flags_signed=1]); AC_DEFINE_UNQUOTED(PYGOBJECT_FLAGS_SIGNED, [$pyg_flags_signed], [Whether last argument to pyg_flags_get_value() is signed])], - [BINDINGS_PYTHON="no"]) + [BINDINGS_PYTHON="no"; python_msg="Python pygobject module required"]) # The Check unit testing framework is optional. Disable if not found. PKG_CHECK_MODULES([check], [check >= 0.9.4], @@ -391,6 +398,10 @@ case "$host" in ;; esac +# The BeagleLogic driver needs sys/mman.h and sys/ioctl.h. Don't try to +# build it if these headers aren't available. +AC_CHECK_HEADERS([sys/mman.h sys/ioctl.h], [], [HW_BEAGLELOGIC="no"]) + AC_SUBST(SR_PKGLIBS) CFLAGS="$CFLAGS -I./include/libsigrok $LIB_CFLAGS" @@ -407,7 +418,13 @@ if test "x$HAVE_JAVAC" = "xyes"; then CXXFLAGS="$CXXFLAGS -I$JNI_INCLUDE_DIR" done else - BINDINGS_JAVA="no" + BINDINGS_JAVA="no"; java_msg="Java compiler required" +fi + +# Python and Java bindings depend on C++ bindings. +if test "x$BINDINGS_CXX" != "xyes"; then + BINDINGS_PYTHON="no"; python_msg="C++ bindings required" + BINDINGS_JAVA="no"; java_msg="C++ bindings required" fi # Now set AM_CONDITIONALs and AC_DEFINEs for the enabled/disabled drivers. @@ -609,7 +626,8 @@ AM_CONDITIONAL(BINDINGS_PYTHON, test x$BINDINGS_PYTHON = xyes) AM_CONDITIONAL(BINDINGS_JAVA, test x$BINDINGS_JAVA = xyes) # Checks for header files. -# These are already checked: inttypes.h stdint.h stdlib.h string.h unistd.h. +# These are already implicitly checked: inttypes.h stdint.h stdlib.h string.h +# unistd.h memory.h strings.h dlfcn.h sys/types.h sys/stat.h. # Checks for typedefs, structures, and compiler characteristics. AC_C_BIGENDIAN @@ -646,7 +664,7 @@ echo "Detected libraries:" echo # Note: This only works for libs with pkg-config integration. -for lib in "glib-2.0 >= 2.32.0" "libzip >= 0.10" "libserialport >= 0.1.0" "librevisa >= 0.0.20130812" "libusb-1.0 >= 1.0.16" "libftdi >= 0.16" "libftdi1 >= 1.0" "check >= 0.9.4"; do +for lib in "glib-2.0 >= 2.32.0" "libzip >= 0.10" "libserialport >= 0.1.0" "librevisa >= 0.0.20130812" "libusb-1.0 >= 1.0.16" "libftdi >= 0.16" "libftdi1 >= 1.0" "glibmm-2.4 >= 2.32.0" "pygobject-3.0 >= 3.0.0" "check >= 0.9.4"; do optional="OPTIONAL" if test "x$lib" = "xglib-2.0 >= 2.32.0"; then optional="REQUIRED"; fi if test "x$lib" = "xlibzip >= 0.10"; then optional="REQUIRED"; fi @@ -661,8 +679,34 @@ done eval echo -e "@Enabled hardware drivers:@@${driver_summary}" | tr @ \\n +# Prepare final bindings report messages +final_cxx="" +final_python="" +final_java="" +if test "$enable_bindings" = "no"; then + final_cxx=" (disabled)" + final_python=" (disabled)" + final_java=" (disabled)" +else + if test "$enable_cxx" = "no"; then + final_cxx=" (disabled)" + elif test "$BINDINGS_CXX" = "no"; then + final_cxx=" ($cxx_msg)" + fi + if test "$enable_python" = "no"; then + final_python=" (disabled)" + elif test "$BINDINGS_PYTHON" = "no"; then + final_python=" ($python_msg)" + fi + if test "$enable_java" = "no"; then + final_java=" (disabled)" + elif test "$BINDINGS_JAVA" = "no"; then + final_java=" ($java_msg)" + fi +fi + echo -e "Enabled language bindings:\n" -echo " - C++............................. $BINDINGS_CXX" -echo " - Python.......................... $BINDINGS_PYTHON" -echo " - Java............................ $BINDINGS_JAVA" +echo " - C++............................. $BINDINGS_CXX$final_cxx" +echo " - Python.......................... $BINDINGS_PYTHON$final_python" +echo " - Java............................ $BINDINGS_JAVA$final_java" echo