]> sigrok.org Git - libsigrokdecode.git/commitdiff
configure.ac: Clearly mark required and optional libs.
authorUwe Hermann <redacted>
Sat, 5 Apr 2014 11:00:59 +0000 (13:00 +0200)
committerUwe Hermann <redacted>
Wed, 9 Apr 2014 08:57:06 +0000 (10:57 +0200)
Also, drop printing of the detected Python CPPFLAGS/LDFLAGS, not really
needed since it's available in 'make V=1' output as well (and we don't print
it for other libs either).

configure.ac

index d9bf6a90d554b60fe8467f4e5dfe3d15c602c980..09f7421e9eeed8f4577aa30a652c85a8195ce762 100644 (file)
@@ -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,14 +94,18 @@ 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";
+       [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)
@@ -161,26 +165,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