X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=configure.ac;h=c27376fd33339dcbb06628d0bda94fa7eae19156;hp=d9bf6a90d554b60fe8467f4e5dfe3d15c602c980;hb=5c0c9cb3a78be20d98f81cff1405bbf2c927384e;hpb=1ced2b013412336a9d9ac77aded7078b4eef3780 diff --git a/configure.ac b/configure.ac index d9bf6a9..c27376f 100644 --- a/configure.ac +++ b/configure.ac @@ -34,7 +34,7 @@ AC_CONFIG_MACRO_DIR([autostuff]) AC_CONFIG_AUX_DIR([autostuff]) # We require at least automake 1.11 (needed for 'silent rules'). -AM_INIT_AUTOMAKE([1.11 -Wall -Werror check-news color-tests]) +AM_INIT_AUTOMAKE([1.11 -Wall -Werror subdir-objects check-news color-tests]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) @@ -77,7 +77,7 @@ AC_SUBST(SRD_LIB_VERSION_AGE) AC_SUBST(SRD_LIB_VERSION) AC_SUBST(SRD_LIB_LDFLAGS) -# assume we can build tests/runtc unless proven otherwise +# Assume we can build tests/runtc unless proven otherwise. build_runtc="yes" # Checks for libraries. @@ -94,19 +94,34 @@ AM_PATH_GLIB_2_0([2.24.0], # See also: http://sigrok.org/wiki/Libsigrokdecode/Python CPPFLAGS_PYTHON="" LDFLAGS_PYTHON="" +pyver="none" PKG_CHECK_MODULES([python3], [python3 >= 3.2], - [CPPFLAGS_PYTHON="$CPPFLAGS_PYTHON $python3_CFLAGS"; + [pyver=`$PKG_CONFIG --modversion python3`; + CPPFLAGS_PYTHON="$CPPFLAGS_PYTHON $python3_CFLAGS"; LDFLAGS_PYTHON="$LDFLAGS_PYTHON $python3_LIBS"], -[PKG_CHECK_MODULES([python33], [python-3.3 >= 3.2], - [CPPFLAGS_PYTHON="$CPPFLAGS_PYTHON $python33_CFLAGS"; +[PKG_CHECK_MODULES([python34], [python-3.4 >= 3.4], + [pyver=`$PKG_CONFIG --modversion python-3.4`; + CPPFLAGS_PYTHON="$CPPFLAGS_PYTHON $python34_CFLAGS"; + LDFLAGS_PYTHON="$LDFLAGS_PYTHON $python34_LIBS"], +[PKG_CHECK_MODULES([python33], [python-3.3 >= 3.3], + [pyver=`$PKG_CONFIG --modversion python-3.3`; + CPPFLAGS_PYTHON="$CPPFLAGS_PYTHON $python33_CFLAGS"; LDFLAGS_PYTHON="$LDFLAGS_PYTHON $python33_LIBS"], [PKG_CHECK_MODULES([python32], [python-3.2 >= 3.2], - [CPPFLAGS_PYTHON="$CPPFLAGS_PYTHON $python32_CFLAGS"; + [pyver=`$PKG_CONFIG --modversion python-3.2`; + CPPFLAGS_PYTHON="$CPPFLAGS_PYTHON $python32_CFLAGS"; LDFLAGS_PYTHON="$LDFLAGS_PYTHON $python32_LIBS"], -)])]) +)])])]) AC_SUBST(CPPFLAGS_PYTHON) AC_SUBST(LDFLAGS_PYTHON) +# We also need to find the name of the python3 executable (for 'make install'). +# Some OSes call this python3, some call it python3.2, etc. etc. +AC_CHECK_PROGS([PYTHON3], [python3.4 python3.3 python3.2 python3]) +if test "x$PYTHON3" == "x"; then + AC_MSG_ERROR([cannot find python3 executable.]) +fi + # Link against libm, this is required (among other things) by Python. AC_SEARCH_LIBS([pow], [m]) @@ -144,12 +159,7 @@ AC_SUBST(SRD_PACKAGE_VERSION) AM_CONDITIONAL(BUILD_RUNTC, test x"$build_runtc" = "xyes") -AC_CONFIG_FILES([Makefile - version.h - libsigrokdecode.pc - contrib/Makefile - tests/Makefile - ]) +AC_CONFIG_FILES([Makefile version.h libsigrokdecode.pc]) AC_OUTPUT @@ -161,26 +171,33 @@ echo " - Library version (current:revision:age): $SRD_LIB_VERSION" echo " - Prefix: $prefix" echo " - Building on: $build" echo " - Building for: $host" -echo " - Building protocol decoder test framework: $build_runtc" echo echo "Detected libraries:" echo +if test "x$pyver" = "xnone"; then + echo " - (REQUIRED) python >= 3.2: no" +else + echo " - (REQUIRED) python >= 3.2: yes ($pyver)" +fi + # Note: This only works for libs with pkg-config integration. for lib in "glib-2.0 >= 2.24.0" "check >= 0.9.4" "libsigrok >= 0.2.0"; do - if `$PKG_CONFIG --exists $lib`; then - ver=`$PKG_CONFIG --modversion $lib` - answer="yes ($ver)" - else - answer="no" - fi - echo " - $lib: $answer" + optional="OPTIONAL" + if test "x$lib" = "xglib-2.0 >= 2.24.0"; then optional="REQUIRED"; fi + if `$PKG_CONFIG --exists $lib`; then + ver=`$PKG_CONFIG --modversion $lib` + answer="yes ($ver)" + else + answer="no" + fi + echo " - ($optional) $lib: $answer" done echo -echo "Detected Python:" +echo "Enabled features:" echo -echo " - Python CPPFLAGS: $CPPFLAGS_PYTHON" -echo " - Python LDFLAGS: $LDFLAGS_PYTHON" +echo " - (OPTIONAL) Library unit test framework support: $have_check" +echo " - (OPTIONAL) Protocol decoder test framework support: $build_runtc" echo